2 * PROJECT: ReactOS Spooler API
3 * LICENSE: GNU LGPL v2.1 or any later version as published by the Free Software Foundation
4 * PURPOSE: Functions giving information about DEVMODE structures
5 * COPYRIGHT: Copyright 2016 Colin Finck <colin@reactos.org>
11 IsValidDevmodeA(PDEVMODEA pDevmode
, size_t DevmodeSize
)
13 // Check if a Devmode was given, its dmSize member is at least as big as the DEVMODEA structure
14 // and DevmodeSize is large enough for the public and private members of the structure.
16 pDevmode
->dmSize
< sizeof(DEVMODEA
) ||
17 DevmodeSize
< pDevmode
->dmSize
+ pDevmode
->dmDriverExtra
)
19 SetLastError(ERROR_INVALID_DATA
);
23 // Return success without setting the error code.
28 IsValidDevmodeW(PDEVMODEW pDevmode
, size_t DevmodeSize
)
30 // Check if a Devmode was given, its dmSize member is at least as big as the DEVMODEW structure
31 // and DevmodeSize is large enough for the public and private members of the structure.
33 pDevmode
->dmSize
< sizeof(DEVMODEW
) ||
34 DevmodeSize
< pDevmode
->dmSize
+ pDevmode
->dmDriverExtra
)
36 SetLastError(ERROR_INVALID_DATA
);
40 // Return success without setting the error code.