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