ReactOS  0.4.14-dev-599-g2d4d3f5
printerdrivers.c File Reference
Include dependency graph for printerdrivers.c:

Go to the source code of this file.

Functions

DWORD _RpcAddPrinterDriver (WINSPOOL_HANDLE pName, WINSPOOL_DRIVER_CONTAINER *pDriverContainer)
 
DWORD _RpcAddPrinterDriverEx (WINSPOOL_HANDLE pName, WINSPOOL_DRIVER_CONTAINER *pDriverContainer, DWORD dwFileCopyFlags)
 
DWORD _RpcDeletePrinterDriver (WINSPOOL_HANDLE pName, WCHAR *pEnvironment, WCHAR *pDriverName)
 
DWORD _RpcDeletePrinterDriverEx (WINSPOOL_HANDLE pName, WCHAR *pEnvironment, WCHAR *pDriverName, DWORD dwDeleteFlag, DWORD dwVersionNum)
 
DWORD _RpcEnumPrinterDrivers (WINSPOOL_HANDLE pName, WCHAR *pEnvironment, DWORD Level, BYTE *pDrivers, DWORD cbBuf, DWORD *pcbNeeded, DWORD *pcReturned)
 
DWORD _RpcGetPrinterDriver (WINSPOOL_PRINTER_HANDLE hPrinter, WCHAR *pEnvironment, DWORD Level, BYTE *pDriver, DWORD cbBuf, DWORD *pcbNeeded)
 
DWORD _RpcGetPrinterDriver2 (WINSPOOL_PRINTER_HANDLE hPrinter, WCHAR *pEnvironment, DWORD Level, BYTE *pDriver, DWORD cbBuf, DWORD *pcbNeeded, DWORD dwClientMajorVersion, DWORD dwClientMinorVersion, DWORD *pdwServerMaxVersion, DWORD *pdwServerMinVersion)
 
DWORD _RpcGetPrinterDriverDirectory (WINSPOOL_HANDLE pName, WCHAR *pEnvironment, DWORD Level, BYTE *pDriverDirectory, DWORD cbBuf, DWORD *pcbNeeded)
 

Function Documentation

◆ _RpcAddPrinterDriver()

DWORD _RpcAddPrinterDriver ( WINSPOOL_HANDLE  pName,
WINSPOOL_DRIVER_CONTAINER pDriverContainer 
)

Definition at line 12 of file printerdrivers.c.

13 {
16 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by pointer_default().

◆ _RpcAddPrinterDriverEx()

DWORD _RpcAddPrinterDriverEx ( WINSPOOL_HANDLE  pName,
WINSPOOL_DRIVER_CONTAINER pDriverContainer,
DWORD  dwFileCopyFlags 
)

Definition at line 19 of file printerdrivers.c.

20 {
23 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by pointer_default().

◆ _RpcDeletePrinterDriver()

DWORD _RpcDeletePrinterDriver ( WINSPOOL_HANDLE  pName,
WCHAR pEnvironment,
WCHAR pDriverName 
)

Definition at line 26 of file printerdrivers.c.

27 {
30 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by pointer_default().

◆ _RpcDeletePrinterDriverEx()

DWORD _RpcDeletePrinterDriverEx ( WINSPOOL_HANDLE  pName,
WCHAR pEnvironment,
WCHAR pDriverName,
DWORD  dwDeleteFlag,
DWORD  dwVersionNum 
)

Definition at line 33 of file printerdrivers.c.

34 {
37 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by pointer_default().

◆ _RpcEnumPrinterDrivers()

DWORD _RpcEnumPrinterDrivers ( WINSPOOL_HANDLE  pName,
WCHAR pEnvironment,
DWORD  Level,
BYTE pDrivers,
DWORD  cbBuf,
DWORD pcbNeeded,
DWORD pcReturned 
)

Definition at line 40 of file printerdrivers.c.

41 {
44 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by pointer_default().

◆ _RpcGetPrinterDriver()

DWORD _RpcGetPrinterDriver ( WINSPOOL_PRINTER_HANDLE  hPrinter,
WCHAR pEnvironment,
DWORD  Level,
BYTE pDriver,
DWORD  cbBuf,
DWORD pcbNeeded 
)

Definition at line 47 of file printerdrivers.c.

48 {
49  DWORD dwErrorCode;
50  PBYTE pDriverAligned;
51 
52  dwErrorCode = RpcImpersonateClient(NULL);
53  if (dwErrorCode != ERROR_SUCCESS)
54  {
55  ERR("RpcImpersonateClient failed with error %lu!\n", dwErrorCode);
56  return dwErrorCode;
57  }
58 
59  pDriverAligned = AlignRpcPtr(pDriver, &cbBuf);
60 
61  if (GetPrinterDriverW(hPrinter, pEnvironment, Level, pDriverAligned, cbBuf, pcbNeeded))
62  {
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);
66  }
67  else
68  {
69  dwErrorCode = GetLastError();
70  }
71 
73  UndoAlignRpcPtr(pDriver, pDriverAligned, cbBuf, pcbNeeded);
74 
75  return dwErrorCode;
76 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
WINBOOL WINAPI GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment, DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded)
Definition: printers.c:594
smooth NULL
Definition: ftsmooth.c:416
RPC_STATUS WINAPI RpcRevertToSelf(void)
Definition: rpc_binding.c:1459
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
BOOL WINAPI MarshallDownStructure(PVOID pStructure, const MARSHALLING_INFO *pInfo, DWORD cbStructureSize, BOOL bSomeBoolean)
Definition: marshalling.c:38
#define ERR(fmt,...)
Definition: debug.h:109
PVOID WINAPI AlignRpcPtr(PVOID pBuffer, PDWORD pcbBuffer)
Definition: memory.c:29
_In_ DWORD _Out_ PDWORD pcbNeeded
Definition: winddi.h:3827
PDWORD WINAPI UndoAlignRpcPtr(PVOID pDestinationBuffer, PVOID pSourceBuffer, DWORD cbBuffer, PDWORD pcbNeeded)
Definition: memory.c:236
RPC_STATUS WINAPI RpcImpersonateClient(RPC_BINDING_HANDLE BindingHandle)
Definition: rpc_binding.c:1052
BYTE * PBYTE
Definition: pedump.c:66
static const MARSHALLING * pPrinterDriverMarshalling[]

Referenced by GetPrinterDriverW(), and pointer_default().

◆ _RpcGetPrinterDriver2()

DWORD _RpcGetPrinterDriver2 ( WINSPOOL_PRINTER_HANDLE  hPrinter,
WCHAR pEnvironment,
DWORD  Level,
BYTE pDriver,
DWORD  cbBuf,
DWORD pcbNeeded,
DWORD  dwClientMajorVersion,
DWORD  dwClientMinorVersion,
DWORD pdwServerMaxVersion,
DWORD pdwServerMinVersion 
)

Definition at line 79 of file printerdrivers.c.

80 {
83 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by pointer_default().

◆ _RpcGetPrinterDriverDirectory()

DWORD _RpcGetPrinterDriverDirectory ( WINSPOOL_HANDLE  pName,
WCHAR pEnvironment,
DWORD  Level,
BYTE pDriverDirectory,
DWORD  cbBuf,
DWORD pcbNeeded 
)

Definition at line 86 of file printerdrivers.c.

87 {
90 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by pointer_default().