get_printer_data_extended


template <class character>
unsigned get_printer_data_extended(handle printer,
                                const character* key_name,
                                const character* value_name,
                                unsigned* type,
                                byte* data,
                                unsigned size,
                                unsigned* required)

This function obtains configuration data for a printer or print server.

Parameters

handle printer

The handle of the printer or printer server for which data is being obtained.

const character* key_name

A pointer to a string specifying the key containing the value to be retrieved. The backslash ( \ ) character may be used as a delimiter to specify a path that has one or more subkeys. If the parameter printer identifies a printer and this parameter is null or an empty string, an error is flagged. If the parameter printer identifies a print server, this parameter must be null.

const character* value_name

A pointer to a string identifying the data to retrieve. For printers, this string is the name of a registry value under the previously specified key. For printer servers, this may be one of the following values.

SpoolerRegistryDefaultSpooldirectory
SpoolerRegistryPortThreadPriorityDefault
SpoolerRegistryPortThreadPriority
SpoolerRegistrySchedulerThreadPriorityDefault
SpoolerRegistrySchedulerThreadPriority
SpoolerRegistryBeepenabled
SpoolerRegistryNetPopup
SpoolerRegistryEventLog
SpoolerRegistryMajorVersion
SpoolerRegistryMinorVersion
SpoolerRegistryArchitecture
SpoolerRegistryVersionOperatingSystem
SpoolerRegistrydirectoryServicesPresent

unsigned* type

A pointer to a variable that receives the type of data being retrieved. The type returned is that specified when the data was set. When no information is required, this parameter may be set to null.

byte* data

A pointer to a buffer to hold the requested information.

unsigned size

The size (in bytes) of the buffer provided by the previous parameter.

unsigned* required

A pointer to a variable that receives the size (in bytes) of the configuration data. If the specified buffer size is too small, the function returns error::more_data and sets this variable to hold the required buffer size.

Return

unsigned

Zero The function succeeded.
Other The error code for the operation.

Notes

Calling this function with registry key name "PrinterDriverData" is equivalent to calling the function get_printer_data.

This function obtains data previously set by