Compartilhar via


3.1.4.1.8.6 PRINTER_CONTAINER Parameters

pPrinterContainer: This parameter is a pointer to a PRINTER_CONTAINER (section 2.2.1.2.9) structure, which specifies printer information. The Level member of the PRINTER_CONTAINER MUST be between 0x00000000 and 0x00000008, inclusive. When the Level member is 0x00000002, the Status, cJobs, and AveragePPM members of the PRINTER_INFO_2 structure (sections 2.2.1.3.6 and 2.2.1.10.3) MUST be set to zero by the caller and MUST be ignored on receipt. For details concerning PRINTER_INFO structures, see section 2.2.1.10.

The individual method sections include the following parameter validation steps by reference:

  • If the pPrinterContainer parameter is declared with the "unique" IDL attribute, and its value is NULL, skip the validation steps and assume validation success.

  • Verify that pPrinterContainer points to a PRINTER_CONTAINER that specifies an appropriate level as defined in the referring method definition. If that verification fails, return ERROR_INVALID_LEVEL.

  • If pDatatype is not NULL, verify that it points to a string that identifies a data type supported by the associated print processor. If that verification fails, return ERROR_INVALID_DATATYPE.

  • If pPrintProcessor is not NULL, verify that it points to a string that identifies a print processor. If that verification fails, return ERROR_UNKNOWN_PRINTPROCESSOR.

  • If pSepFile is not NULL, verify that it points to a string that names an existing file on the server. If that verification fails, return ERROR_INVALID_SEPARATOR_FILE.

  • Verify that pPortName is not NULL and points to a string that identifies an existing port on the server. If that verification fails, return ERROR_UNKNOWN_PORT.

  • Verify that pDriverName is not NULL and points to a string that identifies an existing printer driver on the server. If that verification fails, return ERROR_UNKNOWN_PRINTER_DRIVER.

  • Verify that, if the Attributes parameter has the flag PRINTER_ATTRIBUTE_SHARED (section 2.2.3.12) set, the printer driver identified by pDriverName does not have the attribute that printers using that printer driver cannot be shared (section 3.1.1). If that verification fails, return ERROR_PRINTER_NOT_SHAREABLE.

  • Verify that the Priority member of PRINTER_INFO_2 is within the range specified in section 2.2.1.10.3. If that verification fails, return ERROR_INVALID_PRIORITY.

  • Verify that all members of the PRINTER_CONTAINER structure comply with the constraints defined in section 2.2.1.10, with the exception of pServerName, which SHOULD be ignored.

Unless noted otherwise, if any of the preceding validation steps fail, return ERROR_INVALID_PARAMETER.

The individual method sections further include the following parameter processing steps by reference:

  • If the value of the Level member specifies a PRINTER_INFO structure that contains a pDevMode member (section 2.2.1.3.6), replace the value of that member with the pDevMode value of the DEVMODE_CONTAINER structure (section 2.2.1.2.1) that is pointed to by the pDevModeContainer parameter of the method.

  • If the value of the Level member specifies a PRINTER_INFO structure that contains a pSecurityDescriptor member (section 2.2.1.3.6), replace the value of that member with the pSecurity value of the SECURITY_CONTAINER structure (2.2.1.2.13) that is pointed to by the pSecurityContainer parameter of the method.