RefreshPrinterChangeNotification function

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

Syntax


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 Microsoft Windows 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 Windows 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 Windows SDK documentation).

Remarks

A print provider's RefreshPrinterChangeNotification function is called when an application calls FindNextPrinterChangeNotification (described in the Windows 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 NULLpInfoDataSrc argument.)

The provider must call RouterAllocPrinterNotifyInfo to allocate a PRINTER_NOTIFY_INFO structure (described in the Windows 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 Windows 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.

Requirements

Header

Winsplp.h (include Winsplp.h)

Library

Spoolss.lib

See also

PartialReplyPrinterChangeNotification
RouterAllocPrinterNotifyInfo
AppendPrinterNotifyInfoData
FindFirstPrinterChangeNotification

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft