ホーム › Media.MediaFoundation › OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS
OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| rnRandomNumber | OPM_RANDOM_NUMBER | 16 | +0 | +0 | リプレイ防止用の乱数(OPM_RANDOM_NUMBER)。 |
| guidInformation | GUID | 16 | +16 | +16 | 取得する情報の種別を識別するGUID。 |
| ulSequenceNumber | DWORD | 4 | +32 | +32 | リクエストのシーケンス番号。 |
| cbParametersSize | DWORD | 4 | +36 | +36 | abParameters内の有効パラメータのバイトサイズ。 |
| abParameters | BYTE | 4056 | +40 | +40 | COPP互換情報要求に付随する追加パラメータを格納するバイト配列。 |
各言語での定義
#include <windows.h>
// OPM_RANDOM_NUMBER (x64 16 / x86 16 バイト)
typedef struct OPM_RANDOM_NUMBER {
BYTE abRandomNumber[16];
} OPM_RANDOM_NUMBER;
// OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS (x64 4096 / x86 4096 バイト)
#pragma pack(push, 1)
typedef struct OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS {
OPM_RANDOM_NUMBER rnRandomNumber;
GUID guidInformation;
DWORD ulSequenceNumber;
DWORD cbParametersSize;
BYTE abParameters[4056];
} OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPM_RANDOM_NUMBER
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] abRandomNumber;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS
{
public OPM_RANDOM_NUMBER rnRandomNumber;
public Guid guidInformation;
public uint ulSequenceNumber;
public uint cbParametersSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4056)] public byte[] abParameters;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OPM_RANDOM_NUMBER
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public abRandomNumber() As Byte
End Structure
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS
Public rnRandomNumber As OPM_RANDOM_NUMBER
Public guidInformation As Guid
Public ulSequenceNumber As UInteger
Public cbParametersSize As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4056)> Public abParameters() As Byte
End Structureimport ctypes
from ctypes import wintypes
class OPM_RANDOM_NUMBER(ctypes.Structure):
_fields_ = [
("abRandomNumber", ctypes.c_ubyte * 16),
]
class OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS(ctypes.Structure):
_pack_ = 1
_fields_ = [
("rnRandomNumber", OPM_RANDOM_NUMBER),
("guidInformation", GUID),
("ulSequenceNumber", wintypes.DWORD),
("cbParametersSize", wintypes.DWORD),
("abParameters", ctypes.c_ubyte * 4056),
]#[repr(C)]
pub struct OPM_RANDOM_NUMBER {
pub abRandomNumber: [u8; 16],
}
#[repr(C, packed(1))]
pub struct OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS {
pub rnRandomNumber: OPM_RANDOM_NUMBER,
pub guidInformation: GUID,
pub ulSequenceNumber: u32,
pub cbParametersSize: u32,
pub abParameters: [u8; 4056],
}import "golang.org/x/sys/windows"
type OPM_RANDOM_NUMBER struct {
abRandomNumber [16]byte
}
type OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS struct {
rnRandomNumber OPM_RANDOM_NUMBER
guidInformation windows.GUID
ulSequenceNumber uint32
cbParametersSize uint32
abParameters [4056]byte
}type
OPM_RANDOM_NUMBER = record
abRandomNumber: array[0..15] of Byte;
end;
OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS = packed record
rnRandomNumber: OPM_RANDOM_NUMBER;
guidInformation: TGUID;
ulSequenceNumber: DWORD;
cbParametersSize: DWORD;
abParameters: array[0..4055] of Byte;
end;const OPM_RANDOM_NUMBER = extern struct {
abRandomNumber: [16]u8,
};
const OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS = extern struct {
rnRandomNumber: OPM_RANDOM_NUMBER,
guidInformation: GUID,
ulSequenceNumber: u32,
cbParametersSize: u32,
abParameters: [4056]u8,
};type
OPM_RANDOM_NUMBER {.bycopy.} = object
abRandomNumber: array[16, uint8]
OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS {.packed.} = object
rnRandomNumber: OPM_RANDOM_NUMBER
guidInformation: GUID
ulSequenceNumber: uint32
cbParametersSize: uint32
abParameters: array[4056, uint8]struct OPM_RANDOM_NUMBER
{
ubyte[16] abRandomNumber;
}
align(1)
struct OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS
{
OPM_RANDOM_NUMBER rnRandomNumber;
GUID guidInformation;
uint ulSequenceNumber;
uint cbParametersSize;
ubyte[4056] abParameters;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS サイズ: 4096 バイト(x64)
dim st, 1024 ; 4byte整数×1024(構造体サイズ 4096 / 4 切り上げ)
; rnRandomNumber : OPM_RANDOM_NUMBER (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; guidInformation : GUID (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; ulSequenceNumber : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; cbParametersSize : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; abParameters : BYTE (+40, 4056byte) varptr(st)+40 を基点に操作(4056byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global OPM_RANDOM_NUMBER
#field byte abRandomNumber 16
#endstruct
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS, pack=1
#field OPM_RANDOM_NUMBER rnRandomNumber
#field GUID guidInformation
#field int ulSequenceNumber
#field int cbParametersSize
#field byte abParameters 4056
#endstruct
stdim st, OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS ; NSTRUCT 変数を確保
st->ulSequenceNumber = 100
mes "ulSequenceNumber=" + st->ulSequenceNumber