1 #ifndef __WINE_WINSVC_H
2 #define __WINE_WINSVC_H
6 #endif /* defined(__cplusplus) */
12 typedef HANDLE SC_HANDLE
, *LPSC_HANDLE
;
14 typedef DWORD SERVICE_STATUS_HANDLE
;
16 /* Service status structure */
18 typedef struct _SERVICE_STATUS
{
21 DWORD dwControlsAccepted
;
22 DWORD dwWin32ExitCode
;
23 DWORD dwServiceSpecificExitCode
;
26 } SERVICE_STATUS
, *LPSERVICE_STATUS
;
28 /* Service main function prototype */
30 typedef VOID (CALLBACK
*LPSERVICE_MAIN_FUNCTIONA
)(DWORD
,LPSTR
*);
31 typedef VOID (CALLBACK
*LPSERVICE_MAIN_FUNCTIONW
)(DWORD
,LPWSTR
*);
32 DECL_WINELIB_TYPE_AW(LPSERVICE_MAIN_FUNCTION
)
34 /* Service start table */
36 typedef struct _SERVICE_TABLE_ENTRYA
{
38 LPSERVICE_MAIN_FUNCTIONA lpServiceProc
;
39 } SERVICE_TABLE_ENTRYA
, *LPSERVICE_TABLE_ENTRYA
;
41 typedef struct _SERVICE_TABLE_ENTRYW
{
43 LPSERVICE_MAIN_FUNCTIONW lpServiceProc
;
44 } SERVICE_TABLE_ENTRYW
, *LPSERVICE_TABLE_ENTRYW
;
46 DECL_WINELIB_TYPE_AW(SERVICE_TABLE_ENTRY
)
47 DECL_WINELIB_TYPE_AW(LPSERVICE_TABLE_ENTRY
)
49 /* Service status enumeration structure */
51 typedef struct _ENUM_SERVICE_STATUSA
{
54 SERVICE_STATUS ServiceStatus
;
55 } ENUM_SERVICE_STATUSA
, *LPENUM_SERVICE_STATUSA
;
57 typedef struct _ENUM_SERVICE_STATUSW
{
60 SERVICE_STATUS ServiceStatus
;
61 } ENUM_SERVICE_STATUSW
, *LPENUM_SERVICE_STATUSW
;
63 DECL_WINELIB_TYPE_AW(ENUM_SERVICE_STATUS
)
64 DECL_WINELIB_TYPE_AW(LPENUM_SERVICE_STATUS
)
66 /* Service control handler function prototype */
68 typedef VOID (WINAPI
*LPHANDLER_FUNCTION
)(DWORD
);
70 /* API function prototypes */
72 BOOL WINAPI
CloseServiceHandle(SC_HANDLE
);
73 BOOL WINAPI
ControlService(SC_HANDLE
,DWORD
,LPSERVICE_STATUS
);
74 SC_HANDLE WINAPI
CreateServiceA(DWORD
,LPCSTR
,LPCSTR
,DWORD
,DWORD
,DWORD
,DWORD
,LPCSTR
,
75 LPCSTR
,LPDWORD
,LPCSTR
,LPCSTR
,LPCSTR
);
76 SC_HANDLE WINAPI
CreateServiceW(DWORD
,LPCWSTR
,LPCWSTR
,DWORD
,DWORD
,DWORD
,DWORD
,LPCWSTR
,
77 LPCWSTR
,LPDWORD
,LPCWSTR
,LPCWSTR
,LPCWSTR
);
78 #define CreateService WINELIB_NAME_AW(CreateService)
79 BOOL WINAPI
DeleteService(SC_HANDLE
);
80 BOOL WINAPI
EnumServicesStatusA(SC_HANDLE
,DWORD
,DWORD
,LPENUM_SERVICE_STATUSA
,
81 DWORD
,LPDWORD
,LPDWORD
,LPDWORD
);
82 BOOL WINAPI
EnumServicesStatusW(SC_HANDLE
,DWORD
,DWORD
,LPENUM_SERVICE_STATUSW
,
83 DWORD
,LPDWORD
,LPDWORD
,LPDWORD
);
84 #define EnumServicesStatus WINELIB_NAME_AW(EnumServicesStatus)
85 SC_HANDLE WINAPI
OpenSCManagerA(LPCSTR
,LPCSTR
,DWORD
);
86 SC_HANDLE WINAPI
OpenSCManagerW(LPCWSTR
,LPCWSTR
,DWORD
);
87 #define OpenSCManager WINELIB_NAME_AW(OpenSCManager)
88 SC_HANDLE WINAPI
OpenServiceA(SC_HANDLE
,LPCSTR
,DWORD
);
89 SC_HANDLE WINAPI
OpenServiceW(SC_HANDLE
,LPCWSTR
,DWORD
);
90 #define OpenService WINELIB_NAME_AW(OpenService)
91 SERVICE_STATUS_HANDLE WINAPI
RegisterServiceCtrlHandlerA(LPCSTR
,LPHANDLER_FUNCTION
);
92 SERVICE_STATUS_HANDLE WINAPI
RegisterServiceCtrlHandlerW(LPCWSTR
,LPHANDLER_FUNCTION
);
93 #define RegisterServiceCtrlHandler WINELIB_NAME_AW(RegisterServiceCtrlHandler)
94 BOOL WINAPI
SetServiceStatus(SERVICE_STATUS_HANDLE
,LPSERVICE_STATUS
);
95 BOOL WINAPI
StartServiceA(SC_HANDLE
,DWORD
,LPCSTR
*);
96 BOOL WINAPI
StartServiceW(SC_HANDLE
,DWORD
,LPCWSTR
*);
97 #define StartService WINELIB_NAME_AW(StartService)
98 BOOL WINAPI
StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA
);
99 BOOL WINAPI
StartServiceCtrlDispatcherW(LPSERVICE_TABLE_ENTRYW
);
100 #define StartServiceCtrlDispatcher WINELIB_NAME_AW(StartServiceCtrlDispatcher)
101 BOOL WINAPI
QueryServiceStatus(SC_HANDLE
,LPSERVICE_STATUS
);
105 #endif /* defined(__cplusplus) */
107 #endif /* !defined(__WINE_WINSVC_H) */