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

MprAdminServerGetInfoEx

関数
RAS/ルーティングサーバーの拡張構成情報を取得する。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

DWORD MprAdminServerGetInfoEx(
    INT_PTR hMprServer,
    MPR_SERVER_EX1* pServerInfo
);

パラメーター

名前方向
hMprServerINT_PTRin
pServerInfoMPR_SERVER_EX1*out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MprAdminServerGetInfoEx(
    INT_PTR hMprServer,
    MPR_SERVER_EX1* pServerInfo
);
[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprAdminServerGetInfoEx(
    IntPtr hMprServer,   // INT_PTR
    IntPtr pServerInfo   // MPR_SERVER_EX1* out
);
<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprAdminServerGetInfoEx(
    hMprServer As IntPtr,   ' INT_PTR
    pServerInfo As IntPtr   ' MPR_SERVER_EX1* out
) As UInteger
End Function
' hMprServer : INT_PTR
' pServerInfo : MPR_SERVER_EX1* out
Declare PtrSafe Function MprAdminServerGetInfoEx Lib "mprapi" ( _
    ByVal hMprServer As LongPtr, _
    ByVal pServerInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MprAdminServerGetInfoEx = ctypes.windll.mprapi.MprAdminServerGetInfoEx
MprAdminServerGetInfoEx.restype = wintypes.DWORD
MprAdminServerGetInfoEx.argtypes = [
    ctypes.c_ssize_t,  # hMprServer : INT_PTR
    ctypes.c_void_p,  # pServerInfo : MPR_SERVER_EX1* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MPRAPI.dll')
MprAdminServerGetInfoEx = Fiddle::Function.new(
  lib['MprAdminServerGetInfoEx'],
  [
    Fiddle::TYPE_INTPTR_T,  # hMprServer : INT_PTR
    Fiddle::TYPE_VOIDP,  # pServerInfo : MPR_SERVER_EX1* out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "mprapi")]
extern "system" {
    fn MprAdminServerGetInfoEx(
        hMprServer: isize,  // INT_PTR
        pServerInfo: *mut MPR_SERVER_EX1  // MPR_SERVER_EX1* out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MPRAPI.dll")]
public static extern uint MprAdminServerGetInfoEx(IntPtr hMprServer, IntPtr pServerInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPRAPI_MprAdminServerGetInfoEx' -Namespace Win32 -PassThru
# $api::MprAdminServerGetInfoEx(hMprServer, pServerInfo)
#uselib "MPRAPI.dll"
#func global MprAdminServerGetInfoEx "MprAdminServerGetInfoEx" sptr, sptr
; MprAdminServerGetInfoEx hMprServer, varptr(pServerInfo)   ; 戻り値は stat
; hMprServer : INT_PTR -> "sptr"
; pServerInfo : MPR_SERVER_EX1* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MPRAPI.dll"
#cfunc global MprAdminServerGetInfoEx "MprAdminServerGetInfoEx" sptr, var
; res = MprAdminServerGetInfoEx(hMprServer, pServerInfo)
; hMprServer : INT_PTR -> "sptr"
; pServerInfo : MPR_SERVER_EX1* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD MprAdminServerGetInfoEx(INT_PTR hMprServer, MPR_SERVER_EX1* pServerInfo)
#uselib "MPRAPI.dll"
#cfunc global MprAdminServerGetInfoEx "MprAdminServerGetInfoEx" intptr, var
; res = MprAdminServerGetInfoEx(hMprServer, pServerInfo)
; hMprServer : INT_PTR -> "intptr"
; pServerInfo : MPR_SERVER_EX1* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminServerGetInfoEx = mprapi.NewProc("MprAdminServerGetInfoEx")
)

// hMprServer (INT_PTR), pServerInfo (MPR_SERVER_EX1* out)
r1, _, err := procMprAdminServerGetInfoEx.Call(
	uintptr(hMprServer),
	uintptr(pServerInfo),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function MprAdminServerGetInfoEx(
  hMprServer: NativeInt;   // INT_PTR
  pServerInfo: Pointer   // MPR_SERVER_EX1* out
): DWORD; stdcall;
  external 'MPRAPI.dll' name 'MprAdminServerGetInfoEx';
result := DllCall("MPRAPI\MprAdminServerGetInfoEx"
    , "Ptr", hMprServer   ; INT_PTR
    , "Ptr", pServerInfo   ; MPR_SERVER_EX1* out
    , "UInt")   ; return: DWORD
●MprAdminServerGetInfoEx(hMprServer, pServerInfo) = DLL("MPRAPI.dll", "dword MprAdminServerGetInfoEx(int, void*)")
# 呼び出し: MprAdminServerGetInfoEx(hMprServer, pServerInfo)
# hMprServer : INT_PTR -> "int"
# pServerInfo : MPR_SERVER_EX1* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。