ホーム › Storage.FileSystem › NTMS_LIBREQUESTINFORMATIONA
NTMS_LIBREQUESTINFORMATIONA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| OperationCode | DWORD | 4 | +0 | +0 | 要求された操作のコード。マウント/ディスマウント等。 |
| OperationOption | DWORD | 4 | +4 | +4 | 操作に付随するオプションを示す値。 |
| State | DWORD | 4 | +8 | +8 | ライブラリ要求の状態を示す値。 |
| PartitionId | GUID | 16 | +12 | +12 | 対象パーティションを識別するGUID。 |
| DriveId | GUID | 16 | +28 | +28 | 対象ドライブを識別するGUID。 |
| PhysMediaId | GUID | 16 | +44 | +44 | 対象物理メディアを識別するGUID。 |
| Library | GUID | 16 | +60 | +60 | 対象ライブラリを識別するGUID。 |
| SlotId | GUID | 16 | +76 | +76 | 対象スロットを識別するGUID。 |
| TimeQueued | SYSTEMTIME | 16 | +92 | +92 | 要求がキューに入った日時。SYSTEMTIME。 |
| TimeCompleted | SYSTEMTIME | 16 | +108 | +108 | 要求が完了した日時。SYSTEMTIME。 |
| szApplication | CHAR | 64 | +124 | +124 | 要求元アプリケーション名。ANSI。 |
| szUser | CHAR | 64 | +188 | +188 | 要求元ユーザー名。ANSI。 |
| szComputer | CHAR | 64 | +252 | +252 | 要求元コンピュータ名。ANSI。 |
| dwErrorCode | DWORD | 4 | +316 | +316 | 要求のエラーコード。 |
| WorkItemId | GUID | 16 | +320 | +320 | 作業項目を識別するGUID。 |
| dwPriority | DWORD | 4 | +336 | +336 | 要求の優先度。 |
各言語での定義
#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_LIBREQUESTINFORMATIONA (x64 340 / x86 340 バイト)
typedef struct NTMS_LIBREQUESTINFORMATIONA {
DWORD OperationCode;
DWORD OperationOption;
DWORD State;
GUID PartitionId;
GUID DriveId;
GUID PhysMediaId;
GUID Library;
GUID SlotId;
SYSTEMTIME TimeQueued;
SYSTEMTIME TimeCompleted;
CHAR szApplication[64];
CHAR szUser[64];
CHAR szComputer[64];
DWORD dwErrorCode;
GUID WorkItemId;
DWORD dwPriority;
} NTMS_LIBREQUESTINFORMATIONA;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_LIBREQUESTINFORMATIONA
{
public uint OperationCode;
public uint OperationOption;
public uint State;
public Guid PartitionId;
public Guid DriveId;
public Guid PhysMediaId;
public Guid Library;
public Guid SlotId;
public SYSTEMTIME TimeQueued;
public SYSTEMTIME TimeCompleted;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] szApplication;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] szUser;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public sbyte[] szComputer;
public uint dwErrorCode;
public Guid WorkItemId;
public uint dwPriority;
}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_LIBREQUESTINFORMATIONA
Public OperationCode As UInteger
Public OperationOption As UInteger
Public State As UInteger
Public PartitionId As Guid
Public DriveId As Guid
Public PhysMediaId As Guid
Public Library As Guid
Public SlotId As Guid
Public TimeQueued As SYSTEMTIME
Public TimeCompleted As SYSTEMTIME
<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
Public dwErrorCode As UInteger
Public WorkItemId As Guid
Public dwPriority As UInteger
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_LIBREQUESTINFORMATIONA(ctypes.Structure):
_fields_ = [
("OperationCode", wintypes.DWORD),
("OperationOption", wintypes.DWORD),
("State", wintypes.DWORD),
("PartitionId", GUID),
("DriveId", GUID),
("PhysMediaId", GUID),
("Library", GUID),
("SlotId", GUID),
("TimeQueued", SYSTEMTIME),
("TimeCompleted", SYSTEMTIME),
("szApplication", ctypes.c_byte * 64),
("szUser", ctypes.c_byte * 64),
("szComputer", ctypes.c_byte * 64),
("dwErrorCode", wintypes.DWORD),
("WorkItemId", GUID),
("dwPriority", wintypes.DWORD),
]#[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_LIBREQUESTINFORMATIONA {
pub OperationCode: u32,
pub OperationOption: u32,
pub State: u32,
pub PartitionId: GUID,
pub DriveId: GUID,
pub PhysMediaId: GUID,
pub Library: GUID,
pub SlotId: GUID,
pub TimeQueued: SYSTEMTIME,
pub TimeCompleted: SYSTEMTIME,
pub szApplication: [i8; 64],
pub szUser: [i8; 64],
pub szComputer: [i8; 64],
pub dwErrorCode: u32,
pub WorkItemId: GUID,
pub dwPriority: u32,
}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_LIBREQUESTINFORMATIONA struct {
OperationCode uint32
OperationOption uint32
State uint32
PartitionId windows.GUID
DriveId windows.GUID
PhysMediaId windows.GUID
Library windows.GUID
SlotId windows.GUID
TimeQueued SYSTEMTIME
TimeCompleted SYSTEMTIME
szApplication [64]int8
szUser [64]int8
szComputer [64]int8
dwErrorCode uint32
WorkItemId windows.GUID
dwPriority uint32
}type
SYSTEMTIME = record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
end;
NTMS_LIBREQUESTINFORMATIONA = record
OperationCode: DWORD;
OperationOption: DWORD;
State: DWORD;
PartitionId: TGUID;
DriveId: TGUID;
PhysMediaId: TGUID;
Library: TGUID;
SlotId: TGUID;
TimeQueued: SYSTEMTIME;
TimeCompleted: SYSTEMTIME;
szApplication: array[0..63] of Shortint;
szUser: array[0..63] of Shortint;
szComputer: array[0..63] of Shortint;
dwErrorCode: DWORD;
WorkItemId: TGUID;
dwPriority: DWORD;
end;const SYSTEMTIME = extern struct {
wYear: u16,
wMonth: u16,
wDayOfWeek: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
wMilliseconds: u16,
};
const NTMS_LIBREQUESTINFORMATIONA = extern struct {
OperationCode: u32,
OperationOption: u32,
State: u32,
PartitionId: GUID,
DriveId: GUID,
PhysMediaId: GUID,
Library: GUID,
SlotId: GUID,
TimeQueued: SYSTEMTIME,
TimeCompleted: SYSTEMTIME,
szApplication: [64]i8,
szUser: [64]i8,
szComputer: [64]i8,
dwErrorCode: u32,
WorkItemId: GUID,
dwPriority: u32,
};type
SYSTEMTIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDayOfWeek: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
wMilliseconds: uint16
NTMS_LIBREQUESTINFORMATIONA {.bycopy.} = object
OperationCode: uint32
OperationOption: uint32
State: uint32
PartitionId: GUID
DriveId: GUID
PhysMediaId: GUID
Library: GUID
SlotId: GUID
TimeQueued: SYSTEMTIME
TimeCompleted: SYSTEMTIME
szApplication: array[64, int8]
szUser: array[64, int8]
szComputer: array[64, int8]
dwErrorCode: uint32
WorkItemId: GUID
dwPriority: uint32struct SYSTEMTIME
{
ushort wYear;
ushort wMonth;
ushort wDayOfWeek;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
ushort wMilliseconds;
}
struct NTMS_LIBREQUESTINFORMATIONA
{
uint OperationCode;
uint OperationOption;
uint State;
GUID PartitionId;
GUID DriveId;
GUID PhysMediaId;
GUID Library;
GUID SlotId;
SYSTEMTIME TimeQueued;
SYSTEMTIME TimeCompleted;
byte[64] szApplication;
byte[64] szUser;
byte[64] szComputer;
uint dwErrorCode;
GUID WorkItemId;
uint dwPriority;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NTMS_LIBREQUESTINFORMATIONA サイズ: 340 バイト(x64)
dim st, 85 ; 4byte整数×85(構造体サイズ 340 / 4 切り上げ)
; OperationCode : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; OperationOption : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; State : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; PartitionId : GUID (+12, 16byte) varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; DriveId : GUID (+28, 16byte) varptr(st)+28 を基点に操作(16byte:入れ子/配列)
; PhysMediaId : GUID (+44, 16byte) varptr(st)+44 を基点に操作(16byte:入れ子/配列)
; Library : GUID (+60, 16byte) varptr(st)+60 を基点に操作(16byte:入れ子/配列)
; SlotId : GUID (+76, 16byte) varptr(st)+76 を基点に操作(16byte:入れ子/配列)
; TimeQueued : SYSTEMTIME (+92, 16byte) varptr(st)+92 を基点に操作(16byte:入れ子/配列)
; TimeCompleted : SYSTEMTIME (+108, 16byte) varptr(st)+108 を基点に操作(16byte:入れ子/配列)
; szApplication : CHAR (+124, 64byte) varptr(st)+124 を基点に操作(64byte:入れ子/配列)
; szUser : CHAR (+188, 64byte) varptr(st)+188 を基点に操作(64byte:入れ子/配列)
; szComputer : CHAR (+252, 64byte) varptr(st)+252 を基点に操作(64byte:入れ子/配列)
; dwErrorCode : DWORD (+316, 4byte) st.79 = 値 / 値 = st.79 (lpoke/lpeek も可)
; WorkItemId : GUID (+320, 16byte) varptr(st)+320 を基点に操作(16byte:入れ子/配列)
; dwPriority : DWORD (+336, 4byte) st.84 = 値 / 値 = st.84 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#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 NTMS_LIBREQUESTINFORMATIONA
#field int OperationCode
#field int OperationOption
#field int State
#field GUID PartitionId
#field GUID DriveId
#field GUID PhysMediaId
#field GUID Library
#field GUID SlotId
#field SYSTEMTIME TimeQueued
#field SYSTEMTIME TimeCompleted
#field byte szApplication 64
#field byte szUser 64
#field byte szComputer 64
#field int dwErrorCode
#field GUID WorkItemId
#field int dwPriority
#endstruct
stdim st, NTMS_LIBREQUESTINFORMATIONA ; NSTRUCT 変数を確保
st->OperationCode = 100
mes "OperationCode=" + st->OperationCode