if(hSCM != NULL)
{
hService = CreateService(
hSCM, // SCManager database
"npf", // name of service
"Netgroup Packet Filter Driver", // service name to display
SERVICE_ALL_ACCESS, // desired access
SERVICE_KERNEL_DRIVER, // service type
SERVICE_DEMAND_START, // start type
SERVICE_ERROR_NORMAL, // error control type
"%SystemRoot%\\system32\\npf.sys", // npf.sys的路径
NULL, // no load ordering group
NULL, // no tag identifier
NULL, // no dependencies
NULL, // LocalSystem account
NULL); // no password
if (hService != NULL)
CloseServiceHandle(hService);