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

MprAdminInterfaceTransportRemove

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

シグネチャ

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

DWORD MprAdminInterfaceTransportRemove(
    INT_PTR hMprServer,
    HANDLE hInterface,
    DWORD dwTransportId
);

パラメーター

名前方向
hMprServerINT_PTRin
hInterfaceHANDLEin
dwTransportIdDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

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

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

var (
	mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
	procMprAdminInterfaceTransportRemove = mprapi.NewProc("MprAdminInterfaceTransportRemove")
)

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