createprocess

How to increase the maximum number of child processes that can be spawned by a windows service — desktop heap limits

女生的网名这么多〃 提交于 2019-11-27 01:58:24
问题 Q: I have a windows service that spawns a lot of child processes. There seems to be some limit, around 100, where the process cannot be launched. The CreateProcess() call comes back with a pid, but then the process just fails to materialize. If I run our server as a console application instead, this limit goes away. Also, If I set the DETACHED_PROCESS flag, this limit more than doubles. However, I get failures if I set DETACHED_PROCESS and call CreateProcesssWithLogonW(). 回答1: This is a

Ndk-build: CreateProcess: make (e=87): The parameter is incorrect

强颜欢笑 提交于 2019-11-27 00:27:56
问题 I get an error when build static lib with NDK on Windows platform: process_begin: CreateProcess( "PATH"\android-ndk-r8b\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ar.exe, "some other commands" ) failed. make (e=87): The parameter is incorrect. make: *** [obj/local/armeabi-v7a/staticlib.a] Error 87 make: *** Waiting for unfinished jobs.... All source files build successfully, and this error occur when compose object files. I don't get this error when build

How do I launch a process and obtain its output?

一笑奈何 提交于 2019-11-26 22:10:30
问题 In the C language using the Windows API, how can I get the output of a process when I have its process information? I have code like this: STARTUPINFO si1; ZeroMemory(&si1,sizeof(si1)); PROCESS_INFORMATION pi1; ZeroMemory(&pi1,sizeof(pi1)); BOOL bRes1=CreateProcess(_T("C:\\User\\asd.exe"),cmd_line1,NULL,NULL,FALSE,CREATE_NO_WINDOW,NULL,NULL, &si1,&pi1); and the process asd.exe prints a certain output, I want to get it to my process(the one i used the code above in). 回答1: This answer is

Use CreateProcess to Run a Batch File

亡梦爱人 提交于 2019-11-26 18:30:13
问题 I am trying to use CreateProcess to start a new environment block and run a batch file in the new environment block. I've read through the msdn example for CreateProcess, and came up with the code shown below. What is happening, it will open the new command prompt, and stop there. It will not run my .bat file for some reason. Using system("CALL path") will call the .bat file. #include <iostream> #define WINDOWS_LEAN_AND_MEAN #include <Windows.h> #include <strsafe.h> #define BUFSIZE 4096 int

CreateProcess doesn&#39;t pass command line arguments

天大地大妈咪最大 提交于 2019-11-26 14:12:06
问题 Hello I have the following code but it isn't working as expected, can't figure out what the problem is. Basically, I'm executing a process (a .NET process) and passing it command line arguments, it is executed successfully by CreateProcess() but CreateProcess() isn't passing the command line arguments What am I doing wrong here?? int main(int argc, char* argv[]) { PROCESS_INFORMATION ProcessInfo; //This is what we get as an [out] parameter STARTUPINFO StartupInfo; //This is an [in] parameter

How to run application which requires admin rights from one that doesn&#39;t have them [closed]

浪尽此生 提交于 2019-11-26 12:14:11
问题 I\'ve been stuck on this for a few hours until I\'ve finally managed to do it. There are already links which pointed me the right direction: Is it possible for the executable to ask for Administrator rights? (Windows 7) CreateProcess error=740, The requested operation requires elevation But I\'ve thought that simple overview of the problem could help someone :). 回答1: Real problem: (from Wikipedia: http://en.wikipedia.org/wiki/User_Account_Control) An executable that is marked as

How can I run a child process that requires elevation and wait?

荒凉一梦 提交于 2019-11-26 06:35:52
问题 Win 7/UAC is driving me crazy. From within my C++ application, I need to run an executable that requires elevation on Windows 7. I want to fire this thing off and wait for it to finish before proceeding. What\'s the easiest way to do this? I normally do this kind of thing via CreateProcess() , but it fails for executables that require elevation. I tried running using cmd.exe /c ... through CreateProcess , which works but pops up an ugly cmd terminal window. I am reading that ShellExecute()