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

DRMGetRevocationPoint

関数
発行ライセンスの失効ポイント情報を取得する。
DLLmsdrm.dll呼出規約winapi

シグネチャ

// msdrm.dll
#include <windows.h>

HRESULT DRMGetRevocationPoint(
    DWORD hIssuanceLicense,
    DWORD* puIdLength,
    LPWSTR wszId,   // optional
    DWORD* puIdTypeLength,
    LPWSTR wszIdType,   // optional
    DWORD* puURLLength,
    LPWSTR wszRL,   // optional
    SYSTEMTIME* pstFrequency,
    DWORD* puNameLength,
    LPWSTR wszName,   // optional
    DWORD* puPublicKeyLength,
    LPWSTR wszPublicKey   // optional
);

パラメーター

名前方向説明
hIssuanceLicenseDWORDin対象の発行ライセンスハンドル。
puIdLengthDWORD*inout入力時にIDバッファ長、出力時に必要長を示すポインタ。
wszIdLPWSTRoutoptional失効ポイントIDを受け取る出力バッファ。NULLでサイズ問い合わせ可。
puIdTypeLengthDWORD*inout入力時にID種別バッファ長、出力時に必要長を示すポインタ。
wszIdTypeLPWSTRoutoptional失効ポイントID種別を受け取る出力バッファ。NULLでサイズ問い合わせ可。
puURLLengthDWORD*inout入力時にURLバッファ長、出力時に必要長を示すポインタ。
wszRLLPWSTRoutoptional失効リストURLを受け取る出力バッファ。NULLでサイズ問い合わせ可。
pstFrequencySYSTEMTIME*inout失効リスト更新頻度を受け取るSYSTEMTIMEポインタ。
puNameLengthDWORD*inout入力時に名前バッファ長、出力時に必要長を示すポインタ。
wszNameLPWSTRoutoptional失効ポイント名を受け取る出力バッファ。NULLでサイズ問い合わせ可。
puPublicKeyLengthDWORD*inout入力時に公開鍵バッファ長、出力時に必要長を示すポインタ。
wszPublicKeyLPWSTRoutoptional失効リスト検証用公開鍵を受け取る出力バッファ。NULLでサイズ問い合わせ可。

戻り値の型: HRESULT

各言語での呼び出し定義

// msdrm.dll
#include <windows.h>

HRESULT DRMGetRevocationPoint(
    DWORD hIssuanceLicense,
    DWORD* puIdLength,
    LPWSTR wszId,   // optional
    DWORD* puIdTypeLength,
    LPWSTR wszIdType,   // optional
    DWORD* puURLLength,
    LPWSTR wszRL,   // optional
    SYSTEMTIME* pstFrequency,
    DWORD* puNameLength,
    LPWSTR wszName,   // optional
    DWORD* puPublicKeyLength,
    LPWSTR wszPublicKey   // optional
);
[DllImport("msdrm.dll", ExactSpelling = true)]
static extern int DRMGetRevocationPoint(
    uint hIssuanceLicense,   // DWORD
    ref uint puIdLength,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszId,   // LPWSTR optional, out
    ref uint puIdTypeLength,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszIdType,   // LPWSTR optional, out
    ref uint puURLLength,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszRL,   // LPWSTR optional, out
    IntPtr pstFrequency,   // SYSTEMTIME* in/out
    ref uint puNameLength,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszName,   // LPWSTR optional, out
    ref uint puPublicKeyLength,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszPublicKey   // LPWSTR optional, out
);
<DllImport("msdrm.dll", ExactSpelling:=True)>
Public Shared Function DRMGetRevocationPoint(
    hIssuanceLicense As UInteger,   ' DWORD
    ByRef puIdLength As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPWStr)> wszId As System.Text.StringBuilder,   ' LPWSTR optional, out
    ByRef puIdTypeLength As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPWStr)> wszIdType As System.Text.StringBuilder,   ' LPWSTR optional, out
    ByRef puURLLength As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPWStr)> wszRL As System.Text.StringBuilder,   ' LPWSTR optional, out
    pstFrequency As IntPtr,   ' SYSTEMTIME* in/out
    ByRef puNameLength As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPWStr)> wszName As System.Text.StringBuilder,   ' LPWSTR optional, out
    ByRef puPublicKeyLength As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPWStr)> wszPublicKey As System.Text.StringBuilder   ' LPWSTR optional, out
) As Integer
End Function
' hIssuanceLicense : DWORD
' puIdLength : DWORD* in/out
' wszId : LPWSTR optional, out
' puIdTypeLength : DWORD* in/out
' wszIdType : LPWSTR optional, out
' puURLLength : DWORD* in/out
' wszRL : LPWSTR optional, out
' pstFrequency : SYSTEMTIME* in/out
' puNameLength : DWORD* in/out
' wszName : LPWSTR optional, out
' puPublicKeyLength : DWORD* in/out
' wszPublicKey : LPWSTR optional, out
Declare PtrSafe Function DRMGetRevocationPoint Lib "msdrm" ( _
    ByVal hIssuanceLicense As Long, _
    ByRef puIdLength As Long, _
    ByVal wszId As LongPtr, _
    ByRef puIdTypeLength As Long, _
    ByVal wszIdType As LongPtr, _
    ByRef puURLLength As Long, _
    ByVal wszRL As LongPtr, _
    ByVal pstFrequency As LongPtr, _
    ByRef puNameLength As Long, _
    ByVal wszName As LongPtr, _
    ByRef puPublicKeyLength As Long, _
    ByVal wszPublicKey As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DRMGetRevocationPoint = ctypes.windll.msdrm.DRMGetRevocationPoint
DRMGetRevocationPoint.restype = ctypes.c_int
DRMGetRevocationPoint.argtypes = [
    wintypes.DWORD,  # hIssuanceLicense : DWORD
    ctypes.POINTER(wintypes.DWORD),  # puIdLength : DWORD* in/out
    wintypes.LPWSTR,  # wszId : LPWSTR optional, out
    ctypes.POINTER(wintypes.DWORD),  # puIdTypeLength : DWORD* in/out
    wintypes.LPWSTR,  # wszIdType : LPWSTR optional, out
    ctypes.POINTER(wintypes.DWORD),  # puURLLength : DWORD* in/out
    wintypes.LPWSTR,  # wszRL : LPWSTR optional, out
    ctypes.c_void_p,  # pstFrequency : SYSTEMTIME* in/out
    ctypes.POINTER(wintypes.DWORD),  # puNameLength : DWORD* in/out
    wintypes.LPWSTR,  # wszName : LPWSTR optional, out
    ctypes.POINTER(wintypes.DWORD),  # puPublicKeyLength : DWORD* in/out
    wintypes.LPWSTR,  # wszPublicKey : LPWSTR optional, out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('msdrm.dll')
DRMGetRevocationPoint = Fiddle::Function.new(
  lib['DRMGetRevocationPoint'],
  [
    -Fiddle::TYPE_INT,  # hIssuanceLicense : DWORD
    Fiddle::TYPE_VOIDP,  # puIdLength : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # wszId : LPWSTR optional, out
    Fiddle::TYPE_VOIDP,  # puIdTypeLength : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # wszIdType : LPWSTR optional, out
    Fiddle::TYPE_VOIDP,  # puURLLength : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # wszRL : LPWSTR optional, out
    Fiddle::TYPE_VOIDP,  # pstFrequency : SYSTEMTIME* in/out
    Fiddle::TYPE_VOIDP,  # puNameLength : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # wszName : LPWSTR optional, out
    Fiddle::TYPE_VOIDP,  # puPublicKeyLength : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # wszPublicKey : LPWSTR optional, out
  ],
  Fiddle::TYPE_INT)
#[link(name = "msdrm")]
extern "system" {
    fn DRMGetRevocationPoint(
        hIssuanceLicense: u32,  // DWORD
        puIdLength: *mut u32,  // DWORD* in/out
        wszId: *mut u16,  // LPWSTR optional, out
        puIdTypeLength: *mut u32,  // DWORD* in/out
        wszIdType: *mut u16,  // LPWSTR optional, out
        puURLLength: *mut u32,  // DWORD* in/out
        wszRL: *mut u16,  // LPWSTR optional, out
        pstFrequency: *mut SYSTEMTIME,  // SYSTEMTIME* in/out
        puNameLength: *mut u32,  // DWORD* in/out
        wszName: *mut u16,  // LPWSTR optional, out
        puPublicKeyLength: *mut u32,  // DWORD* in/out
        wszPublicKey: *mut u16  // LPWSTR optional, out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("msdrm.dll")]
public static extern int DRMGetRevocationPoint(uint hIssuanceLicense, ref uint puIdLength, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszId, ref uint puIdTypeLength, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszIdType, ref uint puURLLength, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszRL, IntPtr pstFrequency, ref uint puNameLength, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszName, ref uint puPublicKeyLength, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder wszPublicKey);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msdrm_DRMGetRevocationPoint' -Namespace Win32 -PassThru
# $api::DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey)
#uselib "msdrm.dll"
#func global DRMGetRevocationPoint "DRMGetRevocationPoint" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; DRMGetRevocationPoint hIssuanceLicense, varptr(puIdLength), varptr(wszId), varptr(puIdTypeLength), varptr(wszIdType), varptr(puURLLength), varptr(wszRL), varptr(pstFrequency), varptr(puNameLength), varptr(wszName), varptr(puPublicKeyLength), varptr(wszPublicKey)   ; 戻り値は stat
; hIssuanceLicense : DWORD -> "sptr"
; puIdLength : DWORD* in/out -> "sptr"
; wszId : LPWSTR optional, out -> "sptr"
; puIdTypeLength : DWORD* in/out -> "sptr"
; wszIdType : LPWSTR optional, out -> "sptr"
; puURLLength : DWORD* in/out -> "sptr"
; wszRL : LPWSTR optional, out -> "sptr"
; pstFrequency : SYSTEMTIME* in/out -> "sptr"
; puNameLength : DWORD* in/out -> "sptr"
; wszName : LPWSTR optional, out -> "sptr"
; puPublicKeyLength : DWORD* in/out -> "sptr"
; wszPublicKey : LPWSTR optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "msdrm.dll"
#cfunc global DRMGetRevocationPoint "DRMGetRevocationPoint" int, var, var, var, var, var, var, var, var, var, var, var
; res = DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey)
; hIssuanceLicense : DWORD -> "int"
; puIdLength : DWORD* in/out -> "var"
; wszId : LPWSTR optional, out -> "var"
; puIdTypeLength : DWORD* in/out -> "var"
; wszIdType : LPWSTR optional, out -> "var"
; puURLLength : DWORD* in/out -> "var"
; wszRL : LPWSTR optional, out -> "var"
; pstFrequency : SYSTEMTIME* in/out -> "var"
; puNameLength : DWORD* in/out -> "var"
; wszName : LPWSTR optional, out -> "var"
; puPublicKeyLength : DWORD* in/out -> "var"
; wszPublicKey : LPWSTR optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT DRMGetRevocationPoint(DWORD hIssuanceLicense, DWORD* puIdLength, LPWSTR wszId, DWORD* puIdTypeLength, LPWSTR wszIdType, DWORD* puURLLength, LPWSTR wszRL, SYSTEMTIME* pstFrequency, DWORD* puNameLength, LPWSTR wszName, DWORD* puPublicKeyLength, LPWSTR wszPublicKey)
#uselib "msdrm.dll"
#cfunc global DRMGetRevocationPoint "DRMGetRevocationPoint" int, var, var, var, var, var, var, var, var, var, var, var
; res = DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey)
; hIssuanceLicense : DWORD -> "int"
; puIdLength : DWORD* in/out -> "var"
; wszId : LPWSTR optional, out -> "var"
; puIdTypeLength : DWORD* in/out -> "var"
; wszIdType : LPWSTR optional, out -> "var"
; puURLLength : DWORD* in/out -> "var"
; wszRL : LPWSTR optional, out -> "var"
; pstFrequency : SYSTEMTIME* in/out -> "var"
; puNameLength : DWORD* in/out -> "var"
; wszName : LPWSTR optional, out -> "var"
; puPublicKeyLength : DWORD* in/out -> "var"
; wszPublicKey : LPWSTR optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msdrm = windows.NewLazySystemDLL("msdrm.dll")
	procDRMGetRevocationPoint = msdrm.NewProc("DRMGetRevocationPoint")
)

// hIssuanceLicense (DWORD), puIdLength (DWORD* in/out), wszId (LPWSTR optional, out), puIdTypeLength (DWORD* in/out), wszIdType (LPWSTR optional, out), puURLLength (DWORD* in/out), wszRL (LPWSTR optional, out), pstFrequency (SYSTEMTIME* in/out), puNameLength (DWORD* in/out), wszName (LPWSTR optional, out), puPublicKeyLength (DWORD* in/out), wszPublicKey (LPWSTR optional, out)
r1, _, err := procDRMGetRevocationPoint.Call(
	uintptr(hIssuanceLicense),
	uintptr(puIdLength),
	uintptr(wszId),
	uintptr(puIdTypeLength),
	uintptr(wszIdType),
	uintptr(puURLLength),
	uintptr(wszRL),
	uintptr(pstFrequency),
	uintptr(puNameLength),
	uintptr(wszName),
	uintptr(puPublicKeyLength),
	uintptr(wszPublicKey),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function DRMGetRevocationPoint(
  hIssuanceLicense: DWORD;   // DWORD
  puIdLength: Pointer;   // DWORD* in/out
  wszId: PWideChar;   // LPWSTR optional, out
  puIdTypeLength: Pointer;   // DWORD* in/out
  wszIdType: PWideChar;   // LPWSTR optional, out
  puURLLength: Pointer;   // DWORD* in/out
  wszRL: PWideChar;   // LPWSTR optional, out
  pstFrequency: Pointer;   // SYSTEMTIME* in/out
  puNameLength: Pointer;   // DWORD* in/out
  wszName: PWideChar;   // LPWSTR optional, out
  puPublicKeyLength: Pointer;   // DWORD* in/out
  wszPublicKey: PWideChar   // LPWSTR optional, out
): Integer; stdcall;
  external 'msdrm.dll' name 'DRMGetRevocationPoint';
result := DllCall("msdrm\DRMGetRevocationPoint"
    , "UInt", hIssuanceLicense   ; DWORD
    , "Ptr", puIdLength   ; DWORD* in/out
    , "Ptr", wszId   ; LPWSTR optional, out
    , "Ptr", puIdTypeLength   ; DWORD* in/out
    , "Ptr", wszIdType   ; LPWSTR optional, out
    , "Ptr", puURLLength   ; DWORD* in/out
    , "Ptr", wszRL   ; LPWSTR optional, out
    , "Ptr", pstFrequency   ; SYSTEMTIME* in/out
    , "Ptr", puNameLength   ; DWORD* in/out
    , "Ptr", wszName   ; LPWSTR optional, out
    , "Ptr", puPublicKeyLength   ; DWORD* in/out
    , "Ptr", wszPublicKey   ; LPWSTR optional, out
    , "Int")   ; return: HRESULT
●DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey) = DLL("msdrm.dll", "int DRMGetRevocationPoint(dword, void*, char*, void*, char*, void*, char*, void*, void*, char*, void*, char*)")
# 呼び出し: DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey)
# hIssuanceLicense : DWORD -> "dword"
# puIdLength : DWORD* in/out -> "void*"
# wszId : LPWSTR optional, out -> "char*"
# puIdTypeLength : DWORD* in/out -> "void*"
# wszIdType : LPWSTR optional, out -> "char*"
# puURLLength : DWORD* in/out -> "void*"
# wszRL : LPWSTR optional, out -> "char*"
# pstFrequency : SYSTEMTIME* in/out -> "void*"
# puNameLength : DWORD* in/out -> "void*"
# wszName : LPWSTR optional, out -> "char*"
# puPublicKeyLength : DWORD* in/out -> "void*"
# wszPublicKey : LPWSTR optional, out -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "msdrm" fn DRMGetRevocationPoint(
    hIssuanceLicense: u32, // DWORD
    puIdLength: [*c]u32, // DWORD* in/out
    wszId: [*c]u16, // LPWSTR optional, out
    puIdTypeLength: [*c]u32, // DWORD* in/out
    wszIdType: [*c]u16, // LPWSTR optional, out
    puURLLength: [*c]u32, // DWORD* in/out
    wszRL: [*c]u16, // LPWSTR optional, out
    pstFrequency: [*c]SYSTEMTIME, // SYSTEMTIME* in/out
    puNameLength: [*c]u32, // DWORD* in/out
    wszName: [*c]u16, // LPWSTR optional, out
    puPublicKeyLength: [*c]u32, // DWORD* in/out
    wszPublicKey: [*c]u16 // LPWSTR optional, out
) callconv(std.os.windows.WINAPI) i32;
proc DRMGetRevocationPoint(
    hIssuanceLicense: uint32,  # DWORD
    puIdLength: ptr uint32,  # DWORD* in/out
    wszId: ptr uint16,  # LPWSTR optional, out
    puIdTypeLength: ptr uint32,  # DWORD* in/out
    wszIdType: ptr uint16,  # LPWSTR optional, out
    puURLLength: ptr uint32,  # DWORD* in/out
    wszRL: ptr uint16,  # LPWSTR optional, out
    pstFrequency: ptr SYSTEMTIME,  # SYSTEMTIME* in/out
    puNameLength: ptr uint32,  # DWORD* in/out
    wszName: ptr uint16,  # LPWSTR optional, out
    puPublicKeyLength: ptr uint32,  # DWORD* in/out
    wszPublicKey: ptr uint16  # LPWSTR optional, out
): int32 {.importc: "DRMGetRevocationPoint", stdcall, dynlib: "msdrm.dll".}
pragma(lib, "msdrm");
extern(Windows)
int DRMGetRevocationPoint(
    uint hIssuanceLicense,   // DWORD
    uint* puIdLength,   // DWORD* in/out
    wchar* wszId,   // LPWSTR optional, out
    uint* puIdTypeLength,   // DWORD* in/out
    wchar* wszIdType,   // LPWSTR optional, out
    uint* puURLLength,   // DWORD* in/out
    wchar* wszRL,   // LPWSTR optional, out
    SYSTEMTIME* pstFrequency,   // SYSTEMTIME* in/out
    uint* puNameLength,   // DWORD* in/out
    wchar* wszName,   // LPWSTR optional, out
    uint* puPublicKeyLength,   // DWORD* in/out
    wchar* wszPublicKey   // LPWSTR optional, out
);
ccall((:DRMGetRevocationPoint, "msdrm.dll"), stdcall, Int32,
      (UInt32, Ptr{UInt32}, Ptr{UInt16}, Ptr{UInt32}, Ptr{UInt16}, Ptr{UInt32}, Ptr{UInt16}, Ptr{SYSTEMTIME}, Ptr{UInt32}, Ptr{UInt16}, Ptr{UInt32}, Ptr{UInt16}),
      hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey)
# hIssuanceLicense : DWORD -> UInt32
# puIdLength : DWORD* in/out -> Ptr{UInt32}
# wszId : LPWSTR optional, out -> Ptr{UInt16}
# puIdTypeLength : DWORD* in/out -> Ptr{UInt32}
# wszIdType : LPWSTR optional, out -> Ptr{UInt16}
# puURLLength : DWORD* in/out -> Ptr{UInt32}
# wszRL : LPWSTR optional, out -> Ptr{UInt16}
# pstFrequency : SYSTEMTIME* in/out -> Ptr{SYSTEMTIME}
# puNameLength : DWORD* in/out -> Ptr{UInt32}
# wszName : LPWSTR optional, out -> Ptr{UInt16}
# puPublicKeyLength : DWORD* in/out -> Ptr{UInt32}
# wszPublicKey : LPWSTR optional, out -> Ptr{UInt16}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t DRMGetRevocationPoint(
    uint32_t hIssuanceLicense,
    uint32_t* puIdLength,
    uint16_t* wszId,
    uint32_t* puIdTypeLength,
    uint16_t* wszIdType,
    uint32_t* puURLLength,
    uint16_t* wszRL,
    void* pstFrequency,
    uint32_t* puNameLength,
    uint16_t* wszName,
    uint32_t* puPublicKeyLength,
    uint16_t* wszPublicKey);
]]
local msdrm = ffi.load("msdrm")
-- msdrm.DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey)
-- hIssuanceLicense : DWORD
-- puIdLength : DWORD* in/out
-- wszId : LPWSTR optional, out
-- puIdTypeLength : DWORD* in/out
-- wszIdType : LPWSTR optional, out
-- puURLLength : DWORD* in/out
-- wszRL : LPWSTR optional, out
-- pstFrequency : SYSTEMTIME* in/out
-- puNameLength : DWORD* in/out
-- wszName : LPWSTR optional, out
-- puPublicKeyLength : DWORD* in/out
-- wszPublicKey : LPWSTR optional, out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('msdrm.dll');
const DRMGetRevocationPoint = lib.func('__stdcall', 'DRMGetRevocationPoint', 'int32_t', ['uint32_t', 'uint32_t *', 'uint16_t *', 'uint32_t *', 'uint16_t *', 'uint32_t *', 'uint16_t *', 'void *', 'uint32_t *', 'uint16_t *', 'uint32_t *', 'uint16_t *']);
// DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey)
// hIssuanceLicense : DWORD -> 'uint32_t'
// puIdLength : DWORD* in/out -> 'uint32_t *'
// wszId : LPWSTR optional, out -> 'uint16_t *'
// puIdTypeLength : DWORD* in/out -> 'uint32_t *'
// wszIdType : LPWSTR optional, out -> 'uint16_t *'
// puURLLength : DWORD* in/out -> 'uint32_t *'
// wszRL : LPWSTR optional, out -> 'uint16_t *'
// pstFrequency : SYSTEMTIME* in/out -> 'void *'
// puNameLength : DWORD* in/out -> 'uint32_t *'
// wszName : LPWSTR optional, out -> 'uint16_t *'
// puPublicKeyLength : DWORD* in/out -> 'uint32_t *'
// wszPublicKey : LPWSTR optional, out -> 'uint16_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("msdrm.dll", {
  DRMGetRevocationPoint: { parameters: ["u32", "pointer", "buffer", "pointer", "buffer", "pointer", "buffer", "pointer", "pointer", "buffer", "pointer", "buffer"], result: "i32" },
});
// lib.symbols.DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey)
// hIssuanceLicense : DWORD -> "u32"
// puIdLength : DWORD* in/out -> "pointer"
// wszId : LPWSTR optional, out -> "buffer"
// puIdTypeLength : DWORD* in/out -> "pointer"
// wszIdType : LPWSTR optional, out -> "buffer"
// puURLLength : DWORD* in/out -> "pointer"
// wszRL : LPWSTR optional, out -> "buffer"
// pstFrequency : SYSTEMTIME* in/out -> "pointer"
// puNameLength : DWORD* in/out -> "pointer"
// wszName : LPWSTR optional, out -> "buffer"
// puPublicKeyLength : DWORD* in/out -> "pointer"
// wszPublicKey : LPWSTR optional, out -> "buffer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t DRMGetRevocationPoint(
    uint32_t hIssuanceLicense,
    uint32_t* puIdLength,
    uint16_t* wszId,
    uint32_t* puIdTypeLength,
    uint16_t* wszIdType,
    uint32_t* puURLLength,
    uint16_t* wszRL,
    void* pstFrequency,
    uint32_t* puNameLength,
    uint16_t* wszName,
    uint32_t* puPublicKeyLength,
    uint16_t* wszPublicKey);
C, "msdrm.dll");
// $ffi->DRMGetRevocationPoint(hIssuanceLicense, puIdLength, wszId, puIdTypeLength, wszIdType, puURLLength, wszRL, pstFrequency, puNameLength, wszName, puPublicKeyLength, wszPublicKey);
// hIssuanceLicense : DWORD
// puIdLength : DWORD* in/out
// wszId : LPWSTR optional, out
// puIdTypeLength : DWORD* in/out
// wszIdType : LPWSTR optional, out
// puURLLength : DWORD* in/out
// wszRL : LPWSTR optional, out
// pstFrequency : SYSTEMTIME* in/out
// puNameLength : DWORD* in/out
// wszName : LPWSTR optional, out
// puPublicKeyLength : DWORD* in/out
// wszPublicKey : 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 DRMGetRevocationPoint(
        int hIssuanceLicense,   // DWORD
        IntByReference puIdLength,   // DWORD* in/out
        char[] wszId,   // LPWSTR optional, out
        IntByReference puIdTypeLength,   // DWORD* in/out
        char[] wszIdType,   // LPWSTR optional, out
        IntByReference puURLLength,   // DWORD* in/out
        char[] wszRL,   // LPWSTR optional, out
        Pointer pstFrequency,   // SYSTEMTIME* in/out
        IntByReference puNameLength,   // DWORD* in/out
        char[] wszName,   // LPWSTR optional, out
        IntByReference puPublicKeyLength,   // DWORD* in/out
        char[] wszPublicKey   // LPWSTR optional, out
    );
}
@[Link("msdrm")]
lib Libmsdrm
  fun DRMGetRevocationPoint = DRMGetRevocationPoint(
    hIssuanceLicense : UInt32,   # DWORD
    puIdLength : UInt32*,   # DWORD* in/out
    wszId : UInt16*,   # LPWSTR optional, out
    puIdTypeLength : UInt32*,   # DWORD* in/out
    wszIdType : UInt16*,   # LPWSTR optional, out
    puURLLength : UInt32*,   # DWORD* in/out
    wszRL : UInt16*,   # LPWSTR optional, out
    pstFrequency : SYSTEMTIME*,   # SYSTEMTIME* in/out
    puNameLength : UInt32*,   # DWORD* in/out
    wszName : UInt16*,   # LPWSTR optional, out
    puPublicKeyLength : UInt32*,   # DWORD* in/out
    wszPublicKey : 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 DRMGetRevocationPointNative = Int32 Function(Uint32, Pointer<Uint32>, Pointer<Utf16>, Pointer<Uint32>, Pointer<Utf16>, Pointer<Uint32>, Pointer<Utf16>, Pointer<Void>, Pointer<Uint32>, Pointer<Utf16>, Pointer<Uint32>, Pointer<Utf16>);
typedef DRMGetRevocationPointDart = int Function(int, Pointer<Uint32>, Pointer<Utf16>, Pointer<Uint32>, Pointer<Utf16>, Pointer<Uint32>, Pointer<Utf16>, Pointer<Void>, Pointer<Uint32>, Pointer<Utf16>, Pointer<Uint32>, Pointer<Utf16>);
final DRMGetRevocationPoint = DynamicLibrary.open('msdrm.dll')
    .lookupFunction<DRMGetRevocationPointNative, DRMGetRevocationPointDart>('DRMGetRevocationPoint');
// hIssuanceLicense : DWORD -> Uint32
// puIdLength : DWORD* in/out -> Pointer<Uint32>
// wszId : LPWSTR optional, out -> Pointer<Utf16>
// puIdTypeLength : DWORD* in/out -> Pointer<Uint32>
// wszIdType : LPWSTR optional, out -> Pointer<Utf16>
// puURLLength : DWORD* in/out -> Pointer<Uint32>
// wszRL : LPWSTR optional, out -> Pointer<Utf16>
// pstFrequency : SYSTEMTIME* in/out -> Pointer<Void>
// puNameLength : DWORD* in/out -> Pointer<Uint32>
// wszName : LPWSTR optional, out -> Pointer<Utf16>
// puPublicKeyLength : DWORD* in/out -> Pointer<Uint32>
// wszPublicKey : LPWSTR optional, out -> Pointer<Utf16>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function DRMGetRevocationPoint(
  hIssuanceLicense: DWORD;   // DWORD
  puIdLength: Pointer;   // DWORD* in/out
  wszId: PWideChar;   // LPWSTR optional, out
  puIdTypeLength: Pointer;   // DWORD* in/out
  wszIdType: PWideChar;   // LPWSTR optional, out
  puURLLength: Pointer;   // DWORD* in/out
  wszRL: PWideChar;   // LPWSTR optional, out
  pstFrequency: Pointer;   // SYSTEMTIME* in/out
  puNameLength: Pointer;   // DWORD* in/out
  wszName: PWideChar;   // LPWSTR optional, out
  puPublicKeyLength: Pointer;   // DWORD* in/out
  wszPublicKey: PWideChar   // LPWSTR optional, out
): Integer; stdcall;
  external 'msdrm.dll' name 'DRMGetRevocationPoint';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "DRMGetRevocationPoint"
  c_DRMGetRevocationPoint :: Word32 -> Ptr Word32 -> CWString -> Ptr Word32 -> CWString -> Ptr Word32 -> CWString -> Ptr () -> Ptr Word32 -> CWString -> Ptr Word32 -> CWString -> IO Int32
-- hIssuanceLicense : DWORD -> Word32
-- puIdLength : DWORD* in/out -> Ptr Word32
-- wszId : LPWSTR optional, out -> CWString
-- puIdTypeLength : DWORD* in/out -> Ptr Word32
-- wszIdType : LPWSTR optional, out -> CWString
-- puURLLength : DWORD* in/out -> Ptr Word32
-- wszRL : LPWSTR optional, out -> CWString
-- pstFrequency : SYSTEMTIME* in/out -> Ptr ()
-- puNameLength : DWORD* in/out -> Ptr Word32
-- wszName : LPWSTR optional, out -> CWString
-- puPublicKeyLength : DWORD* in/out -> Ptr Word32
-- wszPublicKey : LPWSTR optional, out -> CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let drmgetrevocationpoint =
  foreign "DRMGetRevocationPoint"
    (uint32_t @-> (ptr uint32_t) @-> (ptr uint16_t) @-> (ptr uint32_t) @-> (ptr uint16_t) @-> (ptr uint32_t) @-> (ptr uint16_t) @-> (ptr void) @-> (ptr uint32_t) @-> (ptr uint16_t) @-> (ptr uint32_t) @-> (ptr uint16_t) @-> returning int32_t)
(* hIssuanceLicense : DWORD -> uint32_t *)
(* puIdLength : DWORD* in/out -> (ptr uint32_t) *)
(* wszId : LPWSTR optional, out -> (ptr uint16_t) *)
(* puIdTypeLength : DWORD* in/out -> (ptr uint32_t) *)
(* wszIdType : LPWSTR optional, out -> (ptr uint16_t) *)
(* puURLLength : DWORD* in/out -> (ptr uint32_t) *)
(* wszRL : LPWSTR optional, out -> (ptr uint16_t) *)
(* pstFrequency : SYSTEMTIME* in/out -> (ptr void) *)
(* puNameLength : DWORD* in/out -> (ptr uint32_t) *)
(* wszName : LPWSTR optional, out -> (ptr uint16_t) *)
(* puPublicKeyLength : DWORD* in/out -> (ptr uint32_t) *)
(* wszPublicKey : 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 ("DRMGetRevocationPoint" drmget-revocation-point :convention :stdcall) :int32
  (h-issuance-license :uint32)   ; DWORD
  (pu-id-length :pointer)   ; DWORD* in/out
  (wsz-id :pointer)   ; LPWSTR optional, out
  (pu-id-type-length :pointer)   ; DWORD* in/out
  (wsz-id-type :pointer)   ; LPWSTR optional, out
  (pu-urllength :pointer)   ; DWORD* in/out
  (wsz-rl :pointer)   ; LPWSTR optional, out
  (pst-frequency :pointer)   ; SYSTEMTIME* in/out
  (pu-name-length :pointer)   ; DWORD* in/out
  (wsz-name :pointer)   ; LPWSTR optional, out
  (pu-public-key-length :pointer)   ; DWORD* in/out
  (wsz-public-key :pointer))   ; LPWSTR optional, out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $DRMGetRevocationPoint = Win32::API::More->new('msdrm',
    'int DRMGetRevocationPoint(DWORD hIssuanceLicense, LPVOID puIdLength, LPWSTR wszId, LPVOID puIdTypeLength, LPWSTR wszIdType, LPVOID puURLLength, LPWSTR wszRL, LPVOID pstFrequency, LPVOID puNameLength, LPWSTR wszName, LPVOID puPublicKeyLength, LPWSTR wszPublicKey)');
# my $ret = $DRMGetRevocationPoint->Call($hIssuanceLicense, $puIdLength, $wszId, $puIdTypeLength, $wszIdType, $puURLLength, $wszRL, $pstFrequency, $puNameLength, $wszName, $puPublicKeyLength, $wszPublicKey);
# hIssuanceLicense : DWORD -> DWORD
# puIdLength : DWORD* in/out -> LPVOID
# wszId : LPWSTR optional, out -> LPWSTR
# puIdTypeLength : DWORD* in/out -> LPVOID
# wszIdType : LPWSTR optional, out -> LPWSTR
# puURLLength : DWORD* in/out -> LPVOID
# wszRL : LPWSTR optional, out -> LPWSTR
# pstFrequency : SYSTEMTIME* in/out -> LPVOID
# puNameLength : DWORD* in/out -> LPVOID
# wszName : LPWSTR optional, out -> LPWSTR
# puPublicKeyLength : DWORD* in/out -> LPVOID
# wszPublicKey : LPWSTR optional, out -> LPWSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型