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