BOOL DrvConvertDevMode(
LPTSTR pPrinterName, | |
PDEVMODE pdmIn, | |
PDEVMODE pdmOut, | |
PLONG pcbNeeded, | |
DWORD fMode | |
); |
DrvConvertDevMode converts the specified DEVMODE.
Value |
Meaning |
CDM_CONVERT |
The driver should determine that both pdmIn and pdmOut point to valid DEVMODEs that were previously returned by it. If either DEVMODE is null or invalid, the driver should set the last-error code to ERROR_INVALID_PARAMETER and return FALSE. Otherwise, the driver should convert the input DEVMODE to the output DEVMODE. |
CDM_CONVERT351 |
If the input value of pcbNeeded specifies an output buffer of
sufficient size, the driver should copy its Windows NT Version 3.51 default
DEVMODE to pdmOut. Then, if pdmIn is not null, the driver should
convert the input DEVMODE to its Windows NT 3.51 DEVMODE, merging the results
in the buffer to which pdmOut points. If pcbNeeded does not
point to a buffer of sufficient size, the driver should update pcbNeeded with the required buffer size, set the last-error code to ERROR_INSUFFICIENT_BUFFER, and return FALSE. |
CDM_DRIVER_DEFAULT |
If the input value of pcbNeeded specifies an output buffer of sufficient size, the driver should copy the current version of its default DEVMODE to pdmOut. If pcbNeeded does not point to a buffer of sufficient size, the driver should update pcbNeeded with the required buffer size, set the last-error code to ERROR_INSUFFICIENT_BUFFER, and return FALSE. The pdmIn parameter is always null. |
DrvConvertDevMode returns TRUE when it succeeds; otherwise, it sets a last-error code and returns FALSE.
The spooler calls DrvConvertDevMode when a call is made to the Win32 SetPrinter or GetPrinter function. DrvConvertDevMode translates the DEVMODE from another operating system version to the DEVMODE of the spooler’s operating system version. The interoperation of a network of machines with different operating system levels requires that a DEVMODE be converted so that it matches the version of the driver/operating system on a particular machine.