[MSIEXEC] Sync with Wine Staging 2.16. CORE-13762
[reactos.git] / base / system / winlogon / rpcserver.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Winlogon
4 * FILE: base/system/winlogon/rpcserver.c
5 * PURPOSE: RPC server interface for the remote registry calls
6 * PROGRAMMERS: Eric Kohl
7 */
8
9 /* INCLUDES *****************************************************************/
10
11 #include "winlogon.h"
12
13 #include <rpc.h>
14 #include <winreg_s.h>
15
16
17 /* FUNCTIONS *****************************************************************/
18
19 BOOL
20 StartRpcServer(VOID)
21 {
22 RPC_STATUS Status;
23
24 TRACE("StartRpcServer() called\n");
25
26 Status = RpcServerUseProtseqEpW(L"ncacn_np",
27 RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
28 L"\\pipe\\winreg",
29 NULL);
30 if (Status != RPC_S_OK)
31 {
32 ERR("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
33 return FALSE;
34 }
35
36 Status = RpcServerRegisterIf(winreg_v1_0_s_ifspec,
37 NULL,
38 NULL);
39 if (Status != RPC_S_OK)
40 {
41 ERR("RpcServerRegisterIf() failed (Status %lx)\n", Status);
42 return FALSE;
43 }
44
45 Status = RpcServerListen(1, 20, TRUE);
46 if (Status != RPC_S_OK)
47 {
48 ERR("RpcServerListen() failed (Status %lx)\n", Status);
49 return FALSE;
50 }
51
52 TRACE("StartRpcServer() done\n");
53 return TRUE;
54 }
55
56
57 void __RPC_FAR * __RPC_USER MIDL_user_allocate(SIZE_T len)
58 {
59 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
60 }
61
62
63 void __RPC_USER MIDL_user_free(void __RPC_FAR * ptr)
64 {
65 HeapFree(GetProcessHeap(), 0, ptr);
66 }
67
68
69 void __RPC_USER RPC_HKEY_rundown(RPC_HKEY hSCObject)
70 {
71 }
72
73
74 /* Function 0 */
75 error_status_t
76 WINAPI
77 OpenClassesRoot(
78 PREGISTRY_SERVER_NAME ServerName,
79 REGSAM samDesired,
80 PRPC_HKEY phKey)
81 {
82 TRACE("\n");
83 return ERROR_SUCCESS;
84 }
85
86
87 /* Function 1 */
88 error_status_t
89 WINAPI
90 OpenCurrentUser(
91 PREGISTRY_SERVER_NAME ServerName,
92 REGSAM samDesired,
93 PRPC_HKEY phKey)
94 {
95 TRACE("\n");
96 return ERROR_SUCCESS;
97 }
98
99
100 /* Function 2 */
101 error_status_t
102 WINAPI
103 OpenLocalMachine(
104 PREGISTRY_SERVER_NAME ServerName,
105 REGSAM samDesired,
106 PRPC_HKEY phKey)
107 {
108 TRACE("\n");
109 return ERROR_SUCCESS;
110 }
111
112
113 /* Function 3 */
114 error_status_t
115 WINAPI
116 OpenPerformanceData(
117 PREGISTRY_SERVER_NAME ServerName,
118 REGSAM samDesired,
119 PRPC_HKEY phKey)
120 {
121 TRACE("\n");
122 return ERROR_SUCCESS;
123 }
124
125
126 /* Function 4 */
127 error_status_t
128 WINAPI
129 OpenUsers(
130 PREGISTRY_SERVER_NAME ServerName,
131 REGSAM samDesired,
132 PRPC_HKEY phKey)
133 {
134 TRACE("\n");
135 return ERROR_SUCCESS;
136 }
137
138
139 /* Function 5 */
140 error_status_t
141 WINAPI
142 BaseRegCloseKey(
143 PRPC_HKEY hKey)
144 {
145 TRACE("\n");
146 return ERROR_SUCCESS;
147 }
148
149
150 /* Function 6 */
151 error_status_t
152 WINAPI
153 BaseRegCreateKey(
154 RPC_HKEY hKey,
155 PRPC_UNICODE_STRING lpSubKey,
156 PRPC_UNICODE_STRING lpClass,
157 DWORD dwOptions,
158 REGSAM samDesired,
159 PRPC_SECURITY_ATTRIBUTES lpSecurityAttributes,
160 PRPC_HKEY phkResult,
161 LPDWORD lpdwDisposition)
162 {
163 TRACE("\n");
164 return ERROR_SUCCESS;
165 }
166
167
168 /* Function 7 */
169 error_status_t
170 WINAPI
171 BaseRegDeleteKey(
172 RPC_HKEY hKey,
173 PRPC_UNICODE_STRING lpSubKey)
174 {
175 TRACE("\n");
176 return ERROR_SUCCESS;
177 }
178
179
180 /* Function 8 */
181 error_status_t
182 WINAPI
183 BaseRegDeleteValue(
184 RPC_HKEY hKey,
185 PRPC_UNICODE_STRING lpValueName)
186 {
187 TRACE("\n");
188 return ERROR_SUCCESS;
189 }
190
191
192 /* Function 9 */
193 error_status_t
194 WINAPI
195 BaseRegEnumKey(
196 RPC_HKEY hKey,
197 DWORD dwIndex,
198 PRPC_UNICODE_STRING lpNameIn,
199 PRPC_UNICODE_STRING lpNameOut,
200 PRPC_UNICODE_STRING lpClassIn,
201 PRPC_UNICODE_STRING *lplpClassOut,
202 PFILETIME lpftLastWriteTime)
203 {
204 TRACE("\n");
205 return ERROR_SUCCESS;
206 }
207
208
209 /* Function 10 */
210 error_status_t
211 WINAPI
212 BaseRegEnumValue(
213 RPC_HKEY hKey,
214 DWORD dwIndex,
215 PRPC_UNICODE_STRING lpValueNameIn,
216 PRPC_UNICODE_STRING lpValueNameOut,
217 LPDWORD lpType,
218 LPBYTE lpData,
219 LPDWORD lpcbData,
220 LPDWORD lpcbLen)
221 {
222 TRACE("\n");
223 return ERROR_SUCCESS;
224 }
225
226
227 /* Function 11 */
228 error_status_t
229 __stdcall
230 BaseRegFlushKey(
231 RPC_HKEY hKey)
232 {
233 TRACE("\n");
234 return ERROR_SUCCESS;
235 }
236
237
238 /* Function 12 */
239 error_status_t
240 __stdcall
241 BaseRegGetKeySecurity(
242 RPC_HKEY hKey,
243 SECURITY_INFORMATION SecurityInformation,
244 PRPC_SECURITY_DESCRIPTOR pRpcSecurityDescriptorIn,
245 PRPC_SECURITY_DESCRIPTOR pRpcSecurityDescriptorOut)
246 {
247 TRACE("\n");
248 return ERROR_SUCCESS;
249 }
250
251
252 /* Function 13 */
253 error_status_t
254 __stdcall
255 BaseRegLoadKey(
256 RPC_HKEY hKey,
257 PRPC_UNICODE_STRING lpSubKey,
258 PRPC_UNICODE_STRING lpFile)
259 {
260 TRACE("\n");
261 return ERROR_SUCCESS;
262 }
263
264
265 /* Function 14 */
266 void
267 __stdcall
268 Opnum14NotImplemented(
269 handle_t IDL_handle)
270 {
271 TRACE("\n");
272 }
273
274
275 /* Function 15 */
276 error_status_t
277 __stdcall
278 BaseRegOpenKey(
279 RPC_HKEY hKey,
280 PRPC_UNICODE_STRING lpSubKey,
281 DWORD dwOptions,
282 REGSAM samDesired,
283 PRPC_HKEY phkResult)
284 {
285 TRACE("\n");
286 return ERROR_SUCCESS;
287 }
288
289
290 /* Function 16 */
291 error_status_t
292 __stdcall
293 BaseRegQueryInfoKey(
294 RPC_HKEY hKey,
295 PRPC_UNICODE_STRING lpClassIn,
296 PRPC_UNICODE_STRING lpClassOut,
297 LPDWORD lpcSubKeys,
298 LPDWORD lpcbMaxSubKeyLen,
299 LPDWORD lpcbMaxClassLen,
300 LPDWORD lpcValues,
301 LPDWORD lpcbMaxValueNameLen,
302 LPDWORD lpcbMaxValueLen,
303 LPDWORD lpcbSecurityDescriptor,
304 PFILETIME lpftLastWriteTime)
305 {
306 TRACE("\n");
307 return ERROR_SUCCESS;
308 }
309
310
311 /* Function 17 */
312 error_status_t
313 __stdcall
314 BaseRegQueryValue(
315 RPC_HKEY hKey,
316 PRPC_UNICODE_STRING lpValueName,
317 LPDWORD lpType,
318 LPBYTE lpData,
319 LPDWORD lpcbData,
320 LPDWORD lpcbLen)
321 {
322 TRACE("\n");
323 return ERROR_SUCCESS;
324 }
325
326
327 /* Function 18 */
328 error_status_t
329 __stdcall
330 BaseRegReplaceKey(
331 RPC_HKEY hKey,
332 PRPC_UNICODE_STRING lpSubKey,
333 PRPC_UNICODE_STRING lpNewFile,
334 PRPC_UNICODE_STRING lpOldFile)
335 {
336 TRACE("\n");
337 return ERROR_SUCCESS;
338 }
339
340
341 /* Function 19 */
342 error_status_t
343 __stdcall
344 BaseRegRestoreKey(
345 RPC_HKEY hKey,
346 PRPC_UNICODE_STRING lpFile,
347 DWORD Flags)
348 {
349 TRACE("\n");
350 return ERROR_SUCCESS;
351 }
352
353
354 /* Function 20 */
355 error_status_t
356 __stdcall
357 BaseRegSaveKey(
358 RPC_HKEY hKey,
359 PRPC_UNICODE_STRING lpFile,
360 PRPC_SECURITY_ATTRIBUTES pSecurityAttributes)
361 {
362 TRACE("\n");
363 return ERROR_SUCCESS;
364 }
365
366
367 /* Function 21 */
368 error_status_t
369 __stdcall
370 BaseRegSetKeySecurity(
371 RPC_HKEY hKey,
372 SECURITY_INFORMATION SecurityInformation,
373 PRPC_SECURITY_DESCRIPTOR pRpcSecurityDescriptor)
374 {
375 TRACE("\n");
376 return ERROR_SUCCESS;
377 }
378
379
380 /* Function 22 */
381 error_status_t
382 __stdcall
383 BaseRegSetValue(
384 RPC_HKEY hKey,
385 PRPC_UNICODE_STRING lpValueName,
386 DWORD dwType,
387 LPBYTE lpData,
388 DWORD cbData)
389 {
390 TRACE("\n");
391 return ERROR_SUCCESS;
392 }
393
394
395 /* Function 23 */
396 error_status_t
397 __stdcall
398 BaseRegUnLoadKey(
399 RPC_HKEY hKey,
400 PRPC_UNICODE_STRING lpSubKey)
401 {
402 TRACE("\n");
403 return ERROR_SUCCESS;
404 }
405
406
407 /* Function 24 */
408 ULONG
409 __stdcall
410 BaseInitiateSystemShutdown(
411 PREGISTRY_SERVER_NAME ServerName,
412 PRPC_UNICODE_STRING lpMessage,
413 ULONG dwTimeout,
414 BOOLEAN bForceAppsClosed,
415 BOOLEAN bRebootAfterShutdown)
416 {
417 TRACE("BaseInitiateSystemShutdown()\n");
418 return BaseInitiateSystemShutdownEx(ServerName,
419 lpMessage,
420 dwTimeout,
421 bForceAppsClosed,
422 bRebootAfterShutdown,
423 0);
424 }
425
426
427 /* Function 25 */
428 ULONG
429 __stdcall
430 BaseAbortSystemShutdown(
431 PREGISTRY_SERVER_NAME ServerName)
432 {
433 TRACE("BaseAbortSystemShutdown()\n");
434 return ERROR_SUCCESS;
435 }
436
437
438 /* Function 26 */
439 error_status_t
440 __stdcall
441 BaseRegGetVersion(
442 RPC_HKEY hKey,
443 LPDWORD lpdwVersion)
444 {
445 TRACE("\n");
446 return ERROR_SUCCESS;
447 }
448
449
450 /* Function 27 */
451 error_status_t
452 __stdcall
453 OpenCurrentConfig(
454 PREGISTRY_SERVER_NAME ServerName,
455 REGSAM samDesired,
456 PRPC_HKEY phKey)
457 {
458 TRACE("\n");
459 return ERROR_SUCCESS;
460 }
461
462
463 /* Function 28 */
464 void
465 __stdcall
466 Opnum28NotImplemented(
467 handle_t IDL_handle)
468 {
469 TRACE("\n");
470 }
471
472
473 /* Function 29 */
474 error_status_t
475 __stdcall
476 BaseRegQueryMultipleValues(
477 RPC_HKEY hKey,
478 PRVALENT val_listIn,
479 PRVALENT val_listOut,
480 DWORD num_vals,
481 char *lpvalueBuf,
482 LPDWORD ldwTotsize)
483 {
484 TRACE("\n");
485 return ERROR_SUCCESS;
486 }
487
488
489 /* Function 30 */
490 ULONG
491 __stdcall
492 BaseInitiateSystemShutdownEx(
493 PREGISTRY_SERVER_NAME ServerName,
494 PRPC_UNICODE_STRING lpMessage,
495 ULONG dwTimeout,
496 BOOLEAN bForceAppsClosed,
497 BOOLEAN bRebootAfterShutdown,
498 ULONG dwReason)
499 {
500 TRACE("BaseInitiateSystemShutdownEx()\n");
501 TRACE(" Message: %wZ\n", lpMessage);
502 TRACE(" Timeout: %lu\n", dwTimeout);
503 TRACE(" Force: %d\n", bForceAppsClosed);
504 TRACE(" Reboot: %d\n", bRebootAfterShutdown);
505 TRACE(" Reason: %lu\n", dwReason);
506
507 // return ERROR_SUCCESS;
508
509 /* FIXME */
510 return ExitWindowsEx((bRebootAfterShutdown ? EWX_REBOOT : EWX_SHUTDOWN) |
511 (bForceAppsClosed ? EWX_FORCE : 0),
512 dwReason);
513 }
514
515
516 /* Function 31 */
517 error_status_t
518 __stdcall
519 BaseRegSaveKeyEx(
520 RPC_HKEY hKey,
521 PRPC_UNICODE_STRING lpFile,
522 PRPC_SECURITY_ATTRIBUTES pSecurityAttributes,
523 DWORD Flags)
524 {
525 TRACE("\n");
526 return ERROR_SUCCESS;
527 }
528
529
530 /* Function 32 */
531 error_status_t
532 __stdcall
533 OpenPerformanceText(
534 PREGISTRY_SERVER_NAME ServerName,
535 REGSAM samDesired,
536 PRPC_HKEY phKey)
537 {
538 TRACE("\n");
539 return ERROR_SUCCESS;
540 }
541
542
543 /* Function 33 */
544 error_status_t
545 __stdcall
546 OpenPerformanceNlsText(
547 PREGISTRY_SERVER_NAME ServerName,
548 REGSAM samDesired,
549 PRPC_HKEY phKey)
550 {
551 TRACE("\n");
552 return ERROR_SUCCESS;
553 }
554
555
556 /* Function 34 */
557 error_status_t
558 __stdcall
559 BaseRegQueryMultipleValues2(
560 RPC_HKEY hKey,
561 PRVALENT val_listIn,
562 PRVALENT val_listOut,
563 DWORD num_vals,
564 char *lpvalueBuf,
565 LPDWORD ldwTotsize,
566 LPDWORD ldwRequiredSize)
567 {
568 TRACE("\n");
569 return ERROR_SUCCESS;
570 }
571
572
573 /* Function 35 */
574 error_status_t
575 __stdcall
576 BaseRegDeleteKeyEx(
577 RPC_HKEY hKey,
578 PRPC_UNICODE_STRING lpSubKey,
579 REGSAM AccessMask,
580 DWORD Reserved)
581 {
582 TRACE("\n");
583 return ERROR_SUCCESS;
584 }
585
586 /* EOF */