[WINSPOOL]
[reactos.git] / reactos / win32ss / printing / base / spoolsv / printprocessors.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: Functions related to Print Processors
5 * COPYRIGHT: Copyright 2015 Colin Finck <colin@reactos.org>
6 */
7
8 #include "precomp.h"
9
10 DWORD
11 _RpcAddPrintProcessor(WINSPOOL_HANDLE pName, WCHAR *pEnvironment, WCHAR *pPathName, WCHAR *pPrintProcessorName)
12 {
13 UNIMPLEMENTED;
14 return ERROR_INVALID_FUNCTION;
15 }
16
17 DWORD
18 _RpcEnumPrintProcessorDatatypes(WINSPOOL_HANDLE pName, WCHAR *pPrintProcessorName, DWORD Level, BYTE *pDatatypes, DWORD cbBuf, DWORD *pcbNeeded, DWORD *pcReturned)
19 {
20 DWORD dwErrorCode;
21
22 dwErrorCode = RpcImpersonateClient(NULL);
23 if (dwErrorCode != ERROR_SUCCESS)
24 {
25 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
26 return dwErrorCode;
27 }
28
29 EnumPrintProcessorDatatypesW(pName, pPrintProcessorName, Level, pDatatypes, cbBuf, pcbNeeded, pcReturned);
30 dwErrorCode = GetLastError();
31
32 RpcRevertToSelf();
33 return dwErrorCode;
34 }
35
36 DWORD
37 _RpcEnumPrintProcessors(WINSPOOL_HANDLE pName, WCHAR *pEnvironment, DWORD Level, BYTE *pPrintProcessorInfo, DWORD cbBuf, DWORD *pcbNeeded, DWORD *pcReturned)
38 {
39 DWORD dwErrorCode;
40
41 dwErrorCode = RpcImpersonateClient(NULL);
42 if (dwErrorCode != ERROR_SUCCESS)
43 {
44 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
45 return dwErrorCode;
46 }
47
48 EnumPrintProcessorsW(pName, pEnvironment, Level, pPrintProcessorInfo, cbBuf, pcbNeeded, pcReturned);
49 dwErrorCode = GetLastError();
50
51 RpcRevertToSelf();
52 return dwErrorCode;
53 }
54
55 DWORD
56 _RpcGetPrintProcessorDirectory(WINSPOOL_HANDLE pName, WCHAR *pEnvironment, DWORD Level, BYTE *pPrintProcessorDirectory, DWORD cbBuf, DWORD *pcbNeeded)
57 {
58 DWORD dwErrorCode;
59
60 dwErrorCode = RpcImpersonateClient(NULL);
61 if (dwErrorCode != ERROR_SUCCESS)
62 {
63 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
64 return dwErrorCode;
65 }
66
67 GetPrintProcessorDirectoryW(pName, pEnvironment, Level, pPrintProcessorDirectory, cbBuf, pcbNeeded);
68 dwErrorCode = GetLastError();
69
70 RpcRevertToSelf();
71 return dwErrorCode;
72 }