IVdsAdviseSink::OnNotify method (vdshwprv.h)

[Beginning with Windows 8 and Windows Server 2012, the Virtual Disk Service COM interface is superseded by the Windows Storage Management API.]

Passes notifications from providers to VDS, and from VDS to applications.

Syntax

HRESULT OnNotify(
  [in] LONG             lNumberOfNotifications,
  [in] VDS_NOTIFICATION *pNotificationArray
);

Parameters

[in] lNumberOfNotifications

The number of notifications specified in pNotificationArray.

[in] pNotificationArray

A pointer to an array of VDS_NOTIFICATION structures. A provider allocates the memory for the array when the provider calls into the service; the service frees the array. VDS allocates the array when the service calls into an application. In this case, callers must free the array by using the CoTaskMemFree function.

Return value

This method can return standard HRESULT values, such as E_INVALIDARG or E_OUTOFMEMORY, and VDS-specific return values. It can also return converted system error codes using the HRESULT_FROM_WIN32 macro. Errors can originate from VDS itself or from the underlying VDS provider that is being used. Possible return values include the following.

Return code Description
S_FALSE
VDS returns this value to a provider if the service is not fully initialized when the provider calls into this method, or if some notifications are lost by the service.

Remarks

An application implements this method to receive notifications from VDS. Some of these notifications originate from VDS; others are provider notifications that are forwarded by VDS.

VDS maintains a cache of information about the properties of all VDS objects, such as subsystems and controllers. Whenever a change occurs that triggers a notification, this cache is updated automatically. Also, calling IVdsHwProvider::Refresh or IVdsService::Refresh in response to a VDS notification could cause an endless loop of notifications to be sent. For these reasons, an application should not call IVdsHwProvider::Refresh or IVdsService::Refresh in its implementation of this method.

For providers that use this method to send notifications, it is good practice to group notifications originating from a single event together. For example, when a LUN is deleted, send VDS_NF_DRIVE_MODIFY notifications for all affected drives together.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header vdshwprv.h
Library Uuid.lib

See also

IVdsAdviseSink

IVdsHwProvider::Refresh

IVdsService::Advise

IVdsService::Refresh

IVdsService::Unadvise

VDS Notifications

VDS_NOTIFICATION