createprocess

Error passing socket to child process when using STARTF_USESTDHANDLES flag with CreateProcess()

I am trying to call a FastCGI application from .Net - this means that I need to pass a handle to a socket to the child process. However what I'm seeing is that if I use the STARTF_USESTDHANDLES flag with CreateProcess() then the child application fails when it attempts to read from the socket. I've worked out that I get around this by ...

CreateProcess to run as administrator

In my Win32 application I have the ability to run child processes with redirected input and output to anonymous pipes that I create and manage - this all works with the CreateProcess() function. However on Win7 (and presumably Vista) if that process is required to be run as administrator then this fails. So what I am looking for is a way...

Process hooking problem!

Hello minds,I have a piece of code where if I run a particular application,it will hook its process and injects my dll into the process space of that application.I will explain my problem with an example..Atfirst if I run MyApplication.exe,my code will hook the process of MyApplication.exe and inject MyDll.dll into MyApplication.exe proc...

Find out if thread is awaiting for input (not output)

Greetings everyone. I'm capturing an output from a process created using CreateProcess() through the redirected named pipes for stdout and stderr. I also send an input to the redirected stdin. Everything goes fine except one big annoying thing. Sometimes it's unknown what data needs to be written in stdin and I present a simple dialog ...

CreateProcess for android adb start-server?

When I use CreateProcess to create process adb.exe, It will Block in ReadFile. void KillAdbProcess() { DWORD aProcesses[1024], cbNeeded, cProcesses; unsigned int i; if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) ) return; cProcesses = cbNeeded / sizeof(DWORD); for ( i = 0; i < cProcesses;...

How to convert CreateProcess to ShellExecuteEx?

I use MS detour library to hook CreateProcess and it works fine on Win7. Then I want to replace the detoured CreateProcess with ShellExecuteEx so that I can use 'runas' to silently run the program with administrator priviledge. Unfortunately, the parameter type is not the same. This is the function signature: CreateProcess( L...

Is there a way to have a process created by CreateProcess open within another window?

Hello, I want to be able to open a GUI application using CreateProcess in a main process and have the GUI display in a window I create from within the main process. Does anyone know how to achive this? Thanks! ...

CreateProcess (binary injection) cannot reference DLL's

In following this example code for binary injection: http://www.security.org.sg/code/loadexe.html I can get it to work, inject a second exe into the primary exe's memory space and run. The trouble is that the second exe can not access any DLL's in the startup folder. For example: c:\1.exe c:\2.exe c:\helper.dll If 2.exe is injected...

Gcc.exe: CreateProcess : No such File or directory - Error?

Hello, I am writing an Objective C program and i saved it as 'hello.m'. The problem is when i am trying to compile it usig MinGW it is giving an error gcc hello.m // i used for compiling and it is giving following error gcc.exe: CreateProcess : No such File or directory is there any way to fix ..so that i can move forward.. Thank Y...

Way to pass argv[] to CreateProcess()

My C Win32 application should allow passing a full command line for another program to start, e.g. myapp.exe /foo /bar "C:\Program Files\Some\App.exe" arg1 "arg 2" myapp.exe may look something like int main(int argc, char**argv) { int i; for (i=1; i<argc; ++i) { if (!strcmp(argv[i], "/foo") { // handle /foo } e...