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

SLOpen

関数
ソフトウェアライセンスクライアントへのハンドルを開く。
DLLSLC.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT SLOpen(
    void** phSLC
);

パラメーター

名前方向
phSLCvoid**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

SLOpen = ctypes.windll.slc.SLOpen
SLOpen.restype = ctypes.c_int
SLOpen.argtypes = [
    ctypes.c_void_p,  # phSLC : void** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SLC.dll')
SLOpen = Fiddle::Function.new(
  lib['SLOpen'],
  [
    Fiddle::TYPE_VOIDP,  # phSLC : void** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "slc")]
extern "system" {
    fn SLOpen(
        phSLC: *mut *mut ()  // void** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SLC.dll")]
public static extern int SLOpen(IntPtr phSLC);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SLC_SLOpen' -Namespace Win32 -PassThru
# $api::SLOpen(phSLC)
#uselib "SLC.dll"
#func global SLOpen "SLOpen" sptr
; SLOpen phSLC   ; 戻り値は stat
; phSLC : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SLC.dll"
#cfunc global SLOpen "SLOpen" sptr
; res = SLOpen(phSLC)
; phSLC : void** out -> "sptr"
; HRESULT SLOpen(void** phSLC)
#uselib "SLC.dll"
#cfunc global SLOpen "SLOpen" intptr
; res = SLOpen(phSLC)
; phSLC : void** out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	slc = windows.NewLazySystemDLL("SLC.dll")
	procSLOpen = slc.NewProc("SLOpen")
)

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