windows.ch

Declarations

Public Only
INT_PTR
Publictypealias
type INT_PTR = i64
PINT_PTR
Publictypealias
type PINT_PTR = *INT_PTR
UINT_PTR
Publictypealias
type UINT_PTR = u64
PUINT_PTR
Publictypealias
type PUINT_PTR = *UINT_PTR
LONG_PTR
Publictypealias
type LONG_PTR = i64
PLONG_PTR
Publictypealias
type PLONG_PTR = *LONG_PTR
ULONG_PTR
Publictypealias
type ULONG_PTR = u64
PULONG_PTR
Publictypealias
type PULONG_PTR = *ULONG_PTR
usize
Publictypealias
type usize = u64
TODO: verify these
UINT
Publictypealias
type UINT = uint
HANDLE
Publictypealias
type HANDLE = *void
@brief Windows handle type.
HMODULE
Publictypealias
type HMODULE = HANDLE
@brief Module handle.
HINSTANCE
Publictypealias
type HINSTANCE = HANDLE
@brief Instance handle.
FARPROC
Publictypealias
type FARPROC = *void
@brief Pointer to procedure.
HKEY
Publictypealias
type HKEY = HANDLE
@brief Handle to Registry Key.
BOOL
Publictypealias
type BOOL = int
@brief Boolean: nonzero is TRUE, zero is FALSE.
BYTE
Publictypealias
type BYTE = uchar
@brief Unsigned 8-bit integer.
WORD
Publictypealias
type WORD = ushort
@brief 16-bit unsigned integer.
DWORD
Publictypealias
type DWORD = ulong
@brief 32-bit unsigned integer.
LONG
Publictypealias
type LONG = int32_t
@brief Signed 32-bit integer.
LONGLONG
Publictypealias
type LONGLONG = i64
@brief 64-bit signed integer.
ULONGLONG
Publictypealias
type ULONGLONG = u64
@brief 64-bit unsigned integer.
SIZE_T
Publictypealias
type SIZE_T = usize
@brief Pointer-sized unsigned integer.
LPVOID
Publictypealias
type LPVOID = *void
@brief Generic pointer.
PVOID
Publictypealias
type PVOID = *void
@brief Pointer to void
LPCVOID
Publictypealias
type LPCVOID = *void
@brief Pointer to constant data.
LPSTR
Publictypealias
type LPSTR = *char
@brief Pointer to CHAR string.
LPCSTR
Publictypealias
type LPCSTR = *char
@brief Pointer to constant CHAR string.
LPWSTR
Publictypealias
type LPWSTR = *ushort
@brief Pointer to WCHAR string.
LPCWSTR
Publictypealias
type LPCWSTR = *ushort
@brief Pointer to constant WCHAR string.
LPDWORD
Publictypealias
type LPDWORD = *DWORD
@brief Pointer to DWORD.
LARGE_INTEGER
Publicunion
union LARGE_INTEGER
@struct LARGE_INTEGER @brief 64-bit signed integer value. Can be accessed as a whole or parts.
_ULARGE_INTEGER
Publicunion
union _ULARGE_INTEGER
@struct ULARGE_INTEGER @brief 64-bit unsigned integer value. Can be accessed as a whole or parts.
ULARGE_INTEGER
Publictypealias
type ULARGE_INTEGER = _ULARGE_INTEGER
PULARGE_INTEGER
Publictypealias
type PULARGE_INTEGER = *ULARGE_INTEGER
SECURITY_ATTRIBUTES
Publicstruct
struct SECURITY_ATTRIBUTES { var nLength : DWORD var lpSecurityDescriptor : LPVOID var bInheritHandle : BOOL }
@struct SECURITY_ATTRIBUTES @brief Security attributes for object creation.
OVERLAPPED
Publicstruct
struct OVERLAPPED { var Internal : ULONG_PTR var InternalHigh : ULONG_PTR var : var hEvent : HANDLE }
@struct OVERLAPPED @brief Overlapped I/O structure.
SYSTEMTIME
Publicstruct
struct SYSTEMTIME { var wYear : WORD var wMonth : WORD var wDayOfWeek : WORD var wDay : WORD var wHour : WORD var wMinute : WORD var wSecond : WORD var wMilliseconds : WORD }
@struct SYSTEMTIME @brief Date and time in human-readable form.
FILETIME
Publicstruct
struct FILETIME { var dwLowDateTime : DWORD var dwHighDateTime : DWORD }
@struct FILETIME @brief 64-bit value representing 100-nanosecond intervals since January 1, 1601.
WIN32_FIND_DATAA
Publicstruct
struct WIN32_FIND_DATAA { var dwFileAttributes : DWORD var ftCreationTime : FILETIME var ftLastAccessTime : FILETIME var ftLastWriteTime : FILETIME var nFileSizeHigh : DWORD var nFileSizeLow : DWORD var dwReserved0 : DWORD var dwReserved1 : DWORD var cFileName : char[260] var cAlternateFileName : char[14] }
@struct WIN32_FIND_DATAA @brief Data returned by FindFirstFileA/FindNextFileA.
STARTUPINFOA
Publicstruct
struct STARTUPINFOA { var cb : DWORD var lpReserved : LPSTR var lpDesktop : LPSTR var lpTitle : LPSTR var dwX : DWORD var dwY : DWORD var dwXSize : DWORD var dwYSize : DWORD var dwXCountChars : DWORD var dwYCountChars : DWORD var dwFillAttribute : DWORD var dwFlags : DWORD var wShowWindow : WORD var cbReserved2 : WORD var lpReserved2 : *BYTE var hStdInput : HANDLE var hStdOutput : HANDLE var hStdError : HANDLE }
--- Added missing STARTUPINFOA and PROCESS_INFORMATION structs ---
PROCESS_INFORMATION
Publicstruct
struct PROCESS_INFORMATION { var hProcess : HANDLE var hThread : HANDLE var dwProcessId : DWORD var dwThreadId : DWORD }
@struct PROCESS_INFORMATION @brief Contains information about a newly created process and its primary thread.
GetLastError
Publicfunction
func GetLastError() : DWORD
@brief Retrieves the calling thread's last-error code value.

Returns

The calling thread's last-error code.

SetLastError
Publicfunction
func SetLastError(dwErrCode : DWORD) : void
@brief Sets the calling thread's last-error code value.

Parameters

  • dwErrCode The new error code.
CreateFileA
Publicfunction
func CreateFileA(lpFileName : LPCSTR, dwDesiredAccess : DWORD, dwShareMode : DWORD, lpSecurityAttributes : *SECURITY_ATTRIBUTES, dwCreationDisposition : DWORD, dwFlagsAndAttributes : DWORD, hTemplateFile : HANDLE) : HANDLE
@brief Creates or opens a file or I/O device.

Parameters

  • lpFileName Path to file or device. @param dwDesiredAccess Access mode flags. @param dwShareMode Share mode flags. @param lpSecurityAttributes Optional security attributes. @param dwCreationDisposition Action to take on files that exist or do not exist. @param dwFlagsAndAttributes File attributes and flags. @param hTemplateFile Handle to template file. @return Handle to the file or device, or INVALID_HANDLE_VALUE on error.
  • dwDesiredAccess Access mode flags. @param dwShareMode Share mode flags. @param lpSecurityAttributes Optional security attributes. @param dwCreationDisposition Action to take on files that exist or do not exist. @param dwFlagsAndAttributes File attributes and flags. @param hTemplateFile Handle to template file. @return Handle to the file or device, or INVALID_HANDLE_VALUE on error.
  • dwShareMode Share mode flags. @param lpSecurityAttributes Optional security attributes. @param dwCreationDisposition Action to take on files that exist or do not exist. @param dwFlagsAndAttributes File attributes and flags. @param hTemplateFile Handle to template file. @return Handle to the file or device, or INVALID_HANDLE_VALUE on error.
  • lpSecurityAttributes Optional security attributes. @param dwCreationDisposition Action to take on files that exist or do not exist. @param dwFlagsAndAttributes File attributes and flags. @param hTemplateFile Handle to template file. @return Handle to the file or device, or INVALID_HANDLE_VALUE on error.
  • dwCreationDisposition Action to take on files that exist or do not exist. @param dwFlagsAndAttributes File attributes and flags. @param hTemplateFile Handle to template file. @return Handle to the file or device, or INVALID_HANDLE_VALUE on error.
  • dwFlagsAndAttributes File attributes and flags. @param hTemplateFile Handle to template file. @return Handle to the file or device, or INVALID_HANDLE_VALUE on error.
  • hTemplateFile Handle to template file. @return Handle to the file or device, or INVALID_HANDLE_VALUE on error.

Returns

Handle to the file or device, or INVALID_HANDLE_VALUE on error.

ReadFile
Publicfunction
func ReadFile(hFile : HANDLE, lpBuffer : LPVOID, nNumberOfBytesToRead : DWORD, lpNumberOfBytesRead : *DWORD, lpOverlapped : *OVERLAPPED) : BOOL
@brief Reads data from a file, starting at the position indicated by the file pointer.

Parameters

  • hFile Handle to file. @param lpBuffer Buffer to receive data. @param nNumberOfBytesToRead Number of bytes to read. @param lpNumberOfBytesRead Out param for number of bytes read. @param lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.
  • lpBuffer Buffer to receive data. @param nNumberOfBytesToRead Number of bytes to read. @param lpNumberOfBytesRead Out param for number of bytes read. @param lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.
  • nNumberOfBytesToRead Number of bytes to read. @param lpNumberOfBytesRead Out param for number of bytes read. @param lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.
  • lpNumberOfBytesRead Out param for number of bytes read. @param lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.
  • lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

WriteFile
Publicfunction
func WriteFile(hFile : HANDLE, lpBuffer : LPCVOID, nNumberOfBytesToWrite : DWORD, lpNumberOfBytesWritten : *DWORD, lpOverlapped : *OVERLAPPED) : BOOL
@brief Writes data to a file at the position indicated by the file pointer.

Parameters

  • hFile Handle to file. @param lpBuffer Buffer containing data to write. @param nNumberOfBytesToWrite Number of bytes to write. @param lpNumberOfBytesWritten Out param for number of bytes written. @param lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.
  • lpBuffer Buffer containing data to write. @param nNumberOfBytesToWrite Number of bytes to write. @param lpNumberOfBytesWritten Out param for number of bytes written. @param lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.
  • nNumberOfBytesToWrite Number of bytes to write. @param lpNumberOfBytesWritten Out param for number of bytes written. @param lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.
  • lpNumberOfBytesWritten Out param for number of bytes written. @param lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.
  • lpOverlapped Optional overlapped structure. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

CloseHandle
Publicfunction
func CloseHandle(hObject : HANDLE) : BOOL
@brief Closes an open object handle.

Parameters

  • hObject Handle to be closed. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

CopyFileA
Publicfunction
func CopyFileA(lpExistingFileName : LPCSTR, lpNewFileName : LPCSTR, bFailIfExists : BOOL) : BOOL
@brief Copies an existing file to a new file.

Parameters

  • lpExistingFileName Name of the existing file. @param lpNewFileName Name of the new file. @param bFailIfExists If TRUE and the new file exists, the function fails. If FALSE and the new file exists, the function overwrites it. @return Nonzero on success, zero on failure.
  • lpNewFileName Name of the new file. @param bFailIfExists If TRUE and the new file exists, the function fails. If FALSE and the new file exists, the function overwrites it. @return Nonzero on success, zero on failure.
  • bFailIfExists If TRUE and the new file exists, the function fails. If FALSE and the new file exists, the function overwrites it. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

MoveFileA
Publicfunction
func MoveFileA(lpExistingFileName : LPCSTR, lpNewFileName : LPCSTR) : BOOL
@brief Moves an existing file or directory, including its children.

Parameters

  • lpExistingFileName The current name of the file or directory. @param lpNewFileName The new name for the file or directory. @return Nonzero on success, zero on failure.
  • lpNewFileName The new name for the file or directory. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

GetFileSizeEx
Publicfunction
func GetFileSizeEx(hFile : HANDLE, lpFileSize : *LARGE_INTEGER) : BOOL
@brief Retrieves the size of the specified file.

Parameters

  • hFile Handle to the file. @param lpFileSize Out param for the file size (64-bit). @return Nonzero on success, zero on failure.
  • lpFileSize Out param for the file size (64-bit). @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

SetFilePointerEx
Publicfunction
func SetFilePointerEx(hFile : HANDLE, liDistanceToMove : LARGE_INTEGER, lpNewFilePointer : *LARGE_INTEGER, dwMoveMethod : DWORD) : BOOL
@brief Sets the file pointer of the specified file.

Parameters

  • hFile Handle to the file. @param liDistanceToMove The number of bytes to move the file pointer. @param lpNewFilePointer Optional out param for the new file pointer. @param dwMoveMethod The starting point for the file pointer move (FILE_BEGIN, FILE_CURRENT, FILE_END). @return Nonzero on success, zero on failure.
  • liDistanceToMove The number of bytes to move the file pointer. @param lpNewFilePointer Optional out param for the new file pointer. @param dwMoveMethod The starting point for the file pointer move (FILE_BEGIN, FILE_CURRENT, FILE_END). @return Nonzero on success, zero on failure.
  • lpNewFilePointer Optional out param for the new file pointer. @param dwMoveMethod The starting point for the file pointer move (FILE_BEGIN, FILE_CURRENT, FILE_END). @return Nonzero on success, zero on failure.
  • dwMoveMethod The starting point for the file pointer move (FILE_BEGIN, FILE_CURRENT, FILE_END). @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

GetFileAttributesA
Publicfunction
func GetFileAttributesA(lpFileName : LPCSTR) : DWORD
@brief Retrieves file system attributes for a specified file or directory.

Parameters

  • lpFileName The name of the file or directory. @return The attributes of the file or directory, or INVALID_FILE_ATTRIBUTES on failure.

Returns

The attributes of the file or directory, or INVALID_FILE_ATTRIBUTES on failure.

SetFileAttributesA
Publicfunction
func SetFileAttributesA(lpFileName : LPCSTR, dwFileAttributes : DWORD) : BOOL
@brief Sets the attributes for a file or directory.

Parameters

  • lpFileName The name of the file or directory. @param dwFileAttributes The file attributes to set. @return Nonzero on success, zero on failure.
  • dwFileAttributes The file attributes to set. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

GetFullPathNameA
Publicfunction
func GetFullPathNameA(lpFileName : LPCSTR, nBufferLength : DWORD, lpBuffer : LPSTR, lpFilePart : *LPSTR) : DWORD
@brief Retrieves the full path and file name of the specified file.

Parameters

  • lpFileName The name of the file. @param nBufferLength The size of the buffer for the path. @param lpBuffer Buffer that receives the null-terminated path. @param lpFilePart Optional out param pointer that receives the address of the file name component in the path. @return Length of the string copied to lpBuffer (excluding null terminator), or 0 on failure.
  • nBufferLength The size of the buffer for the path. @param lpBuffer Buffer that receives the null-terminated path. @param lpFilePart Optional out param pointer that receives the address of the file name component in the path. @return Length of the string copied to lpBuffer (excluding null terminator), or 0 on failure.
  • lpBuffer Buffer that receives the null-terminated path. @param lpFilePart Optional out param pointer that receives the address of the file name component in the path. @return Length of the string copied to lpBuffer (excluding null terminator), or 0 on failure.
  • lpFilePart Optional out param pointer that receives the address of the file name component in the path. @return Length of the string copied to lpBuffer (excluding null terminator), or 0 on failure.

Returns

Length of the string copied to lpBuffer (excluding null terminator), or 0 on failure.

GetCurrentDirectoryA
Publicfunction
func GetCurrentDirectoryA(nBufferLength : DWORD, lpBuffer : LPSTR) : DWORD
@brief Retrieves the current directory for the current process.

Parameters

  • nBufferLength The length of the buffer for the current directory string, in characters. @param lpBuffer Pointer to the buffer that receives the null-terminated current directory string. @return If successful, the return value specifies the length of the string written to the buffer, not including the terminating null character. If fails, returns 0.
  • lpBuffer Pointer to the buffer that receives the null-terminated current directory string. @return If successful, the return value specifies the length of the string written to the buffer, not including the terminating null character. If fails, returns 0.

Returns

If successful, the return value specifies the length of the string written to the buffer, not including the terminating null character. If fails, returns 0.

SetCurrentDirectoryA
Publicfunction
func SetCurrentDirectoryA(lpPathName : LPCSTR) : BOOL
@brief Changes the current directory for the current process.

Parameters

  • lpPathName The path to the new current directory. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

LoadLibraryA
Publicfunction
func LoadLibraryA(lpLibFileName : LPCSTR) : HMODULE
@brief Loads the specified module into the address space of the calling process.

Parameters

  • lpLibFileName Path to the module. @return Handle to the module, or NULL on failure.

Returns

Handle to the module, or NULL on failure.

FreeLibrary
Publicfunction
func FreeLibrary(hLibModule : HMODULE) : BOOL
@brief Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count.

Parameters

  • hLibModule A handle to the loaded library module. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

GetProcAddress
Publicfunction
func GetProcAddress(hModule : HMODULE, lpProcName : LPCSTR) : FARPROC
@brief Retrieves the address of an exported function or variable from the specified DLL.

Parameters

  • hModule Handle to the DLL module. @param lpProcName Name of the function or variable. @return FARPROC pointer to the function or variable, or NULL on failure.
  • lpProcName Name of the function or variable. @return FARPROC pointer to the function or variable, or NULL on failure.

Returns

FARPROC pointer to the function or variable, or NULL on failure.

VirtualAlloc
Publicfunction
func VirtualAlloc(lpAddress : LPVOID, dwSize : SIZE_T, flAllocationType : DWORD, flProtect : DWORD) : LPVOID
@brief Allocates memory in the virtual address space of the calling process.

Parameters

  • lpAddress Desired starting address (optional). @param dwSize Size of the region. @param flAllocationType Allocation type flags. @param flProtect Memory protection flags. @return Pointer to the allocated memory, or NULL on failure.
  • dwSize Size of the region. @param flAllocationType Allocation type flags. @param flProtect Memory protection flags. @return Pointer to the allocated memory, or NULL on failure.
  • flAllocationType Allocation type flags. @param flProtect Memory protection flags. @return Pointer to the allocated memory, or NULL on failure.
  • flProtect Memory protection flags. @return Pointer to the allocated memory, or NULL on failure.

Returns

Pointer to the allocated memory, or NULL on failure.

VirtualFree
Publicfunction
func VirtualFree(lpAddress : LPVOID, dwSize : SIZE_T, dwFreeType : DWORD) : BOOL
@brief Frees memory that was allocated by VirtualAlloc.

Parameters

  • lpAddress Base address of the region. @param dwSize Must be 0 if MEM_RELEASE is used. @param dwFreeType Memory free type flags. @return Nonzero on success, zero on failure.
  • dwSize Must be 0 if MEM_RELEASE is used. @param dwFreeType Memory free type flags. @return Nonzero on success, zero on failure.
  • dwFreeType Memory free type flags. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

Sleep
Publicfunction
func Sleep(dwMilliseconds : DWORD) : void
@brief Causes the calling thread to sleep for a specified interval.

Parameters

  • dwMilliseconds Time-out interval, in milliseconds.
ExitProcess
Publicfunction
func ExitProcess(uExitCode : UINT) : void
@brief Terminates the calling process and returns an exit code.

Parameters

  • uExitCode The exit code for the process.
MessageBoxA
Publicfunction
func MessageBoxA(hWnd : HANDLE, lpText : LPCSTR, lpCaption : LPCSTR, uType : DWORD) : int
@brief Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-generated message, optionally including a title.

Parameters

  • hWnd Handle to owner window. @param lpText Message to display. @param lpCaption Dialog box title. @param uType Dialog box style and button flags. @return Button identifier the user clicked.
  • lpText Message to display. @param lpCaption Dialog box title. @param uType Dialog box style and button flags. @return Button identifier the user clicked.
  • lpCaption Dialog box title. @param uType Dialog box style and button flags. @return Button identifier the user clicked.
  • uType Dialog box style and button flags. @return Button identifier the user clicked.

Returns

Button identifier the user clicked.

FindFirstFileA
Publicfunction
func FindFirstFileA(lpFileName : LPCSTR, lpFindFileData : *WIN32_FIND_DATAA) : HANDLE
@brief Begins a file search.

Parameters

  • lpFileName Path with wildcards. @param lpFindFileData Out param for find data. @return Search handle or INVALID_HANDLE_VALUE on error.
  • lpFindFileData Out param for find data. @return Search handle or INVALID_HANDLE_VALUE on error.

Returns

Search handle or INVALID_HANDLE_VALUE on error.

FindNextFileA
Publicfunction
func FindNextFileA(hFindFile : HANDLE, lpFindFileData : *WIN32_FIND_DATAA) : BOOL
@brief Continues a file search.

Parameters

  • hFindFile Handle from FindFirstFileA. @param lpFindFileData Out param for next data. @return Nonzero on success, zero on failure/end.
  • lpFindFileData Out param for next data. @return Nonzero on success, zero on failure/end.

Returns

Nonzero on success, zero on failure/end.

FindClose
Publicfunction
func FindClose(hFindFile : HANDLE) : BOOL
@brief Closes a search handle.

Parameters

  • hFindFile Handle to close. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

CreateDirectoryA
Publicfunction
func CreateDirectoryA(lpPathName : LPCSTR, lpSecurityAttributes : *SECURITY_ATTRIBUTES) : BOOL
@brief Creates a directory.

Parameters

  • lpPathName Path to the directory. @param lpSecurityAttributes Optional security attributes. @return Nonzero on success, zero on failure.
  • lpSecurityAttributes Optional security attributes. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

RemoveDirectoryA
Publicfunction
func RemoveDirectoryA(lpPathName : LPCSTR) : BOOL
@brief Removes an existing empty directory.

Parameters

  • lpPathName Path to the directory. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

DeleteFileA
Publicfunction
func DeleteFileA(lpFileName : LPCSTR) : BOOL
@brief Deletes an existing file.

Parameters

  • lpFileName Path to the file. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

GetStdHandle
Publicfunction
func GetStdHandle(nStdHandle : DWORD) : HANDLE
@brief Retrieves a handle to the specified standard device (standard input, standard output, or standard error).

Parameters

  • nStdHandle The standard device (STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, or STD_ERROR_HANDLE). @return Handle to the specified device, or INVALID_HANDLE_VALUE on error.

Returns

Handle to the specified device, or INVALID_HANDLE_VALUE on error.

GetSystemTime
Publicfunction
func GetSystemTime(lpSystemTime : *SYSTEMTIME) : void
@brief Retrieves the current system date and time in Coordinated Universal Time (UTC).

Parameters

  • lpSystemTime Pointer to a SYSTEMTIME structure to receive the current system date and time.
GetLocalTime
Publicfunction
func GetLocalTime(lpLocalTime : *SYSTEMTIME) : void
@brief Retrieves the current local date and time.

Parameters

  • lpLocalTime Pointer to a SYSTEMTIME structure to receive the current local date and time.
FileTimeToSystemTime
Publicfunction
func FileTimeToSystemTime(lpFileTime : *FILETIME, lpSystemTime : *SYSTEMTIME) : BOOL
@brief Converts a file time to system time format.

Parameters

  • lpFileTime Pointer to a FILETIME structure containing the file time to be converted. @param lpSystemTime Pointer to a SYSTEMTIME structure to receive the converted system time. @return Nonzero on success, zero on failure.
  • lpSystemTime Pointer to a SYSTEMTIME structure to receive the converted system time. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

SystemTimeToFileTime
Publicfunction
func SystemTimeToFileTime(lpSystemTime : *SYSTEMTIME, lpFileTime : *FILETIME) : BOOL
@brief Converts a system time to file time format.

Parameters

  • lpSystemTime Pointer to a SYSTEMTIME structure containing the system time to be converted. @param lpFileTime Pointer to a FILETIME structure to receive the converted file time. @return Nonzero on success, zero on failure.
  • lpFileTime Pointer to a FILETIME structure to receive the converted file time. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

GetCurrentProcessId
Publicfunction
func GetCurrentProcessId() : DWORD
@brief Retrieves the process identifier of the calling process.

Returns

The process identifier of the calling process.

GetCurrentThreadId
Publicfunction
func GetCurrentThreadId() : DWORD
@brief Retrieves the thread identifier of the calling thread.

Returns

The thread identifier of the calling thread.

CreateProcessA
Publicfunction
func CreateProcessA(lpApplicationName : LPCSTR, lpCommandLine : LPSTR, lpProcessAttributes : *SECURITY_ATTRIBUTES, lpThreadAttributes : *SECURITY_ATTRIBUTES, bInheritHandles : BOOL, dwCreationFlags : DWORD, lpEnvironment : LPVOID, lpCurrentDirectory : LPCSTR, lpStartupInfo : *STARTUPINFOA, lpProcessInformation : *PROCESS_INFORMATION) : BOOL
@brief Creates a new process and its primary thread.

Parameters

  • lpApplicationName Module name (optional, use NULL and set lpCommandLine). @param lpCommandLine Command line to execute (mutable because the function might modify it). @param lpProcessAttributes Security attributes for the process (optional). @param lpThreadAttributes Security attributes for the thread (optional). @param bInheritHandles If TRUE, handles from the calling process are inherited. @param dwCreationFlags Flags controlling priority class and creation (e.g., CREATE_NEW_CONSOLE). @param lpEnvironment Environment block for the new process (optional). @param lpCurrentDirectory Full path to the current directory for the process (optional). @param lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • lpCommandLine Command line to execute (mutable because the function might modify it). @param lpProcessAttributes Security attributes for the process (optional). @param lpThreadAttributes Security attributes for the thread (optional). @param bInheritHandles If TRUE, handles from the calling process are inherited. @param dwCreationFlags Flags controlling priority class and creation (e.g., CREATE_NEW_CONSOLE). @param lpEnvironment Environment block for the new process (optional). @param lpCurrentDirectory Full path to the current directory for the process (optional). @param lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • lpProcessAttributes Security attributes for the process (optional). @param lpThreadAttributes Security attributes for the thread (optional). @param bInheritHandles If TRUE, handles from the calling process are inherited. @param dwCreationFlags Flags controlling priority class and creation (e.g., CREATE_NEW_CONSOLE). @param lpEnvironment Environment block for the new process (optional). @param lpCurrentDirectory Full path to the current directory for the process (optional). @param lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • lpThreadAttributes Security attributes for the thread (optional). @param bInheritHandles If TRUE, handles from the calling process are inherited. @param dwCreationFlags Flags controlling priority class and creation (e.g., CREATE_NEW_CONSOLE). @param lpEnvironment Environment block for the new process (optional). @param lpCurrentDirectory Full path to the current directory for the process (optional). @param lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • bInheritHandles If TRUE, handles from the calling process are inherited. @param dwCreationFlags Flags controlling priority class and creation (e.g., CREATE_NEW_CONSOLE). @param lpEnvironment Environment block for the new process (optional). @param lpCurrentDirectory Full path to the current directory for the process (optional). @param lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • dwCreationFlags Flags controlling priority class and creation (e.g., CREATE_NEW_CONSOLE). @param lpEnvironment Environment block for the new process (optional). @param lpCurrentDirectory Full path to the current directory for the process (optional). @param lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • lpEnvironment Environment block for the new process (optional). @param lpCurrentDirectory Full path to the current directory for the process (optional). @param lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • lpCurrentDirectory Full path to the current directory for the process (optional). @param lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • lpStartupInfo Pointer to a STARTUPINFOA structure. @param lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.
  • lpProcessInformation Pointer to a PROCESS_INFORMATION structure receiving identification information about the new process. @return Nonzero on success, zero on failure.

Returns

Nonzero on success, zero on failure.

RegOpenKeyExA
Publicfunction
func RegOpenKeyExA(hKey : HKEY, lpSubKey : LPCSTR, ulOptions : DWORD, samDesired : DWORD, phkResult : *HKEY) : LONG
@brief Opens the specified registry key.

Parameters

  • hKey A handle to an open registry key (e.g., HKEY_LOCAL_MACHINE) or predefined handle. @param lpSubKey The name of the registry subkey to be opened. @param ulOptions Reserved, must be zero. @param samDesired A mask that specifies the desired access rights to the key. (e.g., KEY_READ) @param phkResult Out param pointer that receives a handle to the opened key. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • lpSubKey The name of the registry subkey to be opened. @param ulOptions Reserved, must be zero. @param samDesired A mask that specifies the desired access rights to the key. (e.g., KEY_READ) @param phkResult Out param pointer that receives a handle to the opened key. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • ulOptions Reserved, must be zero. @param samDesired A mask that specifies the desired access rights to the key. (e.g., KEY_READ) @param phkResult Out param pointer that receives a handle to the opened key. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • samDesired A mask that specifies the desired access rights to the key. (e.g., KEY_READ) @param phkResult Out param pointer that receives a handle to the opened key. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • phkResult Out param pointer that receives a handle to the opened key. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.

Returns

ERROR_SUCCESS (0) if successful, or a nonzero error code.

RegCloseKey
Publicfunction
func RegCloseKey(hKey : HKEY) : LONG
@brief Closes a handle to the specified registry key.

Parameters

  • hKey Handle to the open key to be closed. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.

Returns

ERROR_SUCCESS (0) if successful, or a nonzero error code.

RegQueryValueExA
Publicfunction
func RegQueryValueExA(hKey : HKEY, lpValueName : LPCSTR, lpReserved : LPDWORD, lpType : LPDWORD, lpData : LPVOID, lpcbData : LPDWORD) : LONG
@brief Retrieves the type and data for the specified value name associated with an open registry key.

Parameters

  • hKey Handle to an open registry key. @param lpValueName The name of the registry value. If NULL or empty, retrieves type/data for the key's unnamed/default value. @param lpReserved Reserved, must be NULL. @param lpType Optional out param pointer receiving the value's type code (e.g., REG_SZ). @param lpData Optional out param buffer receiving the value's data. @param lpcbData In/Out param pointer specifying size of lpData buffer / receiving size of data written. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • lpValueName The name of the registry value. If NULL or empty, retrieves type/data for the key's unnamed/default value. @param lpReserved Reserved, must be NULL. @param lpType Optional out param pointer receiving the value's type code (e.g., REG_SZ). @param lpData Optional out param buffer receiving the value's data. @param lpcbData In/Out param pointer specifying size of lpData buffer / receiving size of data written. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • lpReserved Reserved, must be NULL. @param lpType Optional out param pointer receiving the value's type code (e.g., REG_SZ). @param lpData Optional out param buffer receiving the value's data. @param lpcbData In/Out param pointer specifying size of lpData buffer / receiving size of data written. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • lpType Optional out param pointer receiving the value's type code (e.g., REG_SZ). @param lpData Optional out param buffer receiving the value's data. @param lpcbData In/Out param pointer specifying size of lpData buffer / receiving size of data written. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • lpData Optional out param buffer receiving the value's data. @param lpcbData In/Out param pointer specifying size of lpData buffer / receiving size of data written. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • lpcbData In/Out param pointer specifying size of lpData buffer / receiving size of data written. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.

Returns

ERROR_SUCCESS (0) if successful, or a nonzero error code.

RegSetValueExA
Publicfunction
func RegSetValueExA(hKey : HKEY, lpValueName : LPCSTR, Reserved : DWORD, dwType : DWORD, lpData : *BYTE, cbData : DWORD) : LONG
@brief Sets the data and type for a specified value under a registry key.

Parameters

  • hKey Handle to an open registry key. @param lpValueName The name of the value to be set. @param Reserved Reserved, must be zero. @param dwType The type of data to be stored (e.g., REG_SZ). @param lpData The data to be stored. @param cbData The size of the information stored in lpData, in bytes. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • lpValueName The name of the value to be set. @param Reserved Reserved, must be zero. @param dwType The type of data to be stored (e.g., REG_SZ). @param lpData The data to be stored. @param cbData The size of the information stored in lpData, in bytes. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • Reserved Reserved, must be zero. @param dwType The type of data to be stored (e.g., REG_SZ). @param lpData The data to be stored. @param cbData The size of the information stored in lpData, in bytes. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • dwType The type of data to be stored (e.g., REG_SZ). @param lpData The data to be stored. @param cbData The size of the information stored in lpData, in bytes. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • lpData The data to be stored. @param cbData The size of the information stored in lpData, in bytes. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.
  • cbData The size of the information stored in lpData, in bytes. @return ERROR_SUCCESS (0) if successful, or a nonzero error code.

Returns

ERROR_SUCCESS (0) if successful, or a nonzero error code.

_mkdir
Publicfunction
func _mkdir(path : LPCSTR) : int
@brief Creates a directory (C runtime).

Parameters

  • path Path to the directory (ANSI string). @return 0 on success, -1 on failure (sets errno).

Returns

0 on success, -1 on failure (sets errno).

_rmdir
Publicfunction
func _rmdir(path : LPCSTR) : int
@brief Removes a directory (CRT).

Parameters

  • path Path to the directory (ANSI string). @return 0 on success, -1 on failure (sets errno).

Returns

0 on success, -1 on failure (sets errno).

_chdir
Publicfunction
func _chdir(path : LPCSTR) : int
@brief Changes the current working directory (CRT).

Parameters

  • path New working directory (ANSI string). @return 0 on success, -1 on failure (sets errno).

Returns

0 on success, -1 on failure (sets errno).

_getcwd
Publicfunction
func _getcwd(buffer : LPSTR, maxlen : int) : LPSTR
@brief Gets the current working directory (CRT).

Parameters

  • buffer Buffer to receive path (ANSI string). @param maxlen Maximum length of the buffer. @return Pointer to buffer on success, NULL on failure.
  • maxlen Maximum length of the buffer. @return Pointer to buffer on success, NULL on failure.

Returns

Pointer to buffer on success, NULL on failure.