ホーム › Media.DirectShow.Tv › KSM_BDA_WMDRM_RENEWLICENSE
KSM_BDA_WMDRM_RENEWLICENSE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NodeMethod | KSM_NODE | 16 | +0 | +0 | ノードメソッド識別子(KSM_NODE)。WMDRMライセンス更新メソッドを含む。 |
| ulXMRLicenseLength | DWORD | 4 | +16 | +16 | XMR形式ライセンスのバイト長。データ内のライセンス部分長を示す。 |
| ulEntitlementTokenLength | DWORD | 4 | +20 | +20 | エンタイトルメントトークンのバイト長。権利情報部分の長さを示す。 |
| argbDataBuffer | BYTE | 1 | +24 | +24 | ライセンスとトークンを連結したデータの先頭バイト。可変長データへのアンカー。 |
各言語での定義
#include <windows.h>
// KSIDENTIFIER (x64 8 / x86 8 バイト)
typedef struct KSIDENTIFIER {
_Anonymous_e__Union Anonymous;
} KSIDENTIFIER;
// KSM_NODE (x64 16 / x86 16 バイト)
typedef struct KSM_NODE {
KSIDENTIFIER Method;
DWORD NodeId;
DWORD Reserved;
} KSM_NODE;
// KSM_BDA_WMDRM_RENEWLICENSE (x64 32 / x86 32 バイト)
typedef struct KSM_BDA_WMDRM_RENEWLICENSE {
KSM_NODE NodeMethod;
DWORD ulXMRLicenseLength;
DWORD ulEntitlementTokenLength;
BYTE argbDataBuffer[1];
} KSM_BDA_WMDRM_RENEWLICENSE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSIDENTIFIER
{
public _Anonymous_e__Union Anonymous;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSM_NODE
{
public KSIDENTIFIER Method;
public uint NodeId;
public uint Reserved;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSM_BDA_WMDRM_RENEWLICENSE
{
public KSM_NODE NodeMethod;
public uint ulXMRLicenseLength;
public uint ulEntitlementTokenLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] argbDataBuffer;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSIDENTIFIER
Public Anonymous As _Anonymous_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSM_NODE
Public Method As KSIDENTIFIER
Public NodeId As UInteger
Public Reserved As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSM_BDA_WMDRM_RENEWLICENSE
Public NodeMethod As KSM_NODE
Public ulXMRLicenseLength As UInteger
Public ulEntitlementTokenLength As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public argbDataBuffer() As Byte
End Structureimport ctypes
from ctypes import wintypes
class KSIDENTIFIER(ctypes.Structure):
_fields_ = [
("Anonymous", _Anonymous_e__Union),
]
class KSM_NODE(ctypes.Structure):
_fields_ = [
("Method", KSIDENTIFIER),
("NodeId", wintypes.DWORD),
("Reserved", wintypes.DWORD),
]
class KSM_BDA_WMDRM_RENEWLICENSE(ctypes.Structure):
_fields_ = [
("NodeMethod", KSM_NODE),
("ulXMRLicenseLength", wintypes.DWORD),
("ulEntitlementTokenLength", wintypes.DWORD),
("argbDataBuffer", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct KSIDENTIFIER {
pub Anonymous: _Anonymous_e__Union,
}
#[repr(C)]
pub struct KSM_NODE {
pub Method: KSIDENTIFIER,
pub NodeId: u32,
pub Reserved: u32,
}
#[repr(C)]
pub struct KSM_BDA_WMDRM_RENEWLICENSE {
pub NodeMethod: KSM_NODE,
pub ulXMRLicenseLength: u32,
pub ulEntitlementTokenLength: u32,
pub argbDataBuffer: [u8; 1],
}import "golang.org/x/sys/windows"
type KSIDENTIFIER struct {
Anonymous _Anonymous_e__Union
}
type KSM_NODE struct {
Method KSIDENTIFIER
NodeId uint32
Reserved uint32
}
type KSM_BDA_WMDRM_RENEWLICENSE struct {
NodeMethod KSM_NODE
ulXMRLicenseLength uint32
ulEntitlementTokenLength uint32
argbDataBuffer [1]byte
}type
KSIDENTIFIER = record
Anonymous: _Anonymous_e__Union;
end;
KSM_NODE = record
Method: KSIDENTIFIER;
NodeId: DWORD;
Reserved: DWORD;
end;
KSM_BDA_WMDRM_RENEWLICENSE = record
NodeMethod: KSM_NODE;
ulXMRLicenseLength: DWORD;
ulEntitlementTokenLength: DWORD;
argbDataBuffer: array[0..0] of Byte;
end;const KSIDENTIFIER = extern struct {
Anonymous: _Anonymous_e__Union,
};
const KSM_NODE = extern struct {
Method: KSIDENTIFIER,
NodeId: u32,
Reserved: u32,
};
const KSM_BDA_WMDRM_RENEWLICENSE = extern struct {
NodeMethod: KSM_NODE,
ulXMRLicenseLength: u32,
ulEntitlementTokenLength: u32,
argbDataBuffer: [1]u8,
};type
KSIDENTIFIER {.bycopy.} = object
Anonymous: _Anonymous_e__Union
KSM_NODE {.bycopy.} = object
Method: KSIDENTIFIER
NodeId: uint32
Reserved: uint32
KSM_BDA_WMDRM_RENEWLICENSE {.bycopy.} = object
NodeMethod: KSM_NODE
ulXMRLicenseLength: uint32
ulEntitlementTokenLength: uint32
argbDataBuffer: array[1, uint8]struct KSIDENTIFIER
{
_Anonymous_e__Union Anonymous;
}
struct KSM_NODE
{
KSIDENTIFIER Method;
uint NodeId;
uint Reserved;
}
struct KSM_BDA_WMDRM_RENEWLICENSE
{
KSM_NODE NodeMethod;
uint ulXMRLicenseLength;
uint ulEntitlementTokenLength;
ubyte[1] argbDataBuffer;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSM_BDA_WMDRM_RENEWLICENSE サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; NodeMethod : KSM_NODE (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ulXMRLicenseLength : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ulEntitlementTokenLength : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; argbDataBuffer : BYTE (+24, 1byte) varptr(st)+24 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global KSIDENTIFIER
#field byte Anonymous 8
#endstruct
#defstruct global KSM_NODE
#field KSIDENTIFIER Method
#field int NodeId
#field int Reserved
#endstruct
#defstruct global KSM_BDA_WMDRM_RENEWLICENSE
#field KSM_NODE NodeMethod
#field int ulXMRLicenseLength
#field int ulEntitlementTokenLength
#field byte argbDataBuffer 1
#endstruct
stdim st, KSM_BDA_WMDRM_RENEWLICENSE ; NSTRUCT 変数を確保
st->ulXMRLicenseLength = 100
mes "ulXMRLicenseLength=" + st->ulXMRLicenseLength