Export (0) Print
Expand All

IPrintAsyncNotifyDataObject::AcquireData method

Directs listening applications to the notification data, including the data's size and type.

Syntax


HRESULT AcquireData(
  [out]  BYTE **ppNotificationData,
  [out]  ULONG *pSize,
  [out]  PrintAsyncNotificationType **ppSchema
);

Parameters

ppNotificationData [out]

A buffer containing the notification data.

pSize [out]

The size of the data buffer.

ppSchema [out]

A GUID pointer to the data schema.

Return value

See PrintAsyncNotifyError for the possible values.

For more information about COM error codes, see Error Handling.

Remarks

Applications that call this method must call ReleaseData when they have finished consuming the notification data.

The IPrintAsyncNotifyDataObject interface must be implemented to ensure that a call of IUnknown::Release does not free the object if a listening application has not finished consuming the object's data. Accordingly, if a call to Release occurs when an application has called AcquireData but has not yet called ReleaseData , then the object must not be freed. For this reason, we recommend that AcquireData use IUnknown::AddRef to increment the object's reference count and that ReleaseData decrement the count.

When the Print Spooler fails, it creates an IPrintAsyncNotifyDataObject object. When a listener calls AcquireData for this notification, ppNotificationData is NULL, the size is 0, and ppSchema is NOTIFICATION_RELEASE.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Prnasnot.h

DLL

Prnasnot.dll

See also

IPrintAsyncNotifyDataObject
Printing
Asynchronous Printing Notification Interfaces

 

 

Community Additions

ADD
Show:
© 2014 Microsoft