ホーム › Security.Authentication.Identity › SLGetServerStatus
SLGetServerStatus
関数ライセンスアクティベーションサーバーの状態を取得する。
シグネチャ
// slcext.dll
#include <windows.h>
HRESULT SLGetServerStatus(
LPCWSTR pwszServerURL,
LPCWSTR pwszAcquisitionType,
LPCWSTR pwszProxyServer, // optional
WORD wProxyPort, // optional
HRESULT* phrStatus
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pwszServerURL | LPCWSTR | in |
| pwszAcquisitionType | LPCWSTR | in |
| pwszProxyServer | LPCWSTR | inoptional |
| wProxyPort | WORD | inoptional |
| phrStatus | HRESULT* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// slcext.dll
#include <windows.h>
HRESULT SLGetServerStatus(
LPCWSTR pwszServerURL,
LPCWSTR pwszAcquisitionType,
LPCWSTR pwszProxyServer, // optional
WORD wProxyPort, // optional
HRESULT* phrStatus
);[DllImport("slcext.dll", ExactSpelling = true)]
static extern int SLGetServerStatus(
[MarshalAs(UnmanagedType.LPWStr)] string pwszServerURL, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string pwszAcquisitionType, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string pwszProxyServer, // LPCWSTR optional
ushort wProxyPort, // WORD optional
out int phrStatus // HRESULT* out
);<DllImport("slcext.dll", ExactSpelling:=True)>
Public Shared Function SLGetServerStatus(
<MarshalAs(UnmanagedType.LPWStr)> pwszServerURL As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> pwszAcquisitionType As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> pwszProxyServer As String, ' LPCWSTR optional
wProxyPort As UShort, ' WORD optional
<Out> ByRef phrStatus As Integer ' HRESULT* out
) As Integer
End Function' pwszServerURL : LPCWSTR
' pwszAcquisitionType : LPCWSTR
' pwszProxyServer : LPCWSTR optional
' wProxyPort : WORD optional
' phrStatus : HRESULT* out
Declare PtrSafe Function SLGetServerStatus Lib "slcext" ( _
ByVal pwszServerURL As LongPtr, _
ByVal pwszAcquisitionType As LongPtr, _
ByVal pwszProxyServer As LongPtr, _
ByVal wProxyPort As Integer, _
ByRef phrStatus As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SLGetServerStatus = ctypes.windll.slcext.SLGetServerStatus
SLGetServerStatus.restype = ctypes.c_int
SLGetServerStatus.argtypes = [
wintypes.LPCWSTR, # pwszServerURL : LPCWSTR
wintypes.LPCWSTR, # pwszAcquisitionType : LPCWSTR
wintypes.LPCWSTR, # pwszProxyServer : LPCWSTR optional
ctypes.c_ushort, # wProxyPort : WORD optional
ctypes.c_void_p, # phrStatus : HRESULT* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('slcext.dll')
SLGetServerStatus = Fiddle::Function.new(
lib['SLGetServerStatus'],
[
Fiddle::TYPE_VOIDP, # pwszServerURL : LPCWSTR
Fiddle::TYPE_VOIDP, # pwszAcquisitionType : LPCWSTR
Fiddle::TYPE_VOIDP, # pwszProxyServer : LPCWSTR optional
-Fiddle::TYPE_SHORT, # wProxyPort : WORD optional
Fiddle::TYPE_VOIDP, # phrStatus : HRESULT* out
],
Fiddle::TYPE_INT)#[link(name = "slcext")]
extern "system" {
fn SLGetServerStatus(
pwszServerURL: *const u16, // LPCWSTR
pwszAcquisitionType: *const u16, // LPCWSTR
pwszProxyServer: *const u16, // LPCWSTR optional
wProxyPort: u16, // WORD optional
phrStatus: *mut i32 // HRESULT* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("slcext.dll")]
public static extern int SLGetServerStatus([MarshalAs(UnmanagedType.LPWStr)] string pwszServerURL, [MarshalAs(UnmanagedType.LPWStr)] string pwszAcquisitionType, [MarshalAs(UnmanagedType.LPWStr)] string pwszProxyServer, ushort wProxyPort, out int phrStatus);
"@
$api = Add-Type -MemberDefinition $sig -Name 'slcext_SLGetServerStatus' -Namespace Win32 -PassThru
# $api::SLGetServerStatus(pwszServerURL, pwszAcquisitionType, pwszProxyServer, wProxyPort, phrStatus)#uselib "slcext.dll"
#func global SLGetServerStatus "SLGetServerStatus" sptr, sptr, sptr, sptr, sptr
; SLGetServerStatus pwszServerURL, pwszAcquisitionType, pwszProxyServer, wProxyPort, phrStatus ; 戻り値は stat
; pwszServerURL : LPCWSTR -> "sptr"
; pwszAcquisitionType : LPCWSTR -> "sptr"
; pwszProxyServer : LPCWSTR optional -> "sptr"
; wProxyPort : WORD optional -> "sptr"
; phrStatus : HRESULT* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "slcext.dll"
#cfunc global SLGetServerStatus "SLGetServerStatus" wstr, wstr, wstr, int, int
; res = SLGetServerStatus(pwszServerURL, pwszAcquisitionType, pwszProxyServer, wProxyPort, phrStatus)
; pwszServerURL : LPCWSTR -> "wstr"
; pwszAcquisitionType : LPCWSTR -> "wstr"
; pwszProxyServer : LPCWSTR optional -> "wstr"
; wProxyPort : WORD optional -> "int"
; phrStatus : HRESULT* out -> "int"; HRESULT SLGetServerStatus(LPCWSTR pwszServerURL, LPCWSTR pwszAcquisitionType, LPCWSTR pwszProxyServer, WORD wProxyPort, HRESULT* phrStatus)
#uselib "slcext.dll"
#cfunc global SLGetServerStatus "SLGetServerStatus" wstr, wstr, wstr, int, int
; res = SLGetServerStatus(pwszServerURL, pwszAcquisitionType, pwszProxyServer, wProxyPort, phrStatus)
; pwszServerURL : LPCWSTR -> "wstr"
; pwszAcquisitionType : LPCWSTR -> "wstr"
; pwszProxyServer : LPCWSTR optional -> "wstr"
; wProxyPort : WORD optional -> "int"
; phrStatus : HRESULT* out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
slcext = windows.NewLazySystemDLL("slcext.dll")
procSLGetServerStatus = slcext.NewProc("SLGetServerStatus")
)
// pwszServerURL (LPCWSTR), pwszAcquisitionType (LPCWSTR), pwszProxyServer (LPCWSTR optional), wProxyPort (WORD optional), phrStatus (HRESULT* out)
r1, _, err := procSLGetServerStatus.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszServerURL))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszAcquisitionType))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszProxyServer))),
uintptr(wProxyPort),
uintptr(phrStatus),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction SLGetServerStatus(
pwszServerURL: PWideChar; // LPCWSTR
pwszAcquisitionType: PWideChar; // LPCWSTR
pwszProxyServer: PWideChar; // LPCWSTR optional
wProxyPort: Word; // WORD optional
phrStatus: Pointer // HRESULT* out
): Integer; stdcall;
external 'slcext.dll' name 'SLGetServerStatus';result := DllCall("slcext\SLGetServerStatus"
, "WStr", pwszServerURL ; LPCWSTR
, "WStr", pwszAcquisitionType ; LPCWSTR
, "WStr", pwszProxyServer ; LPCWSTR optional
, "UShort", wProxyPort ; WORD optional
, "Ptr", phrStatus ; HRESULT* out
, "Int") ; return: HRESULT●SLGetServerStatus(pwszServerURL, pwszAcquisitionType, pwszProxyServer, wProxyPort, phrStatus) = DLL("slcext.dll", "int SLGetServerStatus(char*, char*, char*, int, void*)")
# 呼び出し: SLGetServerStatus(pwszServerURL, pwszAcquisitionType, pwszProxyServer, wProxyPort, phrStatus)
# pwszServerURL : LPCWSTR -> "char*"
# pwszAcquisitionType : LPCWSTR -> "char*"
# pwszProxyServer : LPCWSTR optional -> "char*"
# wProxyPort : WORD optional -> "int"
# phrStatus : HRESULT* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。