DRM_CLIENT_VERSION_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| uStructVersion | DWORD | 4 | +0 | +0 | 下位互換性のための、この構造体のバージョンです。C では、この値を DRMCLIENTSTRUCTVERSION に初期化する必要があります。 |
| dwVersion | DWORD | 16 | +4 | +4 | Active Directory Rights Management Services クライアント ソフトウェアのバージョン番号を受け取る DWORD 型の配列です。バージョン番号は次の部分で構成されます。 dwVersion (0)クライアントのメジャー バージョン番号。 dwVersion (1)クライアントのマイナー バージョン番号。 dwVersion (2)クライアントのビルド バージョン番号。 dwVersion (3)クライアントのプライベート バージョン番号。 |
| wszHierarchy | WCHAR | 512 | +20 | +20 | Production や Pre-production などの階層情報を受け取る WCHAR 型の配列です。 |
| wszProductId | WCHAR | 512 | +532 | +532 | 製品 ID を受け取る WCHAR 型の配列です。このメンバーは現在、DRMGetClientVersion 関数によって設定されません。 |
| wszProductDescription | WCHAR | 512 | +1044 | +1044 | 製品の説明を受け取る WCHAR 型の配列です。このメンバーは現在、DRMGetClientVersion 関数によって設定されません。 |
公式ドキュメント
Msdrm.dll のクライアントによって公開される機能を利用する AD RMS SDK は、Windows Server 2008、Windows Vista、Windows Server 2008 R2、Windows 7、Windows Server 2012、および Windows 8 で使用できます。以降のバージョンでは変更されるか、利用できなくなる可能性があります。代わりに、Msipc.dll のクライアントによって公開される機能を利用する Active Directory Rights Management Services SDK 2.1 を使用してください。
DRM_CLIENT_VERSION_INFO 構造体は、Active Directory Rights Management Services (AD RMS) クライアントのバージョンと、Production や Pre-production などの階層に関する情報を受け取ります。この構造体は DRMGetClientVersion 関数で使用されます。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// DRM_CLIENT_VERSION_INFO (x64 1556 / x86 1556 バイト)
typedef struct DRM_CLIENT_VERSION_INFO {
DWORD uStructVersion;
DWORD dwVersion[4];
WCHAR wszHierarchy[256];
WCHAR wszProductId[256];
WCHAR wszProductDescription[256];
} DRM_CLIENT_VERSION_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DRM_CLIENT_VERSION_INFO
{
public uint uStructVersion;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint[] dwVersion;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string wszHierarchy;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string wszProductId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string wszProductDescription;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DRM_CLIENT_VERSION_INFO
Public uStructVersion As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public dwVersion() As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public wszHierarchy As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public wszProductId As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public wszProductDescription As String
End Structureimport ctypes
from ctypes import wintypes
class DRM_CLIENT_VERSION_INFO(ctypes.Structure):
_fields_ = [
("uStructVersion", wintypes.DWORD),
("dwVersion", wintypes.DWORD * 4),
("wszHierarchy", ctypes.c_wchar * 256),
("wszProductId", ctypes.c_wchar * 256),
("wszProductDescription", ctypes.c_wchar * 256),
]#[repr(C)]
pub struct DRM_CLIENT_VERSION_INFO {
pub uStructVersion: u32,
pub dwVersion: [u32; 4],
pub wszHierarchy: [u16; 256],
pub wszProductId: [u16; 256],
pub wszProductDescription: [u16; 256],
}import "golang.org/x/sys/windows"
type DRM_CLIENT_VERSION_INFO struct {
uStructVersion uint32
dwVersion [4]uint32
wszHierarchy [256]uint16
wszProductId [256]uint16
wszProductDescription [256]uint16
}type
DRM_CLIENT_VERSION_INFO = record
uStructVersion: DWORD;
dwVersion: array[0..3] of DWORD;
wszHierarchy: array[0..255] of WideChar;
wszProductId: array[0..255] of WideChar;
wszProductDescription: array[0..255] of WideChar;
end;const DRM_CLIENT_VERSION_INFO = extern struct {
uStructVersion: u32,
dwVersion: [4]u32,
wszHierarchy: [256]u16,
wszProductId: [256]u16,
wszProductDescription: [256]u16,
};type
DRM_CLIENT_VERSION_INFO {.bycopy.} = object
uStructVersion: uint32
dwVersion: array[4, uint32]
wszHierarchy: array[256, uint16]
wszProductId: array[256, uint16]
wszProductDescription: array[256, uint16]struct DRM_CLIENT_VERSION_INFO
{
uint uStructVersion;
uint[4] dwVersion;
wchar[256] wszHierarchy;
wchar[256] wszProductId;
wchar[256] wszProductDescription;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DRM_CLIENT_VERSION_INFO サイズ: 1556 バイト(x64)
dim st, 389 ; 4byte整数×389(構造体サイズ 1556 / 4 切り上げ)
; uStructVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwVersion : DWORD (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; wszHierarchy : WCHAR (+20, 512byte) varptr(st)+20 を基点に操作(512byte:入れ子/配列)
; wszProductId : WCHAR (+532, 512byte) varptr(st)+532 を基点に操作(512byte:入れ子/配列)
; wszProductDescription : WCHAR (+1044, 512byte) varptr(st)+1044 を基点に操作(512byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DRM_CLIENT_VERSION_INFO
#field int uStructVersion
#field int dwVersion 4
#field wchar wszHierarchy 256
#field wchar wszProductId 256
#field wchar wszProductDescription 256
#endstruct
stdim st, DRM_CLIENT_VERSION_INFO ; NSTRUCT 変数を確保
st->uStructVersion = 100
mes "uStructVersion=" + st->uStructVersion