CloseServiceHandle

  BOOL CloseServiceHandle(hSCObject)    
  SC_HANDLE hSCObject;    

The CloseServiceHandle function closes a Service Control Manager object.

Parameters

hSCObject

Handle of a SCManager or Service object to close.

Return Value

Returns TRUE if object was successfully closed. If the return value is FALSE, an error has occurred. Use GetLastError to determine the cause of the failure.

Errors Value Meaning
  ERROR_INVALID_HANDLE The specified handle is invalid.