A pointer to a DEVMODE structure that the operating system uses to initialize the property sheet controls.
This parameter is only used if the DM_IN_BUFFER flag is set in the fMode parameter. If DM_IN_BUFFER is not set, the operating system uses the printer's default DEVMODE.
TPrinter.SetPrinter passes uninitialized junk as this 2nd optional parameter rather than nil:
if DocumentProperties(0, FPrinterHandle, ADevice, DevMode^, DevMode^, DM_OUT_BUFFER) < 0 then
Tested
Background
When using the Windows DocumentProperties function:
The 2nd-last
pDevModeInput
argument is optional:TPrinter.SetPrinter passes uninitialized junk as this 2nd optional parameter rather than nil:
if DocumentProperties(0, FPrinterHandle, ADevice, DevMode^, DevMode^, DM_OUT_BUFFER) < 0 then