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

MprConfigServerGetInfoEx

関数
MPR構成からサーバーの拡張構成情報を取得する。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

DWORD MprConfigServerGetInfoEx(
    HANDLE hMprConfig,
    MPR_SERVER_EX1* pServerInfo
);

パラメーター

名前方向
hMprConfigHANDLEin
pServerInfoMPR_SERVER_EX1*out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MprConfigServerGetInfoEx(
    HANDLE hMprConfig,
    MPR_SERVER_EX1* pServerInfo
);
[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprConfigServerGetInfoEx(
    IntPtr hMprConfig,   // HANDLE
    IntPtr pServerInfo   // MPR_SERVER_EX1* out
);
<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprConfigServerGetInfoEx(
    hMprConfig As IntPtr,   ' HANDLE
    pServerInfo As IntPtr   ' MPR_SERVER_EX1* out
) As UInteger
End Function
' hMprConfig : HANDLE
' pServerInfo : MPR_SERVER_EX1* out
Declare PtrSafe Function MprConfigServerGetInfoEx Lib "mprapi" ( _
    ByVal hMprConfig 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

MprConfigServerGetInfoEx = ctypes.windll.mprapi.MprConfigServerGetInfoEx
MprConfigServerGetInfoEx.restype = wintypes.DWORD
MprConfigServerGetInfoEx.argtypes = [
    wintypes.HANDLE,  # hMprConfig : HANDLE
    ctypes.c_void_p,  # pServerInfo : MPR_SERVER_EX1* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MPRAPI.dll')
MprConfigServerGetInfoEx = Fiddle::Function.new(
  lib['MprConfigServerGetInfoEx'],
  [
    Fiddle::TYPE_VOIDP,  # hMprConfig : HANDLE
    Fiddle::TYPE_VOIDP,  # pServerInfo : MPR_SERVER_EX1* out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "mprapi")]
extern "system" {
    fn MprConfigServerGetInfoEx(
        hMprConfig: *mut core::ffi::c_void,  // HANDLE
        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 MprConfigServerGetInfoEx(IntPtr hMprConfig, IntPtr pServerInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPRAPI_MprConfigServerGetInfoEx' -Namespace Win32 -PassThru
# $api::MprConfigServerGetInfoEx(hMprConfig, pServerInfo)
#uselib "MPRAPI.dll"
#func global MprConfigServerGetInfoEx "MprConfigServerGetInfoEx" sptr, sptr
; MprConfigServerGetInfoEx hMprConfig, varptr(pServerInfo)   ; 戻り値は stat
; hMprConfig : HANDLE -> "sptr"
; pServerInfo : MPR_SERVER_EX1* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MPRAPI.dll"
#cfunc global MprConfigServerGetInfoEx "MprConfigServerGetInfoEx" sptr, var
; res = MprConfigServerGetInfoEx(hMprConfig, pServerInfo)
; hMprConfig : HANDLE -> "sptr"
; pServerInfo : MPR_SERVER_EX1* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD MprConfigServerGetInfoEx(HANDLE hMprConfig, MPR_SERVER_EX1* pServerInfo)
#uselib "MPRAPI.dll"
#cfunc global MprConfigServerGetInfoEx "MprConfigServerGetInfoEx" intptr, var
; res = MprConfigServerGetInfoEx(hMprConfig, pServerInfo)
; hMprConfig : HANDLE -> "intptr"
; pServerInfo : MPR_SERVER_EX1* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprConfigServerGetInfoEx = mprapi.NewProc("MprConfigServerGetInfoEx")
)

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