Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › OPM_REQUESTED_INFORMATION

OPM_REQUESTED_INFORMATION

構造体
サイズx64: 4096 バイト / x86: 4096 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
omacOPM_OMAC16+0+0返却情報の完全性を検証するOMAC署名(OPM_OMAC)。
cbRequestedInformationSizeDWORD4+16+16abRequestedInformation内の有効データのバイトサイズ。
abRequestedInformationBYTE4076+20+20要求された情報の本体を格納するバイト配列。

各言語での定義

#include <windows.h>

// OPM_OMAC  (x64 16 / x86 16 バイト)
typedef struct OPM_OMAC {
    BYTE abOMAC[16];
} OPM_OMAC;

// OPM_REQUESTED_INFORMATION  (x64 4096 / x86 4096 バイト)
#pragma pack(push, 1)
typedef struct OPM_REQUESTED_INFORMATION {
    OPM_OMAC omac;
    DWORD cbRequestedInformationSize;
    BYTE abRequestedInformation[4076];
} OPM_REQUESTED_INFORMATION;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPM_OMAC
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] abOMAC;
}

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct OPM_REQUESTED_INFORMATION
{
    public OPM_OMAC omac;
    public uint cbRequestedInformationSize;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4076)] public byte[] abRequestedInformation;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OPM_OMAC
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public abOMAC() As Byte
End Structure

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure OPM_REQUESTED_INFORMATION
    Public omac As OPM_OMAC
    Public cbRequestedInformationSize As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=4076)> Public abRequestedInformation() As Byte
End Structure
import ctypes
from ctypes import wintypes

class OPM_OMAC(ctypes.Structure):
    _fields_ = [
        ("abOMAC", ctypes.c_ubyte * 16),
    ]

class OPM_REQUESTED_INFORMATION(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("omac", OPM_OMAC),
        ("cbRequestedInformationSize", wintypes.DWORD),
        ("abRequestedInformation", ctypes.c_ubyte * 4076),
    ]
#[repr(C)]
pub struct OPM_OMAC {
    pub abOMAC: [u8; 16],
}

#[repr(C, packed(1))]
pub struct OPM_REQUESTED_INFORMATION {
    pub omac: OPM_OMAC,
    pub cbRequestedInformationSize: u32,
    pub abRequestedInformation: [u8; 4076],
}
import "golang.org/x/sys/windows"

type OPM_OMAC struct {
	abOMAC [16]byte
}

type OPM_REQUESTED_INFORMATION struct {
	omac OPM_OMAC
	cbRequestedInformationSize uint32
	abRequestedInformation [4076]byte
}
type
  OPM_OMAC = record
    abOMAC: array[0..15] of Byte;
  end;

  OPM_REQUESTED_INFORMATION = packed record
    omac: OPM_OMAC;
    cbRequestedInformationSize: DWORD;
    abRequestedInformation: array[0..4075] of Byte;
  end;
const OPM_OMAC = extern struct {
    abOMAC: [16]u8,
};

const OPM_REQUESTED_INFORMATION = extern struct {
    omac: OPM_OMAC,
    cbRequestedInformationSize: u32,
    abRequestedInformation: [4076]u8,
};
type
  OPM_OMAC {.bycopy.} = object
    abOMAC: array[16, uint8]

  OPM_REQUESTED_INFORMATION {.packed.} = object
    omac: OPM_OMAC
    cbRequestedInformationSize: uint32
    abRequestedInformation: array[4076, uint8]
struct OPM_OMAC
{
    ubyte[16] abOMAC;
}

align(1)
struct OPM_REQUESTED_INFORMATION
{
    OPM_OMAC omac;
    uint cbRequestedInformationSize;
    ubyte[4076] abRequestedInformation;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OPM_REQUESTED_INFORMATION サイズ: 4096 バイト(x64)
dim st, 1024    ; 4byte整数×1024(構造体サイズ 4096 / 4 切り上げ)
; omac : OPM_OMAC (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; cbRequestedInformationSize : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; abRequestedInformation : BYTE (+20, 4076byte)  varptr(st)+20 を基点に操作(4076byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global OPM_OMAC
    #field byte abOMAC 16
#endstruct

#defstruct global OPM_REQUESTED_INFORMATION, pack=1
    #field OPM_OMAC omac
    #field int cbRequestedInformationSize
    #field byte abRequestedInformation 4076
#endstruct

stdim st, OPM_REQUESTED_INFORMATION        ; NSTRUCT 変数を確保
st->cbRequestedInformationSize = 100
mes "cbRequestedInformationSize=" + st->cbRequestedInformationSize