共用方式為


3.2.4.1.4 RpcRouterReplyPrinterEx (Opnum 66)

RpcRouterReplyPrinterEx handles a notification from a print server.<416>

 DWORD RpcRouterReplyPrinterEx(
   [in] PRINTER_HANDLE hNotify,
   [in] DWORD dwColor,
   [in] DWORD fdwFlags,
   [out] DWORD* pdwResult,
   [in] DWORD dwReplyType,
   [in, switch_is(dwReplyType)] RPC_V2_UREPLY_PRINTER Reply
 );

hNotify: A notification RPC context handle that was opened by RpcReplyOpenPrinter (section 3.2.4.1.1).

dwColor: The value that was most recently specified by the client in the dwColor parameter of a call to RpcRouterRefreshPrinterChangeNotification (section 3.1.4.10.5).

fdwFlags: A value that contains Printer Change Flags (section 2.2.3.6), which indicate changes in printer configuration values.

pdwResult: A pointer to a value that contains Change Notification Flags (section 2.2.3.2), which indicate how the client processed the notification.

dwReplyType: A value that MUST be zero.

Reply: A pointer to an RPC_V2_UREPLY_PRINTER union, which contains a pointer to an RPC_V2_NOTIFY_INFO structure, which contains available notification data that matched the set of notifications that the client previously requested.

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 print client MUST validate parameters as follows:

  • Verify that the hNotify parameter is an RPC context handle to a notification object that was opened using RpcReplyOpenPrinter, and if that verification fails, return ERROR_INVALID_HANDLE [MS-ERREF]. This method SHOULD assume that this handle can be used without further access checks.

  • Verify that the value of the dwColor parameter matches the last value that was passed in the dwColor parameter in the call to RpcRouterRefreshPrinterChangeNotification; if that verification fails, set the PRINTER_NOTIFY_INFO_COLORMISMATCH bit in the variable pointed to by pdwResult and return 0.

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

  • Capture the fdwFlags in the notification state it maintains.

  • Capture the notification data provided in the Reply parameter in the notification state.

  • Store the result of processing the notification (Change Notification Flags) to the variable pointed to by pdwResult.