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

DRMSetRevocationPoint

関数
発行ライセンスに失効ポイントを設定する。
DLLmsdrm.dll呼出規約winapi

シグネチャ

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

HRESULT DRMSetRevocationPoint(
    DWORD hIssuanceLicense,
    BOOL fDelete,
    LPWSTR wszId,
    LPWSTR wszIdType,
    LPWSTR wszURL,
    SYSTEMTIME* pstFrequency,
    LPWSTR wszName,   // optional
    LPWSTR wszPublicKey   // optional
);

パラメーター

名前方向説明
hIssuanceLicenseDWORDin対象の発行ライセンスハンドル。
fDeleteBOOLin失効ポイントを削除する場合TRUEを指定するブール値。
wszIdLPWSTRin失効ポイントのIDを示すUnicode文字列。
wszIdTypeLPWSTRin失効ポイントIDの種別を示すUnicode文字列。
wszURLLPWSTRin失効リストの取得URLを示すUnicode文字列。
pstFrequencySYSTEMTIME*inout失効リスト更新頻度を示すSYSTEMTIMEポインタ。
wszNameLPWSTRinoptional失効ポイントの名前を示すUnicode文字列。
wszPublicKeyLPWSTRinoptional失効リスト検証用の公開鍵を示すUnicode文字列。

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DRMSetRevocationPoint(
    DWORD hIssuanceLicense,
    BOOL fDelete,
    LPWSTR wszId,
    LPWSTR wszIdType,
    LPWSTR wszURL,
    SYSTEMTIME* pstFrequency,
    LPWSTR wszName,   // optional
    LPWSTR wszPublicKey   // optional
);
[DllImport("msdrm.dll", ExactSpelling = true)]
static extern int DRMSetRevocationPoint(
    uint hIssuanceLicense,   // DWORD
    bool fDelete,   // BOOL
    [MarshalAs(UnmanagedType.LPWStr)] string wszId,   // LPWSTR
    [MarshalAs(UnmanagedType.LPWStr)] string wszIdType,   // LPWSTR
    [MarshalAs(UnmanagedType.LPWStr)] string wszURL,   // LPWSTR
    IntPtr pstFrequency,   // SYSTEMTIME* in/out
    [MarshalAs(UnmanagedType.LPWStr)] string wszName,   // LPWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string wszPublicKey   // LPWSTR optional
);
<DllImport("msdrm.dll", ExactSpelling:=True)>
Public Shared Function DRMSetRevocationPoint(
    hIssuanceLicense As UInteger,   ' DWORD
    fDelete As Boolean,   ' BOOL
    <MarshalAs(UnmanagedType.LPWStr)> wszId As String,   ' LPWSTR
    <MarshalAs(UnmanagedType.LPWStr)> wszIdType As String,   ' LPWSTR
    <MarshalAs(UnmanagedType.LPWStr)> wszURL As String,   ' LPWSTR
    pstFrequency As IntPtr,   ' SYSTEMTIME* in/out
    <MarshalAs(UnmanagedType.LPWStr)> wszName As String,   ' LPWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> wszPublicKey As String   ' LPWSTR optional
) As Integer
End Function
' hIssuanceLicense : DWORD
' fDelete : BOOL
' wszId : LPWSTR
' wszIdType : LPWSTR
' wszURL : LPWSTR
' pstFrequency : SYSTEMTIME* in/out
' wszName : LPWSTR optional
' wszPublicKey : LPWSTR optional
Declare PtrSafe Function DRMSetRevocationPoint Lib "msdrm" ( _
    ByVal hIssuanceLicense As Long, _
    ByVal fDelete As Long, _
    ByVal wszId As LongPtr, _
    ByVal wszIdType As LongPtr, _
    ByVal wszURL As LongPtr, _
    ByVal pstFrequency As LongPtr, _
    ByVal wszName As LongPtr, _
    ByVal wszPublicKey As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DRMSetRevocationPoint = ctypes.windll.msdrm.DRMSetRevocationPoint
DRMSetRevocationPoint.restype = ctypes.c_int
DRMSetRevocationPoint.argtypes = [
    wintypes.DWORD,  # hIssuanceLicense : DWORD
    wintypes.BOOL,  # fDelete : BOOL
    wintypes.LPCWSTR,  # wszId : LPWSTR
    wintypes.LPCWSTR,  # wszIdType : LPWSTR
    wintypes.LPCWSTR,  # wszURL : LPWSTR
    ctypes.c_void_p,  # pstFrequency : SYSTEMTIME* in/out
    wintypes.LPCWSTR,  # wszName : LPWSTR optional
    wintypes.LPCWSTR,  # wszPublicKey : LPWSTR optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msdrm = windows.NewLazySystemDLL("msdrm.dll")
	procDRMSetRevocationPoint = msdrm.NewProc("DRMSetRevocationPoint")
)

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

extern "msdrm" fn DRMSetRevocationPoint(
    hIssuanceLicense: u32, // DWORD
    fDelete: i32, // BOOL
    wszId: [*c]const u16, // LPWSTR
    wszIdType: [*c]const u16, // LPWSTR
    wszURL: [*c]const u16, // LPWSTR
    pstFrequency: [*c]SYSTEMTIME, // SYSTEMTIME* in/out
    wszName: [*c]const u16, // LPWSTR optional
    wszPublicKey: [*c]const u16 // LPWSTR optional
) callconv(std.os.windows.WINAPI) i32;
proc DRMSetRevocationPoint(
    hIssuanceLicense: uint32,  # DWORD
    fDelete: int32,  # BOOL
    wszId: WideCString,  # LPWSTR
    wszIdType: WideCString,  # LPWSTR
    wszURL: WideCString,  # LPWSTR
    pstFrequency: ptr SYSTEMTIME,  # SYSTEMTIME* in/out
    wszName: WideCString,  # LPWSTR optional
    wszPublicKey: WideCString  # LPWSTR optional
): int32 {.importc: "DRMSetRevocationPoint", stdcall, dynlib: "msdrm.dll".}
pragma(lib, "msdrm");
extern(Windows)
int DRMSetRevocationPoint(
    uint hIssuanceLicense,   // DWORD
    int fDelete,   // BOOL
    const(wchar)* wszId,   // LPWSTR
    const(wchar)* wszIdType,   // LPWSTR
    const(wchar)* wszURL,   // LPWSTR
    SYSTEMTIME* pstFrequency,   // SYSTEMTIME* in/out
    const(wchar)* wszName,   // LPWSTR optional
    const(wchar)* wszPublicKey   // LPWSTR optional
);
ccall((:DRMSetRevocationPoint, "msdrm.dll"), stdcall, Int32,
      (UInt32, Int32, Cwstring, Cwstring, Cwstring, Ptr{SYSTEMTIME}, Cwstring, Cwstring),
      hIssuanceLicense, fDelete, wszId, wszIdType, wszURL, pstFrequency, wszName, wszPublicKey)
# hIssuanceLicense : DWORD -> UInt32
# fDelete : BOOL -> Int32
# wszId : LPWSTR -> Cwstring
# wszIdType : LPWSTR -> Cwstring
# wszURL : LPWSTR -> Cwstring
# pstFrequency : SYSTEMTIME* in/out -> Ptr{SYSTEMTIME}
# wszName : LPWSTR optional -> Cwstring
# wszPublicKey : LPWSTR optional -> Cwstring
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t DRMSetRevocationPoint(
    uint32_t hIssuanceLicense,
    int32_t fDelete,
    const uint16_t* wszId,
    const uint16_t* wszIdType,
    const uint16_t* wszURL,
    void* pstFrequency,
    const uint16_t* wszName,
    const uint16_t* wszPublicKey);
]]
local msdrm = ffi.load("msdrm")
-- msdrm.DRMSetRevocationPoint(hIssuanceLicense, fDelete, wszId, wszIdType, wszURL, pstFrequency, wszName, wszPublicKey)
-- hIssuanceLicense : DWORD
-- fDelete : BOOL
-- wszId : LPWSTR
-- wszIdType : LPWSTR
-- wszURL : LPWSTR
-- pstFrequency : SYSTEMTIME* in/out
-- wszName : LPWSTR optional
-- wszPublicKey : LPWSTR optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('msdrm.dll');
const DRMSetRevocationPoint = lib.func('__stdcall', 'DRMSetRevocationPoint', 'int32_t', ['uint32_t', 'int32_t', 'str16', 'str16', 'str16', 'void *', 'str16', 'str16']);
// DRMSetRevocationPoint(hIssuanceLicense, fDelete, wszId, wszIdType, wszURL, pstFrequency, wszName, wszPublicKey)
// hIssuanceLicense : DWORD -> 'uint32_t'
// fDelete : BOOL -> 'int32_t'
// wszId : LPWSTR -> 'str16'
// wszIdType : LPWSTR -> 'str16'
// wszURL : LPWSTR -> 'str16'
// pstFrequency : SYSTEMTIME* in/out -> 'void *'
// wszName : LPWSTR optional -> 'str16'
// wszPublicKey : LPWSTR optional -> 'str16'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("msdrm.dll", {
  DRMSetRevocationPoint: { parameters: ["u32", "i32", "buffer", "buffer", "buffer", "pointer", "buffer", "buffer"], result: "i32" },
});
// lib.symbols.DRMSetRevocationPoint(hIssuanceLicense, fDelete, wszId, wszIdType, wszURL, pstFrequency, wszName, wszPublicKey)
// hIssuanceLicense : DWORD -> "u32"
// fDelete : BOOL -> "i32"
// wszId : LPWSTR -> "buffer"
// wszIdType : LPWSTR -> "buffer"
// wszURL : LPWSTR -> "buffer"
// pstFrequency : SYSTEMTIME* in/out -> "pointer"
// wszName : LPWSTR optional -> "buffer"
// wszPublicKey : LPWSTR optional -> "buffer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t DRMSetRevocationPoint(
    uint32_t hIssuanceLicense,
    int32_t fDelete,
    const uint16_t* wszId,
    const uint16_t* wszIdType,
    const uint16_t* wszURL,
    void* pstFrequency,
    const uint16_t* wszName,
    const uint16_t* wszPublicKey);
C, "msdrm.dll");
// $ffi->DRMSetRevocationPoint(hIssuanceLicense, fDelete, wszId, wszIdType, wszURL, pstFrequency, wszName, wszPublicKey);
// hIssuanceLicense : DWORD
// fDelete : BOOL
// wszId : LPWSTR
// wszIdType : LPWSTR
// wszURL : LPWSTR
// pstFrequency : SYSTEMTIME* in/out
// wszName : LPWSTR optional
// wszPublicKey : LPWSTR optional
// 構造体/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 DRMSetRevocationPoint(
        int hIssuanceLicense,   // DWORD
        boolean fDelete,   // BOOL
        WString wszId,   // LPWSTR
        WString wszIdType,   // LPWSTR
        WString wszURL,   // LPWSTR
        Pointer pstFrequency,   // SYSTEMTIME* in/out
        WString wszName,   // LPWSTR optional
        WString wszPublicKey   // LPWSTR optional
    );
}
@[Link("msdrm")]
lib Libmsdrm
  fun DRMSetRevocationPoint = DRMSetRevocationPoint(
    hIssuanceLicense : UInt32,   # DWORD
    fDelete : Int32,   # BOOL
    wszId : UInt16*,   # LPWSTR
    wszIdType : UInt16*,   # LPWSTR
    wszURL : UInt16*,   # LPWSTR
    pstFrequency : SYSTEMTIME*,   # SYSTEMTIME* in/out
    wszName : UInt16*,   # LPWSTR optional
    wszPublicKey : UInt16*   # LPWSTR optional
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef DRMSetRevocationPointNative = Int32 Function(Uint32, Int32, Pointer<Utf16>, Pointer<Utf16>, Pointer<Utf16>, Pointer<Void>, Pointer<Utf16>, Pointer<Utf16>);
typedef DRMSetRevocationPointDart = int Function(int, int, Pointer<Utf16>, Pointer<Utf16>, Pointer<Utf16>, Pointer<Void>, Pointer<Utf16>, Pointer<Utf16>);
final DRMSetRevocationPoint = DynamicLibrary.open('msdrm.dll')
    .lookupFunction<DRMSetRevocationPointNative, DRMSetRevocationPointDart>('DRMSetRevocationPoint');
// hIssuanceLicense : DWORD -> Uint32
// fDelete : BOOL -> Int32
// wszId : LPWSTR -> Pointer<Utf16>
// wszIdType : LPWSTR -> Pointer<Utf16>
// wszURL : LPWSTR -> Pointer<Utf16>
// pstFrequency : SYSTEMTIME* in/out -> Pointer<Void>
// wszName : LPWSTR optional -> Pointer<Utf16>
// wszPublicKey : LPWSTR optional -> Pointer<Utf16>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function DRMSetRevocationPoint(
  hIssuanceLicense: DWORD;   // DWORD
  fDelete: BOOL;   // BOOL
  wszId: PWideChar;   // LPWSTR
  wszIdType: PWideChar;   // LPWSTR
  wszURL: PWideChar;   // LPWSTR
  pstFrequency: Pointer;   // SYSTEMTIME* in/out
  wszName: PWideChar;   // LPWSTR optional
  wszPublicKey: PWideChar   // LPWSTR optional
): Integer; stdcall;
  external 'msdrm.dll' name 'DRMSetRevocationPoint';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "DRMSetRevocationPoint"
  c_DRMSetRevocationPoint :: Word32 -> CInt -> CWString -> CWString -> CWString -> Ptr () -> CWString -> CWString -> IO Int32
-- hIssuanceLicense : DWORD -> Word32
-- fDelete : BOOL -> CInt
-- wszId : LPWSTR -> CWString
-- wszIdType : LPWSTR -> CWString
-- wszURL : LPWSTR -> CWString
-- pstFrequency : SYSTEMTIME* in/out -> Ptr ()
-- wszName : LPWSTR optional -> CWString
-- wszPublicKey : LPWSTR optional -> CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let drmsetrevocationpoint =
  foreign "DRMSetRevocationPoint"
    (uint32_t @-> int32_t @-> (ptr uint16_t) @-> (ptr uint16_t) @-> (ptr uint16_t) @-> (ptr void) @-> (ptr uint16_t) @-> (ptr uint16_t) @-> returning int32_t)
(* hIssuanceLicense : DWORD -> uint32_t *)
(* fDelete : BOOL -> int32_t *)
(* wszId : LPWSTR -> (ptr uint16_t) *)
(* wszIdType : LPWSTR -> (ptr uint16_t) *)
(* wszURL : LPWSTR -> (ptr uint16_t) *)
(* pstFrequency : SYSTEMTIME* in/out -> (ptr void) *)
(* wszName : LPWSTR optional -> (ptr uint16_t) *)
(* wszPublicKey : LPWSTR optional -> (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 ("DRMSetRevocationPoint" drmset-revocation-point :convention :stdcall) :int32
  (h-issuance-license :uint32)   ; DWORD
  (f-delete :int32)   ; BOOL
  (wsz-id (:string :encoding :utf-16le))   ; LPWSTR
  (wsz-id-type (:string :encoding :utf-16le))   ; LPWSTR
  (wsz-url (:string :encoding :utf-16le))   ; LPWSTR
  (pst-frequency :pointer)   ; SYSTEMTIME* in/out
  (wsz-name (:string :encoding :utf-16le))   ; LPWSTR optional
  (wsz-public-key (:string :encoding :utf-16le)))   ; LPWSTR optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $DRMSetRevocationPoint = Win32::API::More->new('msdrm',
    'int DRMSetRevocationPoint(DWORD hIssuanceLicense, BOOL fDelete, LPCWSTR wszId, LPCWSTR wszIdType, LPCWSTR wszURL, LPVOID pstFrequency, LPCWSTR wszName, LPCWSTR wszPublicKey)');
# my $ret = $DRMSetRevocationPoint->Call($hIssuanceLicense, $fDelete, $wszId, $wszIdType, $wszURL, $pstFrequency, $wszName, $wszPublicKey);
# hIssuanceLicense : DWORD -> DWORD
# fDelete : BOOL -> BOOL
# wszId : LPWSTR -> LPCWSTR
# wszIdType : LPWSTR -> LPCWSTR
# wszURL : LPWSTR -> LPCWSTR
# pstFrequency : SYSTEMTIME* in/out -> LPVOID
# wszName : LPWSTR optional -> LPCWSTR
# wszPublicKey : LPWSTR optional -> LPCWSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型