Types and Constants v0.1.0

Source
Types and constants exported by the Windows package.

Package: Windows

Standard Device Handles

Pass one of these to GetStdHandle to obtain a handle to the corresponding standard device.

NameTypeValueDescription
StdInputHandleuint320xFFFFFFF6Standard input device.
StdOutputHandleuint320xFFFFFFF5Standard output device.
StdErrorHandleuint320xFFFFFFF4Standard error device.

CreationDisposition

Microsoft documentation: CreateFileA

enum CreationDisposition: uint32 {
    CreateNew = 1,
    CreateAlways = 2,
    OpenExisting = 3,
    OpenAlways = 4,
    TruncateExisting = 5
}
MemberValueBehavior
CreateNew1Create only when the target does not exist.
CreateAlways2Create or overwrite.
OpenExisting3Open only when the target exists.
OpenAlways4Open or create.
TruncateExisting5Open and truncate an existing file.

FileTime

Microsoft documentation: FILETIME structure

struct FileTime {
    lowDateTime: uint32;
    highDateTime: uint32;
}

The two fields form an unsigned 64-bit count of 100-nanosecond intervals since January 1, 1601 UTC. lowDateTime contains the low-order bits.

SystemTime

Microsoft documentation: SYSTEMTIME structure

struct SystemTime {
    year: uint16;
    month: uint16;
    dayOfWeek: uint16;
    day: uint16;
    hour: uint16;
    minute: uint16;
    second: uint16;
    milliseconds: uint16;
}
FieldTypical rangeDescription
yearFull yearYear.
month112January is 1.
dayOfWeek06Sunday is 0.
day131Day of month.
hour023Hour.
minute059Minute.
second059Second.
milliseconds0999Millisecond within the second.

Filled by GetLocalTime (local time) and GetSystemTime (UTC).

Win32FindDataA

Microsoft documentation: WIN32_FIND_DATAA structure

struct Win32FindDataA {
    fileAttributes: uint32;
    creationTime: FileTime;
    lastAccessTime: FileTime;
    lastWriteTime: FileTime;
    fileSizeHigh: uint32;
    fileSizeLow: uint32;
    reserved0: uint32;
    reserved1: uint32;
    fileName: char8[260];
    alternateFileName: char8[14];
}

fileSizeHigh and fileSizeLow form the high and low halves of the unsigned 64-bit file size. The filename arrays hold null-terminated ANSI strings, and applications must not depend on the reserved fields. Populated by FindFirstFileA and FindNextFileA.

See also

  • Windows — the package overview
  • CodePage — text-encoding identifiers for the conversion functions