Annotation of mstools/h/winsvc.h, revision 1.1.1.3

1.1.1.3 ! root        1: /*++ BUILD Version: 0010    // Increment this if a change has global effects
1.1       root        2: 
1.1.1.3 ! root        3: Copyright (c) 1993  Microsoft Corporation
1.1       root        4: 
                      5: Module Name:
                      6: 
                      7:     winsvc.h
                      8: 
                      9: Abstract:
                     10: 
                     11:     Header file for the Service Control Manager
                     12: 
                     13: Author:
                     14: 
                     15:     Dan Lafferty (danl) 19-Jan-1992
                     16: 
                     17: Environment:
                     18: 
                     19:     User Mode - Win32
                     20: 
                     21: Revision History:
                     22: 
1.1.1.3 ! root       23:     05-Nov-1992     danl
        !            24:         Added Display Names
        !            25: 
        !            26:     19-Jan-1992     danl
        !            27:         Created
1.1       root       28: 
                     29: --*/
                     30: #ifndef _WINSVC_
                     31: #define _WINSVC_
                     32: 
1.1.1.3 ! root       33: #ifdef __cplusplus
        !            34: extern "C" {
        !            35: #endif
        !            36: 
1.1       root       37: //
                     38: // Constants
                     39: //
                     40: 
                     41: //
                     42: // Service database names
                     43: //
                     44: 
                     45: #define SERVICES_ACTIVE_DATABASEW      L"ServicesActive"
                     46: #define SERVICES_FAILED_DATABASEW      L"ServicesFailed"
                     47: 
                     48: #define SERVICES_ACTIVE_DATABASEA      "ServicesActive"
                     49: #define SERVICES_FAILED_DATABASEA      "ServicesFailed"
                     50: 
1.1.1.2   root       51: //
                     52: // Character to designate that a name is a group
                     53: //
                     54: 
                     55: #define SC_GROUP_IDENTIFIERW           L'+'
                     56: #define SC_GROUP_IDENTIFIERA           '+'
                     57: 
1.1       root       58: #ifdef UNICODE
                     59: 
                     60: #define SERVICES_ACTIVE_DATABASE       SERVICES_ACTIVE_DATABASEW
                     61: #define SERVICES_FAILED_DATABASE       SERVICES_FAILED_DATABASEW
                     62: 
1.1.1.2   root       63: 
                     64: #define SC_GROUP_IDENTIFIER            SC_GROUP_IDENTIFIERW
                     65: 
1.1       root       66: #else // ndef UNICODE
                     67: 
                     68: #define SERVICES_ACTIVE_DATABASE       SERVICES_ACTIVE_DATABASEA
                     69: #define SERVICES_FAILED_DATABASE       SERVICES_FAILED_DATABASEA
                     70: 
1.1.1.2   root       71: #define SC_GROUP_IDENTIFIER            SC_GROUP_IDENTIFIERA
1.1       root       72: #endif // ndef UNICODE
                     73: 
1.1.1.2   root       74: 
1.1       root       75: //
                     76: // Value to indicate no change to an optional parameter
                     77: //
                     78: #define SERVICE_NO_CHANGE              0xffffffff
                     79: 
                     80: //
                     81: // Service State -- for Enum Requests (Bit Mask)
                     82: //
                     83: #define SERVICE_ACTIVE                 0x00000001
                     84: #define SERVICE_INACTIVE               0x00000002
                     85: #define SERVICE_STATE_ALL              (SERVICE_ACTIVE   | \
                     86:                                         SERVICE_INACTIVE)
                     87: 
                     88: //
                     89: // Controls
                     90: //
                     91: #define SERVICE_CONTROL_STOP           0x00000001
                     92: #define SERVICE_CONTROL_PAUSE          0x00000002
                     93: #define SERVICE_CONTROL_CONTINUE       0x00000003
                     94: #define SERVICE_CONTROL_INTERROGATE    0x00000004
1.1.1.2   root       95: #define SERVICE_CONTROL_SHUTDOWN       0x00000005
1.1       root       96: 
                     97: //
                     98: // Service State -- for CurrentState
                     99: //
                    100: #define SERVICE_STOPPED                0x00000001
                    101: #define SERVICE_START_PENDING          0x00000002
                    102: #define SERVICE_STOP_PENDING           0x00000003
                    103: #define SERVICE_RUNNING                0x00000004
                    104: #define SERVICE_CONTINUE_PENDING       0x00000005
                    105: #define SERVICE_PAUSE_PENDING          0x00000006
                    106: #define SERVICE_PAUSED                 0x00000007
                    107: 
                    108: //
                    109: // Controls Accepted  (Bit Mask)
                    110: //
                    111: #define SERVICE_ACCEPT_STOP            0x00000001
                    112: #define SERVICE_ACCEPT_PAUSE_CONTINUE  0x00000002
1.1.1.2   root      113: #define SERVICE_ACCEPT_SHUTDOWN        0x00000004
1.1       root      114: 
                    115: //
                    116: // Service Control Manager object specific access types
                    117: //
                    118: #define SC_MANAGER_CONNECT             0x0001
                    119: #define SC_MANAGER_CREATE_SERVICE      0x0002
                    120: #define SC_MANAGER_ENUMERATE_SERVICE   0x0004
                    121: #define SC_MANAGER_LOCK                0x0008
                    122: #define SC_MANAGER_QUERY_LOCK_STATUS   0x0010
                    123: #define SC_MANAGER_MODIFY_BOOT_CONFIG  0x0020
                    124: 
                    125: #define SC_MANAGER_ALL_ACCESS          (STANDARD_RIGHTS_REQUIRED      | \
                    126:                                         SC_MANAGER_CONNECT            | \
                    127:                                         SC_MANAGER_CREATE_SERVICE     | \
                    128:                                         SC_MANAGER_ENUMERATE_SERVICE  | \
                    129:                                         SC_MANAGER_LOCK               | \
                    130:                                         SC_MANAGER_QUERY_LOCK_STATUS  | \
                    131:                                         SC_MANAGER_MODIFY_BOOT_CONFIG)
                    132: 
                    133: 
                    134: 
                    135: //
                    136: // Service object specific access type
                    137: //
                    138: #define SERVICE_QUERY_CONFIG           0x0001
                    139: #define SERVICE_CHANGE_CONFIG          0x0002
                    140: #define SERVICE_QUERY_STATUS           0x0004
                    141: #define SERVICE_ENUMERATE_DEPENDENTS   0x0008
                    142: #define SERVICE_START                  0x0010
                    143: #define SERVICE_STOP                   0x0020
                    144: #define SERVICE_PAUSE_CONTINUE         0x0040
                    145: #define SERVICE_INTERROGATE            0x0080
1.1.1.2   root      146: #define SERVICE_USER_DEFINED_CONTROL   0x0100
1.1       root      147: 
                    148: #define SERVICE_ALL_ACCESS             (STANDARD_RIGHTS_REQUIRED     | \
                    149:                                         SERVICE_QUERY_CONFIG         | \
                    150:                                         SERVICE_CHANGE_CONFIG        | \
                    151:                                         SERVICE_QUERY_STATUS         | \
                    152:                                         SERVICE_ENUMERATE_DEPENDENTS | \
                    153:                                         SERVICE_START                | \
                    154:                                         SERVICE_STOP                 | \
                    155:                                         SERVICE_PAUSE_CONTINUE       | \
1.1.1.2   root      156:                                         SERVICE_INTERROGATE          | \
                    157:                                         SERVICE_USER_DEFINED_CONTROL)
1.1       root      158: 
                    159: 
                    160: //
                    161: // Handle Types
                    162: //
                    163: 
                    164: typedef HANDLE      SC_HANDLE;
                    165: typedef SC_HANDLE   *LPSC_HANDLE;
                    166: 
                    167: typedef DWORD       SERVICE_STATUS_HANDLE;
                    168: 
                    169: //
                    170: // Service Status Structure
                    171: //
                    172: 
                    173: typedef struct _SERVICE_STATUS {
                    174:     DWORD   dwServiceType;
                    175:     DWORD   dwCurrentState;
                    176:     DWORD   dwControlsAccepted;
                    177:     DWORD   dwWin32ExitCode;
                    178:     DWORD   dwServiceSpecificExitCode;
                    179:     DWORD   dwCheckPoint;
                    180:     DWORD   dwWaitHint;
                    181: } SERVICE_STATUS, *LPSERVICE_STATUS;
                    182: 
                    183: 
                    184: 
                    185: //
                    186: // Service Status Enumeration Structure
                    187: //
                    188: 
                    189: typedef struct _ENUM_SERVICE_STATUSA {
                    190:     LPSTR          lpServiceName;
1.1.1.3 ! root      191:     LPSTR          lpDisplayName;
1.1       root      192:     SERVICE_STATUS ServiceStatus;
                    193: } ENUM_SERVICE_STATUSA, *LPENUM_SERVICE_STATUSA;
                    194: typedef struct _ENUM_SERVICE_STATUSW {
                    195:     LPWSTR         lpServiceName;
1.1.1.3 ! root      196:     LPWSTR         lpDisplayName;
1.1       root      197:     SERVICE_STATUS ServiceStatus;
                    198: } ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW;
                    199: #ifdef UNICODE
1.1.1.3 ! root      200: typedef ENUM_SERVICE_STATUSW ENUM_SERVICE_STATUS;
        !           201: typedef LPENUM_SERVICE_STATUSW LPENUM_SERVICE_STATUS;
1.1       root      202: #else
1.1.1.3 ! root      203: typedef ENUM_SERVICE_STATUSA ENUM_SERVICE_STATUS;
        !           204: typedef LPENUM_SERVICE_STATUSA LPENUM_SERVICE_STATUS;
1.1       root      205: #endif // UNICODE
                    206: 
                    207: 
                    208: //
                    209: // Structures for the Lock API functions
                    210: //
                    211: 
                    212: typedef LPVOID  SC_LOCK;
                    213: 
                    214: typedef struct _QUERY_SERVICE_LOCK_STATUSA {
                    215:     DWORD   fIsLocked;
                    216:     LPSTR   lpLockOwner;
                    217:     DWORD   dwLockDuration;
                    218: } QUERY_SERVICE_LOCK_STATUSA, *LPQUERY_SERVICE_LOCK_STATUSA;
                    219: typedef struct _QUERY_SERVICE_LOCK_STATUSW {
                    220:     DWORD   fIsLocked;
                    221:     LPWSTR  lpLockOwner;
                    222:     DWORD   dwLockDuration;
                    223: } QUERY_SERVICE_LOCK_STATUSW, *LPQUERY_SERVICE_LOCK_STATUSW;
                    224: #ifdef UNICODE
1.1.1.3 ! root      225: typedef QUERY_SERVICE_LOCK_STATUSW QUERY_SERVICE_LOCK_STATUS;
        !           226: typedef LPQUERY_SERVICE_LOCK_STATUSW LPQUERY_SERVICE_LOCK_STATUS;
1.1       root      227: #else
1.1.1.3 ! root      228: typedef QUERY_SERVICE_LOCK_STATUSA QUERY_SERVICE_LOCK_STATUS;
        !           229: typedef LPQUERY_SERVICE_LOCK_STATUSA LPQUERY_SERVICE_LOCK_STATUS;
1.1       root      230: #endif // UNICODE
                    231: 
                    232: 
                    233: 
                    234: //
                    235: // Query Service Configuration Structure
                    236: //
                    237: 
                    238: typedef struct _QUERY_SERVICE_CONFIGA {
                    239:     DWORD   dwServiceType;
                    240:     DWORD   dwStartType;
                    241:     DWORD   dwErrorControl;
                    242:     LPSTR   lpBinaryPathName;
                    243:     LPSTR   lpLoadOrderGroup;
1.1.1.2   root      244:     DWORD   dwTagId;
1.1       root      245:     LPSTR   lpDependencies;
                    246:     LPSTR   lpServiceStartName;
1.1.1.3 ! root      247:     LPSTR   lpDisplayName;
1.1       root      248: } QUERY_SERVICE_CONFIGA, *LPQUERY_SERVICE_CONFIGA;
                    249: typedef struct _QUERY_SERVICE_CONFIGW {
                    250:     DWORD   dwServiceType;
                    251:     DWORD   dwStartType;
                    252:     DWORD   dwErrorControl;
                    253:     LPWSTR  lpBinaryPathName;
                    254:     LPWSTR  lpLoadOrderGroup;
1.1.1.2   root      255:     DWORD   dwTagId;
1.1       root      256:     LPWSTR  lpDependencies;
                    257:     LPWSTR  lpServiceStartName;
1.1.1.3 ! root      258:     LPWSTR  lpDisplayName;
1.1       root      259: } QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW;
                    260: #ifdef UNICODE
1.1.1.3 ! root      261: typedef QUERY_SERVICE_CONFIGW QUERY_SERVICE_CONFIG;
        !           262: typedef LPQUERY_SERVICE_CONFIGW LPQUERY_SERVICE_CONFIG;
1.1       root      263: #else
1.1.1.3 ! root      264: typedef QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG;
        !           265: typedef LPQUERY_SERVICE_CONFIGA LPQUERY_SERVICE_CONFIG;
1.1       root      266: #endif // UNICODE
                    267: 
                    268: 
                    269: 
                    270: //
                    271: // Function Prototype for the Service Main Function
                    272: //
                    273: 
                    274: typedef VOID (*LPSERVICE_MAIN_FUNCTIONW)(
                    275:     DWORD   dwNumServicesArgs,
                    276:     LPWSTR  *lpServiceArgVectors
                    277:     );
                    278: 
                    279: typedef VOID (*LPSERVICE_MAIN_FUNCTIONA)(
                    280:     DWORD   dwNumServicesArgs,
                    281:     LPSTR   *lpServiceArgVectors
                    282:     );
                    283: 
                    284: #ifdef UNICODE
                    285: #define LPSERVICE_MAIN_FUNCTION LPSERVICE_MAIN_FUNCTIONW
                    286: #else
                    287: #define LPSERVICE_MAIN_FUNCTION LPSERVICE_MAIN_FUNCTIONA
                    288: #endif //UNICODE
                    289: 
                    290: 
                    291: //
                    292: // Service Start Table
                    293: //
                    294: 
                    295: typedef struct _SERVICE_TABLE_ENTRYA {
                    296:     LPSTR                       lpServiceName;
                    297:     LPSERVICE_MAIN_FUNCTIONA    lpServiceProc;
                    298: }SERVICE_TABLE_ENTRYA, *LPSERVICE_TABLE_ENTRYA;
                    299: typedef struct _SERVICE_TABLE_ENTRYW {
                    300:     LPWSTR                      lpServiceName;
                    301:     LPSERVICE_MAIN_FUNCTIONW    lpServiceProc;
                    302: }SERVICE_TABLE_ENTRYW, *LPSERVICE_TABLE_ENTRYW;
                    303: #ifdef UNICODE
1.1.1.3 ! root      304: typedef SERVICE_TABLE_ENTRYW SERVICE_TABLE_ENTRY;
        !           305: typedef LPSERVICE_TABLE_ENTRYW LPSERVICE_TABLE_ENTRY;
1.1       root      306: #else
1.1.1.3 ! root      307: typedef SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY;
        !           308: typedef LPSERVICE_TABLE_ENTRYA LPSERVICE_TABLE_ENTRY;
1.1       root      309: #endif // UNICODE
                    310: 
                    311: //
                    312: // Prototype for the Service Control Handler Function
                    313: //
                    314: 
                    315: typedef VOID (*LPHANDLER_FUNCTION)(
                    316:     DWORD    dwControl
                    317:     );
                    318: 
                    319: 
                    320: 
                    321: ///////////////////////////////////////////////////////////////////////////
                    322: // API Function Prototypes
                    323: ///////////////////////////////////////////////////////////////////////////
                    324: 
                    325: BOOL
                    326: WINAPI
                    327: ChangeServiceConfigA(
                    328:     SC_HANDLE    hService,
                    329:     DWORD        dwServiceType,
                    330:     DWORD        dwStartType,
                    331:     DWORD        dwErrorControl,
                    332:     LPCSTR     lpBinaryPathName,
                    333:     LPCSTR     lpLoadOrderGroup,
1.1.1.2   root      334:     LPDWORD      lpdwTagId,
1.1       root      335:     LPCSTR     lpDependencies,
                    336:     LPCSTR     lpServiceStartName,
1.1.1.3 ! root      337:     LPCSTR     lpPassword,
        !           338:     LPCSTR     lpDisplayName
1.1       root      339:     );
                    340: BOOL
                    341: WINAPI
                    342: ChangeServiceConfigW(
                    343:     SC_HANDLE    hService,
                    344:     DWORD        dwServiceType,
                    345:     DWORD        dwStartType,
                    346:     DWORD        dwErrorControl,
                    347:     LPCWSTR     lpBinaryPathName,
                    348:     LPCWSTR     lpLoadOrderGroup,
1.1.1.2   root      349:     LPDWORD      lpdwTagId,
1.1       root      350:     LPCWSTR     lpDependencies,
                    351:     LPCWSTR     lpServiceStartName,
1.1.1.3 ! root      352:     LPCWSTR     lpPassword,
        !           353:     LPCWSTR     lpDisplayName
1.1       root      354:     );
                    355: #ifdef UNICODE
1.1.1.3 ! root      356: #define ChangeServiceConfig  ChangeServiceConfigW
1.1       root      357: #else
1.1.1.3 ! root      358: #define ChangeServiceConfig  ChangeServiceConfigA
1.1       root      359: #endif // !UNICODE
                    360: 
                    361: BOOL
                    362: WINAPI
                    363: CloseServiceHandle(
                    364:     SC_HANDLE   hSCObject
                    365:     );
                    366: 
                    367: BOOL
                    368: WINAPI
                    369: ControlService(
                    370:     SC_HANDLE           hService,
                    371:     DWORD               dwControl,
                    372:     LPSERVICE_STATUS    lpServiceStatus
                    373:     );
                    374: 
                    375: SC_HANDLE
                    376: WINAPI
                    377: CreateServiceA(
                    378:     SC_HANDLE    hSCManager,
                    379:     LPCSTR     lpServiceName,
1.1.1.3 ! root      380:     LPCSTR     lpDisplayName,
1.1       root      381:     DWORD        dwDesiredAccess,
                    382:     DWORD        dwServiceType,
                    383:     DWORD        dwStartType,
                    384:     DWORD        dwErrorControl,
                    385:     LPCSTR     lpBinaryPathName,
                    386:     LPCSTR     lpLoadOrderGroup,
1.1.1.2   root      387:     LPDWORD      lpdwTagId,
1.1       root      388:     LPCSTR     lpDependencies,
                    389:     LPCSTR     lpServiceStartName,
                    390:     LPCSTR     lpPassword
                    391:     );
                    392: SC_HANDLE
                    393: WINAPI
                    394: CreateServiceW(
                    395:     SC_HANDLE    hSCManager,
                    396:     LPCWSTR     lpServiceName,
1.1.1.3 ! root      397:     LPCWSTR     lpDisplayName,
1.1       root      398:     DWORD        dwDesiredAccess,
                    399:     DWORD        dwServiceType,
                    400:     DWORD        dwStartType,
                    401:     DWORD        dwErrorControl,
                    402:     LPCWSTR     lpBinaryPathName,
                    403:     LPCWSTR     lpLoadOrderGroup,
1.1.1.2   root      404:     LPDWORD      lpdwTagId,
1.1       root      405:     LPCWSTR     lpDependencies,
                    406:     LPCWSTR     lpServiceStartName,
                    407:     LPCWSTR     lpPassword
                    408:     );
                    409: #ifdef UNICODE
1.1.1.3 ! root      410: #define CreateService  CreateServiceW
1.1       root      411: #else
1.1.1.3 ! root      412: #define CreateService  CreateServiceA
1.1       root      413: #endif // !UNICODE
                    414: 
                    415: BOOL
                    416: WINAPI
                    417: DeleteService(
                    418:     SC_HANDLE   hService
                    419:     );
                    420: 
                    421: BOOL
                    422: WINAPI
                    423: EnumDependentServicesA(
                    424:     SC_HANDLE               hService,
                    425:     DWORD                   dwServiceState,
                    426:     LPENUM_SERVICE_STATUSA  lpServices,
                    427:     DWORD                   cbBufSize,
                    428:     LPDWORD                 pcbBytesNeeded,
                    429:     LPDWORD                 lpServicesReturned
                    430:     );
                    431: BOOL
                    432: WINAPI
                    433: EnumDependentServicesW(
                    434:     SC_HANDLE               hService,
                    435:     DWORD                   dwServiceState,
                    436:     LPENUM_SERVICE_STATUSW  lpServices,
                    437:     DWORD                   cbBufSize,
                    438:     LPDWORD                 pcbBytesNeeded,
                    439:     LPDWORD                 lpServicesReturned
                    440:     );
                    441: #ifdef UNICODE
1.1.1.3 ! root      442: #define EnumDependentServices  EnumDependentServicesW
1.1       root      443: #else
1.1.1.3 ! root      444: #define EnumDependentServices  EnumDependentServicesA
1.1       root      445: #endif // !UNICODE
                    446: 
                    447: BOOL
                    448: WINAPI
                    449: EnumServicesStatusA(
                    450:     SC_HANDLE               hSCManager,
                    451:     DWORD                   dwServiceType,
                    452:     DWORD                   dwServiceState,
                    453:     LPENUM_SERVICE_STATUSA  lpServices,
                    454:     DWORD                   cbBufSize,
                    455:     LPDWORD                 pcbBytesNeeded,
                    456:     LPDWORD                 lpServicesReturned,
                    457:     LPDWORD                 lpResumeHandle
                    458:     );
                    459: BOOL
                    460: WINAPI
                    461: EnumServicesStatusW(
                    462:     SC_HANDLE               hSCManager,
                    463:     DWORD                   dwServiceType,
                    464:     DWORD                   dwServiceState,
                    465:     LPENUM_SERVICE_STATUSW  lpServices,
                    466:     DWORD                   cbBufSize,
                    467:     LPDWORD                 pcbBytesNeeded,
                    468:     LPDWORD                 lpServicesReturned,
                    469:     LPDWORD                 lpResumeHandle
                    470:     );
                    471: #ifdef UNICODE
1.1.1.3 ! root      472: #define EnumServicesStatus  EnumServicesStatusW
1.1       root      473: #else
1.1.1.3 ! root      474: #define EnumServicesStatus  EnumServicesStatusA
        !           475: #endif // !UNICODE
        !           476: 
        !           477: BOOL
        !           478: WINAPI
        !           479: GetServiceKeyNameA(
        !           480:     SC_HANDLE               hSCManager,
        !           481:     LPCSTR                lpDisplayName,
        !           482:     LPSTR                 lpServiceName,
        !           483:     LPDWORD                 lpcchBuffer
        !           484:     );
        !           485: BOOL
        !           486: WINAPI
        !           487: GetServiceKeyNameW(
        !           488:     SC_HANDLE               hSCManager,
        !           489:     LPCWSTR                lpDisplayName,
        !           490:     LPWSTR                 lpServiceName,
        !           491:     LPDWORD                 lpcchBuffer
        !           492:     );
        !           493: #ifdef UNICODE
        !           494: #define GetServiceKeyName  GetServiceKeyNameW
        !           495: #else
        !           496: #define GetServiceKeyName  GetServiceKeyNameA
        !           497: #endif // !UNICODE
        !           498: 
        !           499: BOOL
        !           500: WINAPI
        !           501: GetServiceDisplayNameA(
        !           502:     SC_HANDLE               hSCManager,
        !           503:     LPCSTR                lpServiceName,
        !           504:     LPSTR                 lpDisplayName,
        !           505:     LPDWORD                 lpcchBuffer
        !           506:     );
        !           507: BOOL
        !           508: WINAPI
        !           509: GetServiceDisplayNameW(
        !           510:     SC_HANDLE               hSCManager,
        !           511:     LPCWSTR                lpServiceName,
        !           512:     LPWSTR                 lpDisplayName,
        !           513:     LPDWORD                 lpcchBuffer
        !           514:     );
        !           515: #ifdef UNICODE
        !           516: #define GetServiceDisplayName  GetServiceDisplayNameW
        !           517: #else
        !           518: #define GetServiceDisplayName  GetServiceDisplayNameA
1.1       root      519: #endif // !UNICODE
                    520: 
                    521: SC_LOCK
                    522: WINAPI
                    523: LockServiceDatabase(
                    524:     SC_HANDLE   hSCManager
                    525:     );
                    526: 
                    527: BOOL
                    528: WINAPI
                    529: NotifyBootConfigStatus(
                    530:     BOOL     BootAcceptable
                    531:     );
                    532: 
                    533: SC_HANDLE
                    534: WINAPI
                    535: OpenSCManagerA(
                    536:     LPCSTR lpMachineName,
                    537:     LPCSTR lpDatabaseName,
                    538:     DWORD   dwDesiredAccess
                    539:     );
                    540: SC_HANDLE
                    541: WINAPI
                    542: OpenSCManagerW(
                    543:     LPCWSTR lpMachineName,
                    544:     LPCWSTR lpDatabaseName,
                    545:     DWORD   dwDesiredAccess
                    546:     );
                    547: #ifdef UNICODE
1.1.1.3 ! root      548: #define OpenSCManager  OpenSCManagerW
1.1       root      549: #else
1.1.1.3 ! root      550: #define OpenSCManager  OpenSCManagerA
1.1       root      551: #endif // !UNICODE
                    552: 
                    553: SC_HANDLE
                    554: WINAPI
                    555: OpenServiceA(
                    556:     SC_HANDLE   hSCManager,
                    557:     LPCSTR    lpServiceName,
                    558:     DWORD       dwDesiredAccess
                    559:     );
                    560: SC_HANDLE
                    561: WINAPI
                    562: OpenServiceW(
                    563:     SC_HANDLE   hSCManager,
                    564:     LPCWSTR    lpServiceName,
                    565:     DWORD       dwDesiredAccess
                    566:     );
                    567: #ifdef UNICODE
1.1.1.3 ! root      568: #define OpenService  OpenServiceW
1.1       root      569: #else
1.1.1.3 ! root      570: #define OpenService  OpenServiceA
1.1       root      571: #endif // !UNICODE
                    572: 
                    573: BOOL
                    574: WINAPI
                    575: QueryServiceConfigA(
                    576:     SC_HANDLE               hService,
                    577:     LPQUERY_SERVICE_CONFIGA lpServiceConfig,
                    578:     DWORD                   cbBufSize,
                    579:     LPDWORD                 pcbBytesNeeded
                    580:     );
                    581: BOOL
                    582: WINAPI
                    583: QueryServiceConfigW(
                    584:     SC_HANDLE               hService,
                    585:     LPQUERY_SERVICE_CONFIGW lpServiceConfig,
                    586:     DWORD                   cbBufSize,
                    587:     LPDWORD                 pcbBytesNeeded
                    588:     );
                    589: #ifdef UNICODE
1.1.1.3 ! root      590: #define QueryServiceConfig  QueryServiceConfigW
1.1       root      591: #else
1.1.1.3 ! root      592: #define QueryServiceConfig  QueryServiceConfigA
1.1       root      593: #endif // !UNICODE
                    594: 
                    595: BOOL
                    596: WINAPI
                    597: QueryServiceLockStatusA(
                    598:     SC_HANDLE                       hSCManager,
                    599:     LPQUERY_SERVICE_LOCK_STATUSA    lpLockStatus,
                    600:     DWORD                           cbBufSize,
                    601:     LPDWORD                         pcbBytesNeeded
                    602:     );
                    603: BOOL
                    604: WINAPI
                    605: QueryServiceLockStatusW(
                    606:     SC_HANDLE                       hSCManager,
                    607:     LPQUERY_SERVICE_LOCK_STATUSW    lpLockStatus,
                    608:     DWORD                           cbBufSize,
                    609:     LPDWORD                         pcbBytesNeeded
                    610:     );
                    611: #ifdef UNICODE
1.1.1.3 ! root      612: #define QueryServiceLockStatus  QueryServiceLockStatusW
1.1       root      613: #else
1.1.1.3 ! root      614: #define QueryServiceLockStatus  QueryServiceLockStatusA
1.1       root      615: #endif // !UNICODE
                    616: 
                    617: BOOL
                    618: WINAPI
                    619: QueryServiceObjectSecurity(
                    620:     SC_HANDLE               hService,
                    621:     SECURITY_INFORMATION    dwSecurityInformation,
                    622:     PSECURITY_DESCRIPTOR    lpSecurityDescriptor,
                    623:     DWORD                   cbBufSize,
                    624:     LPDWORD                 pcbBytesNeeded
                    625:     );
                    626: 
                    627: BOOL
                    628: WINAPI
                    629: QueryServiceStatus(
                    630:     SC_HANDLE           hService,
                    631:     LPSERVICE_STATUS    lpServiceStatus
                    632:     );
                    633: 
                    634: SERVICE_STATUS_HANDLE
                    635: WINAPI
                    636: RegisterServiceCtrlHandlerA(
                    637:     LPCSTR             lpServiceName,
                    638:     LPHANDLER_FUNCTION   lpHandlerProc
                    639:     );
                    640: SERVICE_STATUS_HANDLE
                    641: WINAPI
                    642: RegisterServiceCtrlHandlerW(
                    643:     LPCWSTR             lpServiceName,
                    644:     LPHANDLER_FUNCTION   lpHandlerProc
                    645:     );
                    646: #ifdef UNICODE
1.1.1.3 ! root      647: #define RegisterServiceCtrlHandler  RegisterServiceCtrlHandlerW
1.1       root      648: #else
1.1.1.3 ! root      649: #define RegisterServiceCtrlHandler  RegisterServiceCtrlHandlerA
1.1       root      650: #endif // !UNICODE
                    651: 
                    652: BOOL
                    653: WINAPI
                    654: SetServiceObjectSecurity(
                    655:     SC_HANDLE               hService,
                    656:     SECURITY_INFORMATION    dwSecurityInformation,
                    657:     PSECURITY_DESCRIPTOR    lpSecurityDescriptor
                    658:     );
                    659: 
                    660: BOOL
                    661: WINAPI
                    662: SetServiceStatus(
                    663:     SERVICE_STATUS_HANDLE   hServiceStatus,
                    664:     LPSERVICE_STATUS        lpServiceStatus
                    665:     );
                    666: 
                    667: BOOL
                    668: WINAPI
                    669: StartServiceCtrlDispatcherA(
                    670:     LPSERVICE_TABLE_ENTRYA    lpServiceStartTable
                    671:     );
                    672: BOOL
                    673: WINAPI
                    674: StartServiceCtrlDispatcherW(
                    675:     LPSERVICE_TABLE_ENTRYW    lpServiceStartTable
                    676:     );
                    677: #ifdef UNICODE
1.1.1.3 ! root      678: #define StartServiceCtrlDispatcher  StartServiceCtrlDispatcherW
1.1       root      679: #else
1.1.1.3 ! root      680: #define StartServiceCtrlDispatcher  StartServiceCtrlDispatcherA
1.1       root      681: #endif // !UNICODE
                    682: 
                    683: 
                    684: BOOL
                    685: WINAPI
                    686: StartServiceA(
                    687:     SC_HANDLE            hService,
                    688:     DWORD                dwNumServiceArgs,
                    689:     LPCSTR             *lpServiceArgVectors
                    690:     );
                    691: BOOL
                    692: WINAPI
                    693: StartServiceW(
                    694:     SC_HANDLE            hService,
                    695:     DWORD                dwNumServiceArgs,
                    696:     LPCWSTR             *lpServiceArgVectors
                    697:     );
                    698: #ifdef UNICODE
1.1.1.3 ! root      699: #define StartService  StartServiceW
1.1       root      700: #else
1.1.1.3 ! root      701: #define StartService  StartServiceA
1.1       root      702: #endif // !UNICODE
                    703: 
                    704: BOOL
                    705: WINAPI
                    706: UnlockServiceDatabase(
                    707:     SC_LOCK     ScLock
                    708:     );
                    709: 
                    710: 
1.1.1.3 ! root      711: #ifdef __cplusplus
        !           712: }
        !           713: #endif
1.1       root      714: 
                    715: #endif // _WINSVC_

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.