次の方法で共有


3.1.4.2.10 RpcCreatePrinterIC (Opnum 40)

RpcCreatePrinterIC is called by the Graphics Device Interface (GDI) to create an information context for a specified printer.

 DWORD RpcCreatePrinterIC(
   [in] PRINTER_HANDLE hPrinter,
   [out] GDI_HANDLE* pHandle,
   [in] DEVMODE_CONTAINER* pDevModeContainer
 );

hPrinter: A handle to a printer object (section 2.2.1.1.4) that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).

pHandle: A pointer to a printer information context handle (section 2.2.1.1.2).

pDevModeContainer: A parameter specified in DEVMODE_CONTAINER Parameters (section 3.1.4.1.8.1).

Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error code to indicate failure [MS-ERREF].

Upon receiving this message, the server MUST validate parameters as follows:

  • Perform the validation steps specified in PRINTER_HANDLE Parameters (section 3.1.4.1.11). This method SHOULD assume that the handle to the printer object can be used without further access checks.

  • Perform the validation steps specified in DEVMODE_CONTAINER Parameters.

If parameter validation fails, the server MUST fail the operation immediately and return a nonzero error response to the client. Otherwise, the server MUST process the message and compose a response to the client as follows:

  • Perform implementation-specific steps to create the appropriate printer information context.

  • Store an RPC context handle associated with the information context in pHandle.

  • Return the status of the operation.

Except for diagnostic purposes, the server state, as visible to the client through this or any other protocol, MUST NOT change as a result of processing this call.