Win32 API 日本語リファレンス
ホームStorage.FileSystem › NTMS_MEDIAPOOLINFORMATION

NTMS_MEDIAPOOLINFORMATION

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

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

フィールド

フィールドサイズx64x86説明
PoolTypeDWORD4+0+0メディアプールの種類を示す値。フリー/インポート等。
MediaTypeGUID16+4+4プールが扱うメディアの種別GUID。
ParentGUID16+20+20親メディアプールを識別するGUID。
AllocationPolicyDWORD4+36+36メディア割り当てポリシーを示す値。
DeallocationPolicyDWORD4+40+40メディア解放ポリシーを示す値。
dwMaxAllocatesDWORD4+44+44メディア1本あたりの最大割り当て回数。
dwNumberOfPhysicalMediaDWORD4+48+48プール内の物理メディア数。
dwNumberOfLogicalMediaDWORD4+52+52プール内の論理メディア数。
dwNumberOfMediaPoolsDWORD4+56+56プール内の子メディアプール数。

各言語での定義

#include <windows.h>

// NTMS_MEDIAPOOLINFORMATION  (x64 60 / x86 60 バイト)
typedef struct NTMS_MEDIAPOOLINFORMATION {
    DWORD PoolType;
    GUID MediaType;
    GUID Parent;
    DWORD AllocationPolicy;
    DWORD DeallocationPolicy;
    DWORD dwMaxAllocates;
    DWORD dwNumberOfPhysicalMedia;
    DWORD dwNumberOfLogicalMedia;
    DWORD dwNumberOfMediaPools;
} NTMS_MEDIAPOOLINFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NTMS_MEDIAPOOLINFORMATION
{
    public uint PoolType;
    public Guid MediaType;
    public Guid Parent;
    public uint AllocationPolicy;
    public uint DeallocationPolicy;
    public uint dwMaxAllocates;
    public uint dwNumberOfPhysicalMedia;
    public uint dwNumberOfLogicalMedia;
    public uint dwNumberOfMediaPools;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NTMS_MEDIAPOOLINFORMATION
    Public PoolType As UInteger
    Public MediaType As Guid
    Public Parent As Guid
    Public AllocationPolicy As UInteger
    Public DeallocationPolicy As UInteger
    Public dwMaxAllocates As UInteger
    Public dwNumberOfPhysicalMedia As UInteger
    Public dwNumberOfLogicalMedia As UInteger
    Public dwNumberOfMediaPools As UInteger
End Structure
import ctypes
from ctypes import wintypes

class NTMS_MEDIAPOOLINFORMATION(ctypes.Structure):
    _fields_ = [
        ("PoolType", wintypes.DWORD),
        ("MediaType", GUID),
        ("Parent", GUID),
        ("AllocationPolicy", wintypes.DWORD),
        ("DeallocationPolicy", wintypes.DWORD),
        ("dwMaxAllocates", wintypes.DWORD),
        ("dwNumberOfPhysicalMedia", wintypes.DWORD),
        ("dwNumberOfLogicalMedia", wintypes.DWORD),
        ("dwNumberOfMediaPools", wintypes.DWORD),
    ]
#[repr(C)]
pub struct NTMS_MEDIAPOOLINFORMATION {
    pub PoolType: u32,
    pub MediaType: GUID,
    pub Parent: GUID,
    pub AllocationPolicy: u32,
    pub DeallocationPolicy: u32,
    pub dwMaxAllocates: u32,
    pub dwNumberOfPhysicalMedia: u32,
    pub dwNumberOfLogicalMedia: u32,
    pub dwNumberOfMediaPools: u32,
}
import "golang.org/x/sys/windows"

type NTMS_MEDIAPOOLINFORMATION struct {
	PoolType uint32
	MediaType windows.GUID
	Parent windows.GUID
	AllocationPolicy uint32
	DeallocationPolicy uint32
	dwMaxAllocates uint32
	dwNumberOfPhysicalMedia uint32
	dwNumberOfLogicalMedia uint32
	dwNumberOfMediaPools uint32
}
type
  NTMS_MEDIAPOOLINFORMATION = record
    PoolType: DWORD;
    MediaType: TGUID;
    Parent: TGUID;
    AllocationPolicy: DWORD;
    DeallocationPolicy: DWORD;
    dwMaxAllocates: DWORD;
    dwNumberOfPhysicalMedia: DWORD;
    dwNumberOfLogicalMedia: DWORD;
    dwNumberOfMediaPools: DWORD;
  end;
const NTMS_MEDIAPOOLINFORMATION = extern struct {
    PoolType: u32,
    MediaType: GUID,
    Parent: GUID,
    AllocationPolicy: u32,
    DeallocationPolicy: u32,
    dwMaxAllocates: u32,
    dwNumberOfPhysicalMedia: u32,
    dwNumberOfLogicalMedia: u32,
    dwNumberOfMediaPools: u32,
};
type
  NTMS_MEDIAPOOLINFORMATION {.bycopy.} = object
    PoolType: uint32
    MediaType: GUID
    Parent: GUID
    AllocationPolicy: uint32
    DeallocationPolicy: uint32
    dwMaxAllocates: uint32
    dwNumberOfPhysicalMedia: uint32
    dwNumberOfLogicalMedia: uint32
    dwNumberOfMediaPools: uint32
struct NTMS_MEDIAPOOLINFORMATION
{
    uint PoolType;
    GUID MediaType;
    GUID Parent;
    uint AllocationPolicy;
    uint DeallocationPolicy;
    uint dwMaxAllocates;
    uint dwNumberOfPhysicalMedia;
    uint dwNumberOfLogicalMedia;
    uint dwNumberOfMediaPools;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NTMS_MEDIAPOOLINFORMATION サイズ: 60 バイト(x64)
dim st, 15    ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; PoolType : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MediaType : GUID (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; Parent : GUID (+20, 16byte)  varptr(st)+20 を基点に操作(16byte:入れ子/配列)
; AllocationPolicy : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; DeallocationPolicy : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; dwMaxAllocates : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; dwNumberOfPhysicalMedia : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwNumberOfLogicalMedia : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; dwNumberOfMediaPools : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ※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 NTMS_MEDIAPOOLINFORMATION
    #field int PoolType
    #field GUID MediaType
    #field GUID Parent
    #field int AllocationPolicy
    #field int DeallocationPolicy
    #field int dwMaxAllocates
    #field int dwNumberOfPhysicalMedia
    #field int dwNumberOfLogicalMedia
    #field int dwNumberOfMediaPools
#endstruct

stdim st, NTMS_MEDIAPOOLINFORMATION        ; NSTRUCT 変数を確保
st->PoolType = 100
mes "PoolType=" + st->PoolType