Previous Next

RefreshPrinterChangeNotification

A print provider's RefreshPrinterChangeNotification function returns change notification information to the caller.

BOOL
  RefreshPrinterChangeNotification(
    HANDLE  hPrinter,
    DWORD  Reserved,
    PVOID  pvReserved,
    PVOID  pPrinterNotifyInfo
    );

Parameters

hPrinter
Caller-supplied printer handle, identifying the printer for which event notification information is being requested. This handle must have been previously obtained from OpenPrinter (described in the Platform SDK documentation).
Reserved
Not used.
pvReserved
Not used.
pPrinterNotifyInfo
Caller-supplied address to receive a pointer to a provider-allocated PRINTER_NOTIFY_INFO structure (described in the Platform SDK documentation).

Return Value

If the operation succeeds, the function returns TRUE. Otherwise the function returns FALSE. The caller can obtain an error code by calling GetLastError (described in the Platform SDK documentation).

Headers

Declared in winsplp.h. Include winsplp.h.

Comments

A print provider's RefreshPrinterChangeNotification function is called when an application calls FindNextPrinterChangeNotification (described in the Platform SDK documentation) with the PRINTER_NOTIFY_OPTIONS_REFRESH flag set. Applications are supposed to set this flag if a previous call to FindNextPrinterChangeNotification returns a PRINTER_NOTIFY_INFO structure with the PRINTER_NOTIFY_INFO_DISCARDED flag set. This flag means the spooler's copy of printer change information is no longer valid, so the print provider must return a new copy. (The print provider can mark the spooler's copy of printer change information as invalid by calling PartialReplyPrinterChangeNotification with a NULL pInfoDataSrc argument.)

The provider must call RouterAllocPrinterNotifyInfo to allocate a PRINTER_NOTIFY_INFO structure (described in the Platform SDK documentation). The provider must then call AppendPrinterNotifyInfoData to load the structure with requested information, as indicated by the contents of the PRINTER_NOTIFY_OPTIONS structure (described in the Platform SDK documentation) that was previously received by the print provider's FindFirstPrinterChangeNotification function. (The calling application is responsible for deallocating the PRINTER_NOTIFY_INFO structure.)

For additional information, see Supporting Printer Change Notifications.

See Also

PartialReplyPrinterChangeNotification, RouterAllocPrinterNotifyInfo, AppendPrinterNotifyInfoData, FindFirstPrinterChangeNotification