ホーム › NetworkManagement.Rras › MprConfigInterfaceGetCustomInfoEx
MprConfigInterfaceGetCustomInfoEx
関数MPR構成からルーターインターフェイスの拡張カスタム情報を取得する。
シグネチャ
// MPRAPI.dll
#include <windows.h>
DWORD MprConfigInterfaceGetCustomInfoEx(
HANDLE hMprConfig,
HANDLE hRouterInterface,
MPR_IF_CUSTOMINFOEX2* pCustomInfo
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hMprConfig | HANDLE | in |
| hRouterInterface | HANDLE | in |
| pCustomInfo | MPR_IF_CUSTOMINFOEX2* | out |
戻り値の型: DWORD
各言語での呼び出し定義
// MPRAPI.dll
#include <windows.h>
DWORD MprConfigInterfaceGetCustomInfoEx(
HANDLE hMprConfig,
HANDLE hRouterInterface,
MPR_IF_CUSTOMINFOEX2* pCustomInfo
);[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprConfigInterfaceGetCustomInfoEx(
IntPtr hMprConfig, // HANDLE
IntPtr hRouterInterface, // HANDLE
IntPtr pCustomInfo // MPR_IF_CUSTOMINFOEX2* out
);<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprConfigInterfaceGetCustomInfoEx(
hMprConfig As IntPtr, ' HANDLE
hRouterInterface As IntPtr, ' HANDLE
pCustomInfo As IntPtr ' MPR_IF_CUSTOMINFOEX2* out
) As UInteger
End Function' hMprConfig : HANDLE
' hRouterInterface : HANDLE
' pCustomInfo : MPR_IF_CUSTOMINFOEX2* out
Declare PtrSafe Function MprConfigInterfaceGetCustomInfoEx Lib "mprapi" ( _
ByVal hMprConfig As LongPtr, _
ByVal hRouterInterface 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
MprConfigInterfaceGetCustomInfoEx = ctypes.windll.mprapi.MprConfigInterfaceGetCustomInfoEx
MprConfigInterfaceGetCustomInfoEx.restype = wintypes.DWORD
MprConfigInterfaceGetCustomInfoEx.argtypes = [
wintypes.HANDLE, # hMprConfig : HANDLE
wintypes.HANDLE, # hRouterInterface : HANDLE
ctypes.c_void_p, # pCustomInfo : MPR_IF_CUSTOMINFOEX2* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MPRAPI.dll')
MprConfigInterfaceGetCustomInfoEx = Fiddle::Function.new(
lib['MprConfigInterfaceGetCustomInfoEx'],
[
Fiddle::TYPE_VOIDP, # hMprConfig : HANDLE
Fiddle::TYPE_VOIDP, # hRouterInterface : HANDLE
Fiddle::TYPE_VOIDP, # pCustomInfo : MPR_IF_CUSTOMINFOEX2* out
],
-Fiddle::TYPE_INT)#[link(name = "mprapi")]
extern "system" {
fn MprConfigInterfaceGetCustomInfoEx(
hMprConfig: *mut core::ffi::c_void, // HANDLE
hRouterInterface: *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 MprConfigInterfaceGetCustomInfoEx(IntPtr hMprConfig, IntPtr hRouterInterface, IntPtr pCustomInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPRAPI_MprConfigInterfaceGetCustomInfoEx' -Namespace Win32 -PassThru
# $api::MprConfigInterfaceGetCustomInfoEx(hMprConfig, hRouterInterface, pCustomInfo)#uselib "MPRAPI.dll"
#func global MprConfigInterfaceGetCustomInfoEx "MprConfigInterfaceGetCustomInfoEx" sptr, sptr, sptr
; MprConfigInterfaceGetCustomInfoEx hMprConfig, hRouterInterface, varptr(pCustomInfo) ; 戻り値は stat
; hMprConfig : HANDLE -> "sptr"
; hRouterInterface : HANDLE -> "sptr"
; pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MPRAPI.dll" #cfunc global MprConfigInterfaceGetCustomInfoEx "MprConfigInterfaceGetCustomInfoEx" sptr, sptr, var ; res = MprConfigInterfaceGetCustomInfoEx(hMprConfig, hRouterInterface, pCustomInfo) ; hMprConfig : HANDLE -> "sptr" ; hRouterInterface : HANDLE -> "sptr" ; pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MPRAPI.dll" #cfunc global MprConfigInterfaceGetCustomInfoEx "MprConfigInterfaceGetCustomInfoEx" sptr, sptr, sptr ; res = MprConfigInterfaceGetCustomInfoEx(hMprConfig, hRouterInterface, varptr(pCustomInfo)) ; hMprConfig : HANDLE -> "sptr" ; hRouterInterface : HANDLE -> "sptr" ; pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD MprConfigInterfaceGetCustomInfoEx(HANDLE hMprConfig, HANDLE hRouterInterface, MPR_IF_CUSTOMINFOEX2* pCustomInfo) #uselib "MPRAPI.dll" #cfunc global MprConfigInterfaceGetCustomInfoEx "MprConfigInterfaceGetCustomInfoEx" intptr, intptr, var ; res = MprConfigInterfaceGetCustomInfoEx(hMprConfig, hRouterInterface, pCustomInfo) ; hMprConfig : HANDLE -> "intptr" ; hRouterInterface : HANDLE -> "intptr" ; pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD MprConfigInterfaceGetCustomInfoEx(HANDLE hMprConfig, HANDLE hRouterInterface, MPR_IF_CUSTOMINFOEX2* pCustomInfo) #uselib "MPRAPI.dll" #cfunc global MprConfigInterfaceGetCustomInfoEx "MprConfigInterfaceGetCustomInfoEx" intptr, intptr, intptr ; res = MprConfigInterfaceGetCustomInfoEx(hMprConfig, hRouterInterface, varptr(pCustomInfo)) ; hMprConfig : HANDLE -> "intptr" ; hRouterInterface : HANDLE -> "intptr" ; pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
procMprConfigInterfaceGetCustomInfoEx = mprapi.NewProc("MprConfigInterfaceGetCustomInfoEx")
)
// hMprConfig (HANDLE), hRouterInterface (HANDLE), pCustomInfo (MPR_IF_CUSTOMINFOEX2* out)
r1, _, err := procMprConfigInterfaceGetCustomInfoEx.Call(
uintptr(hMprConfig),
uintptr(hRouterInterface),
uintptr(pCustomInfo),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction MprConfigInterfaceGetCustomInfoEx(
hMprConfig: THandle; // HANDLE
hRouterInterface: THandle; // HANDLE
pCustomInfo: Pointer // MPR_IF_CUSTOMINFOEX2* out
): DWORD; stdcall;
external 'MPRAPI.dll' name 'MprConfigInterfaceGetCustomInfoEx';result := DllCall("MPRAPI\MprConfigInterfaceGetCustomInfoEx"
, "Ptr", hMprConfig ; HANDLE
, "Ptr", hRouterInterface ; HANDLE
, "Ptr", pCustomInfo ; MPR_IF_CUSTOMINFOEX2* out
, "UInt") ; return: DWORD●MprConfigInterfaceGetCustomInfoEx(hMprConfig, hRouterInterface, pCustomInfo) = DLL("MPRAPI.dll", "dword MprConfigInterfaceGetCustomInfoEx(void*, void*, void*)")
# 呼び出し: MprConfigInterfaceGetCustomInfoEx(hMprConfig, hRouterInterface, pCustomInfo)
# hMprConfig : HANDLE -> "void*"
# hRouterInterface : HANDLE -> "void*"
# pCustomInfo : MPR_IF_CUSTOMINFOEX2* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。