ホーム › System.Ioctl › DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | 構造体のサイズです。
sizeof(DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT) が設定されます。 | ||||||||||||||||||
| Action | DWORD | 4 | +4 | +4 | この構造体のインスタンスに関連するアクションです。これは DEVICE_DATA_MANAGEMENT_SET_ACTION データ型 の値です。
| ||||||||||||||||||
| Flags | DWORD | 4 | +8 | +8 | 使用されません。 | ||||||||||||||||||
| OperationStatus | DWORD | 4 | +12 | +12 | 使用されません。 | ||||||||||||||||||
| ExtendedError | DWORD | 4 | +16 | +16 | 拡張エラー情報です。 | ||||||||||||||||||
| TargetDetailedError | DWORD | 4 | +20 | +20 | ターゲット固有のエラーです。 | ||||||||||||||||||
| ReservedStatus | DWORD | 4 | +24 | +24 | 予約済みです。 | ||||||||||||||||||
| OutputBlockOffset | DWORD | 4 | +28 | +28 | この構造体の先頭から、アクション固有のデータが配置されている位置までのオフセット (バイト単位) です。 | ||||||||||||||||||
| OutputBlockLength | DWORD | 4 | +32 | +32 | アクション固有のデータの長さ (バイト単位) です。 |
公式ドキュメント
<a href="/windows/desktop/api/winioctl/ni-winioctl-ioctl_storage_manage_data_set_attributes">IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES</a>
制御コードの出力構造体です。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT (x64 36 / x86 36 バイト)
typedef struct DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT {
DWORD Size;
DWORD Action;
DWORD Flags;
DWORD OperationStatus;
DWORD ExtendedError;
DWORD TargetDetailedError;
DWORD ReservedStatus;
DWORD OutputBlockOffset;
DWORD OutputBlockLength;
} DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
{
public uint Size;
public uint Action;
public uint Flags;
public uint OperationStatus;
public uint ExtendedError;
public uint TargetDetailedError;
public uint ReservedStatus;
public uint OutputBlockOffset;
public uint OutputBlockLength;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
Public Size As UInteger
Public Action As UInteger
Public Flags As UInteger
Public OperationStatus As UInteger
Public ExtendedError As UInteger
Public TargetDetailedError As UInteger
Public ReservedStatus As UInteger
Public OutputBlockOffset As UInteger
Public OutputBlockLength As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Action", wintypes.DWORD),
("Flags", wintypes.DWORD),
("OperationStatus", wintypes.DWORD),
("ExtendedError", wintypes.DWORD),
("TargetDetailedError", wintypes.DWORD),
("ReservedStatus", wintypes.DWORD),
("OutputBlockOffset", wintypes.DWORD),
("OutputBlockLength", wintypes.DWORD),
]#[repr(C)]
pub struct DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT {
pub Size: u32,
pub Action: u32,
pub Flags: u32,
pub OperationStatus: u32,
pub ExtendedError: u32,
pub TargetDetailedError: u32,
pub ReservedStatus: u32,
pub OutputBlockOffset: u32,
pub OutputBlockLength: u32,
}import "golang.org/x/sys/windows"
type DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT struct {
Size uint32
Action uint32
Flags uint32
OperationStatus uint32
ExtendedError uint32
TargetDetailedError uint32
ReservedStatus uint32
OutputBlockOffset uint32
OutputBlockLength uint32
}type
DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT = record
Size: DWORD;
Action: DWORD;
Flags: DWORD;
OperationStatus: DWORD;
ExtendedError: DWORD;
TargetDetailedError: DWORD;
ReservedStatus: DWORD;
OutputBlockOffset: DWORD;
OutputBlockLength: DWORD;
end;const DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT = extern struct {
Size: u32,
Action: u32,
Flags: u32,
OperationStatus: u32,
ExtendedError: u32,
TargetDetailedError: u32,
ReservedStatus: u32,
OutputBlockOffset: u32,
OutputBlockLength: u32,
};type
DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT {.bycopy.} = object
Size: uint32
Action: uint32
Flags: uint32
OperationStatus: uint32
ExtendedError: uint32
TargetDetailedError: uint32
ReservedStatus: uint32
OutputBlockOffset: uint32
OutputBlockLength: uint32struct DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
{
uint Size;
uint Action;
uint Flags;
uint OperationStatus;
uint ExtendedError;
uint TargetDetailedError;
uint ReservedStatus;
uint OutputBlockOffset;
uint OutputBlockLength;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Action : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Flags : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; OperationStatus : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ExtendedError : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; TargetDetailedError : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ReservedStatus : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; OutputBlockOffset : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; OutputBlockLength : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT
#field int Size
#field int Action
#field int Flags
#field int OperationStatus
#field int ExtendedError
#field int TargetDetailedError
#field int ReservedStatus
#field int OutputBlockOffset
#field int OutputBlockLength
#endstruct
stdim st, DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size