ホーム › Data.RightsManagement › DRMGetRightExtendedInfo
DRMGetRightExtendedInfo
関数RMS権利の拡張情報を取得する。
シグネチャ
// msdrm.dll
#include <windows.h>
HRESULT DRMGetRightExtendedInfo(
DWORD hRight,
DWORD uIndex,
DWORD* puExtendedInfoNameLength,
LPWSTR wszExtendedInfoName, // optional
DWORD* puExtendedInfoValueLength,
LPWSTR wszExtendedInfoValue // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hRight | DWORD | in | 対象の権利オブジェクトハンドル。 |
| uIndex | DWORD | in | 取得する拡張情報の0始まりのインデックス。 |
| puExtendedInfoNameLength | DWORD* | inout | 入力時に名前バッファ長、出力時に必要長を示すポインタ。 |
| wszExtendedInfoName | LPWSTR | outoptional | 拡張情報名を受け取る出力バッファ。NULLでサイズ問い合わせ可。 |
| puExtendedInfoValueLength | DWORD* | inout | 入力時に値バッファ長、出力時に必要長を示すポインタ。 |
| wszExtendedInfoValue | LPWSTR | outoptional | 拡張情報値を受け取る出力バッファ。NULLでサイズ問い合わせ可。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// msdrm.dll
#include <windows.h>
HRESULT DRMGetRightExtendedInfo(
DWORD hRight,
DWORD uIndex,
DWORD* puExtendedInfoNameLength,
LPWSTR wszExtendedInfoName, // optional
DWORD* puExtendedInfoValueLength,
LPWSTR wszExtendedInfoValue // optional
);[DllImport("msdrm.dll", ExactSpelling = true)]
static extern int DRMGetRightExtendedInfo(
uint hRight, // DWORD
uint uIndex, // DWORD
ref uint puExtendedInfoNameLength, // DWORD* in/out
[MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszExtendedInfoName, // LPWSTR optional, out
ref uint puExtendedInfoValueLength, // DWORD* in/out
[MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszExtendedInfoValue // LPWSTR optional, out
);<DllImport("msdrm.dll", ExactSpelling:=True)>
Public Shared Function DRMGetRightExtendedInfo(
hRight As UInteger, ' DWORD
uIndex As UInteger, ' DWORD
ByRef puExtendedInfoNameLength As UInteger, ' DWORD* in/out
<MarshalAs(UnmanagedType.LPWStr)> wszExtendedInfoName As System.Text.StringBuilder, ' LPWSTR optional, out
ByRef puExtendedInfoValueLength As UInteger, ' DWORD* in/out
<MarshalAs(UnmanagedType.LPWStr)> wszExtendedInfoValue As System.Text.StringBuilder ' LPWSTR optional, out
) As Integer
End Function' hRight : DWORD
' uIndex : DWORD
' puExtendedInfoNameLength : DWORD* in/out
' wszExtendedInfoName : LPWSTR optional, out
' puExtendedInfoValueLength : DWORD* in/out
' wszExtendedInfoValue : LPWSTR optional, out
Declare PtrSafe Function DRMGetRightExtendedInfo Lib "msdrm" ( _
ByVal hRight As Long, _
ByVal uIndex As Long, _
ByRef puExtendedInfoNameLength As Long, _
ByVal wszExtendedInfoName As LongPtr, _
ByRef puExtendedInfoValueLength As Long, _
ByVal wszExtendedInfoValue As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DRMGetRightExtendedInfo = ctypes.windll.msdrm.DRMGetRightExtendedInfo
DRMGetRightExtendedInfo.restype = ctypes.c_int
DRMGetRightExtendedInfo.argtypes = [
wintypes.DWORD, # hRight : DWORD
wintypes.DWORD, # uIndex : DWORD
ctypes.POINTER(wintypes.DWORD), # puExtendedInfoNameLength : DWORD* in/out
wintypes.LPWSTR, # wszExtendedInfoName : LPWSTR optional, out
ctypes.POINTER(wintypes.DWORD), # puExtendedInfoValueLength : DWORD* in/out
wintypes.LPWSTR, # wszExtendedInfoValue : LPWSTR optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('msdrm.dll')
DRMGetRightExtendedInfo = Fiddle::Function.new(
lib['DRMGetRightExtendedInfo'],
[
-Fiddle::TYPE_INT, # hRight : DWORD
-Fiddle::TYPE_INT, # uIndex : DWORD
Fiddle::TYPE_VOIDP, # puExtendedInfoNameLength : DWORD* in/out
Fiddle::TYPE_VOIDP, # wszExtendedInfoName : LPWSTR optional, out
Fiddle::TYPE_VOIDP, # puExtendedInfoValueLength : DWORD* in/out
Fiddle::TYPE_VOIDP, # wszExtendedInfoValue : LPWSTR optional, out
],
Fiddle::TYPE_INT)#[link(name = "msdrm")]
extern "system" {
fn DRMGetRightExtendedInfo(
hRight: u32, // DWORD
uIndex: u32, // DWORD
puExtendedInfoNameLength: *mut u32, // DWORD* in/out
wszExtendedInfoName: *mut u16, // LPWSTR optional, out
puExtendedInfoValueLength: *mut u32, // DWORD* in/out
wszExtendedInfoValue: *mut u16 // LPWSTR optional, out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("msdrm.dll")]
public static extern int DRMGetRightExtendedInfo(uint hRight, uint uIndex, ref uint puExtendedInfoNameLength, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszExtendedInfoName, ref uint puExtendedInfoValueLength, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszExtendedInfoValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msdrm_DRMGetRightExtendedInfo' -Namespace Win32 -PassThru
# $api::DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue)#uselib "msdrm.dll"
#func global DRMGetRightExtendedInfo "DRMGetRightExtendedInfo" sptr, sptr, sptr, sptr, sptr, sptr
; DRMGetRightExtendedInfo hRight, uIndex, varptr(puExtendedInfoNameLength), varptr(wszExtendedInfoName), varptr(puExtendedInfoValueLength), varptr(wszExtendedInfoValue) ; 戻り値は stat
; hRight : DWORD -> "sptr"
; uIndex : DWORD -> "sptr"
; puExtendedInfoNameLength : DWORD* in/out -> "sptr"
; wszExtendedInfoName : LPWSTR optional, out -> "sptr"
; puExtendedInfoValueLength : DWORD* in/out -> "sptr"
; wszExtendedInfoValue : LPWSTR optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "msdrm.dll" #cfunc global DRMGetRightExtendedInfo "DRMGetRightExtendedInfo" int, int, var, var, var, var ; res = DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue) ; hRight : DWORD -> "int" ; uIndex : DWORD -> "int" ; puExtendedInfoNameLength : DWORD* in/out -> "var" ; wszExtendedInfoName : LPWSTR optional, out -> "var" ; puExtendedInfoValueLength : DWORD* in/out -> "var" ; wszExtendedInfoValue : LPWSTR optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "msdrm.dll" #cfunc global DRMGetRightExtendedInfo "DRMGetRightExtendedInfo" int, int, sptr, sptr, sptr, sptr ; res = DRMGetRightExtendedInfo(hRight, uIndex, varptr(puExtendedInfoNameLength), varptr(wszExtendedInfoName), varptr(puExtendedInfoValueLength), varptr(wszExtendedInfoValue)) ; hRight : DWORD -> "int" ; uIndex : DWORD -> "int" ; puExtendedInfoNameLength : DWORD* in/out -> "sptr" ; wszExtendedInfoName : LPWSTR optional, out -> "sptr" ; puExtendedInfoValueLength : DWORD* in/out -> "sptr" ; wszExtendedInfoValue : LPWSTR optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT DRMGetRightExtendedInfo(DWORD hRight, DWORD uIndex, DWORD* puExtendedInfoNameLength, LPWSTR wszExtendedInfoName, DWORD* puExtendedInfoValueLength, LPWSTR wszExtendedInfoValue) #uselib "msdrm.dll" #cfunc global DRMGetRightExtendedInfo "DRMGetRightExtendedInfo" int, int, var, var, var, var ; res = DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue) ; hRight : DWORD -> "int" ; uIndex : DWORD -> "int" ; puExtendedInfoNameLength : DWORD* in/out -> "var" ; wszExtendedInfoName : LPWSTR optional, out -> "var" ; puExtendedInfoValueLength : DWORD* in/out -> "var" ; wszExtendedInfoValue : LPWSTR optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT DRMGetRightExtendedInfo(DWORD hRight, DWORD uIndex, DWORD* puExtendedInfoNameLength, LPWSTR wszExtendedInfoName, DWORD* puExtendedInfoValueLength, LPWSTR wszExtendedInfoValue) #uselib "msdrm.dll" #cfunc global DRMGetRightExtendedInfo "DRMGetRightExtendedInfo" int, int, intptr, intptr, intptr, intptr ; res = DRMGetRightExtendedInfo(hRight, uIndex, varptr(puExtendedInfoNameLength), varptr(wszExtendedInfoName), varptr(puExtendedInfoValueLength), varptr(wszExtendedInfoValue)) ; hRight : DWORD -> "int" ; uIndex : DWORD -> "int" ; puExtendedInfoNameLength : DWORD* in/out -> "intptr" ; wszExtendedInfoName : LPWSTR optional, out -> "intptr" ; puExtendedInfoValueLength : DWORD* in/out -> "intptr" ; wszExtendedInfoValue : LPWSTR optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msdrm = windows.NewLazySystemDLL("msdrm.dll")
procDRMGetRightExtendedInfo = msdrm.NewProc("DRMGetRightExtendedInfo")
)
// hRight (DWORD), uIndex (DWORD), puExtendedInfoNameLength (DWORD* in/out), wszExtendedInfoName (LPWSTR optional, out), puExtendedInfoValueLength (DWORD* in/out), wszExtendedInfoValue (LPWSTR optional, out)
r1, _, err := procDRMGetRightExtendedInfo.Call(
uintptr(hRight),
uintptr(uIndex),
uintptr(puExtendedInfoNameLength),
uintptr(wszExtendedInfoName),
uintptr(puExtendedInfoValueLength),
uintptr(wszExtendedInfoValue),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction DRMGetRightExtendedInfo(
hRight: DWORD; // DWORD
uIndex: DWORD; // DWORD
puExtendedInfoNameLength: Pointer; // DWORD* in/out
wszExtendedInfoName: PWideChar; // LPWSTR optional, out
puExtendedInfoValueLength: Pointer; // DWORD* in/out
wszExtendedInfoValue: PWideChar // LPWSTR optional, out
): Integer; stdcall;
external 'msdrm.dll' name 'DRMGetRightExtendedInfo';result := DllCall("msdrm\DRMGetRightExtendedInfo"
, "UInt", hRight ; DWORD
, "UInt", uIndex ; DWORD
, "Ptr", puExtendedInfoNameLength ; DWORD* in/out
, "Ptr", wszExtendedInfoName ; LPWSTR optional, out
, "Ptr", puExtendedInfoValueLength ; DWORD* in/out
, "Ptr", wszExtendedInfoValue ; LPWSTR optional, out
, "Int") ; return: HRESULT●DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue) = DLL("msdrm.dll", "int DRMGetRightExtendedInfo(dword, dword, void*, char*, void*, char*)")
# 呼び出し: DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue)
# hRight : DWORD -> "dword"
# uIndex : DWORD -> "dword"
# puExtendedInfoNameLength : DWORD* in/out -> "void*"
# wszExtendedInfoName : LPWSTR optional, out -> "char*"
# puExtendedInfoValueLength : DWORD* in/out -> "void*"
# wszExtendedInfoValue : LPWSTR optional, out -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "msdrm" fn DRMGetRightExtendedInfo(
hRight: u32, // DWORD
uIndex: u32, // DWORD
puExtendedInfoNameLength: [*c]u32, // DWORD* in/out
wszExtendedInfoName: [*c]u16, // LPWSTR optional, out
puExtendedInfoValueLength: [*c]u32, // DWORD* in/out
wszExtendedInfoValue: [*c]u16 // LPWSTR optional, out
) callconv(std.os.windows.WINAPI) i32;proc DRMGetRightExtendedInfo(
hRight: uint32, # DWORD
uIndex: uint32, # DWORD
puExtendedInfoNameLength: ptr uint32, # DWORD* in/out
wszExtendedInfoName: ptr uint16, # LPWSTR optional, out
puExtendedInfoValueLength: ptr uint32, # DWORD* in/out
wszExtendedInfoValue: ptr uint16 # LPWSTR optional, out
): int32 {.importc: "DRMGetRightExtendedInfo", stdcall, dynlib: "msdrm.dll".}pragma(lib, "msdrm");
extern(Windows)
int DRMGetRightExtendedInfo(
uint hRight, // DWORD
uint uIndex, // DWORD
uint* puExtendedInfoNameLength, // DWORD* in/out
wchar* wszExtendedInfoName, // LPWSTR optional, out
uint* puExtendedInfoValueLength, // DWORD* in/out
wchar* wszExtendedInfoValue // LPWSTR optional, out
);ccall((:DRMGetRightExtendedInfo, "msdrm.dll"), stdcall, Int32,
(UInt32, UInt32, Ptr{UInt32}, Ptr{UInt16}, Ptr{UInt32}, Ptr{UInt16}),
hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue)
# hRight : DWORD -> UInt32
# uIndex : DWORD -> UInt32
# puExtendedInfoNameLength : DWORD* in/out -> Ptr{UInt32}
# wszExtendedInfoName : LPWSTR optional, out -> Ptr{UInt16}
# puExtendedInfoValueLength : DWORD* in/out -> Ptr{UInt32}
# wszExtendedInfoValue : LPWSTR optional, out -> Ptr{UInt16}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t DRMGetRightExtendedInfo(
uint32_t hRight,
uint32_t uIndex,
uint32_t* puExtendedInfoNameLength,
uint16_t* wszExtendedInfoName,
uint32_t* puExtendedInfoValueLength,
uint16_t* wszExtendedInfoValue);
]]
local msdrm = ffi.load("msdrm")
-- msdrm.DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue)
-- hRight : DWORD
-- uIndex : DWORD
-- puExtendedInfoNameLength : DWORD* in/out
-- wszExtendedInfoName : LPWSTR optional, out
-- puExtendedInfoValueLength : DWORD* in/out
-- wszExtendedInfoValue : LPWSTR optional, out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('msdrm.dll');
const DRMGetRightExtendedInfo = lib.func('__stdcall', 'DRMGetRightExtendedInfo', 'int32_t', ['uint32_t', 'uint32_t', 'uint32_t *', 'uint16_t *', 'uint32_t *', 'uint16_t *']);
// DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue)
// hRight : DWORD -> 'uint32_t'
// uIndex : DWORD -> 'uint32_t'
// puExtendedInfoNameLength : DWORD* in/out -> 'uint32_t *'
// wszExtendedInfoName : LPWSTR optional, out -> 'uint16_t *'
// puExtendedInfoValueLength : DWORD* in/out -> 'uint32_t *'
// wszExtendedInfoValue : LPWSTR optional, out -> 'uint16_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("msdrm.dll", {
DRMGetRightExtendedInfo: { parameters: ["u32", "u32", "pointer", "buffer", "pointer", "buffer"], result: "i32" },
});
// lib.symbols.DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue)
// hRight : DWORD -> "u32"
// uIndex : DWORD -> "u32"
// puExtendedInfoNameLength : DWORD* in/out -> "pointer"
// wszExtendedInfoName : LPWSTR optional, out -> "buffer"
// puExtendedInfoValueLength : DWORD* in/out -> "pointer"
// wszExtendedInfoValue : LPWSTR optional, out -> "buffer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t DRMGetRightExtendedInfo(
uint32_t hRight,
uint32_t uIndex,
uint32_t* puExtendedInfoNameLength,
uint16_t* wszExtendedInfoName,
uint32_t* puExtendedInfoValueLength,
uint16_t* wszExtendedInfoValue);
C, "msdrm.dll");
// $ffi->DRMGetRightExtendedInfo(hRight, uIndex, puExtendedInfoNameLength, wszExtendedInfoName, puExtendedInfoValueLength, wszExtendedInfoValue);
// hRight : DWORD
// uIndex : DWORD
// puExtendedInfoNameLength : DWORD* in/out
// wszExtendedInfoName : LPWSTR optional, out
// puExtendedInfoValueLength : DWORD* in/out
// wszExtendedInfoValue : LPWSTR optional, out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Msdrm extends StdCallLibrary {
Msdrm INSTANCE = Native.load("msdrm", Msdrm.class);
int DRMGetRightExtendedInfo(
int hRight, // DWORD
int uIndex, // DWORD
IntByReference puExtendedInfoNameLength, // DWORD* in/out
char[] wszExtendedInfoName, // LPWSTR optional, out
IntByReference puExtendedInfoValueLength, // DWORD* in/out
char[] wszExtendedInfoValue // LPWSTR optional, out
);
}@[Link("msdrm")]
lib Libmsdrm
fun DRMGetRightExtendedInfo = DRMGetRightExtendedInfo(
hRight : UInt32, # DWORD
uIndex : UInt32, # DWORD
puExtendedInfoNameLength : UInt32*, # DWORD* in/out
wszExtendedInfoName : UInt16*, # LPWSTR optional, out
puExtendedInfoValueLength : UInt32*, # DWORD* in/out
wszExtendedInfoValue : UInt16* # LPWSTR optional, out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef DRMGetRightExtendedInfoNative = Int32 Function(Uint32, Uint32, Pointer<Uint32>, Pointer<Utf16>, Pointer<Uint32>, Pointer<Utf16>);
typedef DRMGetRightExtendedInfoDart = int Function(int, int, Pointer<Uint32>, Pointer<Utf16>, Pointer<Uint32>, Pointer<Utf16>);
final DRMGetRightExtendedInfo = DynamicLibrary.open('msdrm.dll')
.lookupFunction<DRMGetRightExtendedInfoNative, DRMGetRightExtendedInfoDart>('DRMGetRightExtendedInfo');
// hRight : DWORD -> Uint32
// uIndex : DWORD -> Uint32
// puExtendedInfoNameLength : DWORD* in/out -> Pointer<Uint32>
// wszExtendedInfoName : LPWSTR optional, out -> Pointer<Utf16>
// puExtendedInfoValueLength : DWORD* in/out -> Pointer<Uint32>
// wszExtendedInfoValue : LPWSTR optional, out -> Pointer<Utf16>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function DRMGetRightExtendedInfo(
hRight: DWORD; // DWORD
uIndex: DWORD; // DWORD
puExtendedInfoNameLength: Pointer; // DWORD* in/out
wszExtendedInfoName: PWideChar; // LPWSTR optional, out
puExtendedInfoValueLength: Pointer; // DWORD* in/out
wszExtendedInfoValue: PWideChar // LPWSTR optional, out
): Integer; stdcall;
external 'msdrm.dll' name 'DRMGetRightExtendedInfo';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "DRMGetRightExtendedInfo"
c_DRMGetRightExtendedInfo :: Word32 -> Word32 -> Ptr Word32 -> CWString -> Ptr Word32 -> CWString -> IO Int32
-- hRight : DWORD -> Word32
-- uIndex : DWORD -> Word32
-- puExtendedInfoNameLength : DWORD* in/out -> Ptr Word32
-- wszExtendedInfoName : LPWSTR optional, out -> CWString
-- puExtendedInfoValueLength : DWORD* in/out -> Ptr Word32
-- wszExtendedInfoValue : LPWSTR optional, out -> CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let drmgetrightextendedinfo =
foreign "DRMGetRightExtendedInfo"
(uint32_t @-> uint32_t @-> (ptr uint32_t) @-> (ptr uint16_t) @-> (ptr uint32_t) @-> (ptr uint16_t) @-> returning int32_t)
(* hRight : DWORD -> uint32_t *)
(* uIndex : DWORD -> uint32_t *)
(* puExtendedInfoNameLength : DWORD* in/out -> (ptr uint32_t) *)
(* wszExtendedInfoName : LPWSTR optional, out -> (ptr uint16_t) *)
(* puExtendedInfoValueLength : DWORD* in/out -> (ptr uint32_t) *)
(* wszExtendedInfoValue : LPWSTR optional, out -> (ptr uint16_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library msdrm (t "msdrm.dll"))
(cffi:use-foreign-library msdrm)
(cffi:defcfun ("DRMGetRightExtendedInfo" drmget-right-extended-info :convention :stdcall) :int32
(h-right :uint32) ; DWORD
(u-index :uint32) ; DWORD
(pu-extended-info-name-length :pointer) ; DWORD* in/out
(wsz-extended-info-name :pointer) ; LPWSTR optional, out
(pu-extended-info-value-length :pointer) ; DWORD* in/out
(wsz-extended-info-value :pointer)) ; LPWSTR optional, out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $DRMGetRightExtendedInfo = Win32::API::More->new('msdrm',
'int DRMGetRightExtendedInfo(DWORD hRight, DWORD uIndex, LPVOID puExtendedInfoNameLength, LPWSTR wszExtendedInfoName, LPVOID puExtendedInfoValueLength, LPWSTR wszExtendedInfoValue)');
# my $ret = $DRMGetRightExtendedInfo->Call($hRight, $uIndex, $puExtendedInfoNameLength, $wszExtendedInfoName, $puExtendedInfoValueLength, $wszExtendedInfoValue);
# hRight : DWORD -> DWORD
# uIndex : DWORD -> DWORD
# puExtendedInfoNameLength : DWORD* in/out -> LPVOID
# wszExtendedInfoName : LPWSTR optional, out -> LPWSTR
# puExtendedInfoValueLength : DWORD* in/out -> LPVOID
# wszExtendedInfoValue : LPWSTR optional, out -> LPWSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。