Win32 API 日本語リファレンス
ホームSystem.Ioctl › DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT

DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT

構造体
サイズx64: 36 バイト / x86: 36 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のサイズをバイト単位で示す。
ActionDWORD4+4+4実行されたDSMアクションの種類を示す値。
FlagsDWORD4+8+8操作結果の動作を示すフラグ。
OperationStatusDWORD4+12+12操作全体のステータスコード。成功/失敗等を示す。
ExtendedErrorDWORD4+16+16拡張エラー情報を示すコード。
TargetDetailedErrorDWORD4+20+20ターゲット側の詳細エラー情報を示すコード。
ReservedStatusDWORD4+24+24予約されたステータス領域。
OutputBlockOffsetDWORD4+28+28出力ブロックへの本構造体先頭からのバイトオフセット。
OutputBlockLengthDWORD4+32+32出力ブロックのバイト長。

各言語での定義

#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 Structure
import 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: uint32
struct 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