[This is preliminary documentation and subject to change.]
The GetPrinterDataEx function retrieves configuration data stored for the specified printer-or print server by the SetPrinterDataEx or SetPrinterData functions.
DWORD GetPrinterDataEx(
HANDLE hPrinter, // handle to printer or print server
LPCTSTR pKeyName, // name of registry key
LPCTSTR pValueName, // name of registry value
LPDWORD pType, // receives type of data stored in value
LPBYTE pData, // buffer that receives configuration data
DWORD nSize, // size, in bytes, of the buffer
LPDWORD pcbNeeded // receives the required buffer size, in bytes
);
If hPrinter identifies a printer and pKeyName is NULL or an empty string, GetPrinterDataEx returns ERROR_INVALID_PARAMETER.
If hPrinter identifies a print server, pKeyName must be NULL.
For printers, this string specifies the name of a value under the pKeyName key.
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.
GetPrinterDataEx retrieves printer-configuration data set by the SetPrinterDataEx and SetPrinterData functions.
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 |
Calling GetPrinterDataEx with the pKeyName parameter set to "PrinterDriverData" is equivalent to calling the GetPrinterData function.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
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, OpenPrinter, SetPrinterDataEx