Notificaciones de VDS

[A partir de Windows 8 y Windows Server 2012, la interfaz COM del servicio de disco virtual se sustituye por la API de administración de almacenamiento de Windows.]

Un proveedor puede enviar una notificación de eventos a VDS y VDS puede reenviar la notificación a las aplicaciones. El modelo de notificación que usa VDS es similar al modelo de punto de conexión que usan los objetos COM.

VDS genera notificaciones de servicio para eventos como una asignación de letras de unidad o la llegada de un disco sin asignar. Una vez que VDS asigna un disco a un proveedor, el proveedor es responsable de generar las notificaciones asociadas. En la ilustración siguiente se muestran las interfaces y los métodos usados en el modelo de notificación de VDS.

Diagrama que muestra la interfaz y los métodos (Asesor, OnLoad y OnNotify) entre aplicaciones, servicio de disco virtual y proveedores de V D S.

Para recibir notificaciones, VDS registra su interfaz IVdsAdviseSink con el objeto de proveedor llamando al método IVdsProviderPrivate::OnLoad y pasando un puntero a la interfaz. Cuando se produce un evento de notificación, como la llegada de un nuevo volumen o unidad, el proveedor pasa la estructura de notificación adecuada a VDS como un parámetro del método IVdsAdviseSink::OnNotify .

El proceso es similar entre una aplicación y VDS. En concreto, para recibir notificaciones, una aplicación registra su interfaz IVdsAdviseSink con VDS llamando al método IVdsService::Advise y pasando un puntero a la interfaz. Cuando VDS recibe una notificación de un proveedor, pasa la estructura de notificación adecuada a las aplicaciones registradas como un parámetro del método IVdsAdviseSink::OnNotify .

Nota:

Una aplicación que llama a Advise debe llamar finalmente al método IVdsService::Unadvise . Idealmente, debe llamar a Unadvise tan pronto como ya no necesite recibir notificaciones.

 

En la tabla siguiente se enumeran las notificaciones generadas por el proveedor por tipo de objeto.

Object Notification Valor Vínculo a la descripción del evento
Pack VDS_NF_PACK_ARRIVE 1 VDS_PACK_NOTIFICATION
Pack VDS_NF_PACK_DEPART 2 VDS_PACK_NOTIFICATION
Pack VDS_NF_PACK_MODIFY 3 VDS_PACK_NOTIFICATION
Volumen VDS_NF_VOLUME_ARRIVE 4 VDS_VOLUME_NOTIFICATION
Volumen VDS_NF_VOLUME_DEPART 5 VDS_VOLUME_NOTIFICATION
Volumen VDS_NF_VOLUME_MODIFY 6 VDS_VOLUME_NOTIFICATION
Volumen VDS_NF_VOLUME_REBUILDING_PROGRESS 7 VDS_VOLUME_NOTIFICATION
Disco VDS_NF_DISK_ARRIVE 8 VDS_DISK_NOTIFICATION
Disco VDS_NF_DISK_DEPART 9 VDS_DISK_NOTIFICATION
Disco VDS_NF_DISK_MODIFY 10 VDS_DISK_NOTIFICATION
Partition VDS_NF_PARTITION_ARRIVE 11 VDS_PARTITION_NOTIFICATION
Partition VDS_NF_PARTITION_DEPART 12 VDS_PARTITION_NOTIFICATION
Partition VDS_NF_PARTITION_MODIFY 13 VDS_PARTITION_NOTIFICATION
Subsystem VDS_NF_SUB_SYSTEM_ARRIVE 101 VDS_SUB_SYSTEM_NOTIFICATION
Subsystem VDS_NF_SUB_SYSTEM_DEPART 102 VDS_SUB_SYSTEM_NOTIFICATION
Subsystem VDS_NF_SUB_SYSTEM_MODIFY 151 VDS_SUB_SYSTEM_NOTIFICATION
Controller VDS_NF_CONTROLLER_ARRIVE 103 VDS_CONTROLLER_NOTIFICATION
Controller VDS_NF_CONTROLLER_DEPART 104 VDS_CONTROLLER_NOTIFICATION
Controller VDS_NF_CONTROLLER_MODIFY 350 VDS_CONTROLLER_NOTIFICATION
Controller VDS_NF_CONTROLLER_REMOVED 351 VDS_CONTROLLER_NOTIFICATION
Port VDS_NF_PORT_MODIFY 352 VDS_PORT_NOTIFICATION
Port VDS_NF_PORT_REMOVED 353 VDS_PORT_NOTIFICATION
Unidad VDS_NF_DRIVE_ARRIVE 105 VDS_DRIVE_NOTIFICATION
Unidad VDS_NF_DRIVE_DEPART 106 VDS_DRIVE_NOTIFICATION
Unidad VDS_NF_DRIVE_MODIFY 107 VDS_DRIVE_NOTIFICATION
Unidad VDS_NF_DRIVE_REMOVED 354 VDS_DRIVE_NOTIFICATION
LUN VDS_NF_LUN_ARRIVE 108 VDS_LUN_NOTIFICATION
LUN VDS_NF_LUN_DEPART 109 VDS_LUN_NOTIFICATION
LUN VDS_NF_LUN_MODIFY 110 VDS_LUN_NOTIFICATION

 

VDS genera las notificaciones restantes. En la tabla siguiente se enumeran las constantes de notificación basadas en servicios por categoría.

Category Notification Valor Vínculo a la descripción del evento
Disco VDS_NF_DISK_ARRIVE 8 VDS_DISK_NOTIFICATION
Disco VDS_NF_DISK_DEPART 9 VDS_DISK_NOTIFICATION
Disco VDS_NF_DISK_MODIFY 10 VDS_DISK_NOTIFICATION
Letra de unidad VDS_NF_DRIVE_LETTER_FREE 201 VDS_DRIVE_LETTER_NOTIFICATION
Letra de unidad VDS_NF_DRIVE_LETTER_ASSIGN 202 VDS_DRIVE_LETTER_NOTIFICATION
Sistema de archivos VDS_NF_FILE_SYSTEM_MODIFY 203 VDS_FILE_SYSTEM_NOTIFICATION
Sistema de archivos VDS_NF_FILE_SYSTEM_FORMAT_PROGRESS 204 VDS_FILE_SYSTEM_NOTIFICATION
Volumen VDS_NF_MOUNT_POINTS_CHANGE 205 VDS_MOUNT_POINT_NOTIFICATION

 

Modelo de objetos de VDS

IVdsAdviseSink

IVdsAdviseSink::OnNotify

IVdsProviderPrivate::OnLoad

IVdsService::Advise