template <class character>
bool get_printer_driver(handle printer,
                        const character* environment,
                        unsigned level,
                        byte* information,
                        unsigned size,
                        unsigned* required)

This function obtains driver data for a printer.


handle printer

The handle of the printer for which data is being requested.

const character* environment

A pointer to a string specifying the environment (for example, "windows NT x86" or "windows 4.0" etc). If null is specified, the environment of the calling application and client machine is used.

unsigned level

The level of information required. This may be 1, 2 or 3.

byte* information

A pointer to a buffer to hold the driver information (depending on the level).

Level data Structure
1 driver_information1
2 driver_information2
3 driver_information3

unsigned size

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

unsigned* required

A pointer to a variable that is updated to contain the number of bytes copied to the buffer (when the function succeeds) and which contains the required buffer size when the function fails with an error signalling the buffer is too small.



true The function succeeded.
false The call failed.


The classes driver_information2 and driver_information3 contain the full path and filename of the printer driver. This may be used to load the printer driver (supplying the path and filename as the single parameter).