Closed Bug 506394 Opened 17 years ago Closed 17 years ago

ExpandEnvironmentStringsW in CE shunt isn't quite right

Categories

(Core :: General, defect)

All
Windows CE
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: zpao, Assigned: zpao)

References

Details

(Whiteboard: [nv])

Attachments

(1 file, 1 obsolete file)

As discussed with Vlad an on bug 504385 comment 3, the function we have in the shunt misses % parameters. In Windows, "ceplayer.exe %1" will be returned as is. "ceplayer.exe %1 %2" will also be returned as is. Our implementation treats the first case as an invalid parameter. I'm not sure about the 2nd case, but it might mess up. So the logic in our shunt implementation should be fixed to handle these cases better.
Attached patch Patch v0.1 (obsolete) — Splinter Review
This handles the space case & the end of string case. I did a little bit of code cleanup (for consistency's sake) & some whitespace cleanup while I was in there. I tested against the Windows API (in XP) with the following strings and we now match correctly: "%APPDATA%\ceplayer.exe %1 %", "%APPDATA%\ceplayer.exe %1 %2", "%APPDATA%\ceplayer.exe %1", "ceplayer.exe %1"
Assignee: nobody → paul
Attachment #391407 - Flags: review?(vladimir)
While the patch addresses the problem, I found that we're still not quite perfect. Take a basic string "ceplayer.exe" and we're one character short (presumably not accounting for null termination when calculating size on the first pass). Not sure if that's something we want to address now or just spin off or even really care about.
Comment on attachment 391407 [details] [diff] [review] Patch v0.1 Looks fine to me, though boy is that code super scary.
Attachment #391407 - Flags: review?(vladimir) → review+
Taking out a stray variable declaration I accidentally added & minor change to whitespace.
Attachment #391407 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [nv]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: