 |
 |
 |
|
|  |  |
 |
CreateService ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Creates a service object and adds it to the specified service control manager database. |
 |  | | Code examples: |  | |
|
 |  | | Declaration: |  |  |
SC_HANDLE WINAPI CreateService(
SC_HANDLE hSCManager,
LPCTSTR lpServiceName,
LPCTSTR lpDisplayName,
DWORD dwDesiredAccess,
DWORD dwServiceType,
DWORD dwStartType,
DWORD dwErrorControl,
LPCTSTR lpBinaryPathName,
LPCTSTR lpLoadOrderGroup,
LPDWORD lpdwTagId,
LPCTSTR lpDependencies,
LPCTSTR lpServiceStartName,
LPCTSTR lpPassword
);
|
 |  |  | | FoxPro declaration: |  |  |
DECLARE INTEGER CreateService IN advapi32;
INTEGER hSCManager,;
STRING lpServiceName,;
STRING lpDisplayName,;
LONG dwDesiredAccess,;
LONG dwServiceType,;
LONG dwStartType,;
LONG dwErrorControl,;
STRING lpBinaryPathName,;
STRING lpLoadOrderGroup,;
LONG lpdwTagId,;
STRING lpDependencies,;
STRING lpServiceStartName,;
STRING lpPassword
|
 |  |  | | Parameters: |  | hSCManager
[in] Handle to the service control manager database. This handle is returned by the OpenSCManager function and must have the SC_MANAGER_CREATE_SERVICE access right.
lpServiceName
[in] Pointer to a null-terminated string that specifies the name of the service to install.
lpDisplayName
[in] Pointer to a null-terminated string that contains the display name to be used by user interface programs to identify the service.
dwDesiredAccess
[in] Access to the service.
dwServiceType
[in] Service types, example SERVICE_WIN32_OWN_PROCESS.
dwStartType
[in] Service start options, example SERVICE_DEMAND_START.
dwErrorControl
[in] Severity of the error, and action taken, if this service fails to start, example SERVICE_ERROR_NORMAL.
lpBinaryPathName
[in] Pointer to a null-terminated string that contains the fully qualified path to the service binary file.
lpLoadOrderGroup
[in] Pointer to a null-terminated string that names the load ordering group of which this service is a member. Can be NULL.
lpdwTagId
[out] Pointer to a variable that receives a tag value that is unique in the group specified in the lpLoadOrderGroup parameter. Can be NULL.
lpDependencies
[in] Pointer to a double null-terminated array of null-separated names of services or load ordering groups that the system must start before this service. Can be NULL.
lpServiceStartName
[in] Pointer to a null-terminated string that specifies the name of the account under which the service should run. Set to NULL for LocalSystem account.
lpPassword
[in] Pointer to a null-terminated string that contains the password to the account name specified by the lpServiceStartName parameter. |
 |  | | Return value: |  | | If the function succeeds, the return value is a handle to the service. |
 |  | | My comment: |  | | The returned handle is only valid for the process that called CreateService. It can be closed by calling the CloseServiceHandle function. |
 |  | | Word Index links for the CreateService : |  | |
|
 |  | | Translate this page: |  | |  |  | | • |  | | Created: | 2006-09-21 21:49:26 | | Modified: | 2006-09-21 21:55:07 | Visited in last 7 days: 16 |
|
 |
 |
 |
 |
Copyright © 2001-2013
News2News, Inc.
Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use.
The information on this page is presented AS IS, meaning that you may use it at your own risk.
Microsoft Visual FoxPro
and Windows are trade marks
of Microsoft Corp.
All other trademarks are the property of their respective owners.
Privacy policy
|
 |
 |
 |
Credits: PHP (4.4.9), an HTML-embedded scripting language,
MySQL (5.1.55-log), the Open Source standard SQL database,
AceHTML Freeware
Version 4, freeware HTML Editor of choice. Hosted by Korax Online Inc. |
 |
 |
|
 |
 |
|
|