Win32 API 日本語リファレンス
ホームSystem.RemoteDesktop › VM_NOTIFY_ENTRY

VM_NOTIFY_ENTRY

構造体
サイズx64: 512 バイト / x86: 512 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
VmNameWCHAR256+0+0仮想マシンの名前。
VmHostWCHAR256+256+256仮想マシンをホストするホストの名前。

各言語での定義

#include <windows.h>

// VM_NOTIFY_ENTRY  (x64 512 / x86 512 バイト)
typedef struct VM_NOTIFY_ENTRY {
    WCHAR VmName[128];
    WCHAR VmHost[128];
} VM_NOTIFY_ENTRY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VM_NOTIFY_ENTRY
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string VmName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string VmHost;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VM_NOTIFY_ENTRY
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public VmName As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public VmHost As String
End Structure
import ctypes
from ctypes import wintypes

class VM_NOTIFY_ENTRY(ctypes.Structure):
    _fields_ = [
        ("VmName", ctypes.c_wchar * 128),
        ("VmHost", ctypes.c_wchar * 128),
    ]
#[repr(C)]
pub struct VM_NOTIFY_ENTRY {
    pub VmName: [u16; 128],
    pub VmHost: [u16; 128],
}
import "golang.org/x/sys/windows"

type VM_NOTIFY_ENTRY struct {
	VmName [128]uint16
	VmHost [128]uint16
}
type
  VM_NOTIFY_ENTRY = record
    VmName: array[0..127] of WideChar;
    VmHost: array[0..127] of WideChar;
  end;
const VM_NOTIFY_ENTRY = extern struct {
    VmName: [128]u16,
    VmHost: [128]u16,
};
type
  VM_NOTIFY_ENTRY {.bycopy.} = object
    VmName: array[128, uint16]
    VmHost: array[128, uint16]
struct VM_NOTIFY_ENTRY
{
    wchar[128] VmName;
    wchar[128] VmHost;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VM_NOTIFY_ENTRY サイズ: 512 バイト(x64)
dim st, 128    ; 4byte整数×128(構造体サイズ 512 / 4 切り上げ)
; VmName : WCHAR (+0, 256byte)  varptr(st)+0 を基点に操作(256byte:入れ子/配列)
; VmHost : WCHAR (+256, 256byte)  varptr(st)+256 を基点に操作(256byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VM_NOTIFY_ENTRY
    #field wchar VmName 128
    #field wchar VmHost 128
#endstruct

stdim st, VM_NOTIFY_ENTRY        ; NSTRUCT 変数を確保