CommandLineToArgvW fix

Francois Gouget fgouget at free.fr
Wed Oct 10 12:35:09 CDT 2001


On Wed, 10 Oct 2001, Eric Pouech wrote:

> just a last question (that I didn't check)
> what if the process name contains spaces like:
> C:\Program Files\foo\bar.exe
> what does Windows do ? returns in argv[0] "C:\Program" or
> "C:\Program Files". The later would also require testing of
> existence of the directories (doing a more semantical approach while
> current implementation is purely syntaxical)

   CommandLineToArgvW returns "C:\Program" and "Files" and does not test
for the existence of the file. The best way to see that, is to use my
'main' testing program (posted with the original cmdline patch) in
interactive mode: "main -i".

   Then you can type any string you want CommandLineToArgvW to convert
and get the result:

C:\>main -i
Type command line to convert (quit to quit):
C:\Program Files
CommandLineToArgvW -> wargv=00133808 wargc=2
0 00133810 [C:\Program]
1 00133826 [Files]
2 003A0043
Type command line to convert (quit to quit):
"C:\Program Files"
CommandLineToArgvW -> wargv=00133808 wargc=1
0 0013380C [C:\Program Files]
1 003A0043
Type command line to convert (quit to quit):
a b
CommandLineToArgvW -> wargv=00133840 wargc=2
0 00133848 [a]
1 0013384C [b]
2 00000061
Type command line to convert (quit to quit):
"a b " c\"d e
CommandLineToArgvW -> wargv=00132918 wargc=3
0 00132924 [a b ]
1 0013292E [c"d]
2 00132936 [e]
3 00200061
Type command line to convert (quit to quit):
quit


   Etc, etc...

--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
           Cahn's Axiom: When all else fails, read the instructions.





More information about the wine-devel mailing list