ホーム › Storage.VirtualDiskService › VDS_DRIVE_LETTER_NOTIFICATION
VDS_DRIVE_LETTER_NOTIFICATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ulEvent | DWORD | 4 | +0 | +0 | アプリケーションに通知するドライブ文字イベントを、次のいずれかの値で指定します。
| ||||||
| wcLetter | WCHAR | 2 | +4 | +4 | イベントを発生させたドライブ文字です。 | ||||||
| volumeId | GUID | 16 | +8 | +8 | ドライブ文字が割り当てられているボリュームの GUID です。ドライブ文字が解放された場合、ボリューム識別子は GUID_NULL になります。 |
公式ドキュメント
[Windows 8 および Windows Server 2012 以降、Virtual Disk Service COM インターフェイスは Windows Storage Management API に置き換えられています。]
ドライブ文字イベントの詳細を定義します。
解説(Remarks)
VDS_NOTIFICATION 構造体は、この構造体をメンバーとして含みます。
アプリケーションは、IVdsAdviseSink インターフェイスを実装し、そのインターフェイスポインターを IVdsService::Advise メソッドの引数として渡すことで、ドライブ文字イベントを受け取ることができます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// VDS_DRIVE_LETTER_NOTIFICATION (x64 24 / x86 24 バイト)
typedef struct VDS_DRIVE_LETTER_NOTIFICATION {
DWORD ulEvent;
WCHAR wcLetter;
GUID volumeId;
} VDS_DRIVE_LETTER_NOTIFICATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VDS_DRIVE_LETTER_NOTIFICATION
{
public uint ulEvent;
public char wcLetter;
public Guid volumeId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VDS_DRIVE_LETTER_NOTIFICATION
Public ulEvent As UInteger
Public wcLetter As Char
Public volumeId As Guid
End Structureimport ctypes
from ctypes import wintypes
class VDS_DRIVE_LETTER_NOTIFICATION(ctypes.Structure):
_fields_ = [
("ulEvent", wintypes.DWORD),
("wcLetter", ctypes.c_wchar),
("volumeId", GUID),
]#[repr(C)]
pub struct VDS_DRIVE_LETTER_NOTIFICATION {
pub ulEvent: u32,
pub wcLetter: u16,
pub volumeId: GUID,
}import "golang.org/x/sys/windows"
type VDS_DRIVE_LETTER_NOTIFICATION struct {
ulEvent uint32
wcLetter uint16
volumeId windows.GUID
}type
VDS_DRIVE_LETTER_NOTIFICATION = record
ulEvent: DWORD;
wcLetter: WideChar;
volumeId: TGUID;
end;const VDS_DRIVE_LETTER_NOTIFICATION = extern struct {
ulEvent: u32,
wcLetter: u16,
volumeId: GUID,
};type
VDS_DRIVE_LETTER_NOTIFICATION {.bycopy.} = object
ulEvent: uint32
wcLetter: uint16
volumeId: GUIDstruct VDS_DRIVE_LETTER_NOTIFICATION
{
uint ulEvent;
wchar wcLetter;
GUID volumeId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VDS_DRIVE_LETTER_NOTIFICATION サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; ulEvent : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; wcLetter : WCHAR (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; volumeId : GUID (+8, 16byte) varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global VDS_DRIVE_LETTER_NOTIFICATION
#field int ulEvent
#field short wcLetter
#field GUID volumeId
#endstruct
stdim st, VDS_DRIVE_LETTER_NOTIFICATION ; NSTRUCT 変数を確保
st->ulEvent = 100
mes "ulEvent=" + st->ulEvent