import { type HANDLE, type HMODULE, type HWND } from './ctypes.js'; import { FORMAT_MESSAGE_, type GET_MODULE_HANDLE_EX_FLAG_, type HANDLE_FLAG_, type PSAR_ } from './consts.js'; import { type FILETIME, type SYSTEMTIME } from './structs.js'; /** * Generates simple tones on the speaker. * * https://learn.microsoft.com/en-us/windows/win32/api/utilapiset/nf-utilapiset-beep */ export declare function Beep(freq: number, duration: number): boolean; /** * Expands environment-variable strings and replaces them with the values defined for the current user. * * https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-expandenvironmentstringsw */ export declare function ExpandEnvironmentStrings(src: string): string; /** * Closes an open object handle. * * https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-closehandle * */ export declare function CloseHandle(hObject: HANDLE): boolean; /** * Converts a file time to system time format. System time is based on Coordinated Universal Time (UTC). * * https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-filetimetosystemtime */ export declare function FileTimeToSystemTime(fileTime: FILETIME): SYSTEMTIME | null; /** * Formats a message string. * * Notes: * - `FORMAT_MESSAGE_ALLOCATE_BUFFER` and `FORMAT_MESSAGE_ARGUMENT_ARRAY` are not supported and are filtered out. * - the Arguments parameter is not yet supported. * * https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessagew */ export declare function FormatMessage(flags: FORMAT_MESSAGE_, source: HMODULE | string | null, messageId: number, languageId?: number): string; /** * Retrieves the NetBIOS name of the local computer. * * https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcomputernamew */ export declare function GetComputerName(): string | null; /** * Retrieves the window handle used by the console associated with the calling process. * * https://learn.microsoft.com/en-us/windows/console/getconsolewindow */ export declare function GetConsoleWindow(): HWND | null; /** * Retrieves a pseudo handle for the current process. * * https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess */ export declare function GetCurrentProcess(): HANDLE; /** * Retrieves the process identifier of the calling process. * * https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocessid */ export declare function GetCurrentProcessId(): number; /** * Retrieves the termination status of the specified process. * * https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess */ export declare function GetExitCodeProcess(hProcess: HANDLE): number | null; /** * Retrieves certain properties of an object handle. * * https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation */ export declare function GetHandleInformation(hObject: HANDLE): HANDLE_FLAG_ | null; /** * Retrieves the calling thread's last-error code value. * * https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror */ export declare function GetLastError(): number; /** * Retrieves the fully qualified path for the file that contains the specified module. * * The module must have been loaded by the current process. * * https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew */ export declare function GetModuleFileName(hModule: HMODULE | null): string | null; /** * Retrieves a module handle for the specified module. * * The module must have been loaded by the calling process. * * https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandlew */ export declare function GetModuleHandle(moduleName: string | null): HMODULE | null; /** * Retrieves a module handle for the specified module and increments the module's reference count * unless GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT is specified. * * The module must have been loaded by the calling process. * * https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexw */ export declare function GetModuleHandleEx(flags: GET_MODULE_HANDLE_EX_FLAG_, moduleName: string | null): HMODULE | null; /** * Retrieves the current size of the registry and the maximum size that the registry is allowed to attain on the system. * * https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getsystemregistryquota */ export declare function GetSystemRegistryQuota(): { allowed: number; used: number; } | null; /** * Opens an existing local process object. * * https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocess */ export declare function OpenProcess(desiredAccess: PSAR_, inheritHandle: boolean, processId: number): HANDLE | null; /** * Retrieves the full name of the executable image for the specified process. * * https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-queryfullprocessimagenamew */ export declare function QueryFullProcessImageName(hProcess: HANDLE, flags: number): string | null; /** * Sets the last-error code for the calling thread. * * https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-setlasterror */ export declare function SetLastError(errCode: number): void; /** * Waits until the specified object is in the signaled state or the time-out interval elapses. * * https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject */ export declare function WaitForSingleObject(hHandle: HANDLE, milliseconds: number): number;