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

MprAdminMIBEntryGet

関数
ルーティングプロトコルの指定MIBエントリを取得する。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD MprAdminMIBEntryGet(
    INT_PTR hMibServer,
    DWORD dwProtocolId,
    DWORD dwRoutingPid,
    void* lpInEntry,
    DWORD dwInEntrySize,
    void** lplpOutEntry,
    DWORD* lpOutEntrySize
);

パラメーター

名前方向
hMibServerINT_PTRin
dwProtocolIdDWORDin
dwRoutingPidDWORDin
lpInEntryvoid*in
dwInEntrySizeDWORDin
lplpOutEntryvoid**out
lpOutEntrySizeDWORD*out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MprAdminMIBEntryGet(
    INT_PTR hMibServer,
    DWORD dwProtocolId,
    DWORD dwRoutingPid,
    void* lpInEntry,
    DWORD dwInEntrySize,
    void** lplpOutEntry,
    DWORD* lpOutEntrySize
);
[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprAdminMIBEntryGet(
    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 MprAdminMIBEntryGet(
    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 MprAdminMIBEntryGet 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

MprAdminMIBEntryGet = ctypes.windll.mprapi.MprAdminMIBEntryGet
MprAdminMIBEntryGet.restype = wintypes.DWORD
MprAdminMIBEntryGet.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')
MprAdminMIBEntryGet = Fiddle::Function.new(
  lib['MprAdminMIBEntryGet'],
  [
    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 MprAdminMIBEntryGet(
        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 MprAdminMIBEntryGet(IntPtr hMibServer, uint dwProtocolId, uint dwRoutingPid, IntPtr lpInEntry, uint dwInEntrySize, IntPtr lplpOutEntry, out uint lpOutEntrySize);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPRAPI_MprAdminMIBEntryGet' -Namespace Win32 -PassThru
# $api::MprAdminMIBEntryGet(hMibServer, dwProtocolId, dwRoutingPid, lpInEntry, dwInEntrySize, lplpOutEntry, lpOutEntrySize)
#uselib "MPRAPI.dll"
#func global MprAdminMIBEntryGet "MprAdminMIBEntryGet" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; MprAdminMIBEntryGet 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 MprAdminMIBEntryGet "MprAdminMIBEntryGet" sptr, int, int, sptr, int, sptr, var
; res = MprAdminMIBEntryGet(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 方式にも切替可。
出力引数:
; DWORD MprAdminMIBEntryGet(INT_PTR hMibServer, DWORD dwProtocolId, DWORD dwRoutingPid, void* lpInEntry, DWORD dwInEntrySize, void** lplpOutEntry, DWORD* lpOutEntrySize)
#uselib "MPRAPI.dll"
#cfunc global MprAdminMIBEntryGet "MprAdminMIBEntryGet" intptr, int, int, intptr, int, intptr, var
; res = MprAdminMIBEntryGet(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 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminMIBEntryGet = mprapi.NewProc("MprAdminMIBEntryGet")
)

// hMibServer (INT_PTR), dwProtocolId (DWORD), dwRoutingPid (DWORD), lpInEntry (void*), dwInEntrySize (DWORD), lplpOutEntry (void** out), lpOutEntrySize (DWORD* out)
r1, _, err := procMprAdminMIBEntryGet.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   // DWORD
function MprAdminMIBEntryGet(
  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 'MprAdminMIBEntryGet';
result := DllCall("MPRAPI\MprAdminMIBEntryGet"
    , "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
●MprAdminMIBEntryGet(hMibServer, dwProtocolId, dwRoutingPid, lpInEntry, dwInEntrySize, lplpOutEntry, lpOutEntrySize) = DLL("MPRAPI.dll", "dword MprAdminMIBEntryGet(int, dword, dword, void*, dword, void*, void*)")
# 呼び出し: MprAdminMIBEntryGet(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)。