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