Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug › MINIDUMP_HANDLE_DESCRIPTOR_2

MINIDUMP_HANDLE_DESCRIPTOR_2

構造体
サイズx64: 40 バイト / x86: 40 バイトパッキング4

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

フィールド

フィールドサイズx64x86説明
HandleULONGLONG8+0+0ハンドルの値。
TypeNameRvaDWORD4+8+8ハンドル種別名文字列へのRVA。
ObjectNameRvaDWORD4+12+12オブジェクト名文字列へのRVA。
AttributesDWORD4+16+16ハンドルの属性フラグ。
GrantedAccessDWORD4+20+20付与されたアクセス権マスク。
HandleCountDWORD4+24+24このオブジェクトへのハンドル数。
PointerCountDWORD4+28+28このオブジェクトへの参照数。
ObjectInfoRvaDWORD4+32+32追加オブジェクト情報へのRVA。0で無し。
Reserved0DWORD4+36+36予約フィールド。0が入る。

各言語での定義

#include <windows.h>

// MINIDUMP_HANDLE_DESCRIPTOR_2  (x64 40 / x86 40 バイト)
#pragma pack(push, 4)
typedef struct MINIDUMP_HANDLE_DESCRIPTOR_2 {
    ULONGLONG Handle;
    DWORD TypeNameRva;
    DWORD ObjectNameRva;
    DWORD Attributes;
    DWORD GrantedAccess;
    DWORD HandleCount;
    DWORD PointerCount;
    DWORD ObjectInfoRva;
    DWORD Reserved0;
} MINIDUMP_HANDLE_DESCRIPTOR_2;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct MINIDUMP_HANDLE_DESCRIPTOR_2
{
    public ulong Handle;
    public uint TypeNameRva;
    public uint ObjectNameRva;
    public uint Attributes;
    public uint GrantedAccess;
    public uint HandleCount;
    public uint PointerCount;
    public uint ObjectInfoRva;
    public uint Reserved0;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure MINIDUMP_HANDLE_DESCRIPTOR_2
    Public Handle As ULong
    Public TypeNameRva As UInteger
    Public ObjectNameRva As UInteger
    Public Attributes As UInteger
    Public GrantedAccess As UInteger
    Public HandleCount As UInteger
    Public PointerCount As UInteger
    Public ObjectInfoRva As UInteger
    Public Reserved0 As UInteger
End Structure
import ctypes
from ctypes import wintypes

class MINIDUMP_HANDLE_DESCRIPTOR_2(ctypes.Structure):
    _pack_ = 4
    _fields_ = [
        ("Handle", ctypes.c_ulonglong),
        ("TypeNameRva", wintypes.DWORD),
        ("ObjectNameRva", wintypes.DWORD),
        ("Attributes", wintypes.DWORD),
        ("GrantedAccess", wintypes.DWORD),
        ("HandleCount", wintypes.DWORD),
        ("PointerCount", wintypes.DWORD),
        ("ObjectInfoRva", wintypes.DWORD),
        ("Reserved0", wintypes.DWORD),
    ]
#[repr(C, packed(4))]
pub struct MINIDUMP_HANDLE_DESCRIPTOR_2 {
    pub Handle: u64,
    pub TypeNameRva: u32,
    pub ObjectNameRva: u32,
    pub Attributes: u32,
    pub GrantedAccess: u32,
    pub HandleCount: u32,
    pub PointerCount: u32,
    pub ObjectInfoRva: u32,
    pub Reserved0: u32,
}
import "golang.org/x/sys/windows"

type MINIDUMP_HANDLE_DESCRIPTOR_2 struct {
	Handle uint64
	TypeNameRva uint32
	ObjectNameRva uint32
	Attributes uint32
	GrantedAccess uint32
	HandleCount uint32
	PointerCount uint32
	ObjectInfoRva uint32
	Reserved0 uint32
}
type
  MINIDUMP_HANDLE_DESCRIPTOR_2 = packed record
    Handle: UInt64;
    TypeNameRva: DWORD;
    ObjectNameRva: DWORD;
    Attributes: DWORD;
    GrantedAccess: DWORD;
    HandleCount: DWORD;
    PointerCount: DWORD;
    ObjectInfoRva: DWORD;
    Reserved0: DWORD;
  end;
const MINIDUMP_HANDLE_DESCRIPTOR_2 = extern struct {
    Handle: u64,
    TypeNameRva: u32,
    ObjectNameRva: u32,
    Attributes: u32,
    GrantedAccess: u32,
    HandleCount: u32,
    PointerCount: u32,
    ObjectInfoRva: u32,
    Reserved0: u32,
};
type
  MINIDUMP_HANDLE_DESCRIPTOR_2 {.packed.} = object
    Handle: uint64
    TypeNameRva: uint32
    ObjectNameRva: uint32
    Attributes: uint32
    GrantedAccess: uint32
    HandleCount: uint32
    PointerCount: uint32
    ObjectInfoRva: uint32
    Reserved0: uint32
align(4)
struct MINIDUMP_HANDLE_DESCRIPTOR_2
{
    ulong Handle;
    uint TypeNameRva;
    uint ObjectNameRva;
    uint Attributes;
    uint GrantedAccess;
    uint HandleCount;
    uint PointerCount;
    uint ObjectInfoRva;
    uint Reserved0;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MINIDUMP_HANDLE_DESCRIPTOR_2 サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Handle : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; TypeNameRva : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ObjectNameRva : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Attributes : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; GrantedAccess : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; HandleCount : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; PointerCount : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ObjectInfoRva : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Reserved0 : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MINIDUMP_HANDLE_DESCRIPTOR_2, pack=4
    #field int64 Handle
    #field int TypeNameRva
    #field int ObjectNameRva
    #field int Attributes
    #field int GrantedAccess
    #field int HandleCount
    #field int PointerCount
    #field int ObjectInfoRva
    #field int Reserved0
#endstruct

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