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

MprConfigInterfaceSetCustomInfoEx

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

シグネチャ

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

DWORD MprConfigInterfaceSetCustomInfoEx(
    HANDLE hMprConfig,
    HANDLE hRouterInterface,
    MPR_IF_CUSTOMINFOEX2* pCustomInfo
);

パラメーター

名前方向
hMprConfigHANDLEin
hRouterInterfaceHANDLEin
pCustomInfoMPR_IF_CUSTOMINFOEX2*in

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MprConfigInterfaceSetCustomInfoEx(
    HANDLE hMprConfig,
    HANDLE hRouterInterface,
    MPR_IF_CUSTOMINFOEX2* pCustomInfo
);
[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprConfigInterfaceSetCustomInfoEx(
    IntPtr hMprConfig,   // HANDLE
    IntPtr hRouterInterface,   // HANDLE
    IntPtr pCustomInfo   // MPR_IF_CUSTOMINFOEX2*
);
<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprConfigInterfaceSetCustomInfoEx(
    hMprConfig As IntPtr,   ' HANDLE
    hRouterInterface As IntPtr,   ' HANDLE
    pCustomInfo As IntPtr   ' MPR_IF_CUSTOMINFOEX2*
) As UInteger
End Function
' hMprConfig : HANDLE
' hRouterInterface : HANDLE
' pCustomInfo : MPR_IF_CUSTOMINFOEX2*
Declare PtrSafe Function MprConfigInterfaceSetCustomInfoEx 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

MprConfigInterfaceSetCustomInfoEx = ctypes.windll.mprapi.MprConfigInterfaceSetCustomInfoEx
MprConfigInterfaceSetCustomInfoEx.restype = wintypes.DWORD
MprConfigInterfaceSetCustomInfoEx.argtypes = [
    wintypes.HANDLE,  # hMprConfig : HANDLE
    wintypes.HANDLE,  # hRouterInterface : HANDLE
    ctypes.c_void_p,  # pCustomInfo : MPR_IF_CUSTOMINFOEX2*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprConfigInterfaceSetCustomInfoEx = mprapi.NewProc("MprConfigInterfaceSetCustomInfoEx")
)

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