Win32 API 日本語リファレンス
ホームData.RightsManagement › DRM_CLIENT_VERSION_INFO

DRM_CLIENT_VERSION_INFO

構造体
サイズx64: 1556 バイト / x86: 1556 バイト

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

フィールド

フィールドサイズx64x86説明
uStructVersionDWORD4+0+0この構造体のバージョン番号。
dwVersionDWORD16+4+4クライアントのバージョン番号(数値)。
wszHierarchyWCHAR512+20+20クライアントの製品階層名を格納する固定長ワイド文字配列。
wszProductIdWCHAR512+532+532製品IDを格納する固定長ワイド文字配列。
wszProductDescriptionWCHAR512+1044+1044製品の説明を格納する固定長ワイド文字配列。

各言語での定義

#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 Structure
import 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