Share via


DeregisterService (Compact 2013)

3/26/2014

This function stops a service instance.

Syntax

BOOL DeregisterService(
  HANDLE hDevice
);

Parameters

Return Value

A nonzero value indicates success. A value of zero indicates failure. To get extended error information, call GetLastError.

Remarks

If the service is marked with the DEVFLAGS_NOUNLOAD flag, attempts to load it will fail.

Ee498619.security(en-us,WinEmbedded.80).gifSecurity Note:
DeregisterService can be called from either privileged or normal applications, regardless of the setting of the DEVFLAGS_TRUSTEDCALLERONLY registry flag for the service. If a privileged application has loaded a service, a normal application cannot unload the service. However, if a normal application has loaded the service, then either a privileged application or a normal application can unload the service.

Requirements

Header

service.h

Library

coredll.lib

See Also

Reference

Servicesd.exe Functions
ActivateService
xxx_Deinit (Servicesd.exe)
xxx_IOControl (Servicesd.exe)
Servicesd.exe Registry Settings

Other Resources

GetDeviceInformationByFileHandle
Servicesd.exe