Share via


AppendPrinterNotifyInfoData, fonction (winsplp.h)

La fonction AppendPrinterNotifyInfoData du spouleur d’impression ajoute le contenu d’une structure de PRINTER_NOTIFY_INFO_DATA spécifiée à une structure de PRINTER_NOTIFY_INFO spécifiée.

Syntaxe

BOOL AppendPrinterNotifyInfoData(
  [in] PPRINTER_NOTIFY_INFO      pInfoDest,
       PPRINTER_NOTIFY_INFO_DATA pDataSrc,
       DWORD                     fdwFlags
);

Paramètres

[in] pInfoDest

Pointeur fourni par l’appelant vers une structure PRINTER_NOTIFY_INFO .

pDataSrc

Pointeur fourni par l’appelant vers une structure PRINTER_NOTIFY_INFO_DATA .

fdwFlags

Indicateurs fournis par l’appelant. L’indicateur suivant est défini.

PRINTER_NOTIFY_INFO_DATA_COMPACT
Si elle est définie, la fonction examine les membres Type, Field et Id de la structure de PRINTER_NOTIFY_INFO_DATA fournie. S’ils correspondent tous à un élément existant du tableau de structure PRINTER_NOTIFY_INFO_DATA , l’élément existant est remplacé par l’élément fourni. Si aucune correspondance n’est trouvée, la fonction ajoute la structure spécifiée à la fin du tableau.

Valeur retournée

Si l’opération réussit, la fonction retourne TRUE. Sinon, la fonction retourne FALSE. L’appelant peut obtenir un code d’erreur en appelant GetLastError.

Remarques

La fonction RefreshPrinterChangeNotification d’un fournisseur d’impression doit appeler AppendPrinterNotifyInfoData aussi souvent que nécessaire pour remplir un tableau de structure PRINTER_NOTIFY_INFO_DATA , après avoir appelé RouterAllocPrinterNotifyInfo pour allouer du stockage au tableau et à sa structure de PRINTER_NOTIFY_INFO associée.

Selon que l’indicateur de PRINTER_NOTIFY_INFO_DATA_COMPACT est défini, la fonction ajoute la structure PRINTER_NOTIFY_INFO_DATA spécifiée à la fin du tableau de structure ou remplace un élément de tableau existant. Si la structure est ajoutée, la fonction incrémente le membre Count de la structure PRINTER_NOTIFY_INFO.

Si AppendPrinterNotifyInfoData détecte que l’indicateur de PRINTER_NOTIFY_INFO_DISCARDED est défini dans la structure de PRINTER_NOTIFY_INFO spécifiée, la fonction efface toutes les structures PRINTER_NOTIFY_INFO_DATA et définit le code d’erreur sur ERROR_OUT_OF_STRUCTURES.

Si NULL est spécifié pour pInfoDataSrc, AppendPrinterNotifyInfoData définit l’indicateur PRINTER_NOTIFY_INFO_DISCARDED dans la structure de PRINTER_NOTIFY_INFO spécifiée, efface toutes les structures PRINTER_NOTIFY_INFO_DATA et définit le code d’erreur sur ERROR_OUT_OF_STRUCTURES.

(Pour plus d’informations sur l’indicateur PRINTER_NOTIFY_INFO_DISCARDED, consultez la description de FindNextPrinterChangeNotification dans la documentation SDK Windows.)

Pour plus d’informations, consultez Prise en charge des notifications de modification d’imprimante.

Configuration requise

Condition requise Valeur
Plateforme cible Desktop (Expérience utilisateur)
En-tête winsplp.h (inclure Winsplp.h)
Bibliothèque Spoolss.lib
DLL Spoolss.dll

Voir aussi

RefreshPrinterChangeNotification

RouterAllocPrinterNotifyInfo