Home > Software engineering >  CreateProcessAsUser excuse me why the child process may result in the parent process collapse?
CreateProcessAsUser excuse me why the child process may result in the parent process collapse?

Time:09-20

The question is, consult everybody
Process A BOOL execute CreateProcessAsUser call parameters bInheritHandles to true, chose the handle to inherit the parent process, to perform some third-party applications B, can be normal execution,

But tracking found some cases due to the B A execution will collapse, leading to A process in CreateProcessAsUser will collapse, there is no return continue to collapse,


But why the third party programs will lead to the collapse of the parent process also collapse? B program has a problem, CreateProcessAsUse should return failure rather than directly to collapse?

2, call GetProcessHandleCount found a MFC console program didn't do anything actually handle to open the number more than 100, how can so much open handle?

CodePudding user response:

Writing log debug



CodePudding user response:

reference 1st floor zgl7903 response:
writing log debug


You misunderstood my question clearly, I want to ask is why call CreateProcessAsUser this API will collapse? Many times you call is a third party program, you can't control it, but the third party programs run will collapse, executive CreateProcessAsUser should not lead to the caller of this API to collapse

CodePudding user response:

Process will collapse when CreateProcessAsUser
This situation can occur, I have encountered when the target application configuration errors manifest error, this should belong to a Windows bug


Had nothing to do but found a MFC console program should handle to open the number has more than 100
If the handle to create process use inheritance, so all the handle to the parent will be copied, so will be more

CodePudding user response:

Why do you say CreateProcessAsUser will not collapse? Microsoft does not guarantee all API is safe
Can try capture SEH structured exception

CodePudding user response:

How did you write your code? How to call the CreateProcessAsUser function?

CodePudding user response:

Estimation is caused by the called procedure DLL chaos, but the API call collapse is really no solution, zgl7903 SEH structured exception method is effective and can capture the collapse,

CodePudding user response:

reference 5 floor 7-eleven's reply:
how did you write your code? How to call the CreateProcessAsUser function?

Is the back-end services, by getting copied EXPLORER. EXE token, then use this token to CreateProcessAsUser (bInherit invocation parameters for FALSE), general procedure is very normal, father and son process communication by way of a named pipe, but found that called program execution when also is likely to lead to the collapse of the parent, the reason is called program problem, but the collapse is baffled, associated with a parent and child process is a pipe,

CodePudding user response:

Can you position the collapse of the key code, a log out first positioning?
  • Related