CreateProcess experience

zhaozj2021-02-16  50

1. How can we get the input output of this program when performing an external program with CreateProcess? CreateProcess has been ready for us, there are several HSTDINPUT, HSTDOUT, HSTDERROR START, HSTDOUT, HSTDERROR START, HSTDERROR STAR, and created a file to create a file, then create a file with CreateFile, then specify the resulting file handle Give HSTDOUTPUT, and set the value of dwflags to USSTDHANDLES, so that the output of the external program will be lost to this file. Note: create_attributes.binherithandle parameter is set to TRUE.

?

2. There is usually a parameter called Security_Attributes in the Create Series function.

SECURITY_ATTRIBUTES SA;

????????? sa.nlength = sizeof (security_attributes);

????????? sa.lpsecuritydescriptor = null;

????????? sa.binherithandle = true;

• If the value of binherithandle is True, what it creates is that what it can be used by other child processes, such as the pipe created with CreatePipe can be used in the process created in CreateProcess.

?

3. Use the CreateProcess to create a sub-process through the LPCurrentDirectory parameter specifying the path to run the child process.

转载请注明原文地址:https://www.9cbs.com/read-21297.html

New Post(0)