get_printer_data


template <class character>
unsigned get_printer_data(handle printer,
                          const character* 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* name

A pointer to a string identifying the data to retrieve. For printers, this string is the name of a registry value under the printer's key "PrinterDriverData". 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

This function obtains data previously set by