Experience 1: Quote for core objects
Core objects in the Windows system, such as window handles, file handles, event, etc., all in the internal management mechanism of Windows, all reference counting methods are used, such as Hservice = CreateService (.), After this call, HService in the system. The reference count plus 1, and if you do not close again through the Herd service handle open through OpenScManager and OpenService, the service handle removed from the service configuration management database will change, although it can be by deleteServcie. Delete, but after delete, query in the control panel, the current state is "disabled". After the control tool must be exited, the service disappears from the "service" of the control panel. As for the specific reasons, it is not known that it is not connected, but it feels that the reference is not closed after CreateService.
Experience 2: About STARTSERVICECTRLDISPATCHER
Its original definition: BOOL StartServiceCtrldispatcher (const lpservice_table_entry lpserventable); see the original definition of lpserviceetable:
LPSERVICETABLE
[in] Pointer to
An Array of
SERVICE_TABLE_ENTRY structures containing one entry for each service that can execute in the calling process. The members of the last entry in the table must have NULL values to designate the end of the table.
This parameter indicates that a set of structures to service_table_entry, and a group means that it is not possible to pass
Service_table_entry ste; startservicectrldispatcher (& steel);
This is good, maybe the service is successful, but if the luck is not good, there will be "Waiting for the connection timeout of Win32 Service That Help Vise AdministrtRtor to Control ITS Functions service (30000 milliseconds)." "Due to the following errors, Win32 Service That Help Vise Administrator to Control ITS Functions service failed: The service did not respond promptly or control the request in time. "The problem may also appear" disabled "as the above experience. Because "PoinTo An Array" "The Members of the Last Entry In The Table Must Have Null Values To Designate The end of the table." Indicated that the last one of the arrays must end with NULL. As for internal implementation, although I don't know, if there is a continuous non-NULL, it may appear above.