Functions
ServiceImpl.cpp File Reference
#include "StdAfx.h"
#include "ServiceImpl.h"
#include "FlagMaps.h"

Functions

CA_API UINT __stdcall Service_RenameRegistryEntry (MSIHANDLE hInstall)
 Renames the registry entry of a service. More...
 
CA_API UINT __stdcall Service_ChangeBinaryPathName (MSIHANDLE hInstall)
 Change the path to the service binary file of a service. More...
 
CA_API UINT __stdcall Service_ChangeDisplayName (MSIHANDLE hInstall)
 Change the display name of a service. More...
 
CA_API UINT __stdcall Service_ChangeDescription (MSIHANDLE hInstall)
 Change the description of a service. More...
 
CA_API UINT __stdcall Service_Control (MSIHANDLE hInstall)
 Control (start/stop/pause/continue) a service. More...
 
CA_API UINT __stdcall Service_Delete (MSIHANDLE hInstall)
 Delete a service. More...
 
CA_API UINT __stdcall Service_GetConfig (MSIHANDLE hInstall)
 Get service configuration. More...
 
CA_API UINT __stdcall Service_Exists (MSIHANDLE hInstall)
 Check whether a service exists. More...
 
CA_API UINT __stdcall Service_GetState (MSIHANDLE hInstall)
 Get status of a service. More...
 

Function Documentation

CA_API UINT __stdcall Service_ChangeBinaryPathName ( MSIHANDLE  hInstall)

Change the path to the service binary file of a service.

The path to the service binary file of the service specified in SERVICE_CHANGE_SERVICE_NAME or SERVICE_NAME is set to SERVICE_CHANGE_BINARY_PATH_NAME.

Parameters
SERVICE_CHANGE_SERVICE_NAMEname of the service
SERVICE_NAMEalternative property for service name, used when SERVICE_CHANGE_SERVICE_NAME is not set
SERVICE_CHANGE_BINARY_PATH_NAMEnew fully qualified path to the service binary file.
Returns
check CA_ERROR on function failure
CA_API UINT __stdcall Service_ChangeDescription ( MSIHANDLE  hInstall)

Change the description of a service.

Changes the description of the service specified in SERVICE_CHANGE_SERVICE_NAME or SERVICE_NAME. The description is changed to SERVICE_CHANGE_DESCRIPTION.

Parameters
SERVICE_CHANGE_SERVICE_NAMEname of the service
SERVICE_NAMEalternative property for service name, used when SERVICE_CHANGE_SERVICE_NAME is not set
SERVICE_CHANGE_DESCRIPTIONnew description
Returns
check CA_ERROR on function failure
CA_API UINT __stdcall Service_ChangeDisplayName ( MSIHANDLE  hInstall)

Change the display name of a service.

Changes the display name of the service specified in SERVICE_CHANGE_SERVICE_NAME or SERVICE_NAME. The display name is changed to SERVICE_CHANGE_DISPLAY_NAME.

Parameters
SERVICE_CHANGE_SERVICE_NAMEname of the service
SERVICE_NAMEalternative property for service name, used when SERVICE_CHANGE_SERVICE_NAME is not set
SERVICE_CHANGE_DISPLAY_NAMEnew display name
Returns
check CA_ERROR on function failure
CA_API UINT __stdcall Service_Control ( MSIHANDLE  hInstall)

Control (start/stop/pause/continue) a service.

Parameters
SERVICE_NAMEservice name
SERVICE_CONTROLaction, one of SERVICE_CONTROL_START, SERVICE_CONTROL_STOP, SERVICE_CONTROL_PAUSE, SERVICE_CONTROL_CONTINUE
CA_API UINT __stdcall Service_Delete ( MSIHANDLE  hInstall)

Delete a service.

Parameters
SERVICE_NAMEservice name
CA_API UINT __stdcall Service_Exists ( MSIHANDLE  hInstall)

Check whether a service exists.

Parameters
SERVICE_NAMEservice name
Returns
SERVICE_EXISTS set to "1" if service exists, "0" otherwise
CA_API UINT __stdcall Service_GetConfig ( MSIHANDLE  hInstall)

Get service configuration.

Parameters
SERVICE_NAMEservice name
Returns
SERVICE_BINARY_PATH_NAME fully qualified path to the service binary file
SERVICE_ERROR_CONTROL severity of the error and action taken, one of SERVICE_ERROR_IGNORE, SERVICE_ERROR_NORMAL, SERVICE_ERROR_SEVERE or SERVICE_ERROR_CRITICAL
SERVICE_LOAD_ORDER_GROUP the load ordering group to which this service belongs
SERVICE_DISPLAY_NAME the display name to be used by service control programs to identify the service
SERVICE_START_NAME name of the account that the service process will be logged on as when it runs or the driver object name which the I/O system uses to load the device driver
SERVICE_TYPE type of service, one of SERVICE_FILE_SYSTEM_DRIVER, SERVICE_KERNEL_DRIVER, SERVICE_WIN32_OWN_PROCESS, SERVICE_WIN32_SHARE_PROCESS or SERVICE_INTERACTIVE_PROCESS
SERVICE_START_TYPE service start time, one of SERVICE_AUTO_START, SERVICE_BOOT_START, SERVICE_DEMAND_START, SERVICE_DISABLED or SERVICE_SYSTEM_START
SERVICE_TAG_ID unique tag value for this service in the group
SERVICE_DEPENDENCIES comma-separated list of dependencies
CA_API UINT __stdcall Service_GetState ( MSIHANDLE  hInstall)

Get status of a service.

Parameters
SERVICE_STATE_SERVICE_NAMEservice name
SERVICE_NAMEalternative property for service name, used when SERVICE_STATE_SERVICE_NAME is not set
Returns
SERVICE_STATE set to one of: Stopped, Starting, Stopping, Running, Resuming, Pausing, Paused depending on the current service state. Fails if service does not exist; SERVICE_STATUS is unchanged in this case.
CA_API UINT __stdcall Service_RenameRegistryEntry ( MSIHANDLE  hInstall)

Renames the registry entry of a service.

Renames HKLM to HKLM.

Parameters
SERVICE_RENAME_REGISTRY_ENTRY_FROMcurrent service name in the registry
SERVICE_RENAME_REGISTRY_ENTRY_TOnew service name in the registry
Returns
check CA_ERROR on function failure


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com