- Add a dummy winspool.drv SpoolerInit doing an RPC call to a dummy RpcSpoolerInit...
[reactos.git] / reactos / win32ss / printing / base / spoolsv / init.c
1 /*
2 * PROJECT: ReactOS Print Spooler Service
3 * LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
4 * PURPOSE: Various initialization functions
5 * COPYRIGHT: Copyright 2015 Colin Finck <colin@reactos.org>
6 */
7
8 #include "precomp.h"
9
10 DWORD
11 _RpcSpoolerInit()
12 {
13 DWORD ErrorCode;
14
15 // Call SpoolerInit in the security context of the client.
16 // This delay-loads spoolss.dll in the user context and all further calls to functions in spoolss.dll will be done in the user context as well.
17 ErrorCode = RpcImpersonateClient(NULL);
18 if (ErrorCode != ERROR_SUCCESS)
19 {
20 ERR("RpcImpersonateClient failed with status %u!\n", ErrorCode);
21 return ErrorCode;
22 }
23
24 ErrorCode = SpoolerInit();
25 if (ErrorCode != ERROR_SUCCESS)
26 {
27 ERR("SpoolerInit failed with status %u!\n", ErrorCode);
28 RpcRevertToSelf();
29 return ErrorCode;
30 }
31
32 return RpcRevertToSelf();
33 }