Move group-list related code to a separate file and keep the group name in the group...
[reactos.git] / reactos / subsys / system / services / services.h
1 /*
2 * services.h
3 */
4
5 #include <stdio.h>
6 #define WIN32_NO_STATUS
7 #include <windows.h>
8 #define NTOS_MODE_USER
9 #include <ndk/ntndk.h>
10 #include <services/services.h>
11
12
13 typedef struct _SERVICE_GROUP
14 {
15 LIST_ENTRY GroupListEntry;
16 LPWSTR lpGroupName;
17
18 DWORD dwRefCount;
19 BOOLEAN ServicesRunning;
20 ULONG TagCount;
21 PULONG TagArray;
22
23 WCHAR szGroupName[1];
24 } SERVICE_GROUP, *PSERVICE_GROUP;
25
26
27 typedef struct _SERVICE
28 {
29 LIST_ENTRY ServiceListEntry;
30 LPWSTR lpServiceName;
31 LPWSTR lpDisplayName;
32 LPWSTR lpServiceGroup;
33 BOOL bDeleted;
34 DWORD dwResumeCount;
35
36 SERVICE_STATUS Status;
37 DWORD dwStartType;
38 DWORD dwErrorControl;
39 DWORD dwTag;
40
41 ULONG Flags;
42
43 PSECURITY_DESCRIPTOR lpSecurityDescriptor;
44
45 BOOLEAN ServiceVisited;
46
47 HANDLE ControlPipeHandle;
48 ULONG ProcessId;
49 ULONG ThreadId;
50
51 WCHAR szServiceName[1];
52 } SERVICE, *PSERVICE;
53
54
55 /* VARIABLES ***************************************************************/
56
57 extern LIST_ENTRY ServiceListHead;
58 extern LIST_ENTRY GroupListHead;
59 extern BOOL ScmShutdown;
60
61
62 /* FUNCTIONS ***************************************************************/
63
64 /* config.c */
65
66 DWORD ScmOpenServiceKey(LPWSTR lpServiceName,
67 REGSAM samDesired,
68 PHKEY phKey);
69
70 DWORD ScmCreateServiceKey(LPWSTR lpServiceName,
71 REGSAM samDesired,
72 PHKEY phKey);
73
74 DWORD ScmWriteDependencies(HKEY hServiceKey,
75 LPWSTR lpDependencies,
76 DWORD dwDependenciesLength);
77
78 DWORD ScmMarkServiceForDelete(PSERVICE pService);
79 BOOL ScmIsDeleteFlagSet(HKEY hServiceKey);
80
81 DWORD ScmReadString(HKEY hServiceKey,
82 LPWSTR lpValueName,
83 LPWSTR *lpValue);
84
85
86 /* database.c */
87
88 DWORD ScmCreateServiceDatabase(VOID);
89 VOID ScmGetBootAndSystemDriverState(VOID);
90 VOID ScmAutoStartServices(VOID);
91
92 PSERVICE ScmGetServiceEntryByName(LPWSTR lpServiceName);
93 PSERVICE ScmGetServiceEntryByDisplayName(LPWSTR lpDisplayName);
94 PSERVICE ScmGetServiceEntryByResumeCount(DWORD dwResumeCount);
95 DWORD ScmCreateNewServiceRecord(LPWSTR lpServiceName,
96 PSERVICE *lpServiceRecord);
97 DWORD ScmMarkServiceForDelete(PSERVICE pService);
98
99
100 /* driver.c */
101
102 NTSTATUS ScmLoadDriver(PSERVICE lpService);
103 DWORD ScmUnloadDriver(PSERVICE lpService);
104 DWORD ScmControlDriver(PSERVICE lpService,
105 DWORD dwControl,
106 LPSERVICE_STATUS lpServiceStatus);
107
108
109 /* groupdb.c */
110
111 DWORD ScmCreateGroupList(VOID);
112
113
114 /* rpcserver.c */
115
116 VOID ScmStartRpcServer(VOID);
117
118
119 /* services.c */
120
121 VOID PrintString(LPCSTR fmt, ...);
122
123
124
125 /* EOF */
126