2 * PROJECT: ReactOS Print Spooler Service
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Functions related to Printer Drivers
5 * COPYRIGHT: Copyright 2015 Colin Finck (colin@reactos.org)
9 #include "marshalling/printerdrivers.h"
12 _RpcAddPrinterDriver(WINSPOOL_HANDLE pName
, WINSPOOL_DRIVER_CONTAINER
* pDriverContainer
)
15 return ERROR_INVALID_FUNCTION
;
19 _RpcAddPrinterDriverEx(WINSPOOL_HANDLE pName
, WINSPOOL_DRIVER_CONTAINER
* pDriverContainer
, DWORD dwFileCopyFlags
)
22 return ERROR_INVALID_FUNCTION
;
26 _RpcDeletePrinterDriver(WINSPOOL_HANDLE pName
, WCHAR
* pEnvironment
, WCHAR
* pDriverName
)
29 return ERROR_INVALID_FUNCTION
;
33 _RpcDeletePrinterDriverEx(WINSPOOL_HANDLE pName
, WCHAR
* pEnvironment
, WCHAR
* pDriverName
, DWORD dwDeleteFlag
, DWORD dwVersionNum
)
36 return ERROR_INVALID_FUNCTION
;
40 _RpcEnumPrinterDrivers(WINSPOOL_HANDLE pName
, WCHAR
* pEnvironment
, DWORD Level
, BYTE
* pDrivers
, DWORD cbBuf
, DWORD
* pcbNeeded
, DWORD
* pcReturned
)
43 return ERROR_INVALID_FUNCTION
;
47 _RpcGetPrinterDriver(WINSPOOL_PRINTER_HANDLE hPrinter
, WCHAR
* pEnvironment
, DWORD Level
, BYTE
* pDriver
, DWORD cbBuf
, DWORD
* pcbNeeded
)
52 dwErrorCode
= RpcImpersonateClient(NULL
);
53 if (dwErrorCode
!= ERROR_SUCCESS
)
55 ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode
);
59 pDriverAligned
= AlignRpcPtr(pDriver
, &cbBuf
);
61 if (GetPrinterDriverW(hPrinter
, pEnvironment
, Level
, pDriverAligned
, cbBuf
, pcbNeeded
))
63 // Replace relative offset addresses in the output by absolute pointers.
64 ASSERT(Level
>= 1 && Level
<= 3);
65 MarshallDownStructure(pDriverAligned
, pPrinterDriverMarshalling
[Level
]->pInfo
, pPrinterDriverMarshalling
[Level
]->cbStructureSize
, TRUE
);
69 dwErrorCode
= GetLastError();
73 UndoAlignRpcPtr(pDriver
, pDriverAligned
, cbBuf
, pcbNeeded
);
79 _RpcGetPrinterDriver2(WINSPOOL_PRINTER_HANDLE hPrinter
, WCHAR
* pEnvironment
, DWORD Level
, BYTE
* pDriver
, DWORD cbBuf
, DWORD
* pcbNeeded
, DWORD dwClientMajorVersion
, DWORD dwClientMinorVersion
, DWORD
* pdwServerMaxVersion
, DWORD
* pdwServerMinVersion
)
82 return ERROR_INVALID_FUNCTION
;
86 _RpcGetPrinterDriverDirectory(WINSPOOL_HANDLE pName
, WCHAR
* pEnvironment
, DWORD Level
, BYTE
* pDriverDirectory
, DWORD cbBuf
, DWORD
* pcbNeeded
)
89 return ERROR_INVALID_FUNCTION
;