Win32 API 日本語リファレンス
ホームNetworkManagement.Rras › MprAdminInterfaceGetCustomInfoEx

MprAdminInterfaceGetCustomInfoEx

関数
ルーターインターフェイスの拡張カスタム情報を取得する。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2012

シグネチャ

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

DWORD MprAdminInterfaceGetCustomInfoEx(
    INT_PTR hMprServer,
    HANDLE hInterface,
    MPR_IF_CUSTOMINFOEX2* pCustomInfo
);

パラメーター

名前方向
hMprServerINT_PTRin
hInterfaceHANDLEin
pCustomInfoMPR_IF_CUSTOMINFOEX2*out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MprAdminInterfaceGetCustomInfoEx(
    INT_PTR hMprServer,
    HANDLE hInterface,
    MPR_IF_CUSTOMINFOEX2* pCustomInfo
);
[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprAdminInterfaceGetCustomInfoEx(
    IntPtr hMprServer,   // INT_PTR
    IntPtr hInterface,   // HANDLE
    IntPtr pCustomInfo   // MPR_IF_CUSTOMINFOEX2* out
);
<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprAdminInterfaceGetCustomInfoEx(
    hMprServer As IntPtr,   ' INT_PTR
    hInterface As IntPtr,   ' HANDLE
    pCustomInfo As IntPtr   ' MPR_IF_CUSTOMINFOEX2* out
) As UInteger
End Function
' hMprServer : INT_PTR
' hInterface : HANDLE
' pCustomInfo : MPR_IF_CUSTOMINFOEX2* out
Declare PtrSafe Function MprAdminInterfaceGetCustomInfoEx Lib "mprapi" ( _
    ByVal hMprServer As LongPtr, _
    ByVal hInterface As LongPtr, _
    ByVal pCustomInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MprAdminInterfaceGetCustomInfoEx = ctypes.windll.mprapi.MprAdminInterfaceGetCustomInfoEx
MprAdminInterfaceGetCustomInfoEx.restype = wintypes.DWORD
MprAdminInterfaceGetCustomInfoEx.argtypes = [
    ctypes.c_ssize_t,  # hMprServer : INT_PTR
    wintypes.HANDLE,  # hInterface : HANDLE
    ctypes.c_void_p,  # pCustomInfo : MPR_IF_CUSTOMINFOEX2* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MPRAPI.dll')
MprAdminInterfaceGetCustomInfoEx = Fiddle::Function.new(
  lib['MprAdminInterfaceGetCustomInfoEx'],
  [
    Fiddle::TYPE_INTPTR_T,  # hMprServer : INT_PTR
    Fiddle::TYPE_VOIDP,  # hInterface : HANDLE
    Fiddle::TYPE_VOIDP,  # pCustomInfo : MPR_IF_CUSTOMINFOEX2* out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "mprapi")]
extern "system" {
    fn MprAdminInterfaceGetCustomInfoEx(
        hMprServer: isize,  // INT_PTR
        hInterface: *mut core::ffi::c_void,  // HANDLE
        pCustomInfo: *mut MPR_IF_CUSTOMINFOEX2  // MPR_IF_CUSTOMINFOEX2* out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MPRAPI.dll")]
public static extern uint MprAdminInterfaceGetCustomInfoEx(IntPtr hMprServer, IntPtr hInterface, IntPtr pCustomInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPRAPI_MprAdminInterfaceGetCustomInfoEx' -Namespace Win32 -PassThru
# $api::MprAdminInterfaceGetCustomInfoEx(hMprServer, hInterface, pCustomInfo)
#uselib "MPRAPI.dll"
#func global MprAdminInterfaceGetCustomInfoEx "MprAdminInterfaceGetCustomInfoEx" sptr, sptr, sptr
; MprAdminInterfaceGetCustomInfoEx hMprServer, hInterface, varptr(pCustomInfo)   ; 戻り値は stat
; hMprServer : INT_PTR -> "sptr"
; hInterface : HANDLE -> "sptr"
; pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MPRAPI.dll"
#cfunc global MprAdminInterfaceGetCustomInfoEx "MprAdminInterfaceGetCustomInfoEx" sptr, sptr, var
; res = MprAdminInterfaceGetCustomInfoEx(hMprServer, hInterface, pCustomInfo)
; hMprServer : INT_PTR -> "sptr"
; hInterface : HANDLE -> "sptr"
; pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD MprAdminInterfaceGetCustomInfoEx(INT_PTR hMprServer, HANDLE hInterface, MPR_IF_CUSTOMINFOEX2* pCustomInfo)
#uselib "MPRAPI.dll"
#cfunc global MprAdminInterfaceGetCustomInfoEx "MprAdminInterfaceGetCustomInfoEx" intptr, intptr, var
; res = MprAdminInterfaceGetCustomInfoEx(hMprServer, hInterface, pCustomInfo)
; hMprServer : INT_PTR -> "intptr"
; hInterface : HANDLE -> "intptr"
; pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminInterfaceGetCustomInfoEx = mprapi.NewProc("MprAdminInterfaceGetCustomInfoEx")
)

// hMprServer (INT_PTR), hInterface (HANDLE), pCustomInfo (MPR_IF_CUSTOMINFOEX2* out)
r1, _, err := procMprAdminInterfaceGetCustomInfoEx.Call(
	uintptr(hMprServer),
	uintptr(hInterface),
	uintptr(pCustomInfo),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function MprAdminInterfaceGetCustomInfoEx(
  hMprServer: NativeInt;   // INT_PTR
  hInterface: THandle;   // HANDLE
  pCustomInfo: Pointer   // MPR_IF_CUSTOMINFOEX2* out
): DWORD; stdcall;
  external 'MPRAPI.dll' name 'MprAdminInterfaceGetCustomInfoEx';
result := DllCall("MPRAPI\MprAdminInterfaceGetCustomInfoEx"
    , "Ptr", hMprServer   ; INT_PTR
    , "Ptr", hInterface   ; HANDLE
    , "Ptr", pCustomInfo   ; MPR_IF_CUSTOMINFOEX2* out
    , "UInt")   ; return: DWORD
●MprAdminInterfaceGetCustomInfoEx(hMprServer, hInterface, pCustomInfo) = DLL("MPRAPI.dll", "dword MprAdminInterfaceGetCustomInfoEx(int, void*, void*)")
# 呼び出し: MprAdminInterfaceGetCustomInfoEx(hMprServer, hInterface, pCustomInfo)
# hMprServer : INT_PTR -> "int"
# hInterface : HANDLE -> "void*"
# pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。