- Implement EnumServicesStatusW.
[reactos.git] / reactos / services / eventlog / rpc.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS
4 * FILE: services/eventlog/rpc.c
5 * PURPOSE: Event logging service
6 * PROGRAMMER: Saveliy Tretiakov (savelity@mail.ru)
7 */
8
9 #include "eventlog.h"
10
11 DWORD STDCALL RpcThreadRoutine(LPVOID lpParameter)
12 {
13 RPC_STATUS Status;
14
15 Status = RpcServerUseProtseqEpW(L"ncacn_np",
16 20,
17 L"\\pipe\\EventLog",
18 NULL);
19 if(Status != RPC_S_OK)
20 {
21 DPRINT("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
22 return 0;
23 }
24
25 Status = RpcServerRegisterIf(eventlog_ServerIfHandle, NULL, NULL);
26
27 if(Status != RPC_S_OK)
28 {
29 DPRINT("RpcServerRegisterIf() failed (Status %lx)\n", Status);
30 return 0;
31 }
32
33 Status = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, FALSE);
34
35 if(Status != RPC_S_OK)
36 {
37 DPRINT("RpcServerListen() failed (Status %lx)\n", Status);
38 }
39
40 return 0;
41 }
42
43 /* Function 0 */
44 NTSTATUS EventLogClearW(
45 handle_t BindingHandle,
46 LOGHANDLE Handle,
47 wchar_t *BackupName)
48 {
49 DPRINT("EventLogClearW UNIMPLEMENTED\n");
50 return STATUS_NOT_IMPLEMENTED;
51 }
52
53
54 /* Function 1 */
55 NTSTATUS EventLogBackupW(
56 handle_t BindingHandle,
57 LOGHANDLE Handle,
58 wchar_t *FileName)
59 {
60 DPRINT("EventLogBackupW UNIMPLEMENTED\n");
61 return STATUS_NOT_IMPLEMENTED;
62 }
63
64
65 /* Function 2 */
66 NTSTATUS EventLogClose(
67 handle_t BindingHandle,
68 PLOGHANDLE Handle)
69 {
70 DPRINT("EventLogClose UNIMPLEMENTED\n");
71 return STATUS_NOT_IMPLEMENTED;
72 }
73
74
75 /* Function 3 */
76 NTSTATUS EventLogUnregSrc(
77 handle_t BindingHandle,
78 PLOGHANDLE Handle)
79 {
80 DPRINT("EventLogUnregSrc UNIMPLEMENTED\n");
81 return STATUS_NOT_IMPLEMENTED;
82 }
83
84
85 /* Function 4 */
86 NTSTATUS EventLogRecordsNumber(
87 handle_t BindingHandle,
88 LOGHANDLE Handle,
89 unsigned long *RecordsNumber)
90 {
91 DPRINT("EventLogRecordsNumber UNIMPLEMENTED\n");
92 return STATUS_NOT_IMPLEMENTED;
93 }
94
95
96 /* Function 5 */
97 NTSTATUS EventLogGetOldestRec(
98 handle_t BindingHandle,
99 LOGHANDLE Handle,
100 unsigned long *OldestRecNumber)
101 {
102 DPRINT("EventLogGetOldestRec UNIMPLEMENTED\n");
103 return STATUS_NOT_IMPLEMENTED;
104 }
105
106
107 /* FIXME */
108 NTSTATUS Unknown6(handle_t BindingHandle)
109 {
110 DPRINT("Unknown6() called\n");
111 return STATUS_NOT_IMPLEMENTED;
112 }
113
114
115 /* Function 7 */
116 NTSTATUS EventLogOpenW(
117 handle_t BindingHandle,
118 LPWSTR ServerName,
119 wchar_t *FileName,
120 wchar_t *NullStr,
121 unsigned long MajorVer,
122 unsigned long MinorVer,
123 PLOGHANDLE Handle)
124 {
125 DPRINT("EventLogOpenW UNIMPLEMENTED\n");
126 return STATUS_NOT_IMPLEMENTED;
127 }
128
129
130 /* Function 8 */
131 NTSTATUS EventLogRegSrcW(
132 handle_t BindingHandle,
133 LPWSTR ServerName,
134 wchar_t *LogName,
135 wchar_t *NullStr,
136 unsigned long MajorVer,
137 unsigned long MinorVer,
138 PLOGHANDLE Handle)
139 {
140 DPRINT("EventLogRegSrcW UNIMPLEMENTED\n");
141 return STATUS_NOT_IMPLEMENTED;
142 }
143
144
145 /* Function 9 */
146 NTSTATUS EventLogOpenBackupW(
147 handle_t BindingHandle,
148 LPWSTR ServerName,
149 wchar_t *BackupName,
150 unsigned long MajorVer,
151 unsigned long MinorVer,
152 PLOGHANDLE Handle)
153 {
154 DPRINT("EventLogOpenBackupW UNIMPLEMENTED\n");
155 return STATUS_NOT_IMPLEMENTED;
156 }
157
158
159 /* Function 10 */
160 NTSTATUS EventLogReadW(
161 handle_t BindingHandle,
162 LOGHANDLE Handle,
163 unsigned long Flags,
164 unsigned long Offset,
165 unsigned long BufSize,
166 unsigned char *Buffer,
167 unsigned long *BytesRead,
168 unsigned long *BytesNeeded)
169 {
170 DPRINT("EventLogReadW UNIMPLEMENTED\n");
171 return STATUS_NOT_IMPLEMENTED;
172 }
173
174
175 /* Function 11 */
176 NTSTATUS EventLogReportEventW(
177 handle_t BindingHandle,
178 LOGHANDLE Handle,
179 unsigned long Time,
180 unsigned short Type,
181 unsigned short Category,
182 unsigned long ID,
183 unsigned short NumStrings,
184 unsigned long DataSize,
185 wchar_t *ComputerName,
186 unsigned char *SID,
187 wchar_t *Strings,
188 unsigned char *Data,
189 unsigned short Flags)
190 {
191 DPRINT("EventLogReportEventW UNIMPLEMENTED\n");
192 return STATUS_NOT_IMPLEMENTED;
193 }
194
195
196 /* Function 12 */
197 NTSTATUS EventLogClearA(
198 handle_t BindingHandle,
199 LOGHANDLE Handle,
200 char *BackupName)
201 {
202 DPRINT("EventLogClearA UNIMPLEMENTED\n");
203 return STATUS_NOT_IMPLEMENTED;
204 }
205
206
207 /* Function 13 */
208 NTSTATUS EventLogBackupA(
209 handle_t BindingHandle,
210 LOGHANDLE Handle,
211 char *BackupName)
212 {
213 DPRINT("EventLogBackupA UNIMPLEMENTED\n");
214 return STATUS_NOT_IMPLEMENTED;
215 }
216
217
218 /* Function 14 */
219 NTSTATUS EventLogOpenA(
220 handle_t BindingHandle,
221 LPSTR ServerName,
222 char *LogName,
223 char *NullStr,
224 unsigned long MajorVer,
225 unsigned long MinorVer,
226 PLOGHANDLE Handle)
227 {
228 DPRINT("EventLogOpenA UNIMPLEMENTED\n");
229 return STATUS_NOT_IMPLEMENTED;
230 }
231
232
233 /* Function 15 */
234 NTSTATUS EventLogRegSrcA(
235 handle_t BindingHandle,
236 LPSTR ServerName,
237 char *LogName,
238 char *NullStr,
239 unsigned long MajorVer,
240 unsigned long MinorVer,
241 PLOGHANDLE Handle)
242 {
243 DPRINT("EventLogRegSrcA UNIMPLEMENTED\n");
244 return STATUS_NOT_IMPLEMENTED;
245 }
246
247
248 /* Function 16 */
249 NTSTATUS EventLogOpenBackupA(
250 handle_t BindingHandle,
251 LPSTR ServerName,
252 char *BackupName,
253 unsigned long MajorVer,
254 unsigned long MinorVer,
255 PLOGHANDLE Handle)
256 {
257 DPRINT("EventLogOpenBackupA UNIMPLEMENTED\n");
258 return STATUS_NOT_IMPLEMENTED;
259 }
260
261
262 /* Function 17 */
263 NTSTATUS EventLogReadA(
264 handle_t BindingHandle,
265 LOGHANDLE Handle,
266 unsigned long Flags,
267 unsigned long Offset,
268 unsigned long BufSize,
269 unsigned char *Buffer,
270 unsigned long *BytesRead,
271 unsigned long *BytesNeeded)
272 {
273 DPRINT("EventLogReadA UNIMPLEMENTED\n");
274 return STATUS_NOT_IMPLEMENTED;
275 }
276
277
278 /* Function 18 */
279 NTSTATUS EventLogReportEventA(
280 handle_t BindingHandle,
281 LOGHANDLE Handle,
282 unsigned long Time,
283 unsigned short Type,
284 unsigned short Category,
285 unsigned long ID,
286 unsigned short NumStrings,
287 unsigned long DataSize,
288 char *ComputerName,
289 unsigned char *SID,
290 char* Strings,
291 unsigned char *Data,
292 unsigned short Flags)
293 {
294 DPRINT("EventLogReportEventA UNIMPLEMENTED\n");
295 return STATUS_NOT_IMPLEMENTED;
296 }
297
298
299 /* FIXME */
300 NTSTATUS Unknown19(handle_t BindingHandle)
301 {
302 DPRINT("Unknown19 called\n");
303 return STATUS_NOT_IMPLEMENTED;
304 }
305
306
307 /* FIXME */
308 NTSTATUS Unknown20(handle_t BindingHandle)
309 {
310 DPRINT("Unknown20 called\n");
311 return STATUS_NOT_IMPLEMENTED;
312 }
313
314
315 /* FIXME */
316 NTSTATUS Unknown21(handle_t BindingHandle)
317 {
318 DPRINT("Unknown21 called\n");
319 return STATUS_NOT_IMPLEMENTED;
320 }
321
322
323 /* Function 22 */
324 NTSTATUS EventLogGetInfo(
325 handle_t BindingHandle,
326 LOGHANDLE Handle,
327 unsigned long InfoLevel,
328 unsigned char *Buffer,
329 unsigned long BufSize,
330 unsigned long *BytesNeeded)
331 {
332 DPRINT("EventLogGetInfo UNIMPLEMENTED\n");
333 return STATUS_NOT_IMPLEMENTED;
334 }
335
336
337 void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
338 {
339 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
340 }
341
342
343 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
344 {
345 HeapFree(GetProcessHeap(), 0, ptr);
346 }