RpcRouterRefreshPrinterChangeNotification (Opnum 67)

RpcRouterRefreshPrinterChangeNotification returns change notification information.<367>

 DWORD RpcRouterRefreshPrinterChangeNotification(
   [in] PRINTER_HANDLE hPrinter,
   [in] DWORD dwColor,
   [in, unique] RPC_V2_NOTIFY_OPTIONS* pOptions,
   [out] RPC_V2_NOTIFY_INFO** ppInfo

hPrinter: A handle to a printer object or server object that was opened by RpcAddPrinter (section, RpcAddPrinterEx (section, RpcOpenPrinter (section, or RpcOpenPrinterEx (section

This handle MUST have been previously used successfully by the client in a call to RpcRemoteFindFirstPrinterChangeNotification (section or RpcRemoteFindFirstPrinterChangeNotificationEx (section, and it MUST NOT have been closed by calling RpcFindClosePrinterChangeNotification (section

dwColor: An implementation-specific value that MAY be used by print clients to get an indication of the order of notifications.<368>

pOptions: A pointer to an RPC_V2_NOTIFY_OPTIONS (section structure that specifies printer or job members that the client listens to for notifications. For lists of members that can be monitored, see Printer Notification Values (section and Job Notification Values (section

ppInfo: A pointer to a variable that receives a pointer to an RPC_V2_NOTIFY_INFO (section structure that contains notification information.

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 that are specified in PRINTER_HANDLE Parameters (section This method SHOULD assume that the handle to the printer or server object can be used without further access checks.

  • Verify that the client is in the list of notification clients for the printer object or server object.

  • Verify that a notification back channel to the client has been established and is still open.

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:

  • Collect all the notification data requested for the printer objects.

  • Allocate a buffer and write the collected notification data in the buffer.

  • Associate the buffer with ppInfo output parameter.

  • Return the status of the operation.

This method MUST be called when the client receives an RPC_V2_NOTIFY_INFO structure with the PRINTER_NOTIFY_INFO_DISCARDED bit set in its Flags member. This indicates that an overflow or other error has occurred and that notifications might have been lost, which sets the notification object to the discarded state. The server MUST NOT send any additional notifications until the client makes this method call. If the operation is successful, the server MUST modify the notification object to clear the discarded state.