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

MprConfigServerInstall

関数
ルーター構成サーバーをインストールし初期化する。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD MprConfigServerInstall(
    DWORD dwLevel,
    void* pBuffer
);

パラメーター

名前方向
dwLevelDWORDin
pBuffervoid*in

戻り値の型: DWORD

各言語での呼び出し定義

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

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

MprConfigServerInstall = ctypes.windll.mprapi.MprConfigServerInstall
MprConfigServerInstall.restype = wintypes.DWORD
MprConfigServerInstall.argtypes = [
    wintypes.DWORD,  # dwLevel : DWORD
    ctypes.POINTER(None),  # pBuffer : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MPRAPI.dll')
MprConfigServerInstall = Fiddle::Function.new(
  lib['MprConfigServerInstall'],
  [
    -Fiddle::TYPE_INT,  # dwLevel : DWORD
    Fiddle::TYPE_VOIDP,  # pBuffer : void*
  ],
  -Fiddle::TYPE_INT)
#[link(name = "mprapi")]
extern "system" {
    fn MprConfigServerInstall(
        dwLevel: u32,  // DWORD
        pBuffer: *mut ()  // void*
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MPRAPI.dll")]
public static extern uint MprConfigServerInstall(uint dwLevel, IntPtr pBuffer);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPRAPI_MprConfigServerInstall' -Namespace Win32 -PassThru
# $api::MprConfigServerInstall(dwLevel, pBuffer)
#uselib "MPRAPI.dll"
#func global MprConfigServerInstall "MprConfigServerInstall" sptr, sptr
; MprConfigServerInstall dwLevel, pBuffer   ; 戻り値は stat
; dwLevel : DWORD -> "sptr"
; pBuffer : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MPRAPI.dll"
#cfunc global MprConfigServerInstall "MprConfigServerInstall" int, sptr
; res = MprConfigServerInstall(dwLevel, pBuffer)
; dwLevel : DWORD -> "int"
; pBuffer : void* -> "sptr"
; DWORD MprConfigServerInstall(DWORD dwLevel, void* pBuffer)
#uselib "MPRAPI.dll"
#cfunc global MprConfigServerInstall "MprConfigServerInstall" int, intptr
; res = MprConfigServerInstall(dwLevel, pBuffer)
; dwLevel : DWORD -> "int"
; pBuffer : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprConfigServerInstall = mprapi.NewProc("MprConfigServerInstall")
)

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