22.214.171.124.8.1 DEVMODE_CONTAINER Parameters
pDevModeContainer: This parameter is synonymous with pDevMode.
The individual method sections include the following parameter validation steps by reference:
If the pDevModeContainer parameter is declared with the "unique" IDL attribute, and its value is NULL, the server SHOULD skip the validation steps and assume validation success.
If the pDevModeContainer parameter is not declared with the "unique" IDL attribute, the server MAY verify that its value is not NULL.<299>
The server SHOULD verify that the pDevMode member of the DEVMODE_CONTAINER that is pointed to by pDevModeContainer is NULL, or that the _DEVMODE (section 126.96.36.199) structure that is pointed to by the pDevMode member is valid, which means that the total size specified in _DEVMODE MUST be less than or equal to the number of bytes specified by the value of the cbBuf member of the DEVMODE_CONTAINER.
The server SHOULD verify that the dmSize and dmDriverExtra members of the _DEVMODE structure comply with the constraints defined in section 188.8.131.52, and that the sum of their values is not larger than the cbBuf member of the DEVMODE_CONTAINER.
Note The server uses the printer driver associated with a print queue to validate all other _DEVMODE members. Incorrect settings for these other members are silently corrected by the printer driver. Therefore, the print client SHOULD obtain a valid _DEVMODE from the printer driver or print queue to use as template for the DEVMODE_CONTAINER parameter. The client SHOULD modify selected fields only as necessary and as indicated by the printer driver capabilities that are returned by a local call to the printer driver.
Unless noted otherwise, if any of the preceding validation steps fail, the server SHOULD return ERROR_INVALID_PARAMETER.