ホーム › Storage.FileSystem › NTMS_OPREQUESTINFORMATIONA
NTMS_OPREQUESTINFORMATIONA
構造体サイズ=各フィールドのバイト数(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 | CHAR | 256 | +24 | +24 | オペレータに表示するメッセージ。ANSI。 |
| Arg1Type | DWORD | 4 | +280 | +280 | Arg1の種類を示す値。 |
| Arg1 | GUID | 16 | +284 | +284 | 要求に関連する第1引数を識別するGUID。 |
| Arg2Type | DWORD | 4 | +300 | +300 | Arg2の種類を示す値。 |
| Arg2 | GUID | 16 | +304 | +304 | 要求に関連する第2引数を識別するGUID。 |
| szApplication | CHAR | 64 | +320 | +320 | 要求元アプリケーション名。ANSI。 |
| szUser | CHAR | 64 | +384 | +384 | 要求元ユーザー名。ANSI。 |
| szComputer | CHAR | 64 | +448 | +448 | 要求元コンピュータ名。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_OPREQUESTINFORMATIONA (x64 512 / x86 512 バイト)
typedef struct NTMS_OPREQUESTINFORMATIONA {
DWORD Request;
SYSTEMTIME Submitted;
DWORD State;
CHAR szMessage[256];
DWORD Arg1Type;
GUID Arg1;
DWORD Arg2Type;
GUID Arg2;
CHAR szApplication[64];
CHAR szUser[64];
CHAR szComputer[64];
} NTMS_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_OPREQUESTINFORMATIONA
{
public uint Request;
public SYSTEMTIME Submitted;
public uint State;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] 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_OPREQUESTINFORMATIONA
Public Request As UInteger
Public Submitted As SYSTEMTIME
Public State As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> 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 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_OPREQUESTINFORMATIONA(ctypes.Structure):
_fields_ = [
("Request", wintypes.DWORD),
("Submitted", SYSTEMTIME),
("State", wintypes.DWORD),
("szMessage", ctypes.c_byte * 256),
("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_OPREQUESTINFORMATIONA {
pub Request: u32,
pub Submitted: SYSTEMTIME,
pub State: u32,
pub szMessage: [i8; 256],
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_OPREQUESTINFORMATIONA struct {
Request uint32
Submitted SYSTEMTIME
State uint32
szMessage [256]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_OPREQUESTINFORMATIONA = record
Request: DWORD;
Submitted: SYSTEMTIME;
State: DWORD;
szMessage: array[0..255] 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_OPREQUESTINFORMATIONA = extern struct {
Request: u32,
Submitted: SYSTEMTIME,
State: u32,
szMessage: [256]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_OPREQUESTINFORMATIONA {.bycopy.} = object
Request: uint32
Submitted: SYSTEMTIME
State: uint32
szMessage: array[256, 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_OPREQUESTINFORMATIONA
{
uint Request;
SYSTEMTIME Submitted;
uint State;
byte[256] 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_OPREQUESTINFORMATIONA サイズ: 512 バイト(x64)
dim st, 128 ; 4byte整数×128(構造体サイズ 512 / 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, 256byte) varptr(st)+24 を基点に操作(256byte:入れ子/配列)
; Arg1Type : DWORD (+280, 4byte) st.70 = 値 / 値 = st.70 (lpoke/lpeek も可)
; Arg1 : GUID (+284, 16byte) varptr(st)+284 を基点に操作(16byte:入れ子/配列)
; Arg2Type : DWORD (+300, 4byte) st.75 = 値 / 値 = st.75 (lpoke/lpeek も可)
; Arg2 : GUID (+304, 16byte) varptr(st)+304 を基点に操作(16byte:入れ子/配列)
; szApplication : CHAR (+320, 64byte) varptr(st)+320 を基点に操作(64byte:入れ子/配列)
; szUser : CHAR (+384, 64byte) varptr(st)+384 を基点に操作(64byte:入れ子/配列)
; szComputer : CHAR (+448, 64byte) varptr(st)+448 を基点に操作(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_OPREQUESTINFORMATIONA
#field int Request
#field SYSTEMTIME Submitted
#field int State
#field byte szMessage 256
#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_OPREQUESTINFORMATIONA ; NSTRUCT 変数を確保
st->Request = 100
mes "Request=" + st->Request