RouterAllocPrinterNotifyInfo function (winsplp.h)
The print spooler's RouterAllocPrinterNotifyInfo
function allocates a PRINTER_NOTIFY_INFO structure and an array of PRINTER_NOTIFY_INFO_DATA structures. (These structures are described in the Microsoft Windows SDK documentation.)
Syntax
PPRINTER_NOTIFY_INFO RouterAllocPrinterNotifyInfo(
DWORD cPrinterNotifyInfoData
);
Parameters
cPrinterNotifyInfoData
Caller-supplied number specifying size of the PRINTER_NOTIFY_INFO_DATA structure array to be allocated.
Return value
The function returns a pointer to the allocated PRINTER_NOTIFY_INFO structure.
Remarks
Print providers should call RouterAllocPrinterNotifyInfo
to allocate the PRINTER_NOTIFY_INFO structure and the PRINTER_NOTIFY_INFO_DATA structure array that the provider's RefreshPrinterChangeNotification function must supply.
The RouterAllocPrinterNotifyInfo
function initializes the PRINTER_NOTIFY_INFO structure's Version member to the current version of the spooler's notification implementation. It initializes the structure's Flags and Count members to zero, regardless of the number specified for cPrinterNotifyInfoData.
Print providers should call AppendPrinterNotifyInfoData to fill in members of the PRINTER_NOTIFY_INFO_DATA structure array.
If RefreshPrinterChangeNotification
executes successfully and returns the allocated structures to the caller, you should assume that the caller will deallocate structure memory. However, if RefreshPrinterChangeNotification
encounters an error it should call RouterFreePrinterNotifyInfo to deallocate the memory.
For additional information, see Supporting Printer Change Notifications.
Requirements
Requirement | Value |
---|---|
Target Platform | Desktop |
Header | winsplp.h (include Winsplp.h) |
Library | Spoolss.lib |
DLL | Spoolss.dll |