mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
Merge remote-tracking branch 'upstream/master' into sys-windows-2
# Conflicts: # core/sys/windows/shell32.odin
This commit is contained in:
@@ -244,7 +244,7 @@ Mode_Bits :: enum {
|
||||
ISVTX = 9, // 0o0001000
|
||||
ISGID = 10, // 0o0002000
|
||||
ISUID = 11, // 0o0004000
|
||||
IFFIFO = 12, // 0o0010000
|
||||
IFIFO = 12, // 0o0010000
|
||||
IFCHR = 13, // 0o0020000
|
||||
IFDIR = 14, // 0o0040000
|
||||
IFREG = 15, // 0o0100000
|
||||
@@ -1815,3 +1815,11 @@ EPoll_Ctl_Opcode :: enum i32 {
|
||||
DEL = 2,
|
||||
MOD = 3,
|
||||
}
|
||||
|
||||
/*
|
||||
Bits for execveat(2) flags.
|
||||
*/
|
||||
Execveat_Flags_Bits :: enum {
|
||||
AT_SYMLINK_NOFOLLOW = 8,
|
||||
AT_EMPTY_PATH = 12,
|
||||
}
|
||||
|
||||
@@ -39,11 +39,11 @@ PRIO_MIN :: -20
|
||||
SIGRTMIN :: Signal(32)
|
||||
SIGRTMAX :: Signal(64)
|
||||
|
||||
S_IFMT :: Mode{.IFREG, .IFDIR, .IFCHR, .IFFIFO}
|
||||
S_IFMT :: Mode{.IFREG, .IFDIR, .IFCHR, .IFIFO}
|
||||
S_IFSOCK :: Mode{.IFREG, .IFDIR}
|
||||
S_IFLNK :: Mode{.IFREG, .IFCHR}
|
||||
S_IFBLK :: Mode{.IFDIR, .IFCHR}
|
||||
S_IFFIFO :: Mode{.IFFIFO}
|
||||
S_IFIFO :: Mode{.IFIFO}
|
||||
S_IFCHR :: Mode{.IFCHR}
|
||||
S_IFDIR :: Mode{.IFDIR}
|
||||
S_IFREG :: Mode{.IFREG}
|
||||
@@ -51,7 +51,7 @@ S_IFREG :: Mode{.IFREG}
|
||||
/*
|
||||
Checks the Mode bits to see if the file is a named pipe (FIFO).
|
||||
*/
|
||||
S_ISFIFO :: #force_inline proc "contextless" (m: Mode) -> bool {return (S_IFFIFO == (m & S_IFMT))}
|
||||
S_ISFIFO :: #force_inline proc "contextless" (m: Mode) -> bool {return (S_IFIFO == (m & S_IFMT))}
|
||||
|
||||
/*
|
||||
Check the Mode bits to see if the file is a character device.
|
||||
|
||||
+31
-28
@@ -12,7 +12,7 @@ import "base:intrinsics"
|
||||
|
||||
@(private)
|
||||
syscall0 :: #force_inline proc "contextless" (nr: uintptr) -> int {
|
||||
return cast(int) intrinsics.syscall(nr)
|
||||
return int(intrinsics.syscall(nr))
|
||||
}
|
||||
|
||||
@(private)
|
||||
@@ -20,7 +20,7 @@ syscall1 :: #force_inline proc "contextless" (nr: uintptr, p1: $T) -> int
|
||||
where
|
||||
size_of(p1) <= size_of(uintptr)
|
||||
{
|
||||
return cast(int) intrinsics.syscall(nr, cast(uintptr) p1)
|
||||
return int(intrinsics.syscall(nr, uintptr(p1)))
|
||||
}
|
||||
|
||||
@(private)
|
||||
@@ -29,8 +29,7 @@ where
|
||||
size_of(p1) <= size_of(uintptr),
|
||||
size_of(p2) <= size_of(uintptr)
|
||||
{
|
||||
return cast(int) intrinsics.syscall(nr,
|
||||
cast(uintptr) p1, cast(uintptr) p2)
|
||||
return int(intrinsics.syscall(nr, uintptr(p1), uintptr(p2)))
|
||||
}
|
||||
|
||||
@(private)
|
||||
@@ -40,10 +39,11 @@ where
|
||||
size_of(p2) <= size_of(uintptr),
|
||||
size_of(p3) <= size_of(uintptr)
|
||||
{
|
||||
return cast(int) intrinsics.syscall(nr,
|
||||
cast(uintptr) p1,
|
||||
cast(uintptr) p2,
|
||||
cast(uintptr) p3)
|
||||
return int(intrinsics.syscall(nr,
|
||||
uintptr(p1),
|
||||
uintptr(p2),
|
||||
uintptr(p3),
|
||||
))
|
||||
}
|
||||
|
||||
@(private)
|
||||
@@ -54,11 +54,12 @@ where
|
||||
size_of(p3) <= size_of(uintptr),
|
||||
size_of(p4) <= size_of(uintptr)
|
||||
{
|
||||
return cast(int) intrinsics.syscall(nr,
|
||||
cast(uintptr) p1,
|
||||
cast(uintptr) p2,
|
||||
cast(uintptr) p3,
|
||||
cast(uintptr) p4)
|
||||
return int(intrinsics.syscall(nr,
|
||||
uintptr(p1),
|
||||
uintptr(p2),
|
||||
uintptr(p3),
|
||||
uintptr(p4),
|
||||
))
|
||||
}
|
||||
|
||||
@(private)
|
||||
@@ -70,12 +71,13 @@ where
|
||||
size_of(p4) <= size_of(uintptr),
|
||||
size_of(p5) <= size_of(uintptr)
|
||||
{
|
||||
return cast(int) intrinsics.syscall(nr,
|
||||
cast(uintptr) p1,
|
||||
cast(uintptr) p2,
|
||||
cast(uintptr) p3,
|
||||
cast(uintptr) p4,
|
||||
cast(uintptr) p5)
|
||||
return int(intrinsics.syscall(nr,
|
||||
uintptr(p1),
|
||||
uintptr(p2),
|
||||
uintptr(p3),
|
||||
uintptr(p4),
|
||||
uintptr(p5),
|
||||
))
|
||||
}
|
||||
|
||||
@(private)
|
||||
@@ -88,13 +90,14 @@ where
|
||||
size_of(p5) <= size_of(uintptr),
|
||||
size_of(p6) <= size_of(uintptr)
|
||||
{
|
||||
return cast(int) intrinsics.syscall(nr,
|
||||
cast(uintptr) p1,
|
||||
cast(uintptr) p2,
|
||||
cast(uintptr) p3,
|
||||
cast(uintptr) p4,
|
||||
cast(uintptr) p5,
|
||||
cast(uintptr) p6)
|
||||
return int(intrinsics.syscall(nr,
|
||||
uintptr(p1),
|
||||
uintptr(p2),
|
||||
uintptr(p3),
|
||||
uintptr(p4),
|
||||
uintptr(p5),
|
||||
uintptr(p6),
|
||||
))
|
||||
}
|
||||
|
||||
syscall :: proc {syscall0, syscall1, syscall2, syscall3, syscall4, syscall5, syscall6}
|
||||
@@ -113,7 +116,7 @@ where
|
||||
default_value: T
|
||||
return default_value, Errno(-ret)
|
||||
} else {
|
||||
return cast(T) transmute(U) ret, Errno(.NONE)
|
||||
return T(transmute(U)ret), Errno(.NONE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +126,7 @@ errno_unwrap2 :: #force_inline proc "contextless" (ret: $P, $T: typeid) -> (T, E
|
||||
default_value: T
|
||||
return default_value, Errno(-ret)
|
||||
} else {
|
||||
return cast(T) ret, Errno(.NONE)
|
||||
return T(ret), Errno(.NONE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -749,17 +749,13 @@ getsockopt :: proc {
|
||||
getsockopt_base,
|
||||
}
|
||||
|
||||
// TODO(flysand): clone (probably not in this PR, maybe not ever)
|
||||
|
||||
/*
|
||||
Creates a copy of the running process.
|
||||
Available since Linux 1.0.
|
||||
*/
|
||||
fork :: proc "contextless" () -> (Pid, Errno) {
|
||||
when ODIN_ARCH == .arm64 {
|
||||
// Note(flysand): this syscall is not documented, but the bottom 8 bits of flags
|
||||
// are for exit signal
|
||||
ret := syscall(SYS_clone, Signal.SIGCHLD)
|
||||
ret := syscall(SYS_clone, u64(Signal.SIGCHLD), cast(rawptr) nil, cast(rawptr) nil, cast(rawptr) nil, u64(0))
|
||||
return errno_unwrap(ret, Pid)
|
||||
} else {
|
||||
ret := syscall(SYS_fork)
|
||||
@@ -789,7 +785,7 @@ execve :: proc "contextless" (name: cstring, argv: [^]cstring, envp: [^]cstring)
|
||||
ret := syscall(SYS_execve, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp)
|
||||
return Errno(-ret)
|
||||
} else {
|
||||
ret := syscall(SYS_execveat, AT_FDCWD, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp)
|
||||
ret := syscall(SYS_execveat, AT_FDCWD, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp, i32(0))
|
||||
return Errno(-ret)
|
||||
}
|
||||
}
|
||||
@@ -2818,7 +2814,7 @@ getrandom :: proc "contextless" (buf: []u8, flags: Get_Random_Flags) -> (int, Er
|
||||
Execute program relative to a directory file descriptor.
|
||||
Available since Linux 3.19.
|
||||
*/
|
||||
execveat :: proc "contextless" (dirfd: Fd, name: cstring, argv: [^]cstring, envp: [^]cstring, flags: FD_Flags = {}) -> (Errno) {
|
||||
execveat :: proc "contextless" (dirfd: Fd, name: cstring, argv: [^]cstring, envp: [^]cstring, flags: Execveat_Flags = {}) -> (Errno) {
|
||||
ret := syscall(SYS_execveat, dirfd, cast(rawptr) name, cast(rawptr) argv, cast(rawptr) envp, transmute(i32) flags)
|
||||
return Errno(-ret)
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ Sock_Addr_In6 :: struct #packed {
|
||||
}
|
||||
|
||||
/*
|
||||
Struct representing Unix Domain Socket address
|
||||
Struct representing Unix Domain Socket address
|
||||
*/
|
||||
Sock_Addr_Un :: struct #packed {
|
||||
sun_family: Address_Family,
|
||||
@@ -1303,3 +1303,8 @@ EPoll_Event :: struct #packed {
|
||||
events: EPoll_Event_Kind,
|
||||
data: EPoll_Data,
|
||||
}
|
||||
|
||||
/*
|
||||
Flags for execveat(2) syscall.
|
||||
*/
|
||||
Execveat_Flags :: bit_set[Execveat_Flags_Bits; i32]
|
||||
|
||||
@@ -6,4 +6,254 @@ foreign import ntdll_lib "system:ntdll.lib"
|
||||
@(default_calling_convention="system")
|
||||
foreign ntdll_lib {
|
||||
RtlGetVersion :: proc(lpVersionInformation: ^OSVERSIONINFOEXW) -> NTSTATUS ---
|
||||
|
||||
|
||||
NtQueryInformationProcess :: proc(
|
||||
ProcessHandle: HANDLE,
|
||||
ProcessInformationClass: PROCESS_INFO_CLASS,
|
||||
ProcessInformation: rawptr,
|
||||
ProcessInformationLength: u32,
|
||||
ReturnLength: ^u32,
|
||||
) -> u32 ---
|
||||
|
||||
NtQueryInformationFile :: proc(
|
||||
FileHandle: HANDLE,
|
||||
IoStatusBlock: PIO_STATUS_BLOCK,
|
||||
FileInformation: rawptr,
|
||||
Length: ULONG,
|
||||
FileInformationClass: FILE_INFORMATION_CLASS,
|
||||
) -> NTSTATUS ---
|
||||
|
||||
NtQueryDirectoryFileEx :: proc(
|
||||
FileHandle: HANDLE,
|
||||
Event: HANDLE,
|
||||
ApcRoutine: PIO_APC_ROUTINE,
|
||||
ApcContext: PVOID,
|
||||
IoStatusBlock: PIO_STATUS_BLOCK,
|
||||
FileInformation: PVOID,
|
||||
Length: ULONG,
|
||||
FileInformationClass: FILE_INFORMATION_CLASS,
|
||||
QueryFlags: ULONG,
|
||||
FileName : PUNICODE_STRING,
|
||||
) -> NTSTATUS ---
|
||||
}
|
||||
|
||||
|
||||
PIO_APC_ROUTINE :: #type proc "system" (ApcContext: rawptr, IoStatusBlock: PIO_STATUS_BLOCK, Reserved: ULONG)
|
||||
|
||||
PIO_STATUS_BLOCK :: ^IO_STATUS_BLOCK
|
||||
IO_STATUS_BLOCK :: struct {
|
||||
using _: struct #raw_union {
|
||||
Status: NTSTATUS,
|
||||
Pointer: rawptr,
|
||||
},
|
||||
Information: ULONG_PTR,
|
||||
}
|
||||
|
||||
|
||||
PROCESS_INFO_CLASS :: enum c_int {
|
||||
ProcessBasicInformation = 0,
|
||||
ProcessDebugPort = 7,
|
||||
ProcessWow64Information = 26,
|
||||
ProcessImageFileName = 27,
|
||||
ProcessBreakOnTermination = 29,
|
||||
ProcessTelemetryIdInformation = 64,
|
||||
ProcessSubsystemInformation = 75,
|
||||
}
|
||||
|
||||
SL_RESTART_SCAN :: 0x00000001 // The scan will start at the first entry in the directory. If this flag is not set, the scan will resume from where the last query ended.
|
||||
SL_RETURN_SINGLE_ENTRY :: 0x00000002 // Normally the return buffer is packed with as many matching directory entries that fit. If this flag is set, the file system will return only one directory entry at a time. This does make the operation less efficient.
|
||||
SL_INDEX_SPECIFIED :: 0x00000004 // The scan should start at a specified indexed position in the directory. This flag can only be set if you generate your own IRP_MJ_DIRECTORY_CONTROL IRP; the index is specified in the IRP. How the position is specified varies from file system to file system.
|
||||
SL_RETURN_ON_DISK_ENTRIES_ONLY :: 0x00000008 // Any file system filters that perform directory virtualization or just-in-time expansion should simply pass the request through to the file system and return entries that are currently on disk. Not all file systems support this flag.
|
||||
SL_NO_CURSOR_UPDATE_QUERY :: 0x00000010 // File systems maintain per-FileObject directory cursor information. When multiple threads do queries using the same FileObject, access to the per-FileObject structure is single threaded to prevent corruption of the cursor state. This flag tells the file system to not update per-FileObject cursor state information thus allowing multiple threads to query in parallel using the same handle. It behaves as if SL_RESTART_SCAN is specified on each call. If a wild card pattern is given on the next call, the operation will not pick up where the last query ended. This allows for true asynchronous directory query support. If this flag is used inside a TxF transaction the operation will be failed. Not all file systems support this flag.
|
||||
|
||||
|
||||
PFILE_INFORMATION_CLASS :: ^FILE_INFORMATION_CLASS
|
||||
FILE_INFORMATION_CLASS :: enum c_int {
|
||||
FileDirectoryInformation = 1,
|
||||
FileFullDirectoryInformation = 2,
|
||||
FileBothDirectoryInformation = 3,
|
||||
FileBasicInformation = 4,
|
||||
FileStandardInformation = 5,
|
||||
FileInternalInformation = 6,
|
||||
FileEaInformation = 7,
|
||||
FileAccessInformation = 8,
|
||||
FileNameInformation = 9,
|
||||
FileRenameInformation = 10,
|
||||
FileLinkInformation = 11,
|
||||
FileNamesInformation = 12,
|
||||
FileDispositionInformation = 13,
|
||||
FilePositionInformation = 14,
|
||||
FileFullEaInformation = 15,
|
||||
FileModeInformation = 16,
|
||||
FileAlignmentInformation = 17,
|
||||
FileAllInformation = 18,
|
||||
FileAllocationInformation = 19,
|
||||
FileEndOfFileInformation = 20,
|
||||
FileAlternateNameInformation = 21,
|
||||
FileStreamInformation = 22,
|
||||
FilePipeInformation = 23,
|
||||
FilePipeLocalInformation = 24,
|
||||
FilePipeRemoteInformation = 25,
|
||||
FileMailslotQueryInformation = 26,
|
||||
FileMailslotSetInformation = 27,
|
||||
FileCompressionInformation = 28,
|
||||
FileObjectIdInformation = 29,
|
||||
FileCompletionInformation = 30,
|
||||
FileMoveClusterInformation = 31,
|
||||
FileQuotaInformation = 32,
|
||||
FileReparsePointInformation = 33,
|
||||
FileNetworkOpenInformation = 34,
|
||||
FileAttributeTagInformation = 35,
|
||||
FileTrackingInformation = 36,
|
||||
FileIdBothDirectoryInformation = 37,
|
||||
FileIdFullDirectoryInformation = 38,
|
||||
FileValidDataLengthInformation = 39,
|
||||
FileShortNameInformation = 40,
|
||||
FileIoCompletionNotificationInformation = 41,
|
||||
FileIoStatusBlockRangeInformation = 42,
|
||||
FileIoPriorityHintInformation = 43,
|
||||
FileSfioReserveInformation = 44,
|
||||
FileSfioVolumeInformation = 45,
|
||||
FileHardLinkInformation = 46,
|
||||
FileProcessIdsUsingFileInformation = 47,
|
||||
FileNormalizedNameInformation = 48,
|
||||
FileNetworkPhysicalNameInformation = 49,
|
||||
FileIdGlobalTxDirectoryInformation = 50,
|
||||
FileIsRemoteDeviceInformation = 51,
|
||||
FileUnusedInformation = 52,
|
||||
FileNumaNodeInformation = 53,
|
||||
FileStandardLinkInformation = 54,
|
||||
FileRemoteProtocolInformation = 55,
|
||||
FileRenameInformationBypassAccessCheck = 56,
|
||||
FileLinkInformationBypassAccessCheck = 57,
|
||||
FileVolumeNameInformation = 58,
|
||||
FileIdInformation = 59,
|
||||
FileIdExtdDirectoryInformation = 60,
|
||||
FileReplaceCompletionInformation = 61,
|
||||
FileHardLinkFullIdInformation = 62,
|
||||
FileIdExtdBothDirectoryInformation = 63,
|
||||
FileDispositionInformationEx = 64,
|
||||
FileRenameInformationEx = 65,
|
||||
FileRenameInformationExBypassAccessCheck = 66,
|
||||
FileDesiredStorageClassInformation = 67,
|
||||
FileStatInformation = 68,
|
||||
FileMemoryPartitionInformation = 69,
|
||||
FileStatLxInformation = 70,
|
||||
FileCaseSensitiveInformation = 71,
|
||||
FileLinkInformationEx = 72,
|
||||
FileLinkInformationExBypassAccessCheck = 73,
|
||||
FileStorageReserveIdInformation = 74,
|
||||
FileCaseSensitiveInformationForceAccessCheck = 75,
|
||||
FileKnownFolderInformation = 76,
|
||||
FileStatBasicInformation = 77,
|
||||
FileId64ExtdDirectoryInformation = 78,
|
||||
FileId64ExtdBothDirectoryInformation = 79,
|
||||
FileIdAllExtdDirectoryInformation = 80,
|
||||
FileIdAllExtdBothDirectoryInformation = 81,
|
||||
FileStreamReservationInformation,
|
||||
FileMupProviderInfo,
|
||||
FileMaximumInformation,
|
||||
}
|
||||
|
||||
PFILE_ID_FULL_DIR_INFORMATION :: ^FILE_ID_FULL_DIR_INFORMATION
|
||||
FILE_ID_FULL_DIR_INFORMATION :: struct {
|
||||
NextEntryOffset: ULONG,
|
||||
FileIndex: ULONG,
|
||||
CreationTime: LARGE_INTEGER,
|
||||
LastAccessTime: LARGE_INTEGER,
|
||||
LastWriteTime: LARGE_INTEGER,
|
||||
ChangeTime: LARGE_INTEGER,
|
||||
EndOfFile: LARGE_INTEGER,
|
||||
AllocationSize: LARGE_INTEGER,
|
||||
FileAttributes: ULONG,
|
||||
FileNameLength: ULONG,
|
||||
EaSize: ULONG,
|
||||
FileId: LARGE_INTEGER,
|
||||
FileName: [1]WCHAR,
|
||||
}
|
||||
|
||||
|
||||
PROCESS_BASIC_INFORMATION :: struct {
|
||||
ExitStatus: NTSTATUS,
|
||||
PebBaseAddress: ^PEB,
|
||||
AffinityMask: ULONG_PTR,
|
||||
BasePriority: KPRIORITY,
|
||||
UniqueProcessId: ULONG_PTR,
|
||||
InheritedFromUniqueProcessId: ULONG_PTR,
|
||||
}
|
||||
|
||||
KPRIORITY :: rawptr
|
||||
|
||||
PPS_POST_PROCESS_INIT_ROUTINE :: proc "system" ()
|
||||
|
||||
|
||||
PEB :: struct {
|
||||
_: [2]u8,
|
||||
BeingDebugged: u8,
|
||||
_: [1]u8,
|
||||
_: [2]rawptr,
|
||||
Ldr: ^PEB_LDR_DATA,
|
||||
ProcessParameters: ^RTL_USER_PROCESS_PARAMETERS,
|
||||
_: [104]u8,
|
||||
_: [52]rawptr,
|
||||
PostProcessInitRoutine: PPS_POST_PROCESS_INIT_ROUTINE,
|
||||
_: [128]u8,
|
||||
_: [1]rawptr,
|
||||
SessionId: u32,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
PEB_LDR_DATA :: struct {
|
||||
_: [8]u8,
|
||||
_: [3]rawptr,
|
||||
InMemoryOrderModuleList: LIST_ENTRY,
|
||||
}
|
||||
|
||||
RTL_USER_PROCESS_PARAMETERS :: struct {
|
||||
MaximumLength: u32,
|
||||
Length: u32,
|
||||
Flags: u32,
|
||||
DebugFlags: u32,
|
||||
ConsoleHandle: rawptr,
|
||||
ConsoleFlags: u32,
|
||||
StdInputHandle: rawptr,
|
||||
StdOutputHandle: rawptr,
|
||||
StdErrorHandle: rawptr,
|
||||
CurrentDirectoryPath: UNICODE_STRING,
|
||||
CurrentDirectoryHandle: rawptr,
|
||||
DllPath: UNICODE_STRING,
|
||||
ImagePathName: UNICODE_STRING,
|
||||
CommandLine: UNICODE_STRING,
|
||||
Environment: rawptr,
|
||||
StartingPositionLeft: u32,
|
||||
StartingPositionTop: u32,
|
||||
Width: u32,
|
||||
Height: u32,
|
||||
CharWidth: u32,
|
||||
CharHeight: u32,
|
||||
ConsoleTextAttributes: u32,
|
||||
WindowFlags: u32,
|
||||
ShowWindowFlags: u32,
|
||||
WindowTitle: UNICODE_STRING,
|
||||
DesktopName: UNICODE_STRING,
|
||||
ShellInfo: UNICODE_STRING,
|
||||
RuntimeData: UNICODE_STRING,
|
||||
DLCurrentDirectory: [32]RTL_DRIVE_LETTER_CURDIR,
|
||||
EnvironmentSize: u32,
|
||||
}
|
||||
|
||||
RTL_DRIVE_LETTER_CURDIR :: struct {
|
||||
Flags: u16,
|
||||
Length: u16,
|
||||
TimeStamp: u32,
|
||||
DosPath: UNICODE_STRING,
|
||||
}
|
||||
|
||||
|
||||
LIST_ENTRY :: struct {
|
||||
Flink: ^LIST_ENTRY,
|
||||
Blink: ^LIST_ENTRY,
|
||||
}
|
||||
@@ -32,6 +32,10 @@ foreign shell32 {
|
||||
SHGetKnownFolderPath :: proc(rfid: REFKNOWNFOLDERID, dwFlags: /* KNOWN_FOLDER_FLAG */ DWORD, hToken: HANDLE, ppszPath: ^LPWSTR) -> HRESULT ---
|
||||
|
||||
ExtractIconExW :: proc(pszFile: LPCWSTR, nIconIndex: INT, phiconLarge: ^HICON, phiconSmall: ^HICON, nIcons: UINT) -> UINT ---
|
||||
DragAcceptFiles :: proc(hWnd: HWND, fAccept: BOOL) ---
|
||||
DragQueryPoint :: proc(hDrop: HDROP, ppt: ^POINT) -> BOOL ---
|
||||
DragQueryFileW :: proc(hDrop: HDROP, iFile: UINT, lpszFile: LPWSTR, cch: UINT) -> UINT ---
|
||||
DragFinish :: proc(hDrop: HDROP) --- // @New
|
||||
}
|
||||
|
||||
APPBARDATA :: struct {
|
||||
@@ -69,6 +73,8 @@ ABE_BOTTOM :: 3
|
||||
KNOWNFOLDERID :: GUID
|
||||
REFKNOWNFOLDERID :: ^KNOWNFOLDERID
|
||||
|
||||
HDROP :: HANDLE
|
||||
|
||||
KNOWN_FOLDER_FLAG :: enum u32 {
|
||||
DEFAULT = 0x00000000,
|
||||
|
||||
|
||||
+50
-30
@@ -1131,16 +1131,28 @@ TRACKMOUSEEVENT :: struct {
|
||||
}
|
||||
|
||||
WIN32_FIND_DATAW :: struct {
|
||||
dwFileAttributes: DWORD,
|
||||
ftCreationTime: FILETIME,
|
||||
ftLastAccessTime: FILETIME,
|
||||
ftLastWriteTime: FILETIME,
|
||||
nFileSizeHigh: DWORD,
|
||||
nFileSizeLow: DWORD,
|
||||
dwReserved0: DWORD,
|
||||
dwReserved1: DWORD,
|
||||
cFileName: [260]wchar_t, // #define MAX_PATH 260
|
||||
cAlternateFileName: [14]wchar_t,
|
||||
dwFileAttributes: DWORD,
|
||||
ftCreationTime: FILETIME,
|
||||
ftLastAccessTime: FILETIME,
|
||||
ftLastWriteTime: FILETIME,
|
||||
nFileSizeHigh: DWORD,
|
||||
nFileSizeLow: DWORD,
|
||||
dwReserved0: DWORD,
|
||||
dwReserved1: DWORD,
|
||||
cFileName: [MAX_PATH]WCHAR,
|
||||
cAlternateFileName: [14]WCHAR,
|
||||
_OBSOLETE_dwFileType: DWORD, // Obsolete. Do not use.
|
||||
_OBSOLETE_dwCreatorType: DWORD, // Obsolete. Do not use
|
||||
_OBSOLETE_wFinderFlags: WORD, // Obsolete. Do not use
|
||||
}
|
||||
|
||||
FILE_ID_128 :: struct {
|
||||
Identifier: [16]BYTE,
|
||||
}
|
||||
|
||||
FILE_ID_INFO :: struct {
|
||||
VolumeSerialNumber: ULONGLONG,
|
||||
FileId: FILE_ID_128,
|
||||
}
|
||||
|
||||
CREATESTRUCTA :: struct {
|
||||
@@ -1196,6 +1208,11 @@ NMHDR :: struct {
|
||||
code: UINT, // NM_ code
|
||||
}
|
||||
|
||||
NCCALCSIZE_PARAMS :: struct {
|
||||
rgrc: [3]RECT,
|
||||
lppos: PWINDOWPOS,
|
||||
}
|
||||
|
||||
// Generic WM_NOTIFY notification codes
|
||||
NM_OUTOFMEMORY :: ~uintptr(0) // -1
|
||||
NM_CLICK :: NM_OUTOFMEMORY-1 // uses NMCLICK struct
|
||||
@@ -2318,6 +2335,7 @@ FILE_TYPE_PIPE :: 0x0003
|
||||
RECT :: struct {left, top, right, bottom: LONG}
|
||||
POINT :: struct {x, y: LONG}
|
||||
|
||||
PWINDOWPOS :: ^WINDOWPOS
|
||||
WINDOWPOS :: struct {
|
||||
hwnd: HWND,
|
||||
hwndInsertAfter: HWND,
|
||||
@@ -2549,6 +2567,7 @@ CLSCTX_RESERVED6 :: 0x1000000
|
||||
CLSCTX_ACTIVATE_ARM32_SERVER :: 0x2000000
|
||||
CLSCTX_ALLOW_LOWER_TRUST_REGISTRATION :: 0x4000000
|
||||
CLSCTX_PS_DLL :: 0x80000000
|
||||
CLSCTX_ALL :: CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER
|
||||
|
||||
WSAPROTOCOLCHAIN :: struct {
|
||||
ChainLen: c_int,
|
||||
@@ -2608,10 +2627,11 @@ OBJECT_ATTRIBUTES :: struct {
|
||||
SecurityQualityOfService: rawptr,
|
||||
}
|
||||
|
||||
PUNICODE_STRING :: ^UNICODE_STRING
|
||||
UNICODE_STRING :: struct {
|
||||
Length: u16,
|
||||
MaximumLength: u16,
|
||||
Buffer: ^u16,
|
||||
Length: u16 `fmt:"-"`,
|
||||
MaximumLength: u16 `fmt:"-"`,
|
||||
Buffer: [^]u16 `fmt:"s,Length"`,
|
||||
}
|
||||
|
||||
OVERLAPPED :: struct {
|
||||
@@ -2822,41 +2842,41 @@ NEON128 :: struct {
|
||||
|
||||
EXCEPTION_POINTERS :: struct {
|
||||
ExceptionRecord: ^EXCEPTION_RECORD,
|
||||
ContextRecord: ^CONTEXT,
|
||||
ContextRecord: ^CONTEXT,
|
||||
}
|
||||
|
||||
PVECTORED_EXCEPTION_HANDLER :: #type proc "system" (ExceptionInfo: ^EXCEPTION_POINTERS) -> LONG
|
||||
|
||||
CONSOLE_READCONSOLE_CONTROL :: struct {
|
||||
nLength: ULONG,
|
||||
nInitialChars: ULONG,
|
||||
dwCtrlWakeupMask: ULONG,
|
||||
nLength: ULONG,
|
||||
nInitialChars: ULONG,
|
||||
dwCtrlWakeupMask: ULONG,
|
||||
dwControlKeyState: ULONG,
|
||||
}
|
||||
|
||||
PCONSOLE_READCONSOLE_CONTROL :: ^CONSOLE_READCONSOLE_CONTROL
|
||||
|
||||
BY_HANDLE_FILE_INFORMATION :: struct {
|
||||
dwFileAttributes: DWORD,
|
||||
ftCreationTime: FILETIME,
|
||||
ftLastAccessTime: FILETIME,
|
||||
ftLastWriteTime: FILETIME,
|
||||
dwFileAttributes: DWORD,
|
||||
ftCreationTime: FILETIME,
|
||||
ftLastAccessTime: FILETIME,
|
||||
ftLastWriteTime: FILETIME,
|
||||
dwVolumeSerialNumber: DWORD,
|
||||
nFileSizeHigh: DWORD,
|
||||
nFileSizeLow: DWORD,
|
||||
nNumberOfLinks: DWORD,
|
||||
nFileIndexHigh: DWORD,
|
||||
nFileIndexLow: DWORD,
|
||||
nFileSizeHigh: DWORD,
|
||||
nFileSizeLow: DWORD,
|
||||
nNumberOfLinks: DWORD,
|
||||
nFileIndexHigh: DWORD,
|
||||
nFileIndexLow: DWORD,
|
||||
}
|
||||
|
||||
LPBY_HANDLE_FILE_INFORMATION :: ^BY_HANDLE_FILE_INFORMATION
|
||||
|
||||
FILE_STANDARD_INFO :: struct {
|
||||
AllocationSize: LARGE_INTEGER,
|
||||
EndOfFile: LARGE_INTEGER,
|
||||
NumberOfLinks: DWORD,
|
||||
DeletePending: BOOLEAN,
|
||||
Directory: BOOLEAN,
|
||||
EndOfFile: LARGE_INTEGER,
|
||||
NumberOfLinks: DWORD,
|
||||
DeletePending: BOOLEAN,
|
||||
Directory: BOOLEAN,
|
||||
}
|
||||
|
||||
FILE_ATTRIBUTE_TAG_INFO :: struct {
|
||||
|
||||
Reference in New Issue
Block a user