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

MprAdminConnectionRemoveQuarantine

関数
RAS接続の検疫(隔離)状態を解除する。
DLLMPRAPI.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD MprAdminConnectionRemoveQuarantine(
    HANDLE hRasServer,
    HANDLE hRasConnection,
    BOOL fIsIpAddress
);

パラメーター

名前方向
hRasServerHANDLEin
hRasConnectionHANDLEin
fIsIpAddressBOOLin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

MprAdminConnectionRemoveQuarantine = ctypes.windll.mprapi.MprAdminConnectionRemoveQuarantine
MprAdminConnectionRemoveQuarantine.restype = wintypes.DWORD
MprAdminConnectionRemoveQuarantine.argtypes = [
    wintypes.HANDLE,  # hRasServer : HANDLE
    wintypes.HANDLE,  # hRasConnection : HANDLE
    wintypes.BOOL,  # fIsIpAddress : BOOL
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminConnectionRemoveQuarantine = mprapi.NewProc("MprAdminConnectionRemoveQuarantine")
)

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