Win32 API 日本語リファレンス
ホームSecurity.Authentication.Identity › SLDepositOfflineConfirmationIdEx

SLDepositOfflineConfirmationIdEx

関数
アクティベーション情報付きでオフライン確認IDを登録する。
DLLSLC.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT SLDepositOfflineConfirmationIdEx(
    void* hSLC,
    const GUID* pProductSkuId,   // optional
    const SL_ACTIVATION_INFO_HEADER* pActivationInfo,   // optional
    LPCWSTR pwszInstallationId,
    LPCWSTR pwszConfirmationId
);

パラメーター

名前方向
hSLCvoid*in
pProductSkuIdGUID*inoptional
pActivationInfoSL_ACTIVATION_INFO_HEADER*inoptional
pwszInstallationIdLPCWSTRin
pwszConfirmationIdLPCWSTRin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT SLDepositOfflineConfirmationIdEx(
    void* hSLC,
    const GUID* pProductSkuId,   // optional
    const SL_ACTIVATION_INFO_HEADER* pActivationInfo,   // optional
    LPCWSTR pwszInstallationId,
    LPCWSTR pwszConfirmationId
);
[DllImport("SLC.dll", ExactSpelling = true)]
static extern int SLDepositOfflineConfirmationIdEx(
    IntPtr hSLC,   // void*
    IntPtr pProductSkuId,   // GUID* optional
    IntPtr pActivationInfo,   // SL_ACTIVATION_INFO_HEADER* optional
    [MarshalAs(UnmanagedType.LPWStr)] string pwszInstallationId,   // LPCWSTR
    [MarshalAs(UnmanagedType.LPWStr)] string pwszConfirmationId   // LPCWSTR
);
<DllImport("SLC.dll", ExactSpelling:=True)>
Public Shared Function SLDepositOfflineConfirmationIdEx(
    hSLC As IntPtr,   ' void*
    pProductSkuId As IntPtr,   ' GUID* optional
    pActivationInfo As IntPtr,   ' SL_ACTIVATION_INFO_HEADER* optional
    <MarshalAs(UnmanagedType.LPWStr)> pwszInstallationId As String,   ' LPCWSTR
    <MarshalAs(UnmanagedType.LPWStr)> pwszConfirmationId As String   ' LPCWSTR
) As Integer
End Function
' hSLC : void*
' pProductSkuId : GUID* optional
' pActivationInfo : SL_ACTIVATION_INFO_HEADER* optional
' pwszInstallationId : LPCWSTR
' pwszConfirmationId : LPCWSTR
Declare PtrSafe Function SLDepositOfflineConfirmationIdEx Lib "slc" ( _
    ByVal hSLC As LongPtr, _
    ByVal pProductSkuId As LongPtr, _
    ByVal pActivationInfo As LongPtr, _
    ByVal pwszInstallationId As LongPtr, _
    ByVal pwszConfirmationId As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SLDepositOfflineConfirmationIdEx = ctypes.windll.slc.SLDepositOfflineConfirmationIdEx
SLDepositOfflineConfirmationIdEx.restype = ctypes.c_int
SLDepositOfflineConfirmationIdEx.argtypes = [
    ctypes.POINTER(None),  # hSLC : void*
    ctypes.c_void_p,  # pProductSkuId : GUID* optional
    ctypes.c_void_p,  # pActivationInfo : SL_ACTIVATION_INFO_HEADER* optional
    wintypes.LPCWSTR,  # pwszInstallationId : LPCWSTR
    wintypes.LPCWSTR,  # pwszConfirmationId : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SLC.dll')
SLDepositOfflineConfirmationIdEx = Fiddle::Function.new(
  lib['SLDepositOfflineConfirmationIdEx'],
  [
    Fiddle::TYPE_VOIDP,  # hSLC : void*
    Fiddle::TYPE_VOIDP,  # pProductSkuId : GUID* optional
    Fiddle::TYPE_VOIDP,  # pActivationInfo : SL_ACTIVATION_INFO_HEADER* optional
    Fiddle::TYPE_VOIDP,  # pwszInstallationId : LPCWSTR
    Fiddle::TYPE_VOIDP,  # pwszConfirmationId : LPCWSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "slc")]
extern "system" {
    fn SLDepositOfflineConfirmationIdEx(
        hSLC: *mut (),  // void*
        pProductSkuId: *const GUID,  // GUID* optional
        pActivationInfo: *const SL_ACTIVATION_INFO_HEADER,  // SL_ACTIVATION_INFO_HEADER* optional
        pwszInstallationId: *const u16,  // LPCWSTR
        pwszConfirmationId: *const u16  // LPCWSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SLC.dll")]
public static extern int SLDepositOfflineConfirmationIdEx(IntPtr hSLC, IntPtr pProductSkuId, IntPtr pActivationInfo, [MarshalAs(UnmanagedType.LPWStr)] string pwszInstallationId, [MarshalAs(UnmanagedType.LPWStr)] string pwszConfirmationId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SLC_SLDepositOfflineConfirmationIdEx' -Namespace Win32 -PassThru
# $api::SLDepositOfflineConfirmationIdEx(hSLC, pProductSkuId, pActivationInfo, pwszInstallationId, pwszConfirmationId)
#uselib "SLC.dll"
#func global SLDepositOfflineConfirmationIdEx "SLDepositOfflineConfirmationIdEx" sptr, sptr, sptr, sptr, sptr
; SLDepositOfflineConfirmationIdEx hSLC, varptr(pProductSkuId), varptr(pActivationInfo), pwszInstallationId, pwszConfirmationId   ; 戻り値は stat
; hSLC : void* -> "sptr"
; pProductSkuId : GUID* optional -> "sptr"
; pActivationInfo : SL_ACTIVATION_INFO_HEADER* optional -> "sptr"
; pwszInstallationId : LPCWSTR -> "sptr"
; pwszConfirmationId : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "SLC.dll"
#cfunc global SLDepositOfflineConfirmationIdEx "SLDepositOfflineConfirmationIdEx" sptr, var, var, wstr, wstr
; res = SLDepositOfflineConfirmationIdEx(hSLC, pProductSkuId, pActivationInfo, pwszInstallationId, pwszConfirmationId)
; hSLC : void* -> "sptr"
; pProductSkuId : GUID* optional -> "var"
; pActivationInfo : SL_ACTIVATION_INFO_HEADER* optional -> "var"
; pwszInstallationId : LPCWSTR -> "wstr"
; pwszConfirmationId : LPCWSTR -> "wstr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT SLDepositOfflineConfirmationIdEx(void* hSLC, GUID* pProductSkuId, SL_ACTIVATION_INFO_HEADER* pActivationInfo, LPCWSTR pwszInstallationId, LPCWSTR pwszConfirmationId)
#uselib "SLC.dll"
#cfunc global SLDepositOfflineConfirmationIdEx "SLDepositOfflineConfirmationIdEx" intptr, var, var, wstr, wstr
; res = SLDepositOfflineConfirmationIdEx(hSLC, pProductSkuId, pActivationInfo, pwszInstallationId, pwszConfirmationId)
; hSLC : void* -> "intptr"
; pProductSkuId : GUID* optional -> "var"
; pActivationInfo : SL_ACTIVATION_INFO_HEADER* optional -> "var"
; pwszInstallationId : LPCWSTR -> "wstr"
; pwszConfirmationId : LPCWSTR -> "wstr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	slc = windows.NewLazySystemDLL("SLC.dll")
	procSLDepositOfflineConfirmationIdEx = slc.NewProc("SLDepositOfflineConfirmationIdEx")
)

// hSLC (void*), pProductSkuId (GUID* optional), pActivationInfo (SL_ACTIVATION_INFO_HEADER* optional), pwszInstallationId (LPCWSTR), pwszConfirmationId (LPCWSTR)
r1, _, err := procSLDepositOfflineConfirmationIdEx.Call(
	uintptr(hSLC),
	uintptr(pProductSkuId),
	uintptr(pActivationInfo),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszInstallationId))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszConfirmationId))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function SLDepositOfflineConfirmationIdEx(
  hSLC: Pointer;   // void*
  pProductSkuId: PGUID;   // GUID* optional
  pActivationInfo: Pointer;   // SL_ACTIVATION_INFO_HEADER* optional
  pwszInstallationId: PWideChar;   // LPCWSTR
  pwszConfirmationId: PWideChar   // LPCWSTR
): Integer; stdcall;
  external 'SLC.dll' name 'SLDepositOfflineConfirmationIdEx';
result := DllCall("SLC\SLDepositOfflineConfirmationIdEx"
    , "Ptr", hSLC   ; void*
    , "Ptr", pProductSkuId   ; GUID* optional
    , "Ptr", pActivationInfo   ; SL_ACTIVATION_INFO_HEADER* optional
    , "WStr", pwszInstallationId   ; LPCWSTR
    , "WStr", pwszConfirmationId   ; LPCWSTR
    , "Int")   ; return: HRESULT
●SLDepositOfflineConfirmationIdEx(hSLC, pProductSkuId, pActivationInfo, pwszInstallationId, pwszConfirmationId) = DLL("SLC.dll", "int SLDepositOfflineConfirmationIdEx(void*, void*, void*, char*, char*)")
# 呼び出し: SLDepositOfflineConfirmationIdEx(hSLC, pProductSkuId, pActivationInfo, pwszInstallationId, pwszConfirmationId)
# hSLC : void* -> "void*"
# pProductSkuId : GUID* optional -> "void*"
# pActivationInfo : SL_ACTIVATION_INFO_HEADER* optional -> "void*"
# pwszInstallationId : LPCWSTR -> "char*"
# pwszConfirmationId : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。