Re: CreateProcess() Not Passing Command Line
- From: "Hieu Le Trung" <hieult@xxxxxxxxxxxxxxxx>
- Date: Sun, 25 Sep 2005 22:22:04 +0700
BOOL CreateProcess(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
the second paramter is path to EXE file to execute.
to input parameter to open with that application, add it after the EXE file
name.
Use QueryAssocString to get open command line for a document.
Hieu
"L. Spiro" <LSpiro@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:68958C12-6F90-4575-BFA1-1AF3D4733F17@xxxxxxxxxxxxxxxx
>I am writing a program that allows me to select a file (.exe) and enter a
> command-line parameter for the file.
> My program will then use CreateProcess() to open the file.
>
>
> The file does load, but no matter what I type for a parameter, the process
> being created always seems to get a blank command line (except of course
> for
> args[0]).
>
> I have followed my code and I am correctly passing the command line.
> http://www.gwforum.ca/l-spiro/ParmsArePassed.gif
>
> It is compiling into CreateProcessA, so the string must be in char *
> format
> (which it is). I tried already with wchar_t to make sure and it would not
> compile.
>
> So what can cause CreateProcess() to "work" (the process is created) but
> fail to pass the command line?
>
> I am creating a debugger and the process will be loaded in a suspended
> state, but resumed shortly, then stopped via a breakpoint at its entry.
> Is it possible somewhere along the way I am removing the command line?
> I am not messing with the RAM of the target process at all during this
> process; even the breakpoint is hardware.
> I am also not changing the thread's EIP or otherwise doing anything
> unusual
> that might cause the command line to be skipped.
>
>
> L. Spiro
.
- Prev by Date: Re: How to find logon dialog from service
- Next by Date: Re: User Name
- Previous by thread: Re: CreateProcess() Not Passing Command Line
- Next by thread: Lowering user rights for CreateProcess from Svc
- Index(es):
Relevant Pages
|