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

MprAdminServerSetInfoEx

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

シグネチャ

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

DWORD MprAdminServerSetInfoEx(
    INT_PTR hMprServer,
    MPR_SERVER_SET_CONFIG_EX1* pServerInfo
);

パラメーター

名前方向
hMprServerINT_PTRin
pServerInfoMPR_SERVER_SET_CONFIG_EX1*in

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MprAdminServerSetInfoEx(
    INT_PTR hMprServer,
    MPR_SERVER_SET_CONFIG_EX1* pServerInfo
);
[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprAdminServerSetInfoEx(
    IntPtr hMprServer,   // INT_PTR
    IntPtr pServerInfo   // MPR_SERVER_SET_CONFIG_EX1*
);
<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprAdminServerSetInfoEx(
    hMprServer As IntPtr,   ' INT_PTR
    pServerInfo As IntPtr   ' MPR_SERVER_SET_CONFIG_EX1*
) As UInteger
End Function
' hMprServer : INT_PTR
' pServerInfo : MPR_SERVER_SET_CONFIG_EX1*
Declare PtrSafe Function MprAdminServerSetInfoEx 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

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

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

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminServerSetInfoEx = mprapi.NewProc("MprAdminServerSetInfoEx")
)

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