ホーム › NetworkManagement.Rras › MprAdminMIBEntrySet
MprAdminMIBEntrySet
関数ルーティングプロトコルのMIBエントリを設定する。
シグネチャ
// MPRAPI.dll
#include <windows.h>
DWORD MprAdminMIBEntrySet(
INT_PTR hMibServer,
DWORD dwProtocolId,
DWORD dwRoutingPid,
void* lpEntry,
DWORD dwEntrySize
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hMibServer | INT_PTR | in |
| dwProtocolId | DWORD | in |
| dwRoutingPid | DWORD | in |
| lpEntry | void* | in |
| dwEntrySize | DWORD | in |
戻り値の型: DWORD
各言語での呼び出し定義
// MPRAPI.dll
#include <windows.h>
DWORD MprAdminMIBEntrySet(
INT_PTR hMibServer,
DWORD dwProtocolId,
DWORD dwRoutingPid,
void* lpEntry,
DWORD dwEntrySize
);[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprAdminMIBEntrySet(
IntPtr hMibServer, // INT_PTR
uint dwProtocolId, // DWORD
uint dwRoutingPid, // DWORD
IntPtr lpEntry, // void*
uint dwEntrySize // DWORD
);<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprAdminMIBEntrySet(
hMibServer As IntPtr, ' INT_PTR
dwProtocolId As UInteger, ' DWORD
dwRoutingPid As UInteger, ' DWORD
lpEntry As IntPtr, ' void*
dwEntrySize As UInteger ' DWORD
) As UInteger
End Function' hMibServer : INT_PTR
' dwProtocolId : DWORD
' dwRoutingPid : DWORD
' lpEntry : void*
' dwEntrySize : DWORD
Declare PtrSafe Function MprAdminMIBEntrySet Lib "mprapi" ( _
ByVal hMibServer As LongPtr, _
ByVal dwProtocolId As Long, _
ByVal dwRoutingPid As Long, _
ByVal lpEntry As LongPtr, _
ByVal dwEntrySize As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MprAdminMIBEntrySet = ctypes.windll.mprapi.MprAdminMIBEntrySet
MprAdminMIBEntrySet.restype = wintypes.DWORD
MprAdminMIBEntrySet.argtypes = [
ctypes.c_ssize_t, # hMibServer : INT_PTR
wintypes.DWORD, # dwProtocolId : DWORD
wintypes.DWORD, # dwRoutingPid : DWORD
ctypes.POINTER(None), # lpEntry : void*
wintypes.DWORD, # dwEntrySize : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MPRAPI.dll')
MprAdminMIBEntrySet = Fiddle::Function.new(
lib['MprAdminMIBEntrySet'],
[
Fiddle::TYPE_INTPTR_T, # hMibServer : INT_PTR
-Fiddle::TYPE_INT, # dwProtocolId : DWORD
-Fiddle::TYPE_INT, # dwRoutingPid : DWORD
Fiddle::TYPE_VOIDP, # lpEntry : void*
-Fiddle::TYPE_INT, # dwEntrySize : DWORD
],
-Fiddle::TYPE_INT)#[link(name = "mprapi")]
extern "system" {
fn MprAdminMIBEntrySet(
hMibServer: isize, // INT_PTR
dwProtocolId: u32, // DWORD
dwRoutingPid: u32, // DWORD
lpEntry: *mut (), // void*
dwEntrySize: u32 // DWORD
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MPRAPI.dll")]
public static extern uint MprAdminMIBEntrySet(IntPtr hMibServer, uint dwProtocolId, uint dwRoutingPid, IntPtr lpEntry, uint dwEntrySize);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPRAPI_MprAdminMIBEntrySet' -Namespace Win32 -PassThru
# $api::MprAdminMIBEntrySet(hMibServer, dwProtocolId, dwRoutingPid, lpEntry, dwEntrySize)#uselib "MPRAPI.dll"
#func global MprAdminMIBEntrySet "MprAdminMIBEntrySet" sptr, sptr, sptr, sptr, sptr
; MprAdminMIBEntrySet hMibServer, dwProtocolId, dwRoutingPid, lpEntry, dwEntrySize ; 戻り値は stat
; hMibServer : INT_PTR -> "sptr"
; dwProtocolId : DWORD -> "sptr"
; dwRoutingPid : DWORD -> "sptr"
; lpEntry : void* -> "sptr"
; dwEntrySize : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MPRAPI.dll"
#cfunc global MprAdminMIBEntrySet "MprAdminMIBEntrySet" sptr, int, int, sptr, int
; res = MprAdminMIBEntrySet(hMibServer, dwProtocolId, dwRoutingPid, lpEntry, dwEntrySize)
; hMibServer : INT_PTR -> "sptr"
; dwProtocolId : DWORD -> "int"
; dwRoutingPid : DWORD -> "int"
; lpEntry : void* -> "sptr"
; dwEntrySize : DWORD -> "int"; DWORD MprAdminMIBEntrySet(INT_PTR hMibServer, DWORD dwProtocolId, DWORD dwRoutingPid, void* lpEntry, DWORD dwEntrySize)
#uselib "MPRAPI.dll"
#cfunc global MprAdminMIBEntrySet "MprAdminMIBEntrySet" intptr, int, int, intptr, int
; res = MprAdminMIBEntrySet(hMibServer, dwProtocolId, dwRoutingPid, lpEntry, dwEntrySize)
; hMibServer : INT_PTR -> "intptr"
; dwProtocolId : DWORD -> "int"
; dwRoutingPid : DWORD -> "int"
; lpEntry : void* -> "intptr"
; dwEntrySize : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
procMprAdminMIBEntrySet = mprapi.NewProc("MprAdminMIBEntrySet")
)
// hMibServer (INT_PTR), dwProtocolId (DWORD), dwRoutingPid (DWORD), lpEntry (void*), dwEntrySize (DWORD)
r1, _, err := procMprAdminMIBEntrySet.Call(
uintptr(hMibServer),
uintptr(dwProtocolId),
uintptr(dwRoutingPid),
uintptr(lpEntry),
uintptr(dwEntrySize),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction MprAdminMIBEntrySet(
hMibServer: NativeInt; // INT_PTR
dwProtocolId: DWORD; // DWORD
dwRoutingPid: DWORD; // DWORD
lpEntry: Pointer; // void*
dwEntrySize: DWORD // DWORD
): DWORD; stdcall;
external 'MPRAPI.dll' name 'MprAdminMIBEntrySet';result := DllCall("MPRAPI\MprAdminMIBEntrySet"
, "Ptr", hMibServer ; INT_PTR
, "UInt", dwProtocolId ; DWORD
, "UInt", dwRoutingPid ; DWORD
, "Ptr", lpEntry ; void*
, "UInt", dwEntrySize ; DWORD
, "UInt") ; return: DWORD●MprAdminMIBEntrySet(hMibServer, dwProtocolId, dwRoutingPid, lpEntry, dwEntrySize) = DLL("MPRAPI.dll", "dword MprAdminMIBEntrySet(int, dword, dword, void*, dword)")
# 呼び出し: MprAdminMIBEntrySet(hMibServer, dwProtocolId, dwRoutingPid, lpEntry, dwEntrySize)
# hMibServer : INT_PTR -> "int"
# dwProtocolId : DWORD -> "dword"
# dwRoutingPid : DWORD -> "dword"
# lpEntry : void* -> "void*"
# dwEntrySize : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。