NTMS_OPREQUESTINFORMATIONA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Request | DWORD | 4 | +0 | +0 | オペレーター要求の種類です。次のいずれかの値を指定できます。 | ||||||||||||||||||||
| Submitted | SYSTEMTIME | 16 | +4 | +4 | オペレーター要求が送信されたときのシステム時刻です。 | ||||||||||||||||||||
| State | DWORD | 4 | +20 | +20 | オペレーターサービス要求の現在の状態です。次のいずれかの値を指定できます。
| ||||||||||||||||||||
| szMessage | CHAR | 256 | +24 | +24 | オペレーターメッセージのテキストです。 | ||||||||||||||||||||
| Arg1Type | DWORD | 4 | +280 | +280 | Arg1 オブジェクトの種類です。次のいずれかの値を指定できます。
| ||||||||||||||||||||
| Arg1 | GUID | 16 | +284 | +284 | 移動要求や、参照オブジェクトを必要とするその他のオペレーター要求で使用される Arg1 オブジェクトの ID です。このオブジェクトの用途はオペレーター要求の種類によって異なります。Arg1 の適切な使用方法については、Request の説明を参照してください。 | ||||||||||||||||||||
| Arg2Type | DWORD | 4 | +300 | +300 | Arg2 オブジェクトの種類です。次のいずれかの値を指定できます。
| ||||||||||||||||||||
| Arg2 | GUID | 16 | +304 | +304 | 2 つ目の参照オブジェクトを必要とするオペレーター要求で使用される Arg2 オブジェクトの ID です。このオブジェクトの用途はオペレーター要求の種類によって異なります。Arg2 の適切な使用方法については、Request の説明を参照してください。 | ||||||||||||||||||||
| szApplication | CHAR | 64 | +320 | +320 | オペレーター要求を送信したアプリケーションです。 | ||||||||||||||||||||
| szUser | CHAR | 64 | +384 | +384 | オペレーター要求を送信したコンピューターにログオンしている対話ユーザーです。 | ||||||||||||||||||||
| szComputer | CHAR | 64 | +448 | +448 | オペレーター要求を送信したコンピューターです。 |
公式ドキュメント
[リムーバブル記憶域マネージャー は Windows 7 および Windows Server 2008 R2 以降では利用できません。]
NTMS_OPREQUESTINFORMATION 構造体は、RSM のオペレーター要求システム制御に固有のプロパティを定義します。
解説(Remarks)
NTMS_OPREQUESTINFORMATION 構造体は、 NTMS_OBJECTINFORMATION 構造体に含まれます。
ntmsapi.h ヘッダーは、UNICODE プリプロセッサ定数の定義に基づいてこの関数の ANSI 版または Unicode 版を自動的に選択するエイリアスとして、NTMS_OPREQUESTINFORMATION を定義します。エンコーディング中立のエイリアスと、エンコーディング中立でないコードを混在させると、不一致が生じてコンパイルエラーや実行時エラーの原因となる場合があります。詳細については、関数プロトタイプの規則 を参照してください。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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