ホーム › Security.Authentication.Identity › SLFireEvent
SLFireEvent
関数指定アプリケーションに対するライセンスイベントを発生させる。
シグネチャ
// SLC.dll
#include <windows.h>
HRESULT SLFireEvent(
void* hSLC,
LPCWSTR pwszEventId,
const GUID* pApplicationId
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hSLC | void* | in |
| pwszEventId | LPCWSTR | in |
| pApplicationId | GUID* | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// SLC.dll
#include <windows.h>
HRESULT SLFireEvent(
void* hSLC,
LPCWSTR pwszEventId,
const GUID* pApplicationId
);[DllImport("SLC.dll", ExactSpelling = true)]
static extern int SLFireEvent(
IntPtr hSLC, // void*
[MarshalAs(UnmanagedType.LPWStr)] string pwszEventId, // LPCWSTR
ref Guid pApplicationId // GUID*
);<DllImport("SLC.dll", ExactSpelling:=True)>
Public Shared Function SLFireEvent(
hSLC As IntPtr, ' void*
<MarshalAs(UnmanagedType.LPWStr)> pwszEventId As String, ' LPCWSTR
ByRef pApplicationId As Guid ' GUID*
) As Integer
End Function' hSLC : void*
' pwszEventId : LPCWSTR
' pApplicationId : GUID*
Declare PtrSafe Function SLFireEvent Lib "slc" ( _
ByVal hSLC As LongPtr, _
ByVal pwszEventId As LongPtr, _
ByVal pApplicationId As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SLFireEvent = ctypes.windll.slc.SLFireEvent
SLFireEvent.restype = ctypes.c_int
SLFireEvent.argtypes = [
ctypes.POINTER(None), # hSLC : void*
wintypes.LPCWSTR, # pwszEventId : LPCWSTR
ctypes.c_void_p, # pApplicationId : GUID*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SLC.dll')
SLFireEvent = Fiddle::Function.new(
lib['SLFireEvent'],
[
Fiddle::TYPE_VOIDP, # hSLC : void*
Fiddle::TYPE_VOIDP, # pwszEventId : LPCWSTR
Fiddle::TYPE_VOIDP, # pApplicationId : GUID*
],
Fiddle::TYPE_INT)#[link(name = "slc")]
extern "system" {
fn SLFireEvent(
hSLC: *mut (), // void*
pwszEventId: *const u16, // LPCWSTR
pApplicationId: *const GUID // GUID*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SLC.dll")]
public static extern int SLFireEvent(IntPtr hSLC, [MarshalAs(UnmanagedType.LPWStr)] string pwszEventId, ref Guid pApplicationId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SLC_SLFireEvent' -Namespace Win32 -PassThru
# $api::SLFireEvent(hSLC, pwszEventId, pApplicationId)#uselib "SLC.dll"
#func global SLFireEvent "SLFireEvent" sptr, sptr, sptr
; SLFireEvent hSLC, pwszEventId, varptr(pApplicationId) ; 戻り値は stat
; hSLC : void* -> "sptr"
; pwszEventId : LPCWSTR -> "sptr"
; pApplicationId : GUID* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "SLC.dll" #cfunc global SLFireEvent "SLFireEvent" sptr, wstr, var ; res = SLFireEvent(hSLC, pwszEventId, pApplicationId) ; hSLC : void* -> "sptr" ; pwszEventId : LPCWSTR -> "wstr" ; pApplicationId : GUID* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SLC.dll" #cfunc global SLFireEvent "SLFireEvent" sptr, wstr, sptr ; res = SLFireEvent(hSLC, pwszEventId, varptr(pApplicationId)) ; hSLC : void* -> "sptr" ; pwszEventId : LPCWSTR -> "wstr" ; pApplicationId : GUID* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT SLFireEvent(void* hSLC, LPCWSTR pwszEventId, GUID* pApplicationId) #uselib "SLC.dll" #cfunc global SLFireEvent "SLFireEvent" intptr, wstr, var ; res = SLFireEvent(hSLC, pwszEventId, pApplicationId) ; hSLC : void* -> "intptr" ; pwszEventId : LPCWSTR -> "wstr" ; pApplicationId : GUID* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT SLFireEvent(void* hSLC, LPCWSTR pwszEventId, GUID* pApplicationId) #uselib "SLC.dll" #cfunc global SLFireEvent "SLFireEvent" intptr, wstr, intptr ; res = SLFireEvent(hSLC, pwszEventId, varptr(pApplicationId)) ; hSLC : void* -> "intptr" ; pwszEventId : LPCWSTR -> "wstr" ; pApplicationId : GUID* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
slc = windows.NewLazySystemDLL("SLC.dll")
procSLFireEvent = slc.NewProc("SLFireEvent")
)
// hSLC (void*), pwszEventId (LPCWSTR), pApplicationId (GUID*)
r1, _, err := procSLFireEvent.Call(
uintptr(hSLC),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszEventId))),
uintptr(pApplicationId),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction SLFireEvent(
hSLC: Pointer; // void*
pwszEventId: PWideChar; // LPCWSTR
pApplicationId: PGUID // GUID*
): Integer; stdcall;
external 'SLC.dll' name 'SLFireEvent';result := DllCall("SLC\SLFireEvent"
, "Ptr", hSLC ; void*
, "WStr", pwszEventId ; LPCWSTR
, "Ptr", pApplicationId ; GUID*
, "Int") ; return: HRESULT●SLFireEvent(hSLC, pwszEventId, pApplicationId) = DLL("SLC.dll", "int SLFireEvent(void*, char*, void*)")
# 呼び出し: SLFireEvent(hSLC, pwszEventId, pApplicationId)
# hSLC : void* -> "void*"
# pwszEventId : LPCWSTR -> "char*"
# pApplicationId : GUID* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。