ホーム › Storage.FileSystem › NTMS_OPREQUESTINFORMATIONW
NTMS_OPREQUESTINFORMATIONW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Request | DWORD | 4 | +0 | +0 | オペレータ要求の種類を示す値。 |
| Submitted | SYSTEMTIME | 16 | +4 | +4 | 要求が送信された日時。SYSTEMTIME。 |
| State | DWORD | 4 | +20 | +20 | オペレータ要求の状態を示す値。 |
| szMessage | WCHAR | 512 | +24 | +24 | オペレータに表示するメッセージ。Unicode。 |
| Arg1Type | DWORD | 4 | +536 | +536 | Arg1の種類を示す値。 |
| Arg1 | GUID | 16 | +540 | +540 | 要求に関連する第1引数を識別するGUID。 |
| Arg2Type | DWORD | 4 | +556 | +556 | Arg2の種類を示す値。 |
| Arg2 | GUID | 16 | +560 | +560 | 要求に関連する第2引数を識別するGUID。 |
| szApplication | WCHAR | 128 | +576 | +576 | 要求元アプリケーション名。Unicode。 |
| szUser | WCHAR | 128 | +704 | +704 | 要求元ユーザー名。Unicode。 |
| szComputer | WCHAR | 128 | +832 | +832 | 要求元コンピュータ名。Unicode。 |
各言語での定義
#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_OPREQUESTINFORMATIONW (x64 960 / x86 960 バイト)
typedef struct NTMS_OPREQUESTINFORMATIONW {
DWORD Request;
SYSTEMTIME Submitted;
DWORD State;
WCHAR szMessage[256];
DWORD Arg1Type;
GUID Arg1;
DWORD Arg2Type;
GUID Arg2;
WCHAR szApplication[64];
WCHAR szUser[64];
WCHAR szComputer[64];
} NTMS_OPREQUESTINFORMATIONW;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_OPREQUESTINFORMATIONW
{
public uint Request;
public SYSTEMTIME Submitted;
public uint State;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string szMessage;
public uint Arg1Type;
public Guid Arg1;
public uint Arg2Type;
public Guid Arg2;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string szApplication;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string szUser;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string 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_OPREQUESTINFORMATIONW
Public Request As UInteger
Public Submitted As SYSTEMTIME
Public State As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public szMessage As String
Public Arg1Type As UInteger
Public Arg1 As Guid
Public Arg2Type As UInteger
Public Arg2 As Guid
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=64)> Public szApplication As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=64)> Public szUser As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=64)> Public szComputer As String
End Structureimport 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_OPREQUESTINFORMATIONW(ctypes.Structure):
_fields_ = [
("Request", wintypes.DWORD),
("Submitted", SYSTEMTIME),
("State", wintypes.DWORD),
("szMessage", ctypes.c_wchar * 256),
("Arg1Type", wintypes.DWORD),
("Arg1", GUID),
("Arg2Type", wintypes.DWORD),
("Arg2", GUID),
("szApplication", ctypes.c_wchar * 64),
("szUser", ctypes.c_wchar * 64),
("szComputer", ctypes.c_wchar * 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_OPREQUESTINFORMATIONW {
pub Request: u32,
pub Submitted: SYSTEMTIME,
pub State: u32,
pub szMessage: [u16; 256],
pub Arg1Type: u32,
pub Arg1: GUID,
pub Arg2Type: u32,
pub Arg2: GUID,
pub szApplication: [u16; 64],
pub szUser: [u16; 64],
pub szComputer: [u16; 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_OPREQUESTINFORMATIONW struct {
Request uint32
Submitted SYSTEMTIME
State uint32
szMessage [256]uint16
Arg1Type uint32
Arg1 windows.GUID
Arg2Type uint32
Arg2 windows.GUID
szApplication [64]uint16
szUser [64]uint16
szComputer [64]uint16
}type
SYSTEMTIME = record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
end;
NTMS_OPREQUESTINFORMATIONW = record
Request: DWORD;
Submitted: SYSTEMTIME;
State: DWORD;
szMessage: array[0..255] of WideChar;
Arg1Type: DWORD;
Arg1: TGUID;
Arg2Type: DWORD;
Arg2: TGUID;
szApplication: array[0..63] of WideChar;
szUser: array[0..63] of WideChar;
szComputer: array[0..63] of WideChar;
end;const SYSTEMTIME = extern struct {
wYear: u16,
wMonth: u16,
wDayOfWeek: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
wMilliseconds: u16,
};
const NTMS_OPREQUESTINFORMATIONW = extern struct {
Request: u32,
Submitted: SYSTEMTIME,
State: u32,
szMessage: [256]u16,
Arg1Type: u32,
Arg1: GUID,
Arg2Type: u32,
Arg2: GUID,
szApplication: [64]u16,
szUser: [64]u16,
szComputer: [64]u16,
};type
SYSTEMTIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDayOfWeek: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
wMilliseconds: uint16
NTMS_OPREQUESTINFORMATIONW {.bycopy.} = object
Request: uint32
Submitted: SYSTEMTIME
State: uint32
szMessage: array[256, uint16]
Arg1Type: uint32
Arg1: GUID
Arg2Type: uint32
Arg2: GUID
szApplication: array[64, uint16]
szUser: array[64, uint16]
szComputer: array[64, uint16]struct SYSTEMTIME
{
ushort wYear;
ushort wMonth;
ushort wDayOfWeek;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
ushort wMilliseconds;
}
struct NTMS_OPREQUESTINFORMATIONW
{
uint Request;
SYSTEMTIME Submitted;
uint State;
wchar[256] szMessage;
uint Arg1Type;
GUID Arg1;
uint Arg2Type;
GUID Arg2;
wchar[64] szApplication;
wchar[64] szUser;
wchar[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_OPREQUESTINFORMATIONW サイズ: 960 バイト(x64)
dim st, 240 ; 4byte整数×240(構造体サイズ 960 / 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 : WCHAR (+24, 512byte) varptr(st)+24 を基点に操作(512byte:入れ子/配列)
; Arg1Type : DWORD (+536, 4byte) st.134 = 値 / 値 = st.134 (lpoke/lpeek も可)
; Arg1 : GUID (+540, 16byte) varptr(st)+540 を基点に操作(16byte:入れ子/配列)
; Arg2Type : DWORD (+556, 4byte) st.139 = 値 / 値 = st.139 (lpoke/lpeek も可)
; Arg2 : GUID (+560, 16byte) varptr(st)+560 を基点に操作(16byte:入れ子/配列)
; szApplication : WCHAR (+576, 128byte) varptr(st)+576 を基点に操作(128byte:入れ子/配列)
; szUser : WCHAR (+704, 128byte) varptr(st)+704 を基点に操作(128byte:入れ子/配列)
; szComputer : WCHAR (+832, 128byte) varptr(st)+832 を基点に操作(128byte:入れ子/配列)
; ※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_OPREQUESTINFORMATIONW
#field int Request
#field SYSTEMTIME Submitted
#field int State
#field wchar szMessage 256
#field int Arg1Type
#field GUID Arg1
#field int Arg2Type
#field GUID Arg2
#field wchar szApplication 64
#field wchar szUser 64
#field wchar szComputer 64
#endstruct
stdim st, NTMS_OPREQUESTINFORMATIONW ; NSTRUCT 変数を確保
st->Request = 100
mes "Request=" + st->Request