Friday, January 18, 2013

SUPPORT Services in Win

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


Deleting a Service

1 out of 3 rated this helpful - Rate this topicA service configuration program uses the OpenService function to get a handle to an installed service object. The program can then use the service object handle in the DeleteService function to delete the service from the SCM database.The DoDeleteSvc function in the following example shows how to delete a service from the SCM database. The szSvcName variable is a global variable that contains the name of the service to be deleted. For the complete example that sets this variable, see SvcConfig.cpp.C++ // // Purpose: // Deletes a service from the SCM database // // Parameters: // None // // Return value: // None // VOID __stdcall DoDeleteSvc() { SC_HANDLE schSCManager; SC_HANDLE schService; SERVICE_STATUS ssStatus; // Get a handle to the SCM database. schSCManager = OpenSCManager( NULL, // local computer NULL, // ServicesActive database SC_MANAGER_ALL_ACCESS); // full access rights if (NULL == schSCManager) { printf("OpenSCManager failed (%d)\n", GetLastError()); return; } // Get a handle to the service. schService = OpenService( schSCManager, // SCM database szSvcName, // name of service DELETE); // need delete access if (schService == NULL) { printf("OpenService failed (%d)\n", GetLastError()); CloseServiceHandle(schSCManager); return; } // Delete the service. if (! DeleteService(schService) ) { printf("DeleteService failed (%d)\n", GetLastError()); } else printf("Service deleted successfully\n"); CloseServiceHandle(schService); CloseServiceHandle(schSCManager);


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

What's New in Services for Windows 7

5 out of 10 rated this helpful - Rate this topicWindows 7 and Windows Server 2008 R2 include the following new and updated programming elements for services.

New Capabilities

A service can register to be started or stopped when a trigger event occurs. This eliminates the need for services to start when the system starts, or for services to poll or actively wait for an event; a service can start when it is needed, instead of starting automatically whether or not there is work to do. For more information, see Service Trigger Events.

Updated Functions

FunctionDescriptionChangeServiceConfigChanges the configuration parameters of a service. This function supports managed service accounts and virtual accounts. For more information, see Service Accounts Step-by-Step Guide.ChangeServiceConfig2Changes the optional configuration parameters of a service. This function supports new configuration information levels for processor groups and service trigger events.CreateServiceCreates a service object and adds it to the specified service control manager database. This function supports managed service accounts and virtual accounts. For more information, see Service Accounts Step-by-Step Guide.HandlerExAn application-defined callback function used with the RegisterServiceCtrlHandlerExfunction. This callback function supports new extended control codes for system time changes and service trigger events.QueryServiceConfig2Retrieves the optional configuration parameters of a service. This function supports new configuration information levels for processor groups and service trigger events.SetServiceStatusUpdates the service control manager's status information for the calling service. This function supports new extended control codes for system time changes and service trigger events. 

New Structures

StructureDescriptionSERVICE_TIMECHANGE_INFOContains system time change settings.SERVICE_TRIGGERRepresents a service trigger event.SERVICE_TRIGGER_INFOContains trigger event information for a service.SERVICE_TRIGGER_SPECIFIC_DATA_ITEMContains trigger-specific data for a service trigger event. 

Obsolete Functions

The following functions are obsolete.EnumServicesStatusLockServiceDatabaseQueryServiceLockStatusQueryServiceStatusUnlockServiceDatabase

Service Functions

16 out of 22 rated this helpful - Rate this topicThe following functions are used or implemented by services.FunctionDescriptionHandlerAn application-defined callback function used with the RegisterServiceCtrlHandlerfunction.HandlerExAn application-defined callback function used with the RegisterServiceCtrlHandlerExfunction.RegisterServiceCtrlHandlerRegisters a function to handle service control requests.RegisterServiceCtrlHandlerExRegisters a function to handle extended service control requests.ServiceMainAn application-defined function that serves as the starting point for a service.SetServiceBitsRegisters a service type with the service control manager and the Server service.SetServiceStatusUpdates the service control manager's status information for the calling service.StartServiceCtrlDispatcherConnects the main thread of a service process to the service control manager. The following functions are used by programs that control, configure, or interact with services.FunctionDescriptionChangeServiceConfigChanges the configuration parameters of a service.ChangeServiceConfig2Changes the optional configuration parameters of a service.CloseServiceHandleCloses the specified handle to a service control manager object or a service object.ControlServiceSends a control code to a service.ControlServiceExSends a control code to a service.CreateServiceCreates a service object and adds it to the specified service control manager database.DeleteServiceMarks the specified service for deletion from the service control manager database.EnumDependentServicesRetrieves the name and status of each service that depends on the specified service.EnumServicesStatusExEnumerates services in the specified service control manager database based on the specified information level.GetServiceDisplayNameRetrieves the display name of the specified service.GetServiceKeyNameRetrieves the service name of the specified service.NotifyBootConfigStatusReports the boot status to the service control manager.NotifyServiceStatusChangeEnables an application to receive notification when the specified service is created or deleted or when its status changes.OpenSCManagerEstablishes a connection to the service control manager on the specified computer and opens the specified service control manager database.OpenServiceOpens an existing service.QueryServiceConfigRetrieves the configuration parameters of the specified service.QueryServiceConfig2Retrieves the optional configuration parameters of the specified service.QueryServiceDynamicInformationRetrieves dynamic information related to the current service start.QueryServiceObjectSecurityRetrieves a copy of the security descriptor associated with a service object.QueryServiceStatusExRetrieves the current status of the specified service based on the specified information level.SetServiceObjectSecuritySets the security descriptor of a service object.StartServiceStarts a service.

Services

60 out of 100 rated this helpful - Rate this topicA service application conforms to the interface rules of the Service Control Manager (SCM). It can be started automatically at system boot, by a user through the Services control panel applet, or by an application that uses the service functions. Services can execute even when no user is logged on to the system.A driver service conforms to the device driver protocols. It is similar to a service application, but it does not interact with the SCM. For simplicity, the term service refers to a service application in this overview.Triggers can now be used to control service start. For more info, see Service Configuration.



COMCOM is a platform-independent, distributed, object-oriented system for creating binary software components that can interact. COM is the foundation technology for Microsoft's OLE (compound documents) and ActiveX (Internet-enabled components) technologies.COM+COM+ is an evolution of Microsoft Component Object Model (COM) and Microsoft Transaction Server (MTS). COM+ builds on and extends applications written using COM, MTS, and other COM-based technologies. COM+ handles many of the resource management tasks that you previously had to program yourself, such as thread allocation and security. COM+ also makes your applications more scalable by providing thread pooling, object pooling, and just-in-time object activation. COM+ also helps protect the integrity of your data by providing transaction support, even if a transaction spans multiple databases over a network.Compression APIThe Compression API exposes the Windows MSZIP, XPRESS, XPRESS_HUFF, and LZMS compression algorithms. This enables developers of Windows applications to manage versions, service, and extend the exposed compression algorithms.Distributed Transaction CoordinatorGuide and reference documentation for system administrators and developers using the Distributed Transaction Coordinator (DTC).Microsoft.Dtc.PowerShell.DiagnosticsProvides information about the Windows PowerShell cmdlets provided with Microsoft Distributed Transaction Coordinator (MSDTC) for diagnostics.Microsoft.MsDtcManagement.CommandsProvides information about the Windows PowerShell cmdlets provided with Microsoft Distributed Transaction Coordinator (MSDTC) for management.Dynamic Link LibrariesHow to create and manage DLLs.Help APIThe Help API allows the opening of help catalogs and the retrieval of help content items.Interprocess CommunicationsHow to use mailslots and pipes.Kernel Transaction ManagerHow to use transacted file and registry operations, or define transactions for other resources.Memory ManagementCore memory management services.Operation RecorderOperation Recorder enables applications to speed up operations that repeatedly access the same file data by exposing the Windows prefetching mechanism as a public interface.Power ManagementCore power management services.Processes and ThreadsHow to create and manage processes and threads.Remote Desktop ServicesHow to programmatically interact with Remote Desktop Services.ServicesHow to create and manage services.SynchronizationHow to coordinate multiple threads of execution.Windows Desktop SharingWindows Desktop Sharing is a multiple-party screen-sharing technology. Key scenarios include remote assistance, real-time collaboration and conferencing, and video communication.Windows Messaging (MAPI)Enables you to add simple messaging functionality to a Windows-based application.Windows System InformationHow to programmatically access the registry and key system configuration and version information








No comments:

Post a Comment