Condividi tramite


Funzione RouterAllocPrinterNotifyInfo (winsplp.h)

La funzione di RouterAllocPrinterNotifyInfo dello spooler di stampa alloca una struttura PRINTER_NOTIFY_INFO e una matrice di strutture PRINTER_NOTIFY_INFO_DATA. Queste strutture sono descritte nella documentazione di Microsoft Windows SDK.

Sintassi

PPRINTER_NOTIFY_INFO RouterAllocPrinterNotifyInfo(
  DWORD cPrinterNotifyInfoData
);

Parametri

cPrinterNotifyInfoData

Numero fornito dal chiamante che specifica le dimensioni della matrice di struttura PRINTER_NOTIFY_INFO_DATA da allocare.

Valore restituito

La funzione restituisce un puntatore alla struttura PRINTER_NOTIFY_INFO allocata.

Osservazioni

I provider di stampa devono chiamare RouterAllocPrinterNotifyInfo per allocare la struttura PRINTER_NOTIFY_INFO e la matrice di struttura PRINTER_NOTIFY_INFO_DATA che deve essere fornita dalla funzione RefreshPrinterChangeNotification del provider.

La funzione RouterAllocPrinterNotifyInfo inizializza il membro Version della struttura PRINTER_NOTIFY_INFO alla versione corrente dell'implementazione di notifica dello spooler. Inizializza i membri Flag della struttura e Count membri su zero, indipendentemente dal numero specificato per cPrinterNotifyInfoData.

I provider di stampa devono chiamare AppendPrinterNotifyInfoData per compilare i membri della matrice di strutture PRINTER_NOTIFY_INFO_DATA.

Se RefreshPrinterChangeNotification viene eseguito correttamente e restituisce le strutture allocate al chiamante, è consigliabile presupporre che il chiamante dealloca la memoria della struttura. Tuttavia, se RefreshPrinterChangeNotification rileva un errore, deve chiamare RouterFreePrinterNotifyInfo per deallocare la memoria.

Per altre informazioni, vedere Supporto delle notifiche di modifica della stampante.

Fabbisogno

Requisito Valore
piattaforma di destinazione Desktop
intestazione winsplp.h (includere Winsplp.h)
libreria Spoolss.lib
dll Spoolss.dll

Vedere anche

AppendPrinterNotifyInfoData

RefreshPrinterChangeNotification

RouterFreePrinterNotifyInfo