ホーム › Storage.FileSystem › GetTapeStatus
GetTapeStatus
関数テープデバイスの現在の状態を取得する。
シグネチャ
// KERNEL32.dll
#include <windows.h>
DWORD GetTapeStatus(
HANDLE hDevice
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hDevice | HANDLE | in |
戻り値の型: DWORD
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
DWORD GetTapeStatus(
HANDLE hDevice
);[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern uint GetTapeStatus(
IntPtr hDevice // HANDLE
);<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function GetTapeStatus(
hDevice As IntPtr ' HANDLE
) As UInteger
End Function' hDevice : HANDLE
Declare PtrSafe Function GetTapeStatus Lib "kernel32" ( _
ByVal hDevice As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetTapeStatus = ctypes.windll.kernel32.GetTapeStatus
GetTapeStatus.restype = wintypes.DWORD
GetTapeStatus.argtypes = [
wintypes.HANDLE, # hDevice : HANDLE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
GetTapeStatus = Fiddle::Function.new(
lib['GetTapeStatus'],
[
Fiddle::TYPE_VOIDP, # hDevice : HANDLE
],
-Fiddle::TYPE_INT)#[link(name = "kernel32")]
extern "system" {
fn GetTapeStatus(
hDevice: *mut core::ffi::c_void // HANDLE
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("KERNEL32.dll")]
public static extern uint GetTapeStatus(IntPtr hDevice);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_GetTapeStatus' -Namespace Win32 -PassThru
# $api::GetTapeStatus(hDevice)#uselib "KERNEL32.dll"
#func global GetTapeStatus "GetTapeStatus" sptr
; GetTapeStatus hDevice ; 戻り値は stat
; hDevice : HANDLE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global GetTapeStatus "GetTapeStatus" sptr
; res = GetTapeStatus(hDevice)
; hDevice : HANDLE -> "sptr"; DWORD GetTapeStatus(HANDLE hDevice)
#uselib "KERNEL32.dll"
#cfunc global GetTapeStatus "GetTapeStatus" intptr
; res = GetTapeStatus(hDevice)
; hDevice : HANDLE -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procGetTapeStatus = kernel32.NewProc("GetTapeStatus")
)
// hDevice (HANDLE)
r1, _, err := procGetTapeStatus.Call(
uintptr(hDevice),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction GetTapeStatus(
hDevice: THandle // HANDLE
): DWORD; stdcall;
external 'KERNEL32.dll' name 'GetTapeStatus';result := DllCall("KERNEL32\GetTapeStatus"
, "Ptr", hDevice ; HANDLE
, "UInt") ; return: DWORD●GetTapeStatus(hDevice) = DLL("KERNEL32.dll", "dword GetTapeStatus(void*)")
# 呼び出し: GetTapeStatus(hDevice)
# hDevice : HANDLE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。