15f56d6784f1e70e5ad35a97a950de9ecabac8d6
[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 AddJobW(hPrinter, Level, pAddJob, cbBuf, pcbNeeded);
23 dwErrorCode = GetLastError();
24
25 RpcRevertToSelf();
26 return dwErrorCode;
27 }
28
29 DWORD
30 _RpcGetJob(WINSPOOL_PRINTER_HANDLE hPrinter, DWORD JobId, DWORD Level, BYTE* pJob, DWORD cbBuf, DWORD* pcbNeeded)
31 {
32 DWORD dwErrorCode;
33
34 dwErrorCode = RpcImpersonateClient(NULL);
35 if (dwErrorCode != ERROR_SUCCESS)
36 {
37 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
38 return dwErrorCode;
39 }
40
41 GetJobW(hPrinter, JobId, Level, pJob, cbBuf, pcbNeeded);
42 dwErrorCode = GetLastError();
43
44 RpcRevertToSelf();
45 return dwErrorCode;
46 }
47
48 DWORD
49 _RpcScheduleJob(WINSPOOL_PRINTER_HANDLE hPrinter, DWORD JobId)
50 {
51 UNIMPLEMENTED;
52 return ERROR_INVALID_FUNCTION;
53 }
54
55 DWORD
56 _RpcSetJob(WINSPOOL_PRINTER_HANDLE hPrinter, DWORD JobId, WINSPOOL_JOB_CONTAINER* pJobContainer, DWORD Command)
57 {
58 UNIMPLEMENTED;
59 return ERROR_INVALID_FUNCTION;
60 }