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

NTMS_I1_OPREQUESTINFORMATIONA

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

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

フィールド

フィールドサイズx64x86説明
RequestDWORD4+0+0オペレータ要求の種類を示す値。
SubmittedSYSTEMTIME16+4+4要求が送信された日時。SYSTEMTIME。
StateDWORD4+20+20オペレータ要求の状態を示す値。
szMessageCHAR127+24+24オペレータに表示するメッセージ。ANSI。
Arg1TypeDWORD4+152+152Arg1の種類を示す値。
Arg1GUID16+156+156要求に関連する第1引数を識別するGUID。
Arg2TypeDWORD4+172+172Arg2の種類を示す値。
Arg2GUID16+176+176要求に関連する第2引数を識別するGUID。
szApplicationCHAR64+192+192要求元アプリケーション名。ANSI。
szUserCHAR64+256+256要求元ユーザー名。ANSI。
szComputerCHAR64+320+320要求元コンピュータ名。ANSI。

各言語での定義

#include <windows.h>

// SYSTEMTIME  (x64 16 / x86 16 バイト)
typedef struct SYSTEMTIME {
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
} SYSTEMTIME;

// NTMS_I1_OPREQUESTINFORMATIONA  (x64 384 / x86 384 バイト)
typedef struct NTMS_I1_OPREQUESTINFORMATIONA {
    DWORD Request;
    SYSTEMTIME Submitted;
    DWORD State;
    CHAR szMessage[127];
    DWORD Arg1Type;
    GUID Arg1;
    DWORD Arg2Type;
    GUID Arg2;
    CHAR szApplication[64];
    CHAR szUser[64];
    CHAR szComputer[64];
} NTMS_I1_OPREQUESTINFORMATIONA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYSTEMTIME
{
    public ushort wYear;
    public ushort wMonth;
    public ushort wDayOfWeek;
    public ushort wDay;
    public ushort wHour;
    public ushort wMinute;
    public ushort wSecond;
    public ushort wMilliseconds;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NTMS_I1_OPREQUESTINFORMATIONA
{
    public uint Request;
    public SYSTEMTIME Submitted;
    public uint State;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 127)] public sbyte[] szMessage;
    public uint Arg1Type;
    public Guid Arg1;
    public uint Arg2Type;
    public Guid Arg2;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] szApplication;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] szUser;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] szComputer;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYSTEMTIME
    Public wYear As UShort
    Public wMonth As UShort
    Public wDayOfWeek As UShort
    Public wDay As UShort
    Public wHour As UShort
    Public wMinute As UShort
    Public wSecond As UShort
    Public wMilliseconds As UShort
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NTMS_I1_OPREQUESTINFORMATIONA
    Public Request As UInteger
    Public Submitted As SYSTEMTIME
    Public State As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=127)> Public szMessage() As SByte
    Public Arg1Type As UInteger
    Public Arg1 As Guid
    Public Arg2Type As UInteger
    Public Arg2 As Guid
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public szApplication() As SByte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public szUser() As SByte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=64)> Public szComputer() As SByte
End Structure
import ctypes
from ctypes import wintypes

class SYSTEMTIME(ctypes.Structure):
    _fields_ = [
        ("wYear", ctypes.c_ushort),
        ("wMonth", ctypes.c_ushort),
        ("wDayOfWeek", ctypes.c_ushort),
        ("wDay", ctypes.c_ushort),
        ("wHour", ctypes.c_ushort),
        ("wMinute", ctypes.c_ushort),
        ("wSecond", ctypes.c_ushort),
        ("wMilliseconds", ctypes.c_ushort),
    ]

class NTMS_I1_OPREQUESTINFORMATIONA(ctypes.Structure):
    _fields_ = [
        ("Request", wintypes.DWORD),
        ("Submitted", SYSTEMTIME),
        ("State", wintypes.DWORD),
        ("szMessage", ctypes.c_byte * 127),
        ("Arg1Type", wintypes.DWORD),
        ("Arg1", GUID),
        ("Arg2Type", wintypes.DWORD),
        ("Arg2", GUID),
        ("szApplication", ctypes.c_byte * 64),
        ("szUser", ctypes.c_byte * 64),
        ("szComputer", ctypes.c_byte * 64),
    ]
#[repr(C)]
pub struct SYSTEMTIME {
    pub wYear: u16,
    pub wMonth: u16,
    pub wDayOfWeek: u16,
    pub wDay: u16,
    pub wHour: u16,
    pub wMinute: u16,
    pub wSecond: u16,
    pub wMilliseconds: u16,
}

#[repr(C)]
pub struct NTMS_I1_OPREQUESTINFORMATIONA {
    pub Request: u32,
    pub Submitted: SYSTEMTIME,
    pub State: u32,
    pub szMessage: [i8; 127],
    pub Arg1Type: u32,
    pub Arg1: GUID,
    pub Arg2Type: u32,
    pub Arg2: GUID,
    pub szApplication: [i8; 64],
    pub szUser: [i8; 64],
    pub szComputer: [i8; 64],
}
import "golang.org/x/sys/windows"

type SYSTEMTIME struct {
	wYear uint16
	wMonth uint16
	wDayOfWeek uint16
	wDay uint16
	wHour uint16
	wMinute uint16
	wSecond uint16
	wMilliseconds uint16
}

type NTMS_I1_OPREQUESTINFORMATIONA struct {
	Request uint32
	Submitted SYSTEMTIME
	State uint32
	szMessage [127]int8
	Arg1Type uint32
	Arg1 windows.GUID
	Arg2Type uint32
	Arg2 windows.GUID
	szApplication [64]int8
	szUser [64]int8
	szComputer [64]int8
}
type
  SYSTEMTIME = record
    wYear: Word;
    wMonth: Word;
    wDayOfWeek: Word;
    wDay: Word;
    wHour: Word;
    wMinute: Word;
    wSecond: Word;
    wMilliseconds: Word;
  end;

  NTMS_I1_OPREQUESTINFORMATIONA = record
    Request: DWORD;
    Submitted: SYSTEMTIME;
    State: DWORD;
    szMessage: array[0..126] of Shortint;
    Arg1Type: DWORD;
    Arg1: TGUID;
    Arg2Type: DWORD;
    Arg2: TGUID;
    szApplication: array[0..63] of Shortint;
    szUser: array[0..63] of Shortint;
    szComputer: array[0..63] of Shortint;
  end;
const SYSTEMTIME = extern struct {
    wYear: u16,
    wMonth: u16,
    wDayOfWeek: u16,
    wDay: u16,
    wHour: u16,
    wMinute: u16,
    wSecond: u16,
    wMilliseconds: u16,
};

const NTMS_I1_OPREQUESTINFORMATIONA = extern struct {
    Request: u32,
    Submitted: SYSTEMTIME,
    State: u32,
    szMessage: [127]i8,
    Arg1Type: u32,
    Arg1: GUID,
    Arg2Type: u32,
    Arg2: GUID,
    szApplication: [64]i8,
    szUser: [64]i8,
    szComputer: [64]i8,
};
type
  SYSTEMTIME {.bycopy.} = object
    wYear: uint16
    wMonth: uint16
    wDayOfWeek: uint16
    wDay: uint16
    wHour: uint16
    wMinute: uint16
    wSecond: uint16
    wMilliseconds: uint16

  NTMS_I1_OPREQUESTINFORMATIONA {.bycopy.} = object
    Request: uint32
    Submitted: SYSTEMTIME
    State: uint32
    szMessage: array[127, int8]
    Arg1Type: uint32
    Arg1: GUID
    Arg2Type: uint32
    Arg2: GUID
    szApplication: array[64, int8]
    szUser: array[64, int8]
    szComputer: array[64, int8]
struct SYSTEMTIME
{
    ushort wYear;
    ushort wMonth;
    ushort wDayOfWeek;
    ushort wDay;
    ushort wHour;
    ushort wMinute;
    ushort wSecond;
    ushort wMilliseconds;
}

struct NTMS_I1_OPREQUESTINFORMATIONA
{
    uint Request;
    SYSTEMTIME Submitted;
    uint State;
    byte[127] szMessage;
    uint Arg1Type;
    GUID Arg1;
    uint Arg2Type;
    GUID Arg2;
    byte[64] szApplication;
    byte[64] szUser;
    byte[64] szComputer;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NTMS_I1_OPREQUESTINFORMATIONA サイズ: 384 バイト(x64)
dim st, 96    ; 4byte整数×96(構造体サイズ 384 / 4 切り上げ)
; Request : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Submitted : SYSTEMTIME (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; State : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; szMessage : CHAR (+24, 127byte)  varptr(st)+24 を基点に操作(127byte:入れ子/配列)
; Arg1Type : DWORD (+152, 4byte)  st.38 = 値  /  値 = st.38   (lpoke/lpeek も可)
; Arg1 : GUID (+156, 16byte)  varptr(st)+156 を基点に操作(16byte:入れ子/配列)
; Arg2Type : DWORD (+172, 4byte)  st.43 = 値  /  値 = st.43   (lpoke/lpeek も可)
; Arg2 : GUID (+176, 16byte)  varptr(st)+176 を基点に操作(16byte:入れ子/配列)
; szApplication : CHAR (+192, 64byte)  varptr(st)+192 を基点に操作(64byte:入れ子/配列)
; szUser : CHAR (+256, 64byte)  varptr(st)+256 を基点に操作(64byte:入れ子/配列)
; szComputer : CHAR (+320, 64byte)  varptr(st)+320 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SYSTEMTIME
    #field short wYear
    #field short wMonth
    #field short wDayOfWeek
    #field short wDay
    #field short wHour
    #field short wMinute
    #field short wSecond
    #field short wMilliseconds
#endstruct

#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global NTMS_I1_OPREQUESTINFORMATIONA
    #field int Request
    #field SYSTEMTIME Submitted
    #field int State
    #field byte szMessage 127
    #field int Arg1Type
    #field GUID Arg1
    #field int Arg2Type
    #field GUID Arg2
    #field byte szApplication 64
    #field byte szUser 64
    #field byte szComputer 64
#endstruct

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