Deleting a Service

In the following example, a service configuration program uses the OpenService function to get a handle with DELETE access to an installed service object. The program then uses the service object handle in the DeleteService function to remove the service from the SCM database.

VOID DeleteSampleService()

{

schService = OpenService(

schSCManager, // SCManager database

TEXT("Sample_Srv"), // name of service

DELETE); // only need DELETE access

if (schService == NULL)

MyErrorExit("OpenService");

if (! DeleteService(schService) )

MyErrorExit("DeleteService");

else

printf("DeleteService SUCCESS\n");

CloseServiceHandle(schService);

}

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database