From 0e9bf8612377db882622801f96e44066ac87a214 Mon Sep 17 00:00:00 2001 From: Fabian Sperber Date: Wed, 19 Jun 2024 22:22:02 +0200 Subject: [PATCH] Fix d3d11 IInfoQueue_VTable & Add LoadLibraryExW - wrong order & was missing PushStorageFilter & PushRetrievalFilter --- core/sys/windows/kernel32.odin | 1 + core/sys/windows/types.odin | 16 ++++++++++++ vendor/directx/d3d11/d3d11.odin | 46 +++++++++++++++++---------------- 3 files changed, 41 insertions(+), 22 deletions(-) diff --git a/core/sys/windows/kernel32.odin b/core/sys/windows/kernel32.odin index 0d9ad826a..4b21b2bcc 100755 --- a/core/sys/windows/kernel32.odin +++ b/core/sys/windows/kernel32.odin @@ -413,6 +413,7 @@ foreign kernel32 { LoadLibraryW :: proc(c_str: LPCWSTR) -> HMODULE --- FreeLibrary :: proc(h: HMODULE) -> BOOL --- GetProcAddress :: proc(h: HMODULE, c_str: LPCSTR) -> rawptr --- + LoadLibraryExW :: proc(c_str: LPCWSTR, file: HANDLE, flags: LoadLibraryEx_Flags) -> HMODULE --- GetFullPathNameW :: proc(filename: LPCWSTR, buffer_length: DWORD, buffer: LPCWSTR, file_part: ^LPCWSTR) -> DWORD --- diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin index 7ed322169..0480b278c 100644 --- a/core/sys/windows/types.odin +++ b/core/sys/windows/types.odin @@ -2674,6 +2674,22 @@ OSVERSIONINFOEXW :: struct { wReserved: UCHAR, } +LoadLibraryEx_Flag :: enum DWORD { + LOAD_LIBRARY_AS_DATAFILE = 1, // 1 << 1: 0x0002, + LOAD_WITH_ALTERED_SEARCH_PATH = 3, // 1 << 3: 0x0008, + LOAD_IGNORE_CODE_AUTHZ_LEVEL = 4, // 1 << 4: 0x0010, + LOAD_LIBRARY_AS_IMAGE_RESOURCE = 5, // 1 << 5: 0x0020, + LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 6, // 1 << 6: 0x0040, + LOAD_LIBRARY_REQUIRE_SIGNED_TARGET = 7, // 1 << 7: 0x0080, + LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 8, // 1 << 8: 0x0100, + LOAD_LIBRARY_SEARCH_APPLICATION_DIR = 9, // 1 << 9: 0x0200, + LOAD_LIBRARY_SEARCH_USER_DIRS = 10, // 1 << 10: 0x0400, + LOAD_LIBRARY_SEARCH_SYSTEM32 = 11, // 1 << 11: 0x0800, + LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 12, // 1 << 12: 0x1000, + LOAD_LIBRARY_SAFE_CURRENT_DIRS = 13, // 1 << 13: 0x2000, +} +LoadLibraryEx_Flags :: distinct bit_set[LoadLibraryEx_Flag] + // https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-quota_limits // Used in LogonUserExW PQUOTA_LIMITS :: struct { diff --git a/vendor/directx/d3d11/d3d11.odin b/vendor/directx/d3d11/d3d11.odin index 3af0f2965..83801e854 100644 --- a/vendor/directx/d3d11/d3d11.odin +++ b/vendor/directx/d3d11/d3d11.odin @@ -3775,39 +3775,41 @@ MESSAGE :: struct { IInfoQueue_VTable :: struct { using iunkown_vtable: IUnknown_VTable, - AddApplicationMessage: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, pDescription: cstring) -> HRESULT, - AddMessage: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, Severity: MESSAGE_SEVERITY, ID: MESSAGE_ID, pDescription: cstring) -> HRESULT, - AddRetrievalFilterEntries: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - AddStorageFilterEntries: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - ClearRetrievalFilter: proc "system" (this: ^IInfoQueue), - ClearStorageFilter: proc "system" (this: ^IInfoQueue), + SetMessageCountLimit: proc "system" (this: ^IInfoQueue, MessageCountLimit: u64) -> HRESULT, ClearStoredMessages: proc "system" (this: ^IInfoQueue), - GetBreakOnCategory: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY) -> BOOL, - GetBreakOnID: proc "system" (this: ^IInfoQueue, ID: MESSAGE_ID) -> BOOL, - GetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY) -> BOOL, GetMessage: proc "system" (this: ^IInfoQueue, MessageIndex: u64, pMessage: ^MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT, - GetMessageCountLimit: proc "system" (this: ^IInfoQueue) -> u64, - GetMuteDebugOutput: proc "system" (this: ^IInfoQueue) -> BOOL, GetNumMessagesAllowedByStorageFilter: proc "system" (this: ^IInfoQueue) -> u64, GetNumMessagesDeniedByStorageFilter: proc "system" (this: ^IInfoQueue) -> u64, - GetNumMessagesDiscardedByMessageCountLimit: proc "system" (this: ^IInfoQueue) -> u64, GetNumStoredMessages: proc "system" (this: ^IInfoQueue) -> u64, GetNumStoredMessagesAllowedByRetrievalFilter: proc "system" (this: ^IInfoQueue) -> u64, - GetRetrievalFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, - GetRetrievalFilterStackSize: proc "system" (this: ^IInfoQueue) -> u64, + GetNumMessagesDiscardedByMessageCountLimit: proc "system" (this: ^IInfoQueue) -> u64, + GetMessageCountLimit: proc "system" (this: ^IInfoQueue) -> u64, + AddStorageFilterEntries: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, GetStorageFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, - GetStorageFilterStackSize: proc "system" (this: ^IInfoQueue) -> u64, - PopRetrievalFilter: proc "system" (this: ^IInfoQueue), - PopStorageFilter: proc "system" (this: ^IInfoQueue), - PushCopyOfRetrievalFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, - PushCopyOfStorageFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, - PushEmptyRetrievalFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + ClearStorageFilter: proc "system" (this: ^IInfoQueue), PushEmptyStorageFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushCopyOfStorageFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushStorageFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + PopStorageFilter: proc "system" (this: ^IInfoQueue), + GetStorageFilterStackSize: proc "system" (this: ^IInfoQueue) -> u64, + AddRetrievalFilterEntries: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + GetRetrievalFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, + ClearRetrievalFilter: proc "system" (this: ^IInfoQueue), + PushEmptyRetrievalFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushCopyOfRetrievalFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushRetrievalFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + PopRetrievalFilter: proc "system" (this: ^IInfoQueue), + GetRetrievalFilterStackSize: proc "system" (this: ^IInfoQueue) -> u64, + AddMessage: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, Severity: MESSAGE_SEVERITY, ID: MESSAGE_ID, pDescription: cstring) -> HRESULT, + AddApplicationMessage: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, pDescription: cstring) -> HRESULT, SetBreakOnCategory: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT, - SetBreakOnID: proc "system" (this: ^IInfoQueue, ID: MESSAGE_ID, bEnable: BOOL) -> HRESULT, SetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT, - SetMessageCountLimit: proc "system" (this: ^IInfoQueue, MessageCountLimit: u64) -> HRESULT, + SetBreakOnID: proc "system" (this: ^IInfoQueue, ID: MESSAGE_ID, bEnable: BOOL) -> HRESULT, + GetBreakOnCategory: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY) -> BOOL, + GetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY) -> BOOL, + GetBreakOnID: proc "system" (this: ^IInfoQueue, ID: MESSAGE_ID) -> BOOL, SetMuteDebugOutput: proc "system" (this: ^IInfoQueue, bMute: BOOL), + GetMuteDebugOutput: proc "system" (this: ^IInfoQueue) -> BOOL, } MESSAGE_ID :: enum u32 {