ホーム › Storage.FileSystem › CopyLZFile
CopyLZFile
関数LZ圧縮ファイルを展開しながらコピーする。
シグネチャ
// KERNEL32.dll
#include <windows.h>
INT CopyLZFile(
INT hfSource,
INT hfDest
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hfSource | INT | in |
| hfDest | INT | in |
戻り値の型: INT
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
INT CopyLZFile(
INT hfSource,
INT hfDest
);[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern int CopyLZFile(
int hfSource, // INT
int hfDest // INT
);<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function CopyLZFile(
hfSource As Integer, ' INT
hfDest As Integer ' INT
) As Integer
End Function' hfSource : INT
' hfDest : INT
Declare PtrSafe Function CopyLZFile Lib "kernel32" ( _
ByVal hfSource As Long, _
ByVal hfDest As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CopyLZFile = ctypes.windll.kernel32.CopyLZFile
CopyLZFile.restype = ctypes.c_int
CopyLZFile.argtypes = [
ctypes.c_int, # hfSource : INT
ctypes.c_int, # hfDest : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
CopyLZFile = Fiddle::Function.new(
lib['CopyLZFile'],
[
Fiddle::TYPE_INT, # hfSource : INT
Fiddle::TYPE_INT, # hfDest : INT
],
Fiddle::TYPE_INT)#[link(name = "kernel32")]
extern "system" {
fn CopyLZFile(
hfSource: i32, // INT
hfDest: i32 // INT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("KERNEL32.dll")]
public static extern int CopyLZFile(int hfSource, int hfDest);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_CopyLZFile' -Namespace Win32 -PassThru
# $api::CopyLZFile(hfSource, hfDest)#uselib "KERNEL32.dll"
#func global CopyLZFile "CopyLZFile" sptr, sptr
; CopyLZFile hfSource, hfDest ; 戻り値は stat
; hfSource : INT -> "sptr"
; hfDest : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global CopyLZFile "CopyLZFile" int, int
; res = CopyLZFile(hfSource, hfDest)
; hfSource : INT -> "int"
; hfDest : INT -> "int"; INT CopyLZFile(INT hfSource, INT hfDest)
#uselib "KERNEL32.dll"
#cfunc global CopyLZFile "CopyLZFile" int, int
; res = CopyLZFile(hfSource, hfDest)
; hfSource : INT -> "int"
; hfDest : INT -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procCopyLZFile = kernel32.NewProc("CopyLZFile")
)
// hfSource (INT), hfDest (INT)
r1, _, err := procCopyLZFile.Call(
uintptr(hfSource),
uintptr(hfDest),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction CopyLZFile(
hfSource: Integer; // INT
hfDest: Integer // INT
): Integer; stdcall;
external 'KERNEL32.dll' name 'CopyLZFile';result := DllCall("KERNEL32\CopyLZFile"
, "Int", hfSource ; INT
, "Int", hfDest ; INT
, "Int") ; return: INT●CopyLZFile(hfSource, hfDest) = DLL("KERNEL32.dll", "int CopyLZFile(int, int)")
# 呼び出し: CopyLZFile(hfSource, hfDest)
# hfSource : INT -> "int"
# hfDest : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。