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

MprAdminInterfaceQueryUpdateResult

関数
インターフェイスのルート更新要求の結果を問い合わせる。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD MprAdminInterfaceQueryUpdateResult(
    INT_PTR hMprServer,
    HANDLE hInterface,
    DWORD dwProtocolId,
    DWORD* lpdwUpdateResult
);

パラメーター

名前方向
hMprServerINT_PTRin
hInterfaceHANDLEin
dwProtocolIdDWORDin
lpdwUpdateResultDWORD*out

戻り値の型: DWORD

各言語での呼び出し定義

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

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

MprAdminInterfaceQueryUpdateResult = ctypes.windll.mprapi.MprAdminInterfaceQueryUpdateResult
MprAdminInterfaceQueryUpdateResult.restype = wintypes.DWORD
MprAdminInterfaceQueryUpdateResult.argtypes = [
    ctypes.c_ssize_t,  # hMprServer : INT_PTR
    wintypes.HANDLE,  # hInterface : HANDLE
    wintypes.DWORD,  # dwProtocolId : DWORD
    ctypes.POINTER(wintypes.DWORD),  # lpdwUpdateResult : DWORD* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminInterfaceQueryUpdateResult = mprapi.NewProc("MprAdminInterfaceQueryUpdateResult")
)

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