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
wszIdLPWSTRin
wszIdTypeLPWSTRin
wszURLLPWSTRin
pstFrequencySYSTEMTIME*inout
wszNameLPWSTRinoptional
wszPublicKeyLPWSTRinoptional

戻り値の型: 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)。