Win32 API 日本語リファレンス
ホームDevices.Display › VIDEO_WIN32K_CALLBACKS_PARAMS

VIDEO_WIN32K_CALLBACKS_PARAMS

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

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

フィールド

フィールドサイズx64x86説明
CalloutTypeVIDEO_WIN32K_CALLBACKS_PARAMS_TYPE4+0+0Win32kへのコールアウト種別(VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE列挙)。
PhysDispvoid*8/4+8+4物理ディスプレイオブジェクトへのポインタ。
ParamUINT_PTR8/4+16+8コールアウト種別に応じたパラメータ値(ポインタサイズ)。
StatusINT4+24+12コールアウトの結果ステータス。
LockUserSessionBOOLEAN1+28+16ユーザーセッションをロックするか示すフラグ。
IsPostDeviceBOOLEAN1+29+17POSTデバイスか示すフラグ。
SurpriseRemovalBOOLEAN1+30+18予期せぬデバイス取り外しか示すフラグ。
WaitForQueueReadyBOOLEAN1+31+19キュー準備完了を待つか示すフラグ。

各言語での定義

#include <windows.h>

// VIDEO_WIN32K_CALLBACKS_PARAMS  (x64 32 / x86 20 バイト)
typedef struct VIDEO_WIN32K_CALLBACKS_PARAMS {
    VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE CalloutType;
    void* PhysDisp;
    UINT_PTR Param;
    INT Status;
    BOOLEAN LockUserSession;
    BOOLEAN IsPostDevice;
    BOOLEAN SurpriseRemoval;
    BOOLEAN WaitForQueueReady;
} VIDEO_WIN32K_CALLBACKS_PARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VIDEO_WIN32K_CALLBACKS_PARAMS
{
    public int CalloutType;
    public IntPtr PhysDisp;
    public UIntPtr Param;
    public int Status;
    [MarshalAs(UnmanagedType.U1)] public bool LockUserSession;
    [MarshalAs(UnmanagedType.U1)] public bool IsPostDevice;
    [MarshalAs(UnmanagedType.U1)] public bool SurpriseRemoval;
    [MarshalAs(UnmanagedType.U1)] public bool WaitForQueueReady;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VIDEO_WIN32K_CALLBACKS_PARAMS
    Public CalloutType As Integer
    Public PhysDisp As IntPtr
    Public Param As UIntPtr
    Public Status As Integer
    <MarshalAs(UnmanagedType.U1)> Public LockUserSession As Boolean
    <MarshalAs(UnmanagedType.U1)> Public IsPostDevice As Boolean
    <MarshalAs(UnmanagedType.U1)> Public SurpriseRemoval As Boolean
    <MarshalAs(UnmanagedType.U1)> Public WaitForQueueReady As Boolean
End Structure
import ctypes
from ctypes import wintypes

class VIDEO_WIN32K_CALLBACKS_PARAMS(ctypes.Structure):
    _fields_ = [
        ("CalloutType", ctypes.c_int),
        ("PhysDisp", ctypes.c_void_p),
        ("Param", ctypes.c_size_t),
        ("Status", ctypes.c_int),
        ("LockUserSession", ctypes.c_byte),
        ("IsPostDevice", ctypes.c_byte),
        ("SurpriseRemoval", ctypes.c_byte),
        ("WaitForQueueReady", ctypes.c_byte),
    ]
#[repr(C)]
pub struct VIDEO_WIN32K_CALLBACKS_PARAMS {
    pub CalloutType: i32,
    pub PhysDisp: *mut core::ffi::c_void,
    pub Param: usize,
    pub Status: i32,
    pub LockUserSession: u8,
    pub IsPostDevice: u8,
    pub SurpriseRemoval: u8,
    pub WaitForQueueReady: u8,
}
import "golang.org/x/sys/windows"

type VIDEO_WIN32K_CALLBACKS_PARAMS struct {
	CalloutType int32
	PhysDisp uintptr
	Param uintptr
	Status int32
	LockUserSession byte
	IsPostDevice byte
	SurpriseRemoval byte
	WaitForQueueReady byte
}
type
  VIDEO_WIN32K_CALLBACKS_PARAMS = record
    CalloutType: Integer;
    PhysDisp: Pointer;
    Param: NativeUInt;
    Status: Integer;
    LockUserSession: ByteBool;
    IsPostDevice: ByteBool;
    SurpriseRemoval: ByteBool;
    WaitForQueueReady: ByteBool;
  end;
const VIDEO_WIN32K_CALLBACKS_PARAMS = extern struct {
    CalloutType: i32,
    PhysDisp: ?*anyopaque,
    Param: usize,
    Status: i32,
    LockUserSession: u8,
    IsPostDevice: u8,
    SurpriseRemoval: u8,
    WaitForQueueReady: u8,
};
type
  VIDEO_WIN32K_CALLBACKS_PARAMS {.bycopy.} = object
    CalloutType: int32
    PhysDisp: pointer
    Param: uint
    Status: int32
    LockUserSession: uint8
    IsPostDevice: uint8
    SurpriseRemoval: uint8
    WaitForQueueReady: uint8
struct VIDEO_WIN32K_CALLBACKS_PARAMS
{
    int CalloutType;
    void* PhysDisp;
    size_t Param;
    int Status;
    ubyte LockUserSession;
    ubyte IsPostDevice;
    ubyte SurpriseRemoval;
    ubyte WaitForQueueReady;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; VIDEO_WIN32K_CALLBACKS_PARAMS サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; CalloutType : VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; PhysDisp : void* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Param : UINT_PTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Status : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; LockUserSession : BOOLEAN (+16, 1byte)  poke st,16,値  /  値 = peek(st,16)
; IsPostDevice : BOOLEAN (+17, 1byte)  poke st,17,値  /  値 = peek(st,17)
; SurpriseRemoval : BOOLEAN (+18, 1byte)  poke st,18,値  /  値 = peek(st,18)
; WaitForQueueReady : BOOLEAN (+19, 1byte)  poke st,19,値  /  値 = peek(st,19)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VIDEO_WIN32K_CALLBACKS_PARAMS サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; CalloutType : VIDEO_WIN32K_CALLBACKS_PARAMS_TYPE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; PhysDisp : void* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Param : UINT_PTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Status : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; LockUserSession : BOOLEAN (+28, 1byte)  poke st,28,値  /  値 = peek(st,28)
; IsPostDevice : BOOLEAN (+29, 1byte)  poke st,29,値  /  値 = peek(st,29)
; SurpriseRemoval : BOOLEAN (+30, 1byte)  poke st,30,値  /  値 = peek(st,30)
; WaitForQueueReady : BOOLEAN (+31, 1byte)  poke st,31,値  /  値 = peek(st,31)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VIDEO_WIN32K_CALLBACKS_PARAMS
    #field int CalloutType
    #field intptr PhysDisp
    #field intptr Param
    #field int Status
    #field bool1 LockUserSession
    #field bool1 IsPostDevice
    #field bool1 SurpriseRemoval
    #field bool1 WaitForQueueReady
#endstruct

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