ReactOS  0.4.15-dev-309-g7c8d563
printerdata.c File Reference
#include "precomp.h"
Include dependency graph for printerdata.c:

Go to the source code of this file.

Functions

DWORD WINAPI GetPrinterDataExW (HANDLE hPrinter, LPCWSTR pKeyName, LPCWSTR pValueName, LPDWORD pType, LPBYTE pData, DWORD nSize, LPDWORD pcbNeeded)
 
DWORD WINAPI GetPrinterDataW (HANDLE hPrinter, LPWSTR pValueName, LPDWORD pType, LPBYTE pData, DWORD nSize, LPDWORD pcbNeeded)
 
DWORD WINAPI SetPrinterDataExW (HANDLE hPrinter, LPCWSTR pKeyName, LPCWSTR pValueName, DWORD Type, LPBYTE pData, DWORD cbData)
 
DWORD WINAPI SetPrinterDataW (HANDLE hPrinter, PWSTR pValueName, DWORD Type, PBYTE pData, DWORD cbData)
 

Function Documentation

◆ GetPrinterDataExW()

DWORD WINAPI GetPrinterDataExW ( HANDLE  hPrinter,
LPCWSTR  pKeyName,
LPCWSTR  pValueName,
LPDWORD  pType,
LPBYTE  pData,
DWORD  nSize,
LPDWORD  pcbNeeded 
)

Definition at line 11 of file printerdata.c.

12 {
14 
15  // Sanity check.
16  if (!pHandle)
17  {
18  // Yes, Windows checks for the handle here and sets the last error to ERROR_INVALID_HANDLE,
19  // but returns FALSE and not the error code.
21  return FALSE;
22  }
23 
24  // Call GetPrinterDataEx of the Print Provider.
25  return pHandle->pPrintProvider->PrintProvider.fpGetPrinterDataEx(pHandle->hPrinter, pKeyName, pValueName, pType, pData, nSize, pcbNeeded);
26 }
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2037
struct _SPOOLSS_PRINTER_HANDLE * PSPOOLSS_PRINTER_HANDLE
#define SetLastError(x)
Definition: compat.h:418
_In_ DWORD _Out_ PDWORD pcbNeeded
Definition: winddi.h:3827
PRINTPROVIDOR PrintProvider
Definition: precomp.h:36
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
PSPOOLSS_PRINT_PROVIDER pPrintProvider
Definition: precomp.h:46

Referenced by _RpcGetPrinterDataEx(), GetPrinterDataExA(), and GetPrinterDataW().

◆ GetPrinterDataW()

DWORD WINAPI GetPrinterDataW ( HANDLE  hPrinter,
LPWSTR  pValueName,
LPDWORD  pType,
LPBYTE  pData,
DWORD  nSize,
LPDWORD  pcbNeeded 
)

Definition at line 29 of file printerdata.c.

30 {
31  // The ReactOS Printing Stack forwards all GetPrinterData calls to GetPrinterDataEx as soon as possible.
32  // This function may only be called if spoolss.dll is used together with Windows Printing Stack components.
33  WARN("This function should never be called!\n");
34  return GetPrinterDataExW(hPrinter, L"PrinterDriverData", pValueName, pType, pData, nSize, pcbNeeded);
35 }
#define WARN(fmt,...)
Definition: debug.h:112
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2037
DWORD WINAPI GetPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName, LPCWSTR pValueName, LPDWORD pType, LPBYTE pData, DWORD nSize, LPDWORD pcbNeeded)
Definition: printerdata.c:11
static const WCHAR L[]
Definition: oid.c:1250
_In_ DWORD _Out_ PDWORD pcbNeeded
Definition: winddi.h:3827
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827

◆ SetPrinterDataExW()

DWORD WINAPI SetPrinterDataExW ( HANDLE  hPrinter,
LPCWSTR  pKeyName,
LPCWSTR  pValueName,
DWORD  Type,
LPBYTE  pData,
DWORD  cbData 
)

Definition at line 38 of file printerdata.c.

39 {
41 
42  // Sanity check.
43  if (!pHandle)
44  {
45  // Yes, Windows checks for the handle here and sets the last error to ERROR_INVALID_HANDLE,
46  // but returns FALSE and not the error code.
48  return FALSE;
49  }
50 
51  // Call SetPrinterDataEx of the Print Provider.
52  return pHandle->pPrintProvider->PrintProvider.fpSetPrinterDataEx(pHandle->hPrinter, pKeyName, pValueName, Type, pData, cbData);
53 }
Type
Definition: Type.h:6
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
struct _SPOOLSS_PRINTER_HANDLE * PSPOOLSS_PRINTER_HANDLE
#define SetLastError(x)
Definition: compat.h:418
PRINTPROVIDOR PrintProvider
Definition: precomp.h:36
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
PSPOOLSS_PRINT_PROVIDER pPrintProvider
Definition: precomp.h:46

Referenced by _RpcSetPrinterDataEx(), SetPrinterDataExA(), and SetPrinterDataW().

◆ SetPrinterDataW()

DWORD WINAPI SetPrinterDataW ( HANDLE  hPrinter,
PWSTR  pValueName,
DWORD  Type,
PBYTE  pData,
DWORD  cbData 
)

Definition at line 56 of file printerdata.c.

57 {
58  // The ReactOS Printing Stack forwards all SetPrinterData calls to SetPrinterDataEx as soon as possible.
59  // This function may only be called if spoolss.dll is used together with Windows Printing Stack components.
60  WARN("This function should never be called!\n");
61  return SetPrinterDataExW(hPrinter, L"PrinterDriverData", pValueName, Type, pData, cbData);
62 }
DWORD WINAPI SetPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName, LPCWSTR pValueName, DWORD Type, LPBYTE pData, DWORD cbData)
Definition: printerdata.c:38
Type
Definition: Type.h:6
#define WARN(fmt,...)
Definition: debug.h:112
static const WCHAR L[]
Definition: oid.c:1250
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827