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

MprAdminInterfaceDelete

関数
指定したルーターインターフェイスを削除する。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD MprAdminInterfaceDelete(
    INT_PTR hMprServer,
    HANDLE hInterface
);

パラメーター

名前方向
hMprServerINT_PTRin
hInterfaceHANDLEin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

MprAdminInterfaceDelete = ctypes.windll.mprapi.MprAdminInterfaceDelete
MprAdminInterfaceDelete.restype = wintypes.DWORD
MprAdminInterfaceDelete.argtypes = [
    ctypes.c_ssize_t,  # hMprServer : INT_PTR
    wintypes.HANDLE,  # hInterface : HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminInterfaceDelete = mprapi.NewProc("MprAdminInterfaceDelete")
)

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