Hi Im having trouble with breaking my commandline
returned into different arguments. I have read the sdk but It was not too clear for me here is a snippet of my code



section '.data?' data readable writeable
lpCommandLine dd ?
NumArgs dd ?
lpArgArray dd ?

section '.code' code readable executable
entry start
start:
invoke GetCommandLine
mov [lpCommandLine],eax

invoke CommandLineToArgvW,[lpCommandLine],NumArgs
mov [lpArgArray],eax



is this correct or must i first set up some free space for the argument array if so how much space.

Any help would be great thanks
Posted on 2003-03-20 04:04:08 by keyoke
LPWSTR * CommandLineToArgvW(

LPCWSTR lpCmdLine, // pointer to a command-line string
int *pNumArgs // pointer to a variable that receives the argument count
);


Parameters

lpCmdLine

Pointer to a null-terminated Unicode command-line string. An application will usually directly pass on the value returned by a call to GetCommandLineW.

*pNumArgs

Pointer to an integer variable that the function sets to the count of arguments parsed.


So should be


.data?
buffer db 256 dup (?)
data dd ?
.code
invoke CommandLineToArgvW,OFFSET buffer,OFFSET data

Forgive me if I am wrong.
Posted on 2003-03-20 05:02:34 by roticv
im not sure that


.data?
buffer db 256 dup (?)
data dd ?
.code
invoke CommandLineToArgvW,OFFSET buffer,OFFSET data


would work because CommandLineTOArgvW requires two variables

yes
1 is the null terminated string but the 2nd is a pointer to a vairable for storing the number of items in the array. and eax i think returns the start of the array i think but i am not sure how to refernce these values in this array that is returned
:)
thanks 4 the reply
Posted on 2003-03-20 05:20:25 by keyoke