ホーム › System.Rpc › RpcMgmtInqStats
RpcMgmtInqStats
関数RPCサーバーの統計情報を取得する。
シグネチャ
// RPCRT4.dll
#include <windows.h>
RPC_STATUS RpcMgmtInqStats(
void* Binding, // optional
RPC_STATS_VECTOR** Statistics
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Binding | void* | inoptional |
| Statistics | RPC_STATS_VECTOR** | out |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll
#include <windows.h>
RPC_STATUS RpcMgmtInqStats(
void* Binding, // optional
RPC_STATS_VECTOR** Statistics
);[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int RpcMgmtInqStats(
IntPtr Binding, // void* optional
IntPtr Statistics // RPC_STATS_VECTOR** out
);<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function RpcMgmtInqStats(
Binding As IntPtr, ' void* optional
Statistics As IntPtr ' RPC_STATS_VECTOR** out
) As Integer
End Function' Binding : void* optional
' Statistics : RPC_STATS_VECTOR** out
Declare PtrSafe Function RpcMgmtInqStats Lib "rpcrt4" ( _
ByVal Binding As LongPtr, _
ByVal Statistics As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcMgmtInqStats = ctypes.windll.rpcrt4.RpcMgmtInqStats
RpcMgmtInqStats.restype = ctypes.c_int
RpcMgmtInqStats.argtypes = [
ctypes.POINTER(None), # Binding : void* optional
ctypes.c_void_p, # Statistics : RPC_STATS_VECTOR** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
RpcMgmtInqStats = Fiddle::Function.new(
lib['RpcMgmtInqStats'],
[
Fiddle::TYPE_VOIDP, # Binding : void* optional
Fiddle::TYPE_VOIDP, # Statistics : RPC_STATS_VECTOR** out
],
Fiddle::TYPE_INT)#[link(name = "rpcrt4")]
extern "system" {
fn RpcMgmtInqStats(
Binding: *mut (), // void* optional
Statistics: *mut *mut RPC_STATS_VECTOR // RPC_STATS_VECTOR** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll")]
public static extern int RpcMgmtInqStats(IntPtr Binding, IntPtr Statistics);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcMgmtInqStats' -Namespace Win32 -PassThru
# $api::RpcMgmtInqStats(Binding, Statistics)#uselib "RPCRT4.dll"
#func global RpcMgmtInqStats "RpcMgmtInqStats" sptr, sptr
; RpcMgmtInqStats Binding, varptr(Statistics) ; 戻り値は stat
; Binding : void* optional -> "sptr"
; Statistics : RPC_STATS_VECTOR** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCRT4.dll" #cfunc global RpcMgmtInqStats "RpcMgmtInqStats" sptr, var ; res = RpcMgmtInqStats(Binding, Statistics) ; Binding : void* optional -> "sptr" ; Statistics : RPC_STATS_VECTOR** out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global RpcMgmtInqStats "RpcMgmtInqStats" sptr, sptr ; res = RpcMgmtInqStats(Binding, varptr(Statistics)) ; Binding : void* optional -> "sptr" ; Statistics : RPC_STATS_VECTOR** out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS RpcMgmtInqStats(void* Binding, RPC_STATS_VECTOR** Statistics) #uselib "RPCRT4.dll" #cfunc global RpcMgmtInqStats "RpcMgmtInqStats" intptr, var ; res = RpcMgmtInqStats(Binding, Statistics) ; Binding : void* optional -> "intptr" ; Statistics : RPC_STATS_VECTOR** out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS RpcMgmtInqStats(void* Binding, RPC_STATS_VECTOR** Statistics) #uselib "RPCRT4.dll" #cfunc global RpcMgmtInqStats "RpcMgmtInqStats" intptr, intptr ; res = RpcMgmtInqStats(Binding, varptr(Statistics)) ; Binding : void* optional -> "intptr" ; Statistics : RPC_STATS_VECTOR** out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procRpcMgmtInqStats = rpcrt4.NewProc("RpcMgmtInqStats")
)
// Binding (void* optional), Statistics (RPC_STATS_VECTOR** out)
r1, _, err := procRpcMgmtInqStats.Call(
uintptr(Binding),
uintptr(Statistics),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcMgmtInqStats(
Binding: Pointer; // void* optional
Statistics: Pointer // RPC_STATS_VECTOR** out
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcMgmtInqStats';result := DllCall("RPCRT4\RpcMgmtInqStats"
, "Ptr", Binding ; void* optional
, "Ptr", Statistics ; RPC_STATS_VECTOR** out
, "Int") ; return: RPC_STATUS●RpcMgmtInqStats(Binding, Statistics) = DLL("RPCRT4.dll", "int RpcMgmtInqStats(void*, void*)")
# 呼び出し: RpcMgmtInqStats(Binding, Statistics)
# Binding : void* optional -> "void*"
# Statistics : RPC_STATS_VECTOR** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。