CreateFileA v0.1.0

Source
Creates or opens a file or I/O device.

Package: Windows

Microsoft documentation: CreateFileA

Signature

func CreateFileA(
    fileName: *char8,
    desiredAccess: uint32,
    shareMode: uint32,
    securityAttributes: *opaque,
    creationDisposition: uint32,
    flagsAndAttributes: uint32,
    templateFile: *opaque
) -> *opaque;

Parameters

NameDescription
fileNameNull-terminated ANSI path.
desiredAccessRequested read and/or write access.
shareModeSharing permitted to later opens.
securityAttributesSecurity attributes, or null.
creationDispositionCreate/open behavior.
flagsAndAttributesFile attributes and Win32 flags.
templateFileTemplate handle, normally null.

Returns

*opaque — an open handle on success, or the invalid-handle sentinel (-1 as a handle) on failure. Close a successful result with CloseHandle.

See also