Win32 API 日本語リファレンス
ホームStorage.IscsiDisc › RemovePersistentIScsiDeviceA

RemovePersistentIScsiDeviceA

関数
永続的iSCSIデバイスの登録を削除する(ANSI版)。
DLLISCSIDSC.dll文字セットANSI (-A)呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// ISCSIDSC.dll  (ANSI / -A)
#include <windows.h>

DWORD RemovePersistentIScsiDeviceA(
    LPSTR DevicePath
);

パラメーター

名前方向
DevicePathLPSTRin

戻り値の型: DWORD

各言語での呼び出し定義

// ISCSIDSC.dll  (ANSI / -A)
#include <windows.h>

DWORD RemovePersistentIScsiDeviceA(
    LPSTR DevicePath
);
[DllImport("ISCSIDSC.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint RemovePersistentIScsiDeviceA(
    [MarshalAs(UnmanagedType.LPStr)] string DevicePath   // LPSTR
);
<DllImport("ISCSIDSC.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RemovePersistentIScsiDeviceA(
    <MarshalAs(UnmanagedType.LPStr)> DevicePath As String   ' LPSTR
) As UInteger
End Function
' DevicePath : LPSTR
Declare PtrSafe Function RemovePersistentIScsiDeviceA Lib "iscsidsc" ( _
    ByVal DevicePath As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RemovePersistentIScsiDeviceA = ctypes.windll.iscsidsc.RemovePersistentIScsiDeviceA
RemovePersistentIScsiDeviceA.restype = wintypes.DWORD
RemovePersistentIScsiDeviceA.argtypes = [
    wintypes.LPCSTR,  # DevicePath : LPSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ISCSIDSC.dll')
RemovePersistentIScsiDeviceA = Fiddle::Function.new(
  lib['RemovePersistentIScsiDeviceA'],
  [
    Fiddle::TYPE_VOIDP,  # DevicePath : LPSTR
  ],
  -Fiddle::TYPE_INT)
#[link(name = "iscsidsc")]
extern "system" {
    fn RemovePersistentIScsiDeviceA(
        DevicePath: *mut u8  // LPSTR
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ISCSIDSC.dll", CharSet = CharSet.Ansi)]
public static extern uint RemovePersistentIScsiDeviceA([MarshalAs(UnmanagedType.LPStr)] string DevicePath);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ISCSIDSC_RemovePersistentIScsiDeviceA' -Namespace Win32 -PassThru
# $api::RemovePersistentIScsiDeviceA(DevicePath)
#uselib "ISCSIDSC.dll"
#func global RemovePersistentIScsiDeviceA "RemovePersistentIScsiDeviceA" sptr
; RemovePersistentIScsiDeviceA DevicePath   ; 戻り値は stat
; DevicePath : LPSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ISCSIDSC.dll"
#cfunc global RemovePersistentIScsiDeviceA "RemovePersistentIScsiDeviceA" str
; res = RemovePersistentIScsiDeviceA(DevicePath)
; DevicePath : LPSTR -> "str"
; DWORD RemovePersistentIScsiDeviceA(LPSTR DevicePath)
#uselib "ISCSIDSC.dll"
#cfunc global RemovePersistentIScsiDeviceA "RemovePersistentIScsiDeviceA" str
; res = RemovePersistentIScsiDeviceA(DevicePath)
; DevicePath : LPSTR -> "str"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	iscsidsc = windows.NewLazySystemDLL("ISCSIDSC.dll")
	procRemovePersistentIScsiDeviceA = iscsidsc.NewProc("RemovePersistentIScsiDeviceA")
)

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