f1d7cd0108446950026d779fb5c3fa6865ab779f
[reactos.git] / reactos / win32ss / printing / base / spoolsv / jobs.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 for managing print jobs
5 * COPYRIGHT: Copyright 2015 Colin Finck <colin@reactos.org>
6 */
7
8 #include "precomp.h"
9
10 DWORD
11 _RpcAddJob(WINSPOOL_PRINTER_HANDLE hPrinter, DWORD Level, BYTE* pAddJob, DWORD cbBuf, DWORD* pcbNeeded)
12 {
13 DWORD dwErrorCode;
14
15 dwErrorCode = RpcImpersonateClient(NULL);
16 if (dwErrorCode != ERROR_SUCCESS)
17 {
18 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
19 return dwErrorCode;
20 }
21
22 dwErrorCode = AddJobW(hPrinter, Level, pAddJob, cbBuf, pcbNeeded);
23 if (dwErrorCode != ERROR_SUCCESS)
24 {
25 ERR("AddJobW failed with error %lu!\n", dwErrorCode);
26 RpcRevertToSelf();
27 return dwErrorCode;
28 }
29
30 return RpcRevertToSelf();
31 }
32
33 DWORD
34 _RpcGetJob(WINSPOOL_PRINTER_HANDLE hPrinter, DWORD JobId, DWORD Level, BYTE* pJob, DWORD cbBuf, DWORD* pcbNeeded)
35 {
36 DWORD dwErrorCode;
37
38 dwErrorCode = RpcImpersonateClient(NULL);
39 if (dwErrorCode != ERROR_SUCCESS)
40 {
41 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
42 return dwErrorCode;
43 }
44
45 dwErrorCode = GetJobW(hPrinter, JobId, Level, pJob, cbBuf, pcbNeeded);
46 if (dwErrorCode != ERROR_SUCCESS)
47 {
48 ERR("GetJobW failed with error %lu!\n", dwErrorCode);
49 RpcRevertToSelf();
50 return dwErrorCode;
51 }
52
53 return RpcRevertToSelf();
54 }
55
56 DWORD
57 _RpcScheduleJob(WINSPOOL_PRINTER_HANDLE hPrinter, DWORD JobId)
58 {
59 UNIMPLEMENTED;
60 return ERROR_INVALID_FUNCTION;
61 }
62
63 DWORD
64 _RpcSetJob(WINSPOOL_PRINTER_HANDLE hPrinter, DWORD JobId, WINSPOOL_JOB_CONTAINER* pJobContainer, DWORD Command)
65 {
66 UNIMPLEMENTED;
67 return ERROR_INVALID_FUNCTION;
68 }