Win32 API 日本語リファレンス
ホームWeb.InternetExplorer › IECreateFile

IECreateFile

関数
IE保護モードでファイルを作成または開く。
DLLIeframe.dll呼出規約winapi

シグネチャ

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

HANDLE IECreateFile(
    LPCWSTR lpFileName,
    DWORD dwDesiredAccess,
    DWORD dwShareMode,
    SECURITY_ATTRIBUTES* lpSecurityAttributes,
    DWORD dwCreationDisposition,
    DWORD dwFlagsAndAttributes,
    HANDLE hTemplateFile   // optional
);

パラメーター

名前方向説明
lpFileNameLPCWSTRin作成または開くファイルやデバイスの名前を指す文字列を指定する。
dwDesiredAccessDWORDin要求するアクセス権を指定する。GENERIC_READやGENERIC_WRITE等のフラグ。
dwShareModeDWORDinファイルの共有モードを指定する。FILE_SHARE_READ等のフラグ。0で排他。
lpSecurityAttributesSECURITY_ATTRIBUTES*inセキュリティ記述子と継承可否を持つSECURITY_ATTRIBUTES構造体へのポインタ。NULL可。
dwCreationDispositionDWORDin存在有無に応じた動作を指定する。CREATE_NEWやOPEN_EXISTING等の値。
dwFlagsAndAttributesDWORDinファイル属性とフラグを指定する。FILE_ATTRIBUTE_NORMAL等の組み合わせ。
hTemplateFileHANDLEinoptional属性を複製するテンプレートファイルのハンドルを指定する。通常NULL。

戻り値の型: HANDLE

各言語での呼び出し定義

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

HANDLE IECreateFile(
    LPCWSTR lpFileName,
    DWORD dwDesiredAccess,
    DWORD dwShareMode,
    SECURITY_ATTRIBUTES* lpSecurityAttributes,
    DWORD dwCreationDisposition,
    DWORD dwFlagsAndAttributes,
    HANDLE hTemplateFile   // optional
);
[DllImport("Ieframe.dll", ExactSpelling = true)]
static extern IntPtr IECreateFile(
    [MarshalAs(UnmanagedType.LPWStr)] string lpFileName,   // LPCWSTR
    uint dwDesiredAccess,   // DWORD
    uint dwShareMode,   // DWORD
    IntPtr lpSecurityAttributes,   // SECURITY_ATTRIBUTES*
    uint dwCreationDisposition,   // DWORD
    uint dwFlagsAndAttributes,   // DWORD
    IntPtr hTemplateFile   // HANDLE optional
);
<DllImport("Ieframe.dll", ExactSpelling:=True)>
Public Shared Function IECreateFile(
    <MarshalAs(UnmanagedType.LPWStr)> lpFileName As String,   ' LPCWSTR
    dwDesiredAccess As UInteger,   ' DWORD
    dwShareMode As UInteger,   ' DWORD
    lpSecurityAttributes As IntPtr,   ' SECURITY_ATTRIBUTES*
    dwCreationDisposition As UInteger,   ' DWORD
    dwFlagsAndAttributes As UInteger,   ' DWORD
    hTemplateFile As IntPtr   ' HANDLE optional
) As IntPtr
End Function
' lpFileName : LPCWSTR
' dwDesiredAccess : DWORD
' dwShareMode : DWORD
' lpSecurityAttributes : SECURITY_ATTRIBUTES*
' dwCreationDisposition : DWORD
' dwFlagsAndAttributes : DWORD
' hTemplateFile : HANDLE optional
Declare PtrSafe Function IECreateFile Lib "ieframe" ( _
    ByVal lpFileName As LongPtr, _
    ByVal dwDesiredAccess As Long, _
    ByVal dwShareMode As Long, _
    ByVal lpSecurityAttributes As LongPtr, _
    ByVal dwCreationDisposition As Long, _
    ByVal dwFlagsAndAttributes As Long, _
    ByVal hTemplateFile As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

IECreateFile = ctypes.windll.ieframe.IECreateFile
IECreateFile.restype = ctypes.c_void_p
IECreateFile.argtypes = [
    wintypes.LPCWSTR,  # lpFileName : LPCWSTR
    wintypes.DWORD,  # dwDesiredAccess : DWORD
    wintypes.DWORD,  # dwShareMode : DWORD
    ctypes.c_void_p,  # lpSecurityAttributes : SECURITY_ATTRIBUTES*
    wintypes.DWORD,  # dwCreationDisposition : DWORD
    wintypes.DWORD,  # dwFlagsAndAttributes : DWORD
    wintypes.HANDLE,  # hTemplateFile : HANDLE optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('Ieframe.dll')
IECreateFile = Fiddle::Function.new(
  lib['IECreateFile'],
  [
    Fiddle::TYPE_VOIDP,  # lpFileName : LPCWSTR
    -Fiddle::TYPE_INT,  # dwDesiredAccess : DWORD
    -Fiddle::TYPE_INT,  # dwShareMode : DWORD
    Fiddle::TYPE_VOIDP,  # lpSecurityAttributes : SECURITY_ATTRIBUTES*
    -Fiddle::TYPE_INT,  # dwCreationDisposition : DWORD
    -Fiddle::TYPE_INT,  # dwFlagsAndAttributes : DWORD
    Fiddle::TYPE_VOIDP,  # hTemplateFile : HANDLE optional
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "ieframe")]
extern "system" {
    fn IECreateFile(
        lpFileName: *const u16,  // LPCWSTR
        dwDesiredAccess: u32,  // DWORD
        dwShareMode: u32,  // DWORD
        lpSecurityAttributes: *mut SECURITY_ATTRIBUTES,  // SECURITY_ATTRIBUTES*
        dwCreationDisposition: u32,  // DWORD
        dwFlagsAndAttributes: u32,  // DWORD
        hTemplateFile: *mut core::ffi::c_void  // HANDLE optional
    ) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("Ieframe.dll")]
public static extern IntPtr IECreateFile([MarshalAs(UnmanagedType.LPWStr)] string lpFileName, uint dwDesiredAccess, uint dwShareMode, IntPtr lpSecurityAttributes, uint dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile);
"@
$api = Add-Type -MemberDefinition $sig -Name 'Ieframe_IECreateFile' -Namespace Win32 -PassThru
# $api::IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile)
#uselib "Ieframe.dll"
#func global IECreateFile "IECreateFile" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; IECreateFile lpFileName, dwDesiredAccess, dwShareMode, varptr(lpSecurityAttributes), dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile   ; 戻り値は stat
; lpFileName : LPCWSTR -> "sptr"
; dwDesiredAccess : DWORD -> "sptr"
; dwShareMode : DWORD -> "sptr"
; lpSecurityAttributes : SECURITY_ATTRIBUTES* -> "sptr"
; dwCreationDisposition : DWORD -> "sptr"
; dwFlagsAndAttributes : DWORD -> "sptr"
; hTemplateFile : HANDLE optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "Ieframe.dll"
#cfunc global IECreateFile "IECreateFile" wstr, int, int, var, int, int, sptr
; res = IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile)
; lpFileName : LPCWSTR -> "wstr"
; dwDesiredAccess : DWORD -> "int"
; dwShareMode : DWORD -> "int"
; lpSecurityAttributes : SECURITY_ATTRIBUTES* -> "var"
; dwCreationDisposition : DWORD -> "int"
; dwFlagsAndAttributes : DWORD -> "int"
; hTemplateFile : HANDLE optional -> "sptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HANDLE IECreateFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, SECURITY_ATTRIBUTES* lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
#uselib "Ieframe.dll"
#cfunc global IECreateFile "IECreateFile" wstr, int, int, var, int, int, intptr
; res = IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile)
; lpFileName : LPCWSTR -> "wstr"
; dwDesiredAccess : DWORD -> "int"
; dwShareMode : DWORD -> "int"
; lpSecurityAttributes : SECURITY_ATTRIBUTES* -> "var"
; dwCreationDisposition : DWORD -> "int"
; dwFlagsAndAttributes : DWORD -> "int"
; hTemplateFile : HANDLE optional -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	ieframe = windows.NewLazySystemDLL("Ieframe.dll")
	procIECreateFile = ieframe.NewProc("IECreateFile")
)

// lpFileName (LPCWSTR), dwDesiredAccess (DWORD), dwShareMode (DWORD), lpSecurityAttributes (SECURITY_ATTRIBUTES*), dwCreationDisposition (DWORD), dwFlagsAndAttributes (DWORD), hTemplateFile (HANDLE optional)
r1, _, err := procIECreateFile.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpFileName))),
	uintptr(dwDesiredAccess),
	uintptr(dwShareMode),
	uintptr(lpSecurityAttributes),
	uintptr(dwCreationDisposition),
	uintptr(dwFlagsAndAttributes),
	uintptr(hTemplateFile),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HANDLE
function IECreateFile(
  lpFileName: PWideChar;   // LPCWSTR
  dwDesiredAccess: DWORD;   // DWORD
  dwShareMode: DWORD;   // DWORD
  lpSecurityAttributes: Pointer;   // SECURITY_ATTRIBUTES*
  dwCreationDisposition: DWORD;   // DWORD
  dwFlagsAndAttributes: DWORD;   // DWORD
  hTemplateFile: THandle   // HANDLE optional
): THandle; stdcall;
  external 'Ieframe.dll' name 'IECreateFile';
result := DllCall("Ieframe\IECreateFile"
    , "WStr", lpFileName   ; LPCWSTR
    , "UInt", dwDesiredAccess   ; DWORD
    , "UInt", dwShareMode   ; DWORD
    , "Ptr", lpSecurityAttributes   ; SECURITY_ATTRIBUTES*
    , "UInt", dwCreationDisposition   ; DWORD
    , "UInt", dwFlagsAndAttributes   ; DWORD
    , "Ptr", hTemplateFile   ; HANDLE optional
    , "Ptr")   ; return: HANDLE
●IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile) = DLL("Ieframe.dll", "void* IECreateFile(char*, dword, dword, void*, dword, dword, void*)")
# 呼び出し: IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile)
# lpFileName : LPCWSTR -> "char*"
# dwDesiredAccess : DWORD -> "dword"
# dwShareMode : DWORD -> "dword"
# lpSecurityAttributes : SECURITY_ATTRIBUTES* -> "void*"
# dwCreationDisposition : DWORD -> "dword"
# dwFlagsAndAttributes : DWORD -> "dword"
# hTemplateFile : HANDLE optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "ieframe" fn IECreateFile(
    lpFileName: [*c]const u16, // LPCWSTR
    dwDesiredAccess: u32, // DWORD
    dwShareMode: u32, // DWORD
    lpSecurityAttributes: [*c]SECURITY_ATTRIBUTES, // SECURITY_ATTRIBUTES*
    dwCreationDisposition: u32, // DWORD
    dwFlagsAndAttributes: u32, // DWORD
    hTemplateFile: ?*anyopaque // HANDLE optional
) callconv(std.os.windows.WINAPI) ?*anyopaque;
proc IECreateFile(
    lpFileName: WideCString,  # LPCWSTR
    dwDesiredAccess: uint32,  # DWORD
    dwShareMode: uint32,  # DWORD
    lpSecurityAttributes: ptr SECURITY_ATTRIBUTES,  # SECURITY_ATTRIBUTES*
    dwCreationDisposition: uint32,  # DWORD
    dwFlagsAndAttributes: uint32,  # DWORD
    hTemplateFile: pointer  # HANDLE optional
): pointer {.importc: "IECreateFile", stdcall, dynlib: "Ieframe.dll".}
pragma(lib, "ieframe");
extern(Windows)
void* IECreateFile(
    const(wchar)* lpFileName,   // LPCWSTR
    uint dwDesiredAccess,   // DWORD
    uint dwShareMode,   // DWORD
    SECURITY_ATTRIBUTES* lpSecurityAttributes,   // SECURITY_ATTRIBUTES*
    uint dwCreationDisposition,   // DWORD
    uint dwFlagsAndAttributes,   // DWORD
    void* hTemplateFile   // HANDLE optional
);
ccall((:IECreateFile, "Ieframe.dll"), stdcall, Ptr{Cvoid},
      (Cwstring, UInt32, UInt32, Ptr{SECURITY_ATTRIBUTES}, UInt32, UInt32, Ptr{Cvoid}),
      lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile)
# lpFileName : LPCWSTR -> Cwstring
# dwDesiredAccess : DWORD -> UInt32
# dwShareMode : DWORD -> UInt32
# lpSecurityAttributes : SECURITY_ATTRIBUTES* -> Ptr{SECURITY_ATTRIBUTES}
# dwCreationDisposition : DWORD -> UInt32
# dwFlagsAndAttributes : DWORD -> UInt32
# hTemplateFile : HANDLE optional -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
void* IECreateFile(
    const uint16_t* lpFileName,
    uint32_t dwDesiredAccess,
    uint32_t dwShareMode,
    void* lpSecurityAttributes,
    uint32_t dwCreationDisposition,
    uint32_t dwFlagsAndAttributes,
    void* hTemplateFile);
]]
local ieframe = ffi.load("ieframe")
-- ieframe.IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile)
-- lpFileName : LPCWSTR
-- dwDesiredAccess : DWORD
-- dwShareMode : DWORD
-- lpSecurityAttributes : SECURITY_ATTRIBUTES*
-- dwCreationDisposition : DWORD
-- dwFlagsAndAttributes : DWORD
-- hTemplateFile : HANDLE optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('Ieframe.dll');
const IECreateFile = lib.func('__stdcall', 'IECreateFile', 'void *', ['str16', 'uint32_t', 'uint32_t', 'void *', 'uint32_t', 'uint32_t', 'void *']);
// IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile)
// lpFileName : LPCWSTR -> 'str16'
// dwDesiredAccess : DWORD -> 'uint32_t'
// dwShareMode : DWORD -> 'uint32_t'
// lpSecurityAttributes : SECURITY_ATTRIBUTES* -> 'void *'
// dwCreationDisposition : DWORD -> 'uint32_t'
// dwFlagsAndAttributes : DWORD -> 'uint32_t'
// hTemplateFile : HANDLE optional -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("Ieframe.dll", {
  IECreateFile: { parameters: ["buffer", "u32", "u32", "pointer", "u32", "u32", "pointer"], result: "pointer" },
});
// lib.symbols.IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile)
// lpFileName : LPCWSTR -> "buffer"
// dwDesiredAccess : DWORD -> "u32"
// dwShareMode : DWORD -> "u32"
// lpSecurityAttributes : SECURITY_ATTRIBUTES* -> "pointer"
// dwCreationDisposition : DWORD -> "u32"
// dwFlagsAndAttributes : DWORD -> "u32"
// hTemplateFile : HANDLE optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void* IECreateFile(
    const uint16_t* lpFileName,
    uint32_t dwDesiredAccess,
    uint32_t dwShareMode,
    void* lpSecurityAttributes,
    uint32_t dwCreationDisposition,
    uint32_t dwFlagsAndAttributes,
    void* hTemplateFile);
C, "Ieframe.dll");
// $ffi->IECreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
// lpFileName : LPCWSTR
// dwDesiredAccess : DWORD
// dwShareMode : DWORD
// lpSecurityAttributes : SECURITY_ATTRIBUTES*
// dwCreationDisposition : DWORD
// dwFlagsAndAttributes : DWORD
// hTemplateFile : HANDLE optional
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Ieframe extends StdCallLibrary {
    Ieframe INSTANCE = Native.load("ieframe", Ieframe.class);
    Pointer IECreateFile(
        WString lpFileName,   // LPCWSTR
        int dwDesiredAccess,   // DWORD
        int dwShareMode,   // DWORD
        Pointer lpSecurityAttributes,   // SECURITY_ATTRIBUTES*
        int dwCreationDisposition,   // DWORD
        int dwFlagsAndAttributes,   // DWORD
        Pointer hTemplateFile   // HANDLE optional
    );
}
@[Link("ieframe")]
lib LibIeframe
  fun IECreateFile = IECreateFile(
    lpFileName : UInt16*,   # LPCWSTR
    dwDesiredAccess : UInt32,   # DWORD
    dwShareMode : UInt32,   # DWORD
    lpSecurityAttributes : SECURITY_ATTRIBUTES*,   # SECURITY_ATTRIBUTES*
    dwCreationDisposition : UInt32,   # DWORD
    dwFlagsAndAttributes : UInt32,   # DWORD
    hTemplateFile : Void*   # HANDLE optional
  ) : Void*
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef IECreateFileNative = Pointer<Void> Function(Pointer<Utf16>, Uint32, Uint32, Pointer<Void>, Uint32, Uint32, Pointer<Void>);
typedef IECreateFileDart = Pointer<Void> Function(Pointer<Utf16>, int, int, Pointer<Void>, int, int, Pointer<Void>);
final IECreateFile = DynamicLibrary.open('Ieframe.dll')
    .lookupFunction<IECreateFileNative, IECreateFileDart>('IECreateFile');
// lpFileName : LPCWSTR -> Pointer<Utf16>
// dwDesiredAccess : DWORD -> Uint32
// dwShareMode : DWORD -> Uint32
// lpSecurityAttributes : SECURITY_ATTRIBUTES* -> Pointer<Void>
// dwCreationDisposition : DWORD -> Uint32
// dwFlagsAndAttributes : DWORD -> Uint32
// hTemplateFile : HANDLE optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function IECreateFile(
  lpFileName: PWideChar;   // LPCWSTR
  dwDesiredAccess: DWORD;   // DWORD
  dwShareMode: DWORD;   // DWORD
  lpSecurityAttributes: Pointer;   // SECURITY_ATTRIBUTES*
  dwCreationDisposition: DWORD;   // DWORD
  dwFlagsAndAttributes: DWORD;   // DWORD
  hTemplateFile: THandle   // HANDLE optional
): THandle; stdcall;
  external 'Ieframe.dll' name 'IECreateFile';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "IECreateFile"
  c_IECreateFile :: CWString -> Word32 -> Word32 -> Ptr () -> Word32 -> Word32 -> Ptr () -> IO (Ptr ())
-- lpFileName : LPCWSTR -> CWString
-- dwDesiredAccess : DWORD -> Word32
-- dwShareMode : DWORD -> Word32
-- lpSecurityAttributes : SECURITY_ATTRIBUTES* -> Ptr ()
-- dwCreationDisposition : DWORD -> Word32
-- dwFlagsAndAttributes : DWORD -> Word32
-- hTemplateFile : HANDLE optional -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let iecreatefile =
  foreign "IECreateFile"
    ((ptr uint16_t) @-> uint32_t @-> uint32_t @-> (ptr void) @-> uint32_t @-> uint32_t @-> (ptr void) @-> returning (ptr void))
(* lpFileName : LPCWSTR -> (ptr uint16_t) *)
(* dwDesiredAccess : DWORD -> uint32_t *)
(* dwShareMode : DWORD -> uint32_t *)
(* lpSecurityAttributes : SECURITY_ATTRIBUTES* -> (ptr void) *)
(* dwCreationDisposition : DWORD -> uint32_t *)
(* dwFlagsAndAttributes : DWORD -> uint32_t *)
(* hTemplateFile : HANDLE optional -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library ieframe (t "Ieframe.dll"))
(cffi:use-foreign-library ieframe)

(cffi:defcfun ("IECreateFile" iecreate-file :convention :stdcall) :pointer
  (lp-file-name (:string :encoding :utf-16le))   ; LPCWSTR
  (dw-desired-access :uint32)   ; DWORD
  (dw-share-mode :uint32)   ; DWORD
  (lp-security-attributes :pointer)   ; SECURITY_ATTRIBUTES*
  (dw-creation-disposition :uint32)   ; DWORD
  (dw-flags-and-attributes :uint32)   ; DWORD
  (h-template-file :pointer))   ; HANDLE optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $IECreateFile = Win32::API::More->new('Ieframe',
    'HANDLE IECreateFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPVOID lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)');
# my $ret = $IECreateFile->Call($lpFileName, $dwDesiredAccess, $dwShareMode, $lpSecurityAttributes, $dwCreationDisposition, $dwFlagsAndAttributes, $hTemplateFile);
# lpFileName : LPCWSTR -> LPCWSTR
# dwDesiredAccess : DWORD -> DWORD
# dwShareMode : DWORD -> DWORD
# lpSecurityAttributes : SECURITY_ATTRIBUTES* -> LPVOID
# dwCreationDisposition : DWORD -> DWORD
# dwFlagsAndAttributes : DWORD -> DWORD
# hTemplateFile : HANDLE optional -> HANDLE
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型