ホーム › Data.RightsManagement › DRMBOUNDLICENSEPARAMS
DRMBOUNDLICENSEPARAMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| uVersion | DWORD | 4 | +0 | +0 | この構造体のバージョン番号。 |
| hEnablingPrincipal | DWORD | 4 | +4 | +4 | ライセンスを利用可能にするプリンシパルのハンドル。 |
| hSecureStore | DWORD | 4 | +8 | +8 | セキュアストアのハンドル。 |
| wszRightsRequested | LPWSTR | 8/4 | +16 | +12 | 要求する権利を示す文字列へのポインタ(ワイド文字列)。NULL可。 |
| wszRightsGroup | LPWSTR | 8/4 | +24 | +16 | 権利グループ名を示す文字列へのポインタ(ワイド文字列)。NULL可。 |
| idResource | DRMID | 24/12 | +32 | +20 | 対象リソースの識別子(DRMID)。 |
| cAuthenticatorCount | DWORD | 4 | +56 | +32 | 認証子の数。rghAuthenticators配列の要素数。 |
| rghAuthenticators | DWORD* | 8/4 | +64 | +36 | 認証子ハンドルの配列へのポインタ。NULL可。 |
| wszDefaultEnablingPrincipalCredentials | LPWSTR | 8/4 | +72 | +40 | 既定の有効化プリンシパルの資格情報を示す文字列(ワイド文字列)。NULL可。 |
| dwFlags | DWORD | 4 | +80 | +44 | バインド動作を制御するビットフラグ。 |
各言語での定義
#include <windows.h>
// DRMID (x64 24 / x86 12 バイト)
typedef struct DRMID {
DWORD uVersion;
LPWSTR wszIDType;
LPWSTR wszID;
} DRMID;
// DRMBOUNDLICENSEPARAMS (x64 88 / x86 48 バイト)
typedef struct DRMBOUNDLICENSEPARAMS {
DWORD uVersion;
DWORD hEnablingPrincipal;
DWORD hSecureStore;
LPWSTR wszRightsRequested;
LPWSTR wszRightsGroup;
DRMID idResource;
DWORD cAuthenticatorCount;
DWORD* rghAuthenticators;
LPWSTR wszDefaultEnablingPrincipalCredentials;
DWORD dwFlags;
} DRMBOUNDLICENSEPARAMS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DRMID
{
public uint uVersion;
public IntPtr wszIDType;
public IntPtr wszID;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DRMBOUNDLICENSEPARAMS
{
public uint uVersion;
public uint hEnablingPrincipal;
public uint hSecureStore;
public IntPtr wszRightsRequested;
public IntPtr wszRightsGroup;
public DRMID idResource;
public uint cAuthenticatorCount;
public IntPtr rghAuthenticators;
public IntPtr wszDefaultEnablingPrincipalCredentials;
public uint dwFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DRMID
Public uVersion As UInteger
Public wszIDType As IntPtr
Public wszID As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DRMBOUNDLICENSEPARAMS
Public uVersion As UInteger
Public hEnablingPrincipal As UInteger
Public hSecureStore As UInteger
Public wszRightsRequested As IntPtr
Public wszRightsGroup As IntPtr
Public idResource As DRMID
Public cAuthenticatorCount As UInteger
Public rghAuthenticators As IntPtr
Public wszDefaultEnablingPrincipalCredentials As IntPtr
Public dwFlags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DRMID(ctypes.Structure):
_fields_ = [
("uVersion", wintypes.DWORD),
("wszIDType", ctypes.c_void_p),
("wszID", ctypes.c_void_p),
]
class DRMBOUNDLICENSEPARAMS(ctypes.Structure):
_fields_ = [
("uVersion", wintypes.DWORD),
("hEnablingPrincipal", wintypes.DWORD),
("hSecureStore", wintypes.DWORD),
("wszRightsRequested", ctypes.c_void_p),
("wszRightsGroup", ctypes.c_void_p),
("idResource", DRMID),
("cAuthenticatorCount", wintypes.DWORD),
("rghAuthenticators", ctypes.c_void_p),
("wszDefaultEnablingPrincipalCredentials", ctypes.c_void_p),
("dwFlags", wintypes.DWORD),
]#[repr(C)]
pub struct DRMID {
pub uVersion: u32,
pub wszIDType: *mut core::ffi::c_void,
pub wszID: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct DRMBOUNDLICENSEPARAMS {
pub uVersion: u32,
pub hEnablingPrincipal: u32,
pub hSecureStore: u32,
pub wszRightsRequested: *mut core::ffi::c_void,
pub wszRightsGroup: *mut core::ffi::c_void,
pub idResource: DRMID,
pub cAuthenticatorCount: u32,
pub rghAuthenticators: *mut core::ffi::c_void,
pub wszDefaultEnablingPrincipalCredentials: *mut core::ffi::c_void,
pub dwFlags: u32,
}import "golang.org/x/sys/windows"
type DRMID struct {
uVersion uint32
wszIDType uintptr
wszID uintptr
}
type DRMBOUNDLICENSEPARAMS struct {
uVersion uint32
hEnablingPrincipal uint32
hSecureStore uint32
wszRightsRequested uintptr
wszRightsGroup uintptr
idResource DRMID
cAuthenticatorCount uint32
rghAuthenticators uintptr
wszDefaultEnablingPrincipalCredentials uintptr
dwFlags uint32
}type
DRMID = record
uVersion: DWORD;
wszIDType: Pointer;
wszID: Pointer;
end;
DRMBOUNDLICENSEPARAMS = record
uVersion: DWORD;
hEnablingPrincipal: DWORD;
hSecureStore: DWORD;
wszRightsRequested: Pointer;
wszRightsGroup: Pointer;
idResource: DRMID;
cAuthenticatorCount: DWORD;
rghAuthenticators: Pointer;
wszDefaultEnablingPrincipalCredentials: Pointer;
dwFlags: DWORD;
end;const DRMID = extern struct {
uVersion: u32,
wszIDType: ?*anyopaque,
wszID: ?*anyopaque,
};
const DRMBOUNDLICENSEPARAMS = extern struct {
uVersion: u32,
hEnablingPrincipal: u32,
hSecureStore: u32,
wszRightsRequested: ?*anyopaque,
wszRightsGroup: ?*anyopaque,
idResource: DRMID,
cAuthenticatorCount: u32,
rghAuthenticators: ?*anyopaque,
wszDefaultEnablingPrincipalCredentials: ?*anyopaque,
dwFlags: u32,
};type
DRMID {.bycopy.} = object
uVersion: uint32
wszIDType: pointer
wszID: pointer
DRMBOUNDLICENSEPARAMS {.bycopy.} = object
uVersion: uint32
hEnablingPrincipal: uint32
hSecureStore: uint32
wszRightsRequested: pointer
wszRightsGroup: pointer
idResource: DRMID
cAuthenticatorCount: uint32
rghAuthenticators: pointer
wszDefaultEnablingPrincipalCredentials: pointer
dwFlags: uint32struct DRMID
{
uint uVersion;
void* wszIDType;
void* wszID;
}
struct DRMBOUNDLICENSEPARAMS
{
uint uVersion;
uint hEnablingPrincipal;
uint hSecureStore;
void* wszRightsRequested;
void* wszRightsGroup;
DRMID idResource;
uint cAuthenticatorCount;
void* rghAuthenticators;
void* wszDefaultEnablingPrincipalCredentials;
uint dwFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DRMBOUNDLICENSEPARAMS サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; uVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hEnablingPrincipal : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hSecureStore : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; wszRightsRequested : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; wszRightsGroup : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; idResource : DRMID (+20, 12byte) varptr(st)+20 を基点に操作(12byte:入れ子/配列)
; cAuthenticatorCount : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; rghAuthenticators : DWORD* (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; wszDefaultEnablingPrincipalCredentials : LPWSTR (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwFlags : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DRMBOUNDLICENSEPARAMS サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; uVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hEnablingPrincipal : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hSecureStore : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; wszRightsRequested : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; wszRightsGroup : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; idResource : DRMID (+32, 24byte) varptr(st)+32 を基点に操作(24byte:入れ子/配列)
; cAuthenticatorCount : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; rghAuthenticators : DWORD* (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; wszDefaultEnablingPrincipalCredentials : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; dwFlags : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DRMID
#field int uVersion
#field intptr wszIDType
#field intptr wszID
#endstruct
#defstruct global DRMBOUNDLICENSEPARAMS
#field int uVersion
#field int hEnablingPrincipal
#field int hSecureStore
#field intptr wszRightsRequested
#field intptr wszRightsGroup
#field DRMID idResource
#field int cAuthenticatorCount
#field intptr rghAuthenticators
#field intptr wszDefaultEnablingPrincipalCredentials
#field int dwFlags
#endstruct
stdim st, DRMBOUNDLICENSEPARAMS ; NSTRUCT 変数を確保
st->uVersion = 100
mes "uVersion=" + st->uVersion