aboutsummaryrefslogtreecommitdiff
path: root/core/sys/windows
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-06-30 15:42:11 +0100
committergingerBill <bill@gingerbill.org>2022-06-30 15:42:11 +0100
commite2bfb024defb1b2efc7969172b6557cec985c15a (patch)
tree6157fa455dd4bebf9c074dfa7d33398ac70c18ae /core/sys/windows
parent4d06a54c0ce7266d8f30c0f6b10dd527c3f9d8c6 (diff)
parent04ae87eaef35860c9c9ef425cc425d29e4caf978 (diff)
Merge branch 'master' of https://github.com/odin-lang/Odin
Diffstat (limited to 'core/sys/windows')
-rw-r--r--core/sys/windows/types.odin81
-rw-r--r--core/sys/windows/user32.odin2
2 files changed, 75 insertions, 8 deletions
diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin
index 1b5189b13..edf6e593e 100644
--- a/core/sys/windows/types.odin
+++ b/core/sys/windows/types.odin
@@ -196,15 +196,26 @@ OPEN_ALWAYS: DWORD : 4
OPEN_EXISTING: DWORD : 3
TRUNCATE_EXISTING: DWORD : 5
+FILE_READ_DATA : DWORD : 0x00000001
+FILE_LIST_DIRECTORY : DWORD : 0x00000001
+FILE_WRITE_DATA : DWORD : 0x00000002
+FILE_ADD_FILE : DWORD : 0x00000002
+FILE_APPEND_DATA : DWORD : 0x00000004
+FILE_ADD_SUBDIRECTORY : DWORD : 0x00000004
+FILE_CREATE_PIPE_INSTANCE : DWORD : 0x00000004
+FILE_READ_EA : DWORD : 0x00000008
+FILE_WRITE_EA : DWORD : 0x00000010
+FILE_EXECUTE : DWORD : 0x00000020
+FILE_TRAVERSE : DWORD : 0x00000020
+FILE_DELETE_CHILD : DWORD : 0x00000040
+FILE_READ_ATTRIBUTES : DWORD : 0x00000080
+FILE_WRITE_ATTRIBUTES : DWORD : 0x00000100
+
+GENERIC_READ : DWORD : 0x80000000
+GENERIC_WRITE : DWORD : 0x40000000
+GENERIC_EXECUTE : DWORD : 0x20000000
+GENERIC_ALL : DWORD : 0x10000000
-
-FILE_WRITE_DATA: DWORD : 0x00000002
-FILE_APPEND_DATA: DWORD : 0x00000004
-FILE_WRITE_EA: DWORD : 0x00000010
-FILE_WRITE_ATTRIBUTES: DWORD : 0x00000100
-FILE_READ_ATTRIBUTES: DWORD : 0x000000080
-GENERIC_READ: DWORD : 0x80000000
-GENERIC_WRITE: DWORD : 0x40000000
FILE_GENERIC_WRITE: DWORD : STANDARD_RIGHTS_WRITE |
FILE_WRITE_DATA |
FILE_WRITE_ATTRIBUTES |
@@ -250,6 +261,9 @@ DIAGNOSTIC_REASON_SIMPLE_STRING :: 0x00000001
DIAGNOSTIC_REASON_DETAILED_STRING :: 0x00000002
DIAGNOSTIC_REASON_NOT_SPECIFIED :: 0x80000000
+ENUM_CURRENT_SETTINGS : DWORD : 4294967295 // (DWORD)-1
+ENUM_REGISTRY_SETTINGS : DWORD : 4294967294 // (DWORD)-2
+
// Defines for power request APIs
POWER_REQUEST_CONTEXT_VERSION :: DIAGNOSTIC_REASON_VERSION
@@ -813,6 +827,57 @@ CREATESTRUCTW:: struct {
dwExStyle: DWORD,
}
+DEVMODEW :: struct {
+ dmDeviceName: [32]wchar_t,
+ dmSpecVersion: WORD,
+ dmDriverVersion: WORD,
+ dmSize: WORD,
+ dmDriverExtra: WORD,
+ dmFields: DWORD,
+ using _: struct #raw_union {
+ // Printer only fields.
+ using _: struct {
+ dmOrientation: c_short,
+ dmPaperSize: c_short,
+ dmPaperLength: c_short,
+ dmPaperWidth: c_short,
+ dmScale: c_short,
+ dmCopies: c_short,
+ dmDefaultSource: c_short,
+ dmPrintQuality: c_short,
+ },
+ // Display only fields.
+ using _: struct {
+ dmPosition: POINT,
+ dmDisplayOrientation: DWORD,
+ dmDisplayFixedOutput: DWORD,
+ },
+ },
+ dmColor: c_short,
+ dmDuplex: c_short,
+ dmYResolution: c_short,
+ dmTTOption: c_short,
+ dmCollate: c_short,
+ dmFormName: [32]wchar_t,
+ dmLogPixels: WORD,
+ dmBitsPerPel: DWORD,
+ dmPelsWidth: DWORD,
+ dmPelsHeight: DWORD,
+ using _: struct #raw_union {
+ dmDisplayFlags: DWORD,
+ dmNup: DWORD,
+ },
+ dmDisplayFrequency: DWORD,
+ dmICMMethod: DWORD,
+ dmICMIntent: DWORD,
+ dmMediaType: DWORD,
+ dmDitherType: DWORD,
+ dmReserved1: DWORD,
+ dmReserved2: DWORD,
+ dmPanningWidth: DWORD,
+ dmPanningHeight: DWORD,
+}
+
// MessageBox() Flags
MB_OK :: 0x00000000
MB_OKCANCEL :: 0x00000001
diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin
index 6a4e75b7b..47de354b6 100644
--- a/core/sys/windows/user32.odin
+++ b/core/sys/windows/user32.odin
@@ -135,6 +135,8 @@ foreign user32 {
SetCursorPos :: proc(X: c_int, Y: c_int) -> BOOL ---
SetCursor :: proc(hCursor: HCURSOR) -> HCURSOR ---
+ EnumDisplaySettingsW :: proc(lpszDeviceName: LPCWSTR, iModeNum: DWORD, lpDevMode: ^DEVMODEW) -> BOOL ---
+
BroadcastSystemMessageW :: proc(
flags: DWORD,
lpInfo: LPDWORD,