DrvSetPrinterData


DWORD DrvSetPrinterData(LPSTR lpPrinter, LPSTR lpProfile, 
    DWORD lpType, LPBYTE lpPrinterData, DWORD dwSize)

Enables a printer driver to store data in the registry. The data can be stored under a unique key to be retrieved later. Typically used to store data from the extended DEVMODE structure in the registry.

lpPrinter

Friendly name that identifies the printer device.

lpProfile

Name of profile under which to save data. Note that setting this parameter to INT_PD_DEFAULT_DEVMODE (which is defined in PRINT.H), the default DEVMODE is used. Private profile data can be used by passing the lpProfile parameter from ExtDeviceMode (it is non-NULL) as this parameter.

lpType

Type of data being stored. Use REG_BINARY for binary data (see the Win32 SDK for other registry data type descriptions).

lpPrinterData

Far pointer to location of data to be saved.

dwSize

Buffer size at the location pointed to by the lpPrinterData parameter.


Printer drivers are strongly encouraged to use this functionality to store all printer driver settings and to avoid using INI files wherever possible.

Printer drivers may obtain the model name of the device, typically required by the device driver, by calling the DrvGetPrinterData function with the lpProfile parameter set to INT_PD_DEFAULT_MODEL.

If the data has the REG_SZ, REG_MULTI_SZ, or REG_EXPAND_SZ types, then the size of the data returned to the location pointed to by the lpPrinterData parameter will include the terminating NULL character.