he GetCurrentProcess function returns a pseudohandle for the current process.
This function has no parameters.
The return value is a pseudohandle to the current process.
A pseudohandle is a special constant that is interpreted as the current process handle. The calling process can use this handle to specify its own process whenever a process handle is required. Pseudohandles are not inherited by child processes.
This handle has the maximum possible access to the process object. For systems that support security descriptors, this is the maximum access allowed by the security descriptor for the calling process. For systems that do not support security descriptors, this is PROCESS_ALL_ACCESS. For more information, see Process Objects.
A process can create a "real" handle to itself that is valid in the context of other processes, or that can be inherited by other processes, by specifying the pseudohandle as the source handle in a call to the DuplicateHandle function. A process can also use the OpenProcess function to open a real handle to itself.
The pseudohandle need not be closed when it is no longer needed. Calling the CloseHandle function with a pseudohandle has no effect. If the pseudohandle is duplicated by DuplicateHandle, the duplicate handle must be closed.
The RegisterServiceProcess function registers or unregisters a service process. A service process continues to run after the user logs off.
DWORD RegisterServiceProcess(DWORD dwProcessId,
Specifies the identifier of the process to register as a service process. Specifies NULL to register the current process.
Specifies whether the service is to be registered or unregistered. This parameter can be one of the following values.
RSP_SIMPLE_SERVICE Registers the process as a service process.
RSP_UNREGISTER_SERVICE Unregisters the process as a service process.
The return value is 1 if successful or 0 if an error occurs.
The following function is supported by the Windows 95 Service Control Manager.