The GetPrinterData function retrieves configuration data for the specified printer or print server.
Windows NT 5.0 or later: Calling GetPrinterData is equivalent to calling the GetPrinterDataEx function with the pKeyName parameter set to "PrinterDriverData".
DWORD GetPrinterData(
HANDLE hPrinter, // handle to a printer or print server
LPTSTR pValueName, // string that identifies the data to retrieve
LPDWORD pType, // variable that receives the type of data
LPBYTE pData, // buffer that receives the configuration data
DWORD nSize, // size, in bytes, of buffer
LPDWORD pcbNeeded // receives the required buffer size, in bytes
);
For printers, this string is the name of a registry value under the printer's "PrinterDriverData" key in the registry.
For print servers, this string is one of the predefined strings listed in the following Remarks section.
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is an error value.
GetPrinterData retrieves printer-configuration data set by the SetPrinterDataEx or SetPrinterData function.
If hPrinter is a handle to a print server, pValueName can specify one of the following predefined values.
SPLREG_DEFAULT_SPOOL_DIRECTORY | |
SPLREG_PORT_THREAD_PRIORITY_DEFAULT | |
SPLREG_PORT_THREAD_PRIORITY | |
SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT | |
SPLREG_SCHEDULER_THREAD_PRIORITY | |
SPLREG_BEEP_ENABLED | |
SPLREG_NET_POPUP | |
SPLREG_EVENT_LOG | |
SPLREG_MAJOR_VERSION | |
SPLREG_MINOR_VERSION | |
SPLREG_ARCHITECTURE | |
SPLREG_OS_VERSION |
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winspool.h.
Import Library: Use winspool.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Printing and Print Spooler Overview, Printing and Print Spooler Functions, GetPrinterDataEx, OpenPrinter, SetPrinter, SetPrinterData, SetPrinterDataEx