src/SeeDll/Packet32.c
/*! 
  \brief Installs the NPF device driver.
  \return If the function succeeds, the return value is nonzero.

  This function installs the driver's service in the system using the CreateService function.
*/
\brief Installs the NPF device driver.
\return If the function succeeds, the return value is nonzero.

This function installs the driver's service in the system using the CreateService function.
\ brief Installs the NPF device driver . \ return If the function succeeds the return value is nonzero . This function installs the driver ' s service in the system using the CreateService function .
BOOL PacketInstallDriver()
{
	BOOL result = FALSE;
	ULONG err = 0;
	SC_HANDLE svcHandle;
	SC_HANDLE scmHandle;
	ODS("PacketInstallDriver\n");
	scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
	if(scmHandle == NULL)
		return FALSE;
	svcHandle = CreateService(scmHandle, 
		NPFServiceName,
		NPFServiceDesc,
		SERVICE_ALL_ACCESS,
		SERVICE_KERNEL_DRIVER,
		SERVICE_DEMAND_START,
		SERVICE_ERROR_NORMAL,
		NPFDriverPath,
		NULL, NULL, NULL, NULL, NULL);
	if (svcHandle == NULL) 
	{
		err = GetLastError();
		if (err == ERROR_SERVICE_EXISTS) 
		{
			err = 0;
			result = TRUE;
		}
	}
	else 
	{
		result = TRUE;
	}
	if (svcHandle != NULL)
		CloseServiceHandle(svcHandle);
	if(result == FALSE)
	{
		ODSEx("PacketInstallDriver failed, Error=%d\n",err);
	}
	CloseServiceHandle(scmHandle);
	SetLastError(err);
	return result;
}
BOOL PacketInstallDriver ( ) { BOOL result = FALSE ; ULONG err = 0 ; SC_HANDLE svcHandle ; SC_HANDLE scmHandle ; ODS ( " \n " ) ; scmHandle = OpenSCManager ( NULL , NULL , SC_MANAGER_ALL_ACCESS ) ; if ( scmHandle == NULL ) return FALSE ; svcHandle = CreateService ( scmHandle , NPFServiceName , NPFServiceDesc , SERVICE_ALL_ACCESS , SERVICE_KERNEL_DRIVER , SERVICE_DEMAND_START , SERVICE_ERROR_NORMAL , NPFDriverPath , NULL , NULL , NULL , NULL , NULL ) ; if ( svcHandle == NULL ) { err = GetLastError ( ) ; if ( err == ERROR_SERVICE_EXISTS ) { err = 0 ; result = TRUE ; } } else { result = TRUE ; } if ( svcHandle != NULL ) CloseServiceHandle ( svcHandle ) ; if ( result == FALSE ) { ODSEx ( " \n " , err ) ; } CloseServiceHandle ( scmHandle ) ; SetLastError ( err ) ; return result ; }
\brief Installs the NPF device driver.
\ brief Installs the NPF device driver .
//npf.sys already existed
 //Created service for npf.sys
