c++ - Hang on CreateService when windows is starting -


i register program windows service. when reboot windows, service start_pending forever. after traced, found hung on createservice function.

hservice=createservice( hscmanager,                             pszdrivername,                             pszdrivername,                             service_all_access,                             service_kernel_driver,                             service_demand_start,                             service_error_normal,                             pszdriverpath,                             null,                             null,                             null,                             null,                             null); 

i can resolve problem creating service before rebooting, want know hang happened. have idea?

if remember well, services must created once. don't have call createservice function again ever ! , wouldn't recommend create while in windows boot process.

as can see in following msdn example, have start given example software "install" command line argument create service. in other case service considered installed.

notice in example use of startservicectrldispatcher function launch service main function (in case svcmain).

http://msdn.microsoft.com/en-us/library/windows/desktop/bb540476(v=vs.85).aspx


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -