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