News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Console and Command Line Options

Started by Astro, August 25, 2009, 08:12:33 PM

Previous topic - Next topic

Astro

Hi,

If I create a console app and start it using command-line parameters, where do the parameters I passed end up?

Best regards,
Astro.

jj2007

\masm32\help\masmlib.chm - look for GetCL.

drizz

They end up in your process environment block (PEB), where every other information is stored. (well, the ring3 portion that is)
Common way to access cmd. line parameters is to parse GetCommandLine(A|W) result which, if you trace it with a debugger, is the same value as in PEB.
The truth cannot be learned ... it can only be recognized.

Astro

Thanks! Something else to research.

Best regards,
Astro.

Vortex

Another option is to use the __getmainargs function exported by msvcrt.dll