Home > Software engineering >  CreateProcess return C0000142 under system services of the local system account
CreateProcess return C0000142 under system services of the local system account

Time:09-22

A Windows service program, the login id is the local system account, in the program need to create a child process with the CreateProcess, when the service attributes chose not to allow service when interacting with the desktop, CreateProcess returns success, but GetExitCodeProcess access to the child to return code is C0000142, actually the child did not create success, depressed is this does not appear every time they perform, sometimes failed to repeat one can normal execution, sometimes try again many times cannot succeed, sometimes running is normal in a day and found no regularity,
Service type selected allows service when interacting with the desktop didn't find this kind of situation, but the execution on Windows 7 will be popup hint of detection of interactive services not too friendly,
To search on the net stackoverflow question, didn't find the right solution, because the service launched the child is not their own development, not the child process source,
Windows website have a session, the interpretation of the station and the desktop also not too understand, is about to use a user logged in to perform the child, friends ever encountered a similar situation to a solution: choosing are not allowed to interact with the desktop can successfully create the child process, choose don't pop up when allowed to interact with the desktop Interactive Services testing tips, don't stop the Interactive Services Detection service methods, too violent,

CodePudding user response:

About Windows services, did I use is not much, just before the function of simple, read from the format of the disk, the service starts trying to load all of the disk, and one by one to see whether there is a custom tag, if any, will read the disk (add the disk to read the list), otherwise, skip, and not to join the list, the service does not create other process, when there is a need for the service, through a predefined pipe to communication, this service requires administrator users to install and set to start, according to the system startup after the installation and set up, you can use the common user login system, and use the service
As for the original poster said the creation of the child, createProcess (), I also use much, only used simply to create a process, then, no matter it is, of course, in the ordinary procedure, not in service,
According to the online search C0000142, plus I understand it, estimate or permission problems, the child needs to access certain resources, but sometimes the resources be locked or other result cannot access quilt process, at this time there is a problem,
Don't know what do you use the original poster of the child, whether to need to interact with the other local programs

CodePudding user response:

CreateProcessAsUser
  • Related