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

SLUninstallLicense

関数
インストール済みのライセンスをライセンスストアから削除する。
DLLSLC.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT SLUninstallLicense(
    void* hSLC,
    const GUID* pLicenseFileId
);

パラメーター

名前方向
hSLCvoid*in
pLicenseFileIdGUID*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT SLUninstallLicense(
    void* hSLC,
    const GUID* pLicenseFileId
);
[DllImport("SLC.dll", ExactSpelling = true)]
static extern int SLUninstallLicense(
    IntPtr hSLC,   // void*
    ref Guid pLicenseFileId   // GUID*
);
<DllImport("SLC.dll", ExactSpelling:=True)>
Public Shared Function SLUninstallLicense(
    hSLC As IntPtr,   ' void*
    ByRef pLicenseFileId As Guid   ' GUID*
) As Integer
End Function
' hSLC : void*
' pLicenseFileId : GUID*
Declare PtrSafe Function SLUninstallLicense Lib "slc" ( _
    ByVal hSLC As LongPtr, _
    ByVal pLicenseFileId As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SLUninstallLicense = ctypes.windll.slc.SLUninstallLicense
SLUninstallLicense.restype = ctypes.c_int
SLUninstallLicense.argtypes = [
    ctypes.POINTER(None),  # hSLC : void*
    ctypes.c_void_p,  # pLicenseFileId : GUID*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	slc = windows.NewLazySystemDLL("SLC.dll")
	procSLUninstallLicense = slc.NewProc("SLUninstallLicense")
)

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