├── .gitignore ├── .gitmodules ├── README.md ├── VERSION ├── makebuild.sh └── patches ├── .protonprep.sh.kate-swp ├── LoL ├── LoL-broken-client-update-fix.patch ├── LoL-client-slow-start-fix.patch ├── LoL-ntdll-fix-signal-set-full-context.patch ├── LoL-ntdll-implement-ntcontinueex.patch └── LoL-ntdll-nopguard-call_vectored_handlers.patch ├── game-patches ├── assettocorsa-hud.patch ├── ffxiv_hydaelyn_intro_playback_fix.patch ├── killer-instinct-winevulkan_fix.patch ├── pso2_hack.patch ├── star-citizen-eac.patch └── uplay-fsync-proton-wine-hotfix.patch ├── proton ├── 0001-De-steamify-proton-s-WINE-so-it-can-be-used-as-a-sta.patch ├── 47-proton-fshack-AMD-FSR-complete.patch ├── 48-proton-fshack_amd_fsr.patch ├── 49-fsr-width-using-height-and-aspect-ratio.patch ├── 71-invert-fsr-logic.patch └── fix-non-steam-controller-input.patch ├── protonprep-LoL.sh ├── protonprep-lutris-staging.sh └── wine-hotfixes ├── pending ├── 4428.patch ├── hotfix-guild_wars_2.patch ├── ntdll_add_wine_disable_sfn.patch └── unity_crash_hotfix.patch ├── staging ├── cryptext-CryptExtOpenCER │ ├── 0001-cryptext-Implement-CryptExtOpenCER.patch │ └── definition ├── d3dx11_43-D3DX11CreateTextureFromMemory │ ├── 0001-d3dx11_43-Implement-D3DX11GetImageInfoFromMemory.patch │ ├── 0002-d3dx11_42-Implement-D3DX11CreateTextureFromMemory.patch │ └── definition ├── fltmgr.sys-FltBuildDefaultSecurityDescriptor │ ├── 0001-fltmgr.sys-Implement-FltBuildDefaultSecurityDescript.patch │ ├── 0002-fltmgr.sys-Create-import-library.patch │ ├── 0003-ntoskrnl.exe-Add-FltBuildDefaultSecurityDescriptor-t.patch │ └── definition ├── inseng-Implementation │ ├── 0001-inseng-Implement-CIF-reader-and-download-functions.patch │ └── definition ├── loader-KeyboardLayouts │ ├── 0001-loader-Add-Keyboard-Layouts-registry-enteries.patch │ └── 0002-user32-Improve-GetKeyboardLayoutList.patch ├── ntdll-Exception │ ├── 0002-ntdll-OutputDebugString-should-throw-the-exception-a.patch │ └── definition ├── ntdll-RtlQueryPackageIdentity │ ├── 0003-ntdll-tests-Add-basic-tests-for-RtlQueryPackageIdent.patch │ └── definition ├── ntdll-Serial_Port_Detection │ ├── 0001-ntdll-Do-a-device-check-before-returning-a-default-s.patch │ └── definition ├── ntdll-WRITECOPY │ ├── 0001-ntdll-Trigger-write-watches-before-passing-userdata-.patch │ ├── 0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch │ ├── 0004-ntdll-Properly-handle-PAGE_WRITECOPY-protection.-try.patch │ ├── 0005-ntdll-Track-if-a-WRITECOPY-page-has-been-modified.patch │ ├── 0006-ntdll-Support-WRITECOPY-on-x64.patch │ ├── 0007-ntdll-Report-unmodified-WRITECOPY-pages-as-shared.patch │ ├── 0008-ntdll-Fallback-to-copy-pages-for-WRITECOPY.patch │ ├── 0009-kernel32-tests-psapi-tests-Update-tests.patch │ └── definition ├── ntdll-ext4-case-folder │ ├── 0002-ntdll-server-Mark-drive_c-as-case-insensitive-when-c.patch │ └── definition ├── packager-DllMain │ ├── 0001-packager-Prefer-native-version.patch │ └── definition ├── rawinput │ └── 0006-winex11.drv-Send-relative-RawMotion-events-unprocess.patch ├── shell32-NewMenu_Interface │ ├── 0001-shell32-Implement-NewMenu-with-new-folder-item.patch │ └── definition ├── shell32-registry-lookup-app │ ├── 0001-shell32-Append-.exe-when-registry-lookup-fails-first.patch │ └── definition ├── user32-FlashWindowEx │ ├── 0001-user32-Improve-FlashWindowEx-message-and-return-valu.patch │ └── definition ├── windows.networking.connectivity-new-dll │ ├── 0001-include-Add-windows.networking.connectivity.idl.patch │ ├── 0002-include-Add-windows.networking.idl.patch │ ├── 0003-windows.networking.connectivity-Add-stub-dll.patch │ ├── 0004-windows.networking.connectivity-Implement-IActivatio.patch │ ├── 0005-windows.networking.connectivity-Implement-INetworkIn.patch │ ├── 0006-windows.networking.connectivity-Registry-DLL.patch │ ├── 0007-windows.networking.connectivity-Implement-INetworkIn.patch │ ├── 0008-windows.networking.connectivity-IConnectionProfile-G.patch │ └── definition ├── wineboot-ProxySettings │ ├── 0001-wineboot-Initialize-proxy-settings-registry-key.patch │ └── definition ├── winepulse-PulseAudio_Support │ ├── 0001-winepulse.drv-Use-a-separate-mainloop-and-ctx-for-pu.patch │ └── definition ├── winex11-Vulkan_support │ ├── 0001-winex11-Specify-a-default-vulkan-driver-if-one-not-f.patch │ └── definition ├── wininet-Cleanup │ ├── 0001-wininet-tests-Add-more-tests-for-cookies.patch │ ├── 0002-wininet-tests-Test-auth-credential-reusage-with-host.patch │ ├── 0003-wininet-tests-Check-cookie-behaviour-when-overriding.patch │ ├── 0004-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch │ ├── 0005-wininet-Replacing-header-fields-should-fail-if-they-.patch │ └── definition ├── wintrust-WTHelperGetProvCertFromChain │ ├── 0001-wintrust-Add-parameter-check-in-WTHelperGetProvCertF.patch │ └── definition ├── wscript-support-d-u-switches │ ├── 0001-wscript-return-TRUE-for-d-and-u-stub-switches.patch │ └── definition └── xactengine-initial │ ├── 0001-x3daudio1_7-Create-import-library.patch │ └── definition └── upstream ├── 2403.patch └── 3777.patch /.gitignore: -------------------------------------------------------------------------------- 1 | /.vagrant/ 2 | /vagrant_share/ 3 | /builds 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "proton-wine"] 2 | path = proton-wine 3 | url = http://github.com/gloriouseggroll/proton-wine/ 4 | [submodule "wine-staging"] 5 | path = wine-staging 6 | url = https://github.com/wine-staging/wine-staging/ 7 | [submodule "buildbot"] 8 | path = buildbot 9 | url = https://github.com/lutris/buildbot/ 10 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | Lutris Wine GE-Proton8-26 2 | -------------------------------------------------------------------------------- /makebuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # usage: ./makebuild.sh name winerepo branch 4 | # example: ./makebuild.sh lutris-GE https://github.com/GloriousEggroll/proton-wine Proton8-15 5 | # build name output: builds/runners/wine/wine-lutris-GE-Proton8-15-x86_64.tar.xz 6 | 7 | if [[ ! -d builds ]]; then 8 | mkdir -p builds 9 | fi 10 | if [[ -z $(podman container list -a | grep buildbot) ]]; then 11 | docker create --interactive --name buildbot --mount type=bind,source="$PWD"/builds,destination=/builds,readonly=false --mount type=bind,source="$PWD"/buildbot,destination=/home/vagrant/buildbot,readonly=false docker.io/gloriouseggroll/lutris_buildbot:bullseye 12 | fi 13 | 14 | docker start buildbot 15 | 16 | # cleanup any old builds first 17 | docker exec buildbot bash -c "rm -Rf /home/vagrant/buildbot/runners/wine/wine-src/" 18 | 19 | # start build 20 | docker exec buildbot bash -c "cd /home/vagrant/buildbot/runners/wine && ./build.sh --as $1 --version $3 --with $2 --branch $3" 21 | 22 | docker stop buildbot 23 | 24 | cd builds/runners/wine 25 | export SHA512NAME=$(ls | grep tar.xz | sed -r 's/tar.xz/sha512sum/g'); sha512sum $(ls | grep tar.xz) > $SHA512NAME 26 | -------------------------------------------------------------------------------- /patches/.protonprep.sh.kate-swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GloriousEggroll/wine-ge-custom/21f5f463cb761b94bcd00553f924f55516389f5b/patches/.protonprep.sh.kate-swp -------------------------------------------------------------------------------- /patches/LoL/LoL-broken-client-update-fix.patch: -------------------------------------------------------------------------------- 1 | From bd1491a3c81e3cef11160e51d74a49f575ba4b1e Mon Sep 17 00:00:00 2001 2 | From: Matias Zuniga 3 | Date: Sun, 29 Aug 2021 15:58:03 -0400 4 | Subject: [PATCH 1/3] ntdll: resolve drive symlink for mapped filename 5 | 6 | Applications expect a path starting with a drive like 7 | '\Device\Harddisk1\' instead of a drive letter. 8 | 9 | Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51687 10 | Signed-off-by: Matias Zuniga 11 | --- 12 | dlls/ntdll/unix/virtual.c | 89 +++++++++++++++++++++++++++++++---- 13 | dlls/psapi/tests/psapi_main.c | 5 +- 14 | 2 files changed, 82 insertions(+), 12 deletions(-) 15 | 16 | diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c 17 | index b62968cb26d..ff554e274c6 100644 18 | --- a/dlls/ntdll/unix/virtual.c 19 | +++ b/dlls/ntdll/unix/virtual.c 20 | @@ -4993,9 +4993,9 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr, 21 | return STATUS_SUCCESS; 22 | } 23 | 24 | -static NTSTATUS read_nt_symlink( UNICODE_STRING *name, WCHAR *target, DWORD size ) 25 | +static unsigned int read_nt_symlink( UNICODE_STRING *name, UNICODE_STRING *targetW ) 26 | { 27 | - NTSTATUS status; 28 | + unsigned int status; 29 | OBJECT_ATTRIBUTES attr; 30 | HANDLE handle; 31 | 32 | @@ -5008,101 +5008,93 @@ static NTSTATUS read_nt_symlink( UNICODE_STRING *name, WCHAR *target, DWORD size 33 | 34 | if (!(status = NtOpenSymbolicLinkObject( &handle, SYMBOLIC_LINK_QUERY, &attr ))) 35 | { 36 | - UNICODE_STRING targetW; 37 | - targetW.Buffer = target; 38 | - targetW.MaximumLength = (size - 1) * sizeof(WCHAR); 39 | - status = NtQuerySymbolicLinkObject( handle, &targetW, NULL ); 40 | - if (!status) target[targetW.Length / sizeof(WCHAR)] = 0; 41 | + status = NtQuerySymbolicLinkObject( handle, targetW, NULL ); 42 | NtClose( handle ); 43 | } 44 | return status; 45 | } 46 | 47 | -static NTSTATUS resolve_drive_symlink( UNICODE_STRING *name, SIZE_T max_name_len, SIZE_T *ret_len, NTSTATUS status ) 48 | +static unsigned int follow_device_symlink( WCHAR *name_ret, SIZE_T max_ret_len, 49 | + WCHAR *buffer, SIZE_T buffer_len, 50 | + SIZE_T *current_path_len ) 51 | { 52 | - static int enabled = -1; 53 | + unsigned int status = STATUS_SUCCESS; 54 | + SIZE_T devname_len = 6 * sizeof(WCHAR); /* e.g. \??\C: */ 55 | + UNICODE_STRING devname, targetW; 56 | 57 | - static const WCHAR dosprefixW[] = {'\\','?','?','\\'}; 58 | - UNICODE_STRING device_name; 59 | - SIZE_T required_length, symlink_len; 60 | - WCHAR symlink[256]; 61 | - size_t offset = 0; 62 | + if (*current_path_len >= devname_len && buffer[devname_len / sizeof(WCHAR) - 1] == ':') { 63 | + devname.Buffer = buffer; 64 | + devname.Length = devname_len; 65 | 66 | - if (enabled == -1) 67 | - { 68 | - const char *sgi = getenv("SteamGameId"); 69 | + targetW.Buffer = buffer + (*current_path_len / sizeof(WCHAR)); 70 | + targetW.MaximumLength = buffer_len - *current_path_len - sizeof(WCHAR); 71 | + if (!(status = read_nt_symlink( &devname, &targetW ))) 72 | + { 73 | + *current_path_len -= devname_len; /* skip the device name */ 74 | + *current_path_len += targetW.Length; 75 | 76 | - enabled = sgi && !strcmp(sgi, "284160"); 77 | - } 78 | - if (!enabled) return status; 79 | - if (status == STATUS_INFO_LENGTH_MISMATCH) 80 | - { 81 | - /* FIXME */ 82 | - *ret_len += 64; 83 | - return status; 84 | + if (*current_path_len <= max_ret_len) 85 | + { 86 | + memcpy( name_ret, targetW.Buffer, targetW.Length ); /* Copy the drive path */ 87 | + memcpy( name_ret + targetW.Length / sizeof(WCHAR), /* Copy the rest of the path */ 88 | + buffer + devname_len / sizeof(WCHAR), 89 | + *current_path_len - targetW.Length ); 90 | + } 91 | + else status = STATUS_BUFFER_OVERFLOW; 92 | + } 93 | } 94 | - if (status) return status; 95 | - 96 | - if (name->Length < sizeof(dosprefixW) || 97 | - memcmp( name->Buffer, dosprefixW, sizeof(dosprefixW) )) 98 | - return STATUS_SUCCESS; 99 | - 100 | - offset = ARRAY_SIZE(dosprefixW); 101 | - while (offset * sizeof(WCHAR) < name->Length && name->Buffer[ offset ] != '\\') offset++; 102 | - 103 | - device_name = *name; 104 | - device_name.Length = offset * sizeof(WCHAR); 105 | - if ((status = read_nt_symlink( &device_name, symlink, ARRAY_SIZE( symlink )))) 106 | - { 107 | - ERR("read_nt_symlink failed, status %#x.\n", (int)status); 108 | - return status; 109 | + else if (*current_path_len <= max_ret_len) { 110 | + memcpy( name_ret, buffer, *current_path_len ); 111 | } 112 | - symlink_len = wcslen( symlink ); 113 | - required_length = symlink_len * sizeof(WCHAR) + 114 | - name->Length - offset * sizeof(WCHAR) + sizeof(WCHAR); 115 | - if (ret_len) 116 | - *ret_len = sizeof(MEMORY_SECTION_NAME) + required_length; 117 | - if (required_length > max_name_len) 118 | - return STATUS_INFO_LENGTH_MISMATCH; 119 | + else status = STATUS_BUFFER_OVERFLOW; 120 | 121 | - memmove( name->Buffer + symlink_len, name->Buffer + offset, name->Length - offset * sizeof(WCHAR) ); 122 | - memcpy( name->Buffer, symlink, symlink_len * sizeof(WCHAR) ); 123 | - name->MaximumLength = required_length; 124 | - name->Length = required_length - sizeof(WCHAR); 125 | - name->Buffer[name->Length / sizeof(WCHAR)] = 0; 126 | - return STATUS_SUCCESS; 127 | + return status; 128 | } 129 | 130 | static unsigned int get_memory_section_name( HANDLE process, LPCVOID addr, 131 | MEMORY_SECTION_NAME *info, SIZE_T len, SIZE_T *ret_len ) 132 | { 133 | + SIZE_T current_path_len, max_path_len = 0; 134 | + /* buffer to hold the path + 6 chars devname (e.g. \??\C:) */ 135 | + SIZE_T buffer_len = (MAX_PATH + 6) * sizeof(WCHAR); 136 | + WCHAR *buffer = NULL; 137 | unsigned int status; 138 | 139 | if (!info) return STATUS_ACCESS_VIOLATION; 140 | + if (!(buffer = malloc( buffer_len ))) return STATUS_NO_MEMORY; 141 | + if (len > sizeof(*info) + sizeof(WCHAR)) 142 | + { 143 | + max_path_len = len - sizeof(*info) - sizeof(WCHAR); /* dont count null char */ 144 | + } 145 | 146 | SERVER_START_REQ( get_mapping_filename ) 147 | { 148 | req->process = wine_server_obj_handle( process ); 149 | req->addr = wine_server_client_ptr( addr ); 150 | - if (len > sizeof(*info) + sizeof(WCHAR)) 151 | - wine_server_set_reply( req, info + 1, len - sizeof(*info) - sizeof(WCHAR) ); 152 | + wine_server_set_reply( req, buffer, MAX_PATH ); 153 | status = wine_server_call( req ); 154 | - if (!status || status == STATUS_BUFFER_OVERFLOW) 155 | + if (!status) 156 | { 157 | - if (ret_len) *ret_len = sizeof(*info) + reply->len + sizeof(WCHAR); 158 | - if (len < sizeof(*info)) status = STATUS_INFO_LENGTH_MISMATCH; 159 | + current_path_len = reply->len; 160 | + status = follow_device_symlink( (WCHAR *)(info + 1), max_path_len, buffer, buffer_len, ¤t_path_len); 161 | + if (len < sizeof(*info)) 162 | + { 163 | + status = STATUS_INFO_LENGTH_MISMATCH; 164 | + } 165 | + 166 | + if (ret_len) *ret_len = sizeof(*info) + current_path_len + sizeof(WCHAR); 167 | if (!status) 168 | { 169 | info->SectionFileName.Buffer = (WCHAR *)(info + 1); 170 | - info->SectionFileName.Length = reply->len; 171 | - info->SectionFileName.MaximumLength = reply->len + sizeof(WCHAR); 172 | - info->SectionFileName.Buffer[reply->len / sizeof(WCHAR)] = 0; 173 | + info->SectionFileName.Length = current_path_len; 174 | + info->SectionFileName.MaximumLength = current_path_len + sizeof(WCHAR); 175 | + info->SectionFileName.Buffer[current_path_len / sizeof(WCHAR)] = 0; 176 | } 177 | } 178 | } 179 | SERVER_END_REQ; 180 | - 181 | - return resolve_drive_symlink( &info->SectionFileName, len - sizeof(*info), ret_len, status ); 182 | + free(buffer); 183 | + return status; 184 | } 185 | 186 | 187 | diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c 188 | index 860598c39c5..e11eac60d01 100644 189 | --- a/dlls/psapi/tests/psapi_main.c 190 | +++ b/dlls/psapi/tests/psapi_main.c 191 | @@ -824,7 +824,6 @@ static void test_GetMappedFileName(void) 192 | ret = GetMappedFileNameA(GetCurrentProcess(), base, map_name, sizeof(map_name)); 193 | ok(ret, "GetMappedFileName error %ld\n", GetLastError()); 194 | ok(ret > strlen(device_name), "map_name should be longer than device_name\n"); 195 | - todo_wine 196 | ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); 197 | 198 | SetLastError(0xdeadbeef); 199 | @@ -835,7 +834,6 @@ static void test_GetMappedFileName(void) 200 | { 201 | ok(memcmp(map_nameW, nt_map_name, lstrlenW(map_nameW)) == 0, "map name does not start with a device name: %s\n", map_name); 202 | WideCharToMultiByte(CP_ACP, 0, map_nameW, -1, map_name, MAX_PATH, NULL, NULL); 203 | - todo_wine 204 | ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); 205 | } 206 | 207 | @@ -843,7 +841,6 @@ static void test_GetMappedFileName(void) 208 | ret = GetMappedFileNameA(GetCurrentProcess(), base + 0x2000, map_name, sizeof(map_name)); 209 | ok(ret, "GetMappedFileName error %ld\n", GetLastError()); 210 | ok(ret > strlen(device_name), "map_name should be longer than device_name\n"); 211 | - todo_wine 212 | ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); 213 | 214 | SetLastError(0xdeadbeef); 215 | @@ -919,7 +916,7 @@ static void test_GetProcessImageFileName(void) 216 | { 217 | /* Windows returns 2*strlen-1 */ 218 | ok(ret >= strlen(szImgPath), "szImgPath=\"%s\" ret=%ld\n", szImgPath, ret); 219 | - todo_wine ok(!strcmp(szImgPath, szMapPath), "szImgPath=\"%s\" szMapPath=\"%s\"\n", szImgPath, szMapPath); 220 | + ok(!strcmp(szImgPath, szMapPath), "szImgPath=\"%s\" szMapPath=\"%s\"\n", szImgPath, szMapPath); 221 | } 222 | 223 | SetLastError(0xdeadbeef); 224 | -- 225 | 2.39.2 226 | 227 | -------------------------------------------------------------------------------- /patches/LoL/LoL-client-slow-start-fix.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c 2 | index e8a04e2e714..650a5866372 100644 3 | --- a/dlls/ws2_32/socket.c 4 | +++ b/dlls/ws2_32/socket.c 5 | @@ -2768,6 +2768,17 @@ int WINAPI select( int count, fd_set *read_ptr, fd_set *write_ptr, 6 | 7 | TRACE( "read %p, write %p, except %p, timeout %p\n", read_ptr, write_ptr, except_ptr, timeout ); 8 | 9 | + static int is_RCS = -1; 10 | + if (is_RCS < 0) { 11 | + is_RCS = GetModuleHandleA(NULL) == GetModuleHandleA("RiotClientServices.exe"); 12 | + } 13 | + const struct timeval zero_tv = { 0, 1000 }; 14 | + if (is_RCS && read_ptr && write_ptr && except_ptr && timeout && timeout->tv_sec == 1 && timeout->tv_usec == 0) { 15 | + if (read_ptr->fd_count >= 4 && read_ptr->fd_count <= 8 && write_ptr->fd_count == 0 && except_ptr->fd_count == 1) { 16 | + timeout = &zero_tv; 17 | + } 18 | + } 19 | + 20 | if (!(sync_event = get_sync_event())) return -1; 21 | 22 | if (read_ptr) poll_count += read_ptr->fd_count; 23 | -------------------------------------------------------------------------------- /patches/LoL/LoL-ntdll-fix-signal-set-full-context.patch: -------------------------------------------------------------------------------- 1 | From b6302b1fe8b172986baa0a4c66917b2e16f3dcd0 Mon Sep 17 00:00:00 2001 2 | From: "kyechou (moonshadow565)" 3 | Date: Tue, 12 Dec 2023 05:37:06 +0200 4 | Subject: [PATCH] ntdll: Fix signal_set_full_context() 5 | 6 | --- 7 | dlls/ntdll/unix/signal_x86_64.c | 5 +++-- 8 | 1 file changed, 3 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c 11 | index 84b3422d491..5b12e963c1e 100644 12 | --- a/dlls/ntdll/unix/signal_x86_64.c 13 | +++ b/dlls/ntdll/unix/signal_x86_64.c 14 | @@ -952,8 +952,9 @@ NTSTATUS signal_set_full_context( CONTEXT *context ) 15 | { 16 | NTSTATUS status = NtSetContextThread( GetCurrentThread(), context ); 17 | 18 | - if (!status && (context->ContextFlags & CONTEXT_INTEGER) == CONTEXT_INTEGER) 19 | - amd64_thread_data()->syscall_frame->restore_flags |= CONTEXT_INTEGER; 20 | + unsigned int real_mask = CONTEXT_INTEGER & ~CONTEXT_AMD64; 21 | + if (!status && (context->ContextFlags & real_mask) == real_mask) 22 | + amd64_thread_data()->syscall_frame->restore_flags |= real_mask; 23 | return status; 24 | } 25 | 26 | -- 27 | GitLab 28 | 29 | -------------------------------------------------------------------------------- /patches/LoL/LoL-ntdll-nopguard-call_vectored_handlers.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c 2 | index fc3e8982a98..a975e5c897a 100644 3 | --- a/dlls/ntdll/exception.c 4 | +++ b/dlls/ntdll/exception.c 5 | @@ -168,7 +168,9 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ) 6 | 7 | TRACE( "calling handler at %p code=%lx flags=%lx\n", 8 | func, rec->ExceptionCode, rec->ExceptionFlags ); 9 | + __asm__ __volatile__(".rept 16 ; nop ; .endr"); 10 | ret = func( &except_ptrs ); 11 | + __asm__ __volatile__(".rept 16 ; nop ; .endr"); 12 | TRACE( "handler at %p returned %lx\n", func, ret ); 13 | 14 | RtlEnterCriticalSection( &vectored_handlers_section ); 15 | -------------------------------------------------------------------------------- /patches/game-patches/assettocorsa-hud.patch: -------------------------------------------------------------------------------- 1 | From 0b242db6d63ec466c09d47020596ba941ce7cdf2 Mon Sep 17 00:00:00 2001 2 | From: GloriousEggroll 3 | Date: Sat, 16 May 2020 20:05:38 -0600 4 | Subject: [PATCH] Revert "dwrite: Release file streams when building 5 | collections." 6 | 7 | This reverts commit d19e34d8f072514cb903bda89767996ba078bae4. 8 | --- 9 | dlls/dwrite/font.c | 2 -- 10 | 1 file changed, 2 deletions(-) 11 | 12 | diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c 13 | index e1593f7729..2a69c2a436 100644 14 | --- a/dlls/dwrite/font.c 15 | +++ b/dlls/dwrite/font.c 16 | @@ -4348,7 +4348,11 @@ HRESULT create_font_collection(IDWriteFactory7 *factory, IDWriteFontFileEnumerat 17 | break; 18 | } 19 | 20 | - IDWriteFontFileStream_Release(stream); 21 | + const char *sgi = getenv("SteamGameId"); 22 | + 23 | + if ((!sgi) | (sgi && strcmp(sgi, "244210"))) { 24 | + IDWriteFontFileStream_Release(stream); 25 | + } 26 | } 27 | 28 | LIST_FOR_EACH_ENTRY_SAFE(fileenum, fileenum2, &scannedfiles, struct fontfile_enum, entry) { 29 | -- 30 | 2.26.2 31 | 32 | -------------------------------------------------------------------------------- /patches/game-patches/ffxiv_hydaelyn_intro_playback_fix.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c 2 | index eff8c414ea8..ae54e7336e0 100644 3 | --- a/dlls/winegstreamer/wma_decoder.c 4 | +++ b/dlls/winegstreamer/wma_decoder.c 5 | @@ -1030,13 +1030,6 @@ HRESULT wma_decoder_create(IUnknown *outer, IUnknown **out) 6 | 7 | TRACE("outer %p, out %p.\n", outer, out); 8 | 9 | - if (!(transform = wg_transform_create(&input_format, &output_format, &attrs))) 10 | - { 11 | - ERR_(winediag)("GStreamer doesn't support WMA decoding, please install appropriate plugins\n"); 12 | - return E_FAIL; 13 | - } 14 | - wg_transform_destroy(transform); 15 | - 16 | if (!(decoder = calloc(1, sizeof(*decoder)))) 17 | return E_OUTOFMEMORY; 18 | 19 | -------------------------------------------------------------------------------- /patches/game-patches/killer-instinct-winevulkan_fix.patch: -------------------------------------------------------------------------------- 1 | From 252d6abc7b52a5f506c7fc621c4469d7fd0252f7 Mon Sep 17 00:00:00 2001 2 | From: Paul Gofman 3 | Date: Fri, 23 Oct 2020 17:11:18 +0300 4 | Subject: [PATCH] winevulkan: HACK: Set default mxcsr for 5 | vkEnumeratePhysicalDevices() call. 6 | 7 | Workaround Killer Instinct crash on start with AMD GPU. 8 | --- 9 | dlls/winevulkan/vulkan.c | 6 ++++++ 10 | 1 file changed, 6 insertions(+) 11 | 12 | diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c 13 | index 6e2a5b01359..ca080798f64 100644 14 | --- a/dlls/winevulkan/vulkan.c 15 | +++ b/dlls/winevulkan/vulkan.c 16 | @@ -1042,6 +1042,7 @@ VkResult wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, 17 | VkInstance client_instance = client_ptr; 18 | VkInstanceCreateInfo create_info_host; 19 | const VkApplicationInfo *app_info; 20 | + uint32_t new_mxcsr, old_mxcsr; 21 | struct conversion_context ctx; 22 | struct wine_instance *object; 23 | VkResult res; 24 | @@ -694,7 +695,12 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, 25 | * the native physical devices and present those to the application. 26 | * Cleanup happens as part of wine_vkDestroyInstance. 27 | */ 28 | + __asm__ volatile("stmxcsr %0" : "=m"(old_mxcsr)); 29 | + new_mxcsr = 0x1f80; 30 | + __asm__ volatile("ldmxcsr %0" : : "m"(new_mxcsr)); 31 | res = wine_vk_instance_load_physical_devices(object); 32 | + __asm__ volatile("ldmxcsr %0" : : "m"(old_mxcsr)); 33 | + TRACE("old_mxcsr %#x.\n", old_mxcsr); 34 | if (res != VK_SUCCESS) 35 | { 36 | ERR("Failed to load physical devices, res=%d\n", res); 37 | -- 38 | 2.26.2 39 | 40 | -------------------------------------------------------------------------------- /patches/game-patches/pso2_hack.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c 2 | index 850c70a6b2b..8882ed7aaff 100644 3 | --- a/dlls/ntdll/unix/file.c 4 | +++ b/dlls/ntdll/unix/file.c 5 | @@ -3188,6 +3350,18 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer 6 | if (is_unix && (disposition == FILE_OPEN || disposition == FILE_OVERWRITE)) 7 | return STATUS_OBJECT_NAME_NOT_FOUND; 8 | 9 | + 10 | + static char *skip_search = NULL; 11 | + if (skip_search == NULL) 12 | + { 13 | + const char *env_var; 14 | + 15 | + skip_search = getenv("WINE_NO_OPEN_FILE_SEARCH"); 16 | + WARN("Disabling case insensitive search for opening files"); 17 | + } 18 | + if (skip_search && strcasestr(unix_name, skip_search) && disposition == FILE_OPEN) 19 | + return STATUS_OBJECT_NAME_NOT_FOUND; 20 | + 21 | /* now do it component by component */ 22 | 23 | while (name_len) 24 | -------------------------------------------------------------------------------- /patches/game-patches/star-citizen-eac.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dlls/ws2_32/protocol.c b/dlls/ws2_32/protocol.c 2 | index 84047e1f28c..e243cad3d91 100644 3 | --- a/dlls/ws2_32/protocol.c 4 | +++ b/dlls/ws2_32/protocol.c 5 | @@ -188,6 +188,19 @@ int WINAPI getaddrinfo( const char *node, const char *service, 6 | 7 | if (node) 8 | { 9 | + char sgi[64]; 10 | + /* default -- if star citizen and url is modules-cdn.eac-prod.on.epicgames.com, block */ 11 | + if (GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) && !strcmp(sgi, "starcitizen")) 12 | + { 13 | + TRACE( "node %s, matched sgi %s\n", debugstr_a(node), debugstr_a(sgi) ); 14 | + if (!strcmp(node, "modules-cdn.eac-prod.on.epicgames.com")) 15 | + { 16 | + SetLastError(WSAHOST_NOT_FOUND); 17 | + return WSAHOST_NOT_FOUND; 18 | + } 19 | + } 20 | + TRACE( "node %s, unmatched sgi %s\n", debugstr_a(node), debugstr_a(sgi) ); 21 | + 22 | if (eac_download_hack() && !strcmp(node, "download-alt.easyanticheat.net")) 23 | { 24 | SetLastError(WSAHOST_NOT_FOUND); 25 | @@ -950,6 +963,19 @@ struct hostent * WINAPI gethostbyname( const char *name ) 26 | SetLastError( WSANOTINITIALISED ); 27 | return NULL; 28 | } 29 | + 30 | + char sgi[64]; 31 | + /* default -- if star citizen and url is modules-cdn.eac-prod.on.epicgames.com, block */ 32 | + if (GetEnvironmentVariableA("SteamGameId", sgi, sizeof(sgi)) && !strcmp(sgi, "starcitizen")) 33 | + { 34 | + TRACE( "name %s, matched sgi %s\n", debugstr_a(name), debugstr_a(sgi) ); 35 | + if (name && !strcmp(name, "modules-cdn.eac-prod.on.epicgames.com")) 36 | + { 37 | + SetLastError( WSAHOST_NOT_FOUND ); 38 | + return NULL; 39 | + } 40 | + } 41 | + TRACE( "name %s, unmatched sgi %s\n", debugstr_a(name), debugstr_a(sgi) ); 42 | 43 | if (eac_download_hack() && name && !strcmp(name, "download-alt.easyanticheat.net")) 44 | { 45 | 46 | -------------------------------------------------------------------------------- /patches/game-patches/uplay-fsync-proton-wine-hotfix.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c 2 | index e0e5006f498..a3e885aef7c 100644 3 | --- a/dlls/ntdll/unix/loader.c 4 | +++ b/dlls/ntdll/unix/loader.c 5 | @@ -2287,6 +2287,7 @@ BOOL simulate_writecopy; 6 | static void hacks_init(void) 7 | { 8 | static const char upc_exe[] = "Ubisoft Game Launcher\\upc.exe"; 9 | + static const char upc2_exe[] = "upc.exe"; 10 | const char *env_str, *sgi; 11 | 12 | 13 | @@ -2305,6 +2306,7 @@ static void hacks_init(void) 14 | else if (main_argc > 1) 15 | { 16 | fsync_simulate_sched_quantum = !!strstr(main_argv[1], upc_exe); 17 | + fsync_simulate_sched_quantum = !!strstr(main_argv[1], upc2_exe); 18 | fsync_simulate_sched_quantum = fsync_simulate_sched_quantum || !!strstr(main_argv[1], "PlanetZoo.exe"); 19 | fsync_simulate_sched_quantum = fsync_simulate_sched_quantum || !!strstr(main_argv[1], "GTA5.exe"); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /patches/proton/49-fsr-width-using-height-and-aspect-ratio.patch: -------------------------------------------------------------------------------- 1 | From bfa433091a379c35a6627bf72b8adb5a6a294f91 Mon Sep 17 00:00:00 2001 2 | From: Ph42oN 3 | Date: Mon, 25 Sep 2023 11:53:22 +0300 4 | Subject: [PATCH] calculate width using height and aspect ratio 5 | 6 | --- 7 | dlls/winex11.drv/fs.c | 3 ++- 8 | 1 file changed, 2 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/dlls/winex11.drv/fs.c b/dlls/winex11.drv/fs.c 11 | index f2162d2..e67734c 100644 12 | --- a/dlls/winex11.drv/fs.c 13 | +++ b/dlls/winex11.drv/fs.c 14 | @@ -360,8 +360,9 @@ static void monitor_get_modes( struct fs_monitor *monitor, DEVMODEW **modes, UIN 15 | { 16 | for (i = 0; i < ARRAY_SIZE(fs_monitor_sizes_fsr); ++i) 17 | { 18 | - fs_monitor_sizes_fsr[i].size.cx = (DWORD)(mode_host.dmPelsWidth / fsr_ratios[i] + 0.5f); 19 | fs_monitor_sizes_fsr[i].size.cy = (DWORD)(mode_host.dmPelsHeight / fsr_ratios[i] + 0.5f); 20 | + fs_monitor_sizes_fsr[i].size.cx = (DWORD)(fs_monitor_sizes_fsr[i].size.cy 21 | + * ((float)mode_host.dmPelsWidth / (float)mode_host.dmPelsHeight) + 0.5f); 22 | 23 | TRACE("created fsr resolution: %dx%d, ratio: %1.1f\n", 24 | fs_monitor_sizes_fsr[i].size.cx, 25 | -- 26 | 2.41.0 27 | 28 | -------------------------------------------------------------------------------- /patches/proton/71-invert-fsr-logic.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dlls/winex11.drv/fs.c b/dlls/winex11.drv/fs.c 2 | index d689bddb327..2be7bac053c 100644 3 | --- a/dlls/winex11.drv/fs.c 4 | +++ b/dlls/winex11.drv/fs.c 5 | @@ -769,12 +769,12 @@ BOOL fs_hack_is_integer(void) 6 | 7 | BOOL fs_hack_is_fsr(float *sharpness) 8 | { 9 | - static int is_fsr = -1; 10 | + static int is_fsr = 1; 11 | int sharpness_int = 2; 12 | - if (is_fsr < 0) 13 | + const char *e = getenv("WINE_FULLSCREEN_FSR"); 14 | + if (e && !strcmp(e, "0")) 15 | { 16 | - const char *e = getenv("WINE_FULLSCREEN_FSR"); 17 | - is_fsr = e && strcmp(e, "0"); 18 | + is_fsr = 0; 19 | } 20 | if (sharpness) 21 | { 22 | -------------------------------------------------------------------------------- /patches/proton/fix-non-steam-controller-input.patch: -------------------------------------------------------------------------------- 1 | diff --git a/loader/wine.inf.in b/loader/wine.inf.in 2 | index 138ad2a90ad..2151487cfe8 100644 3 | --- a/loader/wine.inf.in 4 | +++ b/loader/wine.inf.in 5 | @@ -100,6 +100,7 @@ AddReg=\ 6 | VersionInfo,\ 7 | LicenseInformation, \ 8 | NVIDIANGX, \ 9 | + WineGEOverrides, \ 10 | ProtonOverrides 11 | 12 | [DefaultInstall.ntamd64] 13 | @@ -129,6 +130,7 @@ AddReg=\ 14 | VersionInfo.ntamd64,\ 15 | LicenseInformation, \ 16 | NVIDIANGX, \ 17 | + WineGEOverrides, \ 18 | ProtonOverrides 19 | 20 | [DefaultInstall.ntarm64] 21 | @@ -174,6 +176,7 @@ AddReg=\ 22 | VersionInfo.ntamd64,\ 23 | LicenseInformation, \ 24 | NVIDIANGX, \ 25 | + WineGEOverrides, \ 26 | ProtonOverrides 27 | 28 | [Wow64Install.ntarm64] 29 | @@ -3014,6 +3017,10 @@ SortFiles = 10,globalization\sorting 30 | [NVIDIANGX] 31 | HKLM,Software\NVIDIA Corporation\Global\NGXCore,"FullPath",,"C:\Windows\System32" 32 | 33 | +[WineGEOverrides] 34 | +HKLM,System\CurrentControlSet\Services\winebus,"DisableHidraw",0x10001,"1" 35 | +HKLM,System\CurrentControlSet\Services\winebus,"Enable SDL",0x10001,"1" 36 | + 37 | [ProtonOverrides] 38 | HKLM,Software\Khronos\OpenXR\1,"ActiveRuntime",,"C:\openxr\wineopenxr64.json" 39 | ;;Likely want *80 and *90 too, but those require removing Wine's manifest files. 40 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/pending/4428.patch: -------------------------------------------------------------------------------- 1 | From ed32c881e266b116e394f0343fc976ab0b6d2962 Mon Sep 17 00:00:00 2001 2 | From: Etaash Mathamsetty 3 | Date: Fri, 17 Nov 2023 17:48:10 -0500 4 | Subject: [PATCH] cfgmgr32: Add CM_Register_Notification stub. 5 | 6 | --- 7 | dlls/cfgmgr32/cfgmgr32.spec | 1 + 8 | dlls/cfgmgr32/main.c | 8 +++++ 9 | include/cfgmgr32.h | 72 +++++++++++++++++++++++++++++++++++++ 10 | 3 files changed, 81 insertions(+) 11 | 12 | diff --git a/dlls/cfgmgr32/cfgmgr32.spec b/dlls/cfgmgr32/cfgmgr32.spec 13 | index 5c9b8f613db..e4cd845e2a4 100644 14 | --- a/dlls/cfgmgr32/cfgmgr32.spec 15 | +++ b/dlls/cfgmgr32/cfgmgr32.spec 16 | @@ -154,6 +154,7 @@ 17 | @ stub CM_Register_Device_InterfaceW 18 | @ stub CM_Register_Device_Interface_ExA 19 | @ stub CM_Register_Device_Interface_ExW 20 | +@ stdcall CM_Register_Notification(ptr ptr ptr ptr) 21 | @ stub CM_Remove_SubTree 22 | @ stub CM_Remove_SubTree_Ex 23 | @ stub CM_Remove_Unmarked_Children 24 | diff --git a/dlls/cfgmgr32/main.c b/dlls/cfgmgr32/main.c 25 | index fee3c42a5c4..d15354367f8 100644 26 | --- a/dlls/cfgmgr32/main.c 27 | +++ b/dlls/cfgmgr32/main.c 28 | @@ -21,6 +21,14 @@ 29 | 30 | WINE_DEFAULT_DEBUG_CHANNEL(setupapi); 31 | 32 | +CONFIGRET WINAPI CM_Register_Notification( CM_NOTIFY_FILTER *filter, void *context, 33 | + PCM_NOTIFY_CALLBACK callback, HCMNOTIFICATION *notify_context ) 34 | +{ 35 | + FIXME("%p %p %p %p stub!\n", filter, context, callback, notify_context); 36 | + 37 | + return CR_CALL_NOT_IMPLEMENTED; 38 | +} 39 | + 40 | /*********************************************************************** 41 | * CM_MapCrToWin32Err (cfgmgr32.@) 42 | */ 43 | diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h 44 | index 04f1f80b174..e07ca4edd6f 100644 45 | --- a/include/cfgmgr32.h 46 | +++ b/include/cfgmgr32.h 47 | @@ -187,6 +187,7 @@ typedef DWORD CONFIGRET; 48 | typedef DWORD DEVINST, *PDEVINST; 49 | typedef DWORD DEVNODE, *PDEVNODE; 50 | typedef HANDLE HMACHINE, *PHMACHINE; 51 | +typedef HANDLE HCMNOTIFICATION, *PHCMNOTIFICATION; 52 | typedef CHAR *DEVNODEID_A, *DEVINSTID_A; 53 | typedef WCHAR *DEVNODEID_W, *DEVINSTID_W; 54 | typedef ULONG REGDISPOSITION; 55 | @@ -208,6 +209,77 @@ typedef enum _PNP_VETO_TYPE 56 | PNP_VetoInsufficientRights 57 | } PNP_VETO_TYPE, *PPNP_VETO_TYPE; 58 | 59 | +typedef enum _CM_NOTIFY_FILTER_TYPE 60 | +{ 61 | + CM_NOTIFY_FILTER_TYPE_DEVICEINTERFACE = 0, 62 | + CM_NOTIFY_FILTER_TYPE_DEVICEHANDLE, 63 | + CM_NOTIFY_FILTER_TYPE_DEVICEINSTANCE, 64 | + CM_NOTIFY_FILTER_TYPE_MAX 65 | +} CM_NOTIFY_FILTER_TYPE, *PCM_NOTIFY_FILTER_TYPE; 66 | + 67 | +typedef enum _CM_NOTIFY_ACTION 68 | +{ 69 | + CM_NOTIFY_ACTION_DEVICEINTERFACEARRIVAL = 0, 70 | + CM_NOTIFY_ACTION_DEVICEINTERFACEREMOVAL, 71 | + CM_NOTIFY_ACTION_DEVICEQUERYREMOVE, 72 | + CM_NOTIFY_ACTION_DEVICEQUERYREMOVEFAILED, 73 | + CM_NOTIFY_ACTION_DEVICEREMOVEPENDING, 74 | + CM_NOTIFY_ACTION_DEVICEREMOVECOMPLETE, 75 | + CM_NOTIFY_ACTION_DEVICECUSTOMEVENT, 76 | + CM_NOTIFY_ACTION_DEVICEINSTANCEENUMERATED, 77 | + CM_NOTIFY_ACTION_DEVICEINSTANCESTARTED, 78 | + CM_NOTIFY_ACTION_DEVICEINSTANCEREMOVED, 79 | + CM_NOTIFY_ACTION_MAX 80 | +} CM_NOTIFY_ACTION, *PCM_NOTIFY_ACTION; 81 | + 82 | +typedef struct _CM_NOTIFY_FILTER 83 | +{ 84 | + DWORD cbSize; 85 | + DWORD Flags; 86 | + CM_NOTIFY_FILTER_TYPE FilterType; 87 | + DWORD Reserved; 88 | + union { 89 | + struct { 90 | + GUID ClassGuid; 91 | + } DeviceInterface; 92 | + struct { 93 | + HANDLE hTarget; 94 | + } DeviceHandle; 95 | + struct { 96 | + WCHAR InstanceId[MAX_DEVICE_ID_LEN]; 97 | + } DeviceInstance; 98 | + } u; 99 | +} CM_NOTIFY_FILTER, *PCM_NOTIFY_FILTER; 100 | + 101 | +typedef struct _CM_NOTIFY_EVENT_DATA 102 | +{ 103 | + CM_NOTIFY_FILTER_TYPE FilterType; 104 | + DWORD Reserved; 105 | + union { 106 | + struct { 107 | + GUID ClassGuid; 108 | + WCHAR SymbolicLink[ANYSIZE_ARRAY]; 109 | + } DeviceInterface; 110 | + struct { 111 | + GUID EventGuid; 112 | + LONG NameOffset; 113 | + DWORD DataSize; 114 | + BYTE Data[ANYSIZE_ARRAY]; 115 | + } DeviceHandle; 116 | + struct { 117 | + WCHAR InstanceId[ANYSIZE_ARRAY]; 118 | + } DeviceInstance; 119 | + } u; 120 | +} CM_NOTIFY_EVENT_DATA, *PCM_NOTIFY_EVENT_DATA; 121 | + 122 | +typedef DWORD (WINAPI *PCM_NOTIFY_CALLBACK)( 123 | + HCMNOTIFICATION Notify, 124 | + void *Context, 125 | + CM_NOTIFY_ACTION Action, 126 | + CM_NOTIFY_EVENT_DATA *EventData, 127 | + DWORD EventDataSize 128 | +); 129 | + 130 | DECL_WINELIB_CFGMGR32_TYPE_AW(DEVNODEID) 131 | DECL_WINELIB_CFGMGR32_TYPE_AW(DEVINSTID) 132 | 133 | -- 134 | GitLab 135 | 136 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/pending/hotfix-guild_wars_2.patch: -------------------------------------------------------------------------------- 1 | From 7bc7829db283134946d1c7ae0468ddc1bbf993a0 Mon Sep 17 00:00:00 2001 2 | From: deltaconnected 3 | Date: Thu, 26 Aug 2021 03:06:23 +0200 4 | Subject: [PATCH] ntdll: Use a critical section for setting the newly created timer in RtlCreateTimer 5 | 6 | In RtlCreateTimer, NewTimer is being set after RtlLeaveCriticalSection, which 7 | seems to allow callbacks created with DueTime == 0 to execute and finish and 8 | delete an invalid timer before the scheduling thread is switched back. 9 | 10 | Fixes crashes inside DeleteTimerQueueEx and DeleteTimerQueueTimer for 11 | Guild Wars 2 with Arcdps (https://www.deltaconnected.com/arcdps/) 12 | 13 | Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51683 14 | --- 15 | dlls/ntdll/threadpool.c | 7 ++++--- 16 | 1 file changed, 4 insertions(+), 3 deletions(-) 17 | 18 | diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c 19 | index ca323919d05..20096573c2b 100644 20 | --- a/dlls/ntdll/threadpool.c 21 | +++ b/dlls/ntdll/threadpool.c 22 | @@ -936,12 +936,13 @@ NTSTATUS WINAPI RtlCreateTimer(PHANDLE NewTimer, HANDLE TimerQueue, 23 | if (q->quit) 24 | status = STATUS_INVALID_HANDLE; 25 | else 26 | + { 27 | + *NewTimer = t; 28 | queue_add_timer(t, queue_current_time() + DueTime, TRUE); 29 | + } 30 | RtlLeaveCriticalSection(&q->cs); 31 | 32 | - if (status == STATUS_SUCCESS) 33 | - *NewTimer = t; 34 | - else 35 | + if (status != STATUS_SUCCESS) 36 | RtlFreeHeap(GetProcessHeap(), 0, t); 37 | 38 | return status; 39 | -- 40 | 2.33.0 41 | 42 | 43 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/pending/ntdll_add_wine_disable_sfn.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c 2 | index 870c5e39271..3162d36a803 100644 3 | --- a/dlls/ntdll/unix/file.c 4 | +++ b/dlls/ntdll/unix/file.c 5 | @@ -1511,16 +1511,20 @@ static BOOL append_entry( struct dir_data *data, const char *long_name, 6 | if (long_len == ARRAY_SIZE(long_nameW)) return TRUE; 7 | long_nameW[long_len] = 0; 8 | 9 | - if (short_name) 10 | - { 11 | - short_len = ntdll_umbstowcs( short_name, strlen(short_name), 12 | - short_nameW, ARRAY_SIZE( short_nameW ) - 1 ); 13 | - } 14 | - else /* generate a short name if necessary */ 15 | + short_len = 0; 16 | + 17 | + if (!disable_sfn) 18 | { 19 | - short_len = 0; 20 | - if (!is_legal_8dot3_name( long_nameW, long_len )) 21 | - short_len = hash_short_file_name( long_nameW, long_len, short_nameW ); 22 | + if (short_name) 23 | + { 24 | + short_len = ntdll_umbstowcs( short_name, strlen(short_name), 25 | + short_nameW, ARRAY_SIZE( short_nameW ) - 1 ); 26 | + } 27 | + else /* generate a short name if necessary */ 28 | + { 29 | + if (!is_legal_8dot3_name( long_nameW, long_len )) 30 | + short_len = hash_short_file_name( long_nameW, long_len, short_nameW ); 31 | + } 32 | } 33 | short_nameW[short_len] = 0; 34 | wcsupr( short_nameW ); 35 | diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c 36 | index 5f7f114b286..cbea0dc5d2d 100644 37 | --- a/dlls/ntdll/unix/loader.c 38 | +++ b/dlls/ntdll/unix/loader.c 39 | @@ -2152,6 +2152,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = 40 | debugstr_pc, 41 | }; 42 | 43 | +BOOL disable_sfn; 44 | BOOL ac_odyssey; 45 | BOOL fsync_simulate_sched_quantum; 46 | BOOL alert_simulate_sched_quantum; 47 | @@ -2175,6 +2176,12 @@ static void hacks_init(void) 48 | ERR( "HACK: ram_reporting_bias %lldMB.\n", ram_reporting_bias / (1024 * 1024) ); 49 | } 50 | 51 | + env_str = getenv("WINE_DISABLE_SFN"); 52 | + if (env_str) 53 | + disable_sfn = !!atoi(env_str); 54 | + else if (main_argc > 1 && (strstr(main_argv[1], "Yakuza5.exe") )) 55 | + disable_sfn = TRUE; 56 | + 57 | env_str = getenv("WINE_SIMULATE_ASYNC_READ"); 58 | if (env_str) 59 | ac_odyssey = !!atoi(env_str); 60 | diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h 61 | index cae15947bbd..6403dad858d 100644 62 | --- a/dlls/ntdll/unix/unix_private.h 63 | +++ b/dlls/ntdll/unix/unix_private.h 64 | @@ -152,6 +152,7 @@ extern BOOL is_wow64 DECLSPEC_HIDDEN; 65 | extern struct ldt_copy __wine_ldt_copy DECLSPEC_HIDDEN; 66 | #endif 67 | 68 | +extern BOOL disable_sfn DECLSPEC_HIDDEN; 69 | extern BOOL ac_odyssey DECLSPEC_HIDDEN; 70 | extern BOOL fsync_simulate_sched_quantum DECLSPEC_HIDDEN; 71 | extern BOOL alert_simulate_sched_quantum DECLSPEC_HIDDEN; 72 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/pending/unity_crash_hotfix.patch: -------------------------------------------------------------------------------- 1 | --- a/dlls/dxgi/dxgi_main.c 2 | +++ a/dlls/dxgi/dxgi_main.c 3 | @@ -268,8 +268,6 @@ HRESULT WINAPI DXGID3D10RegisterLayers(const struct dxgi_device_layer *layers, UINT layer_count) 4 | 5 | HRESULT WINAPI DXGIGetDebugInterface1(UINT flags, REFIID iid, void **debug) 6 | { 7 | - TRACE("flags %#x, iid %s, debug %p.\n", flags, debugstr_guid(iid), debug); 8 | - 9 | WARN("Returning DXGI_ERROR_SDK_COMPONENT_MISSING.\n"); 10 | return DXGI_ERROR_SDK_COMPONENT_MISSING; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/cryptext-CryptExtOpenCER/0001-cryptext-Implement-CryptExtOpenCER.patch: -------------------------------------------------------------------------------- 1 | From a5045503cf3310058cc64814ff9626f4877a13bb Mon Sep 17 00:00:00 2001 2 | From: Dmitry Timoshkov 3 | Date: Fri, 5 Jul 2019 13:20:23 +0800 4 | Subject: [PATCH] cryptext: Implement CryptExtOpenCER. 5 | 6 | Signed-off-by: Dmitry Timoshkov 7 | --- 8 | configure | 1 + 9 | configure.ac | 1 + 10 | dlls/cryptext/Makefile.in | 3 +- 11 | dlls/cryptext/cryptext.spec | 4 +-- 12 | dlls/cryptext/cryptext_main.c | 64 +++++++++++++++++++++++++++++++++ 13 | dlls/cryptext/tests/Makefile.in | 4 +++ 14 | dlls/cryptext/tests/cryptext.c | 61 +++++++++++++++++++++++++++++++ 15 | 7 files changed, 135 insertions(+), 3 deletions(-) 16 | create mode 100644 dlls/cryptext/tests/Makefile.in 17 | create mode 100644 dlls/cryptext/tests/cryptext.c 18 | 19 | diff --git a/configure b/configure 20 | index db592f0868d..ba13abacc46 100755 21 | --- a/configure 22 | +++ b/configure 23 | @@ -20291,6 +20291,7 @@ wine_fn_config_makefile dlls/crypt32/tests enable_tests 24 | wine_fn_config_makefile dlls/cryptdlg enable_cryptdlg 25 | wine_fn_config_makefile dlls/cryptdll enable_cryptdll 26 | wine_fn_config_makefile dlls/cryptext enable_cryptext 27 | +wine_fn_config_makefile dlls/cryptext/tests enable_tests 28 | wine_fn_config_makefile dlls/cryptnet enable_cryptnet 29 | wine_fn_config_makefile dlls/cryptnet/tests enable_tests 30 | wine_fn_config_makefile dlls/cryptsp enable_cryptsp 31 | diff --git a/configure.ac b/configure.ac 32 | index d449b88fb19..af75e0e80ab 100644 33 | --- a/configure.ac 34 | +++ b/configure.ac 35 | @@ -3029,6 +3029,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests) 36 | WINE_CONFIG_MAKEFILE(dlls/cryptdlg) 37 | WINE_CONFIG_MAKEFILE(dlls/cryptdll) 38 | WINE_CONFIG_MAKEFILE(dlls/cryptext) 39 | +WINE_CONFIG_MAKEFILE(dlls/cryptext/tests) 40 | WINE_CONFIG_MAKEFILE(dlls/cryptnet) 41 | WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests) 42 | WINE_CONFIG_MAKEFILE(dlls/cryptowinrt) 43 | diff --git a/dlls/cryptext/Makefile.in b/dlls/cryptext/Makefile.in 44 | index 0ec2b8a2045..76accca43eb 100644 45 | --- a/dlls/cryptext/Makefile.in 46 | +++ b/dlls/cryptext/Makefile.in 47 | @@ -1,4 +1,5 @@ 48 | -MODULE = cryptext.dll 49 | +MODULE = cryptext.dll 50 | +IMPORTS = crypt32 cryptui user32 51 | 52 | EXTRADLLFLAGS = -Wb,--prefer-native 53 | 54 | diff --git a/dlls/cryptext/cryptext.spec b/dlls/cryptext/cryptext.spec 55 | index ee3e155f457..24b4794c198 100644 56 | --- a/dlls/cryptext/cryptext.spec 57 | +++ b/dlls/cryptext/cryptext.spec 58 | @@ -12,8 +12,8 @@ 59 | @ stub CryptExtAddSPCW 60 | @ stub CryptExtOpenCAT 61 | @ stub CryptExtOpenCATW 62 | -@ stub CryptExtOpenCER 63 | -@ stub CryptExtOpenCERW 64 | +@ stdcall CryptExtOpenCER(long ptr str long) 65 | +@ stdcall CryptExtOpenCERW(long ptr wstr long) 66 | @ stub CryptExtOpenCRL 67 | @ stub CryptExtOpenCRLW 68 | @ stub CryptExtOpenCTL 69 | diff --git a/dlls/cryptext/cryptext_main.c b/dlls/cryptext/cryptext_main.c 70 | index 537ba66cd3b..f9e34d1f8c5 100644 71 | --- a/dlls/cryptext/cryptext_main.c 72 | +++ b/dlls/cryptext/cryptext_main.c 73 | @@ -22,10 +22,29 @@ 74 | 75 | #include "windef.h" 76 | #include "winbase.h" 77 | +#include "winnls.h" 78 | +#include "wincrypt.h" 79 | +#include "winuser.h" 80 | +#include "cryptuiapi.h" 81 | + 82 | +#include "wine/heap.h" 83 | #include "wine/debug.h" 84 | 85 | WINE_DEFAULT_DEBUG_CHANNEL(cryptext); 86 | 87 | +static WCHAR *heap_strdupAtoW(const char *str) 88 | +{ 89 | + WCHAR *ret; 90 | + INT len; 91 | + 92 | + if (!str) return NULL; 93 | + len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); 94 | + ret = heap_alloc(len * sizeof(WCHAR)); 95 | + if (ret) 96 | + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); 97 | + return ret; 98 | +} 99 | + 100 | /*********************************************************************** 101 | * CryptExtAddPFX (CRYPTEXT.@) 102 | */ 103 | @@ -43,3 +62,48 @@ HRESULT WINAPI CryptExtAddPFXW(LPCWSTR filename) 104 | FIXME("stub: %s\n", debugstr_w(filename)); 105 | return E_NOTIMPL; 106 | } 107 | + 108 | +/*********************************************************************** 109 | + * CryptExtOpenCERW (CRYPTEXT.@) 110 | + */ 111 | +HRESULT WINAPI CryptExtOpenCERW(HWND hwnd, HINSTANCE hinst, LPCWSTR filename, DWORD showcmd) 112 | +{ 113 | + PCCERT_CONTEXT ctx; 114 | + CRYPTUI_VIEWCERTIFICATE_STRUCTW info; 115 | + 116 | + TRACE("(%p, %p, %s, %u)\n", hwnd, hinst, debugstr_w(filename), showcmd); 117 | + 118 | + if (!CryptQueryObject(CERT_QUERY_OBJECT_FILE, filename, CERT_QUERY_CONTENT_FLAG_CERT, 119 | + CERT_QUERY_FORMAT_FLAG_ALL, 0, NULL, NULL, NULL, NULL, NULL, 120 | + (const void **)&ctx)) 121 | + { 122 | + /* FIXME: move to the resources */ 123 | + static const WCHAR msg[] = {'T','h','i','s',' ','i','s',' ','n','o','t',' ','a',' ','v','a','l','i','d',' ','c','e','r','t','i','f','i','c','a','t','e',0}; 124 | + MessageBoxW(NULL, msg, filename, MB_OK | MB_ICONERROR); 125 | + return S_OK; /* according to the tests */ 126 | + } 127 | + 128 | + memset(&info, 0, sizeof(info)); 129 | + info.dwSize = sizeof(info); 130 | + info.pCertContext = ctx; 131 | + CryptUIDlgViewCertificateW(&info, NULL); 132 | + CertFreeCertificateContext(ctx); 133 | + 134 | + return S_OK; 135 | +} 136 | + 137 | +/*********************************************************************** 138 | + * CryptExtOpenCER (CRYPTEXT.@) 139 | + */ 140 | +HRESULT WINAPI CryptExtOpenCER(HWND hwnd, HINSTANCE hinst, LPCSTR filename, DWORD showcmd) 141 | +{ 142 | + HRESULT hr; 143 | + LPWSTR filenameW; 144 | + 145 | + TRACE("(%p, %p, %s, %u)\n", hwnd, hinst, debugstr_a(filename), showcmd); 146 | + 147 | + filenameW = heap_strdupAtoW(filename); 148 | + hr = CryptExtOpenCERW(hwnd, hinst, filenameW, showcmd); 149 | + heap_free(filenameW); 150 | + return hr; 151 | +} 152 | diff --git a/dlls/cryptext/tests/Makefile.in b/dlls/cryptext/tests/Makefile.in 153 | new file mode 100644 154 | index 00000000000..522fc60a4af 155 | --- /dev/null 156 | +++ b/dlls/cryptext/tests/Makefile.in 157 | @@ -0,0 +1,4 @@ 158 | +TESTDLL = cryptext.dll 159 | + 160 | +C_SRCS = \ 161 | + cryptext.c 162 | diff --git a/dlls/cryptext/tests/cryptext.c b/dlls/cryptext/tests/cryptext.c 163 | new file mode 100644 164 | index 00000000000..cc62a772b59 165 | --- /dev/null 166 | +++ b/dlls/cryptext/tests/cryptext.c 167 | @@ -0,0 +1,61 @@ 168 | +/* 169 | + * Copyright 2019 Dmitry Timoshkov 170 | + * 171 | + * This library is free software; you can redistribute it and/or 172 | + * modify it under the terms of the GNU Lesser General Public 173 | + * License as published by the Free Software Foundation; either 174 | + * version 2.1 of the License, or (at your option) any later version. 175 | + * 176 | + * This library is distributed in the hope that it will be useful, 177 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of 178 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 179 | + * Lesser General Public License for more details. 180 | + * 181 | + * You should have received a copy of the GNU Lesser General Public 182 | + * License along with this library; if not, write to the Free Software 183 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 184 | + */ 185 | + 186 | +#include 187 | +#include 188 | +#include 189 | +#include 190 | +#include 191 | +#include 192 | + 193 | +#include "wine/test.h" 194 | + 195 | +static HRESULT (WINAPI *pCryptExtOpenCER)(HWND,HINSTANCE,LPCSTR,DWORD); 196 | + 197 | +static void test_CryptExtOpenCER(void) 198 | +{ 199 | + HRESULT hr; 200 | + 201 | + if (!pCryptExtOpenCER) 202 | + { 203 | + win_skip("CryptExtOpenCER is not available on this platform\n"); 204 | + return; 205 | + } 206 | + 207 | + if (!winetest_interactive) 208 | + { 209 | + skip("CryptExtOpenCER test needs user interaction\n"); 210 | + return; 211 | + } 212 | + 213 | + SetLastError(0xdeadbeef); 214 | + hr = pCryptExtOpenCER(0, 0, "dead.beef", SW_HIDE); 215 | + ok(hr == S_OK, "got %#x\n", hr); 216 | + 217 | + hr = pCryptExtOpenCER(0, 0, "VeriSign Class 3 Public Primary Certification Authority - G4.txt", SW_SHOW); 218 | + ok(hr == S_OK, "got %#x\n", hr); 219 | +} 220 | + 221 | +START_TEST(cryptext) 222 | +{ 223 | + HMODULE hmod = LoadLibraryA("cryptext.dll"); 224 | + 225 | + pCryptExtOpenCER = (void *)GetProcAddress(hmod, "CryptExtOpenCER"); 226 | + 227 | + test_CryptExtOpenCER(); 228 | +} 229 | -- 230 | 2.33.0 231 | 232 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/cryptext-CryptExtOpenCER/definition: -------------------------------------------------------------------------------- 1 | # Taken from the mailing list - July 2019. 2 | Fixes: cryptext: Implement CryptExtOpenCER. 3 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/d3dx11_43-D3DX11CreateTextureFromMemory/0001-d3dx11_43-Implement-D3DX11GetImageInfoFromMemory.patch: -------------------------------------------------------------------------------- 1 | From ea3579b5b3d701647f5c7f16de658f1cd7fe876d Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Fri, 30 Jul 2021 15:57:29 +1000 4 | Subject: [PATCH] d3dx11_43: Implement D3DX11GetImageInfoFromMemory 5 | 6 | Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=50210 7 | 8 | Signed-off-by: Alistair Leslie-Hughes 9 | --- 10 | dlls/d3dx11_42/Makefile.in | 1 + 11 | dlls/d3dx11_43/Makefile.in | 1 + 12 | dlls/d3dx11_43/main.c | 9 -- 13 | dlls/d3dx11_43/texture.c | 176 +++++++++++++++++++++++++++++++++++++ 14 | 4 files changed, 178 insertions(+), 9 deletions(-) 15 | 16 | diff --git a/dlls/d3dx11_42/Makefile.in b/dlls/d3dx11_42/Makefile.in 17 | index 7fcce18a8e1..78ca5f707a7 100644 18 | --- a/dlls/d3dx11_42/Makefile.in 19 | +++ b/dlls/d3dx11_42/Makefile.in 20 | @@ -2,6 +2,7 @@ EXTRADEFS = -DD3DX11_SDK_VERSION=42 21 | MODULE = d3dx11_42.dll 22 | IMPORTLIB = d3dx11_42 23 | IMPORTS = d3dcompiler 24 | +DELAYIMPORTS = windowscodecs 25 | PARENTSRC = ../d3dx11_43 26 | 27 | EXTRADLLFLAGS = -Wb,--prefer-native 28 | diff --git a/dlls/d3dx11_43/Makefile.in b/dlls/d3dx11_43/Makefile.in 29 | index ccd4319ace2..6854c73ebcb 100644 30 | --- a/dlls/d3dx11_43/Makefile.in 31 | +++ b/dlls/d3dx11_43/Makefile.in 32 | @@ -2,6 +2,7 @@ EXTRADEFS = -DD3DX11_SDK_VERSION=43 33 | MODULE = d3dx11_43.dll 34 | IMPORTLIB = d3dx11 35 | IMPORTS = d3dcompiler 36 | +DELAYIMPORTS = windowscodecs 37 | 38 | EXTRADLLFLAGS = -Wb,--prefer-native 39 | 40 | diff --git a/dlls/d3dx11_43/main.c b/dlls/d3dx11_43/main.c 41 | index 5dad027864f..00c1db35e42 100644 42 | --- a/dlls/d3dx11_43/main.c 43 | +++ b/dlls/d3dx11_43/main.c 44 | @@ -66,12 +66,3 @@ HRESULT WINAPI D3DX11GetImageInfoFromFileW(const WCHAR *filename, ID3DX11ThreadP 45 | 46 | return E_NOTIMPL; 47 | } 48 | - 49 | -HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump, 50 | - D3DX11_IMAGE_INFO *img_info, HRESULT *hresult) 51 | -{ 52 | - FIXME("src_data %p, src_data_size %Iu, pump %p, img_info %p, hresult %p stub!\n", 53 | - src_data, src_data_size, pump, img_info, hresult); 54 | - 55 | - return E_NOTIMPL; 56 | -} 57 | diff --git a/dlls/d3dx11_43/texture.c b/dlls/d3dx11_43/texture.c 58 | index 81ac8ee6db7..6881eec107d 100644 59 | --- a/dlls/d3dx11_43/texture.c 60 | +++ b/dlls/d3dx11_43/texture.c 61 | @@ -15,14 +15,190 @@ 62 | * License along with this library; if not, write to the Free Software 63 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 64 | */ 65 | +#define COBJMACROS 66 | 67 | #include "d3dx11.h" 68 | #include "d3dcompiler.h" 69 | +#include "wincodec.h" 70 | 71 | #include "wine/debug.h" 72 | 73 | WINE_DEFAULT_DEBUG_CHANNEL(d3dx); 74 | 75 | +HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT sdk_version, IWICImagingFactory **imaging_factory); 76 | + 77 | +static const struct 78 | +{ 79 | + const GUID *wic_container_guid; 80 | + D3DX11_IMAGE_FILE_FORMAT d3dx_file_format; 81 | +} 82 | +file_formats[] = 83 | +{ 84 | + { &GUID_ContainerFormatBmp, D3DX11_IFF_BMP }, 85 | + { &GUID_ContainerFormatJpeg, D3DX11_IFF_JPG }, 86 | + { &GUID_ContainerFormatPng, D3DX11_IFF_PNG }, 87 | + { &GUID_ContainerFormatDds, D3DX11_IFF_DDS }, 88 | + { &GUID_ContainerFormatTiff, D3DX11_IFF_TIFF }, 89 | + { &GUID_ContainerFormatGif, D3DX11_IFF_GIF }, 90 | + { &GUID_ContainerFormatWmp, D3DX11_IFF_WMP }, 91 | +}; 92 | + 93 | +static D3DX11_IMAGE_FILE_FORMAT wic_container_guid_to_file_format(GUID *container_format) 94 | +{ 95 | + unsigned int i; 96 | + 97 | + for (i = 0; i < ARRAY_SIZE(file_formats); ++i) 98 | + { 99 | + if (IsEqualGUID(file_formats[i].wic_container_guid, container_format)) 100 | + return file_formats[i].d3dx_file_format; 101 | + } 102 | + return D3DX11_IFF_FORCE_DWORD; 103 | +} 104 | + 105 | +static D3D11_RESOURCE_DIMENSION wic_dimension_to_d3dx11_dimension(WICDdsDimension wic_dimension) 106 | +{ 107 | + switch (wic_dimension) 108 | + { 109 | + case WICDdsTexture1D: 110 | + return D3D11_RESOURCE_DIMENSION_TEXTURE1D; 111 | + case WICDdsTexture2D: 112 | + case WICDdsTextureCube: 113 | + return D3D11_RESOURCE_DIMENSION_TEXTURE2D; 114 | + case WICDdsTexture3D: 115 | + return D3D11_RESOURCE_DIMENSION_TEXTURE3D; 116 | + default: 117 | + return D3D11_RESOURCE_DIMENSION_UNKNOWN; 118 | + } 119 | +} 120 | + 121 | +static const DXGI_FORMAT to_be_converted_format[] = 122 | +{ 123 | + DXGI_FORMAT_UNKNOWN, 124 | + DXGI_FORMAT_R8_UNORM, 125 | + DXGI_FORMAT_R8G8_UNORM, 126 | + DXGI_FORMAT_B5G6R5_UNORM, 127 | + DXGI_FORMAT_B4G4R4A4_UNORM, 128 | + DXGI_FORMAT_B5G5R5A1_UNORM, 129 | + DXGI_FORMAT_B8G8R8X8_UNORM, 130 | + DXGI_FORMAT_B8G8R8A8_UNORM 131 | +}; 132 | + 133 | +static DXGI_FORMAT get_d3dx11_dds_format(DXGI_FORMAT format) 134 | +{ 135 | + unsigned int i; 136 | + 137 | + for (i = 0; i < ARRAY_SIZE(to_be_converted_format); ++i) 138 | + { 139 | + if (format == to_be_converted_format[i]) 140 | + return DXGI_FORMAT_R8G8B8A8_UNORM; 141 | + } 142 | + return format; 143 | +} 144 | + 145 | +HRESULT WINAPI D3DX11GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX11ThreadPump *pump, 146 | + D3DX11_IMAGE_INFO *img_info, HRESULT *hresult) 147 | +{ 148 | + IWICBitmapFrameDecode *frame = NULL; 149 | + IWICImagingFactory *factory = NULL; 150 | + IWICDdsDecoder *dds_decoder = NULL; 151 | + IWICBitmapDecoder *decoder = NULL; 152 | + WICDdsParameters dds_params; 153 | + IWICStream *stream = NULL; 154 | + unsigned int frame_count; 155 | + GUID container_format; 156 | + HRESULT hr; 157 | + 158 | + TRACE("src_data %p, src_data_size %Iu, pump %p, img_info %p, hresult %p.\n", 159 | + src_data, src_data_size, pump, img_info, hresult); 160 | + 161 | + if (!src_data || !src_data_size || !img_info) 162 | + return E_FAIL; 163 | + if (pump) 164 | + FIXME("Thread pump is not supported yet.\n"); 165 | + 166 | + WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); 167 | + IWICImagingFactory_CreateStream(factory, &stream); 168 | + hr = IWICStream_InitializeFromMemory(stream, (BYTE *)src_data, src_data_size); 169 | + if (FAILED(hr)) 170 | + { 171 | + WARN("Failed to initialize stream.\n"); 172 | + goto end; 173 | + } 174 | + hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder); 175 | + if (FAILED(hr)) 176 | + goto end; 177 | + 178 | + hr = IWICBitmapDecoder_GetContainerFormat(decoder, &container_format); 179 | + if (FAILED(hr)) 180 | + goto end; 181 | + img_info->ImageFileFormat = wic_container_guid_to_file_format(&container_format); 182 | + if (img_info->ImageFileFormat == D3DX11_IFF_FORCE_DWORD) 183 | + { 184 | + hr = E_FAIL; 185 | + WARN("Unsupported image file format %s.\n", debugstr_guid(&container_format)); 186 | + goto end; 187 | + } 188 | + 189 | + hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); 190 | + if (FAILED(hr) || !frame_count) 191 | + goto end; 192 | + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); 193 | + if (FAILED(hr)) 194 | + goto end; 195 | + hr = IWICBitmapFrameDecode_GetSize(frame, &img_info->Width, &img_info->Height); 196 | + if (FAILED(hr)) 197 | + goto end; 198 | + 199 | + if (img_info->ImageFileFormat == D3DX11_IFF_DDS) 200 | + { 201 | + hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder); 202 | + if (FAILED(hr)) 203 | + goto end; 204 | + hr = IWICDdsDecoder_GetParameters(dds_decoder, &dds_params); 205 | + if (FAILED(hr)) 206 | + goto end; 207 | + img_info->ArraySize = dds_params.ArraySize; 208 | + img_info->Depth = dds_params.Depth; 209 | + img_info->MipLevels = dds_params.MipLevels; 210 | + img_info->ResourceDimension = wic_dimension_to_d3dx11_dimension(dds_params.Dimension); 211 | + img_info->Format = get_d3dx11_dds_format(dds_params.DxgiFormat); 212 | + img_info->MiscFlags = 0; 213 | + if (dds_params.Dimension == WICDdsTextureCube) 214 | + { 215 | + img_info->MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE; 216 | + img_info->ArraySize *= 6; 217 | + } 218 | + } 219 | + else 220 | + { 221 | + img_info->ArraySize = 1; 222 | + img_info->Depth = 1; 223 | + img_info->MipLevels = 1; 224 | + img_info->ResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D; 225 | + img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM; 226 | + img_info->MiscFlags = 0; 227 | + } 228 | + 229 | +end: 230 | + if (dds_decoder) 231 | + IWICDdsDecoder_Release(dds_decoder); 232 | + if (frame) 233 | + IWICBitmapFrameDecode_Release(frame); 234 | + if (decoder) 235 | + IWICBitmapDecoder_Release(decoder); 236 | + if (stream) 237 | + IWICStream_Release(stream); 238 | + if (factory) 239 | + IWICImagingFactory_Release(factory); 240 | + 241 | + if (hr != S_OK) 242 | + { 243 | + WARN("Invalid or unsupported image file.\n"); 244 | + return E_FAIL; 245 | + } 246 | + return S_OK; 247 | +} 248 | + 249 | HRESULT WINAPI D3DX11CreateShaderResourceViewFromMemory(ID3D11Device *device, const void *data, 250 | SIZE_T data_size, D3DX11_IMAGE_LOAD_INFO *load_info, ID3DX11ThreadPump *pump, 251 | ID3D11ShaderResourceView **view, HRESULT *hresult) 252 | -- 253 | 2.34.1 254 | 255 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/d3dx11_43-D3DX11CreateTextureFromMemory/definition: -------------------------------------------------------------------------------- 1 | Fixes: [50210] - Implement D3DX11GetImageInfoFromMemory 2 | Fixes: [45533] - Implement D3DX11CreateTextureFromMemory 3 | 4 | # This patchset will need to wait until the new wined3dx dll implemented. 5 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/fltmgr.sys-FltBuildDefaultSecurityDescriptor/0001-fltmgr.sys-Implement-FltBuildDefaultSecurityDescript.patch: -------------------------------------------------------------------------------- 1 | From f9da0ca4c7012918b5c8660ebe8a9ea0c74f05b0 Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Sun, 29 Aug 2021 13:26:53 +1000 4 | Subject: [PATCH] fltmgr.sys: Implement FltBuildDefaultSecurityDescriptor 5 | 6 | Signed-off-by: Alistair Leslie-Hughes 7 | --- 8 | dlls/fltmgr.sys/Makefile.in | 1 + 9 | dlls/fltmgr.sys/fltmgr.sys.spec | 4 +- 10 | dlls/fltmgr.sys/main.c | 71 +++++++++++++++++++++++++++++++++ 11 | include/ddk/fltkernel.h | 3 +- 12 | 4 files changed, 76 insertions(+), 3 deletions(-) 13 | 14 | diff --git a/dlls/fltmgr.sys/Makefile.in b/dlls/fltmgr.sys/Makefile.in 15 | index ba106a43831..bb1f34b4896 100644 16 | --- a/dlls/fltmgr.sys/Makefile.in 17 | +++ b/dlls/fltmgr.sys/Makefile.in 18 | @@ -1,5 +1,6 @@ 19 | MODULE = fltmgr.sys 20 | EXTRADLLFLAGS = -Wl,--subsystem,native 21 | +IMPORTS = ntoskrnl 22 | 23 | C_SRCS = \ 24 | main.c 25 | diff --git a/dlls/fltmgr.sys/fltmgr.sys.spec b/dlls/fltmgr.sys/fltmgr.sys.spec 26 | index 39ce6798178..8943b9f85cf 100644 27 | --- a/dlls/fltmgr.sys/fltmgr.sys.spec 28 | +++ b/dlls/fltmgr.sys/fltmgr.sys.spec 29 | @@ -10,7 +10,7 @@ 30 | @ stub FltAllocatePoolAlignedWithTag 31 | @ stub FltAttachVolume 32 | @ stub FltAttachVolumeAtAltitude 33 | -@ stub FltBuildDefaultSecurityDescriptor 34 | +@ stdcall FltBuildDefaultSecurityDescriptor(ptr long) 35 | @ stub FltCancelFileOpen 36 | @ stub FltCancelIo 37 | @ stub FltCbdqDisable 38 | @@ -60,7 +60,7 @@ 39 | @ stub FltFreeFileLock 40 | @ stub FltFreeGenericWorkItem 41 | @ stub FltFreePoolAlignedWithTag 42 | -@ stub FltFreeSecurityDescriptor 43 | +@ stdcall FltFreeSecurityDescriptor(ptr) 44 | @ stub FltFsControlFile 45 | @ stub FltGetBottomInstance 46 | @ stub FltGetContexts 47 | diff --git a/dlls/fltmgr.sys/main.c b/dlls/fltmgr.sys/main.c 48 | index e1016a4989c..ea9685b4308 100644 49 | --- a/dlls/fltmgr.sys/main.c 50 | +++ b/dlls/fltmgr.sys/main.c 51 | @@ -93,3 +93,74 @@ void* WINAPI FltGetRoutineAddress(LPCSTR name) 52 | 53 | return func; 54 | } 55 | + 56 | +NTSTATUS WINAPI FltBuildDefaultSecurityDescriptor(PSECURITY_DESCRIPTOR *descriptor, ACCESS_MASK access) 57 | +{ 58 | + PACL dacl; 59 | + NTSTATUS ret = STATUS_INSUFFICIENT_RESOURCES; 60 | + ULONG sid_len; 61 | + PSID sid; 62 | + PSID sid_system; 63 | + PSECURITY_DESCRIPTOR sec_desc = NULL; 64 | + SID_IDENTIFIER_AUTHORITY auth = { SECURITY_NULL_SID_AUTHORITY }; 65 | + 66 | + *descriptor = NULL; 67 | + 68 | + ret = RtlAllocateAndInitializeSid(&auth, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_GROUP_RID_ADMINS, 69 | + 0, 0, 0, 0, 0, 0, &sid); 70 | + if (ret != STATUS_SUCCESS) 71 | + goto done; 72 | + 73 | + ret = RtlAllocateAndInitializeSid(&auth, 1, SECURITY_LOCAL_SYSTEM_RID, 0, 0, 0, 0, 0, 0, 0, &sid_system); 74 | + if (ret != STATUS_SUCCESS) 75 | + goto done; 76 | + 77 | + sid_len = SECURITY_DESCRIPTOR_MIN_LENGTH + sizeof(ACL) + 78 | + sizeof(ACCESS_ALLOWED_ACE) + RtlLengthSid(sid) + 79 | + sizeof(ACCESS_ALLOWED_ACE) + RtlLengthSid(sid_system); 80 | + 81 | + sec_desc = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, sid_len); 82 | + if (!sec_desc) 83 | + { 84 | + ret = STATUS_NO_MEMORY; 85 | + goto done; 86 | + } 87 | + 88 | + ret = RtlCreateSecurityDescriptor(sec_desc, SECURITY_DESCRIPTOR_REVISION); 89 | + if (ret != STATUS_SUCCESS) 90 | + goto done; 91 | + 92 | + dacl = (PACL)((char*)sec_desc + SECURITY_DESCRIPTOR_MIN_LENGTH); 93 | + ret = RtlCreateAcl(dacl, sid_len - SECURITY_DESCRIPTOR_MIN_LENGTH, ACL_REVISION); 94 | + if (ret != STATUS_SUCCESS) 95 | + goto done; 96 | + 97 | + ret = RtlAddAccessAllowedAce(dacl, ACL_REVISION, access, sid); 98 | + if (ret != STATUS_SUCCESS) 99 | + goto done; 100 | + 101 | + ret = RtlAddAccessAllowedAce(dacl, ACL_REVISION, access, sid_system); 102 | + if (ret != STATUS_SUCCESS) 103 | + goto done; 104 | + 105 | + ret = RtlSetDaclSecurityDescriptor(sec_desc, 1, dacl, 0); 106 | + if (ret == STATUS_SUCCESS) 107 | + *descriptor = sec_desc; 108 | + 109 | +done: 110 | + if (ret != STATUS_SUCCESS && sec_desc != NULL) 111 | + RtlFreeHeap(GetProcessHeap(), 0, sec_desc); 112 | + 113 | + if (sid != NULL) 114 | + RtlFreeHeap(GetProcessHeap(), 0, sid); 115 | + 116 | + if (sid_system != NULL) 117 | + RtlFreeHeap(GetProcessHeap(), 0, sid_system); 118 | + 119 | + return ret; 120 | +} 121 | + 122 | +void WINAPI FltFreeSecurityDescriptor(PSECURITY_DESCRIPTOR descriptor) 123 | +{ 124 | + RtlFreeHeap(GetProcessHeap(), 0, descriptor); 125 | +} 126 | \ No newline at end of file 127 | diff --git a/include/ddk/fltkernel.h b/include/ddk/fltkernel.h 128 | index 8ebebfa2e81..9ece0990810 100644 129 | --- a/include/ddk/fltkernel.h 130 | +++ b/include/ddk/fltkernel.h 131 | @@ -653,7 +653,8 @@ typedef struct _FLT_REGISTRATION 132 | PFLT_SECTION_CONFLICT_NOTIFICATION_CALLBACK SectionNotificationCallback; 133 | } FLT_REGISTRATION, *PFLT_REGISTRATION; 134 | 135 | - 136 | +NTSTATUS WINAPI FltBuildDefaultSecurityDescriptor(PSECURITY_DESCRIPTOR *, ACCESS_MASK); 137 | +void WINAPI FltFreeSecurityDescriptor(PSECURITY_DESCRIPTOR); 138 | void* WINAPI FltGetRoutineAddress(LPCSTR name); 139 | NTSTATUS WINAPI FltRegisterFilter(PDRIVER_OBJECT, const FLT_REGISTRATION *, PFLT_FILTER *); 140 | NTSTATUS WINAPI FltStartFiltering(PFLT_FILTER); 141 | -- 142 | 2.33.0 143 | 144 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/fltmgr.sys-FltBuildDefaultSecurityDescriptor/0002-fltmgr.sys-Create-import-library.patch: -------------------------------------------------------------------------------- 1 | From 36bb7032734a97c5b9d01ef96d595973ea16eb95 Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Mon, 30 Aug 2021 15:15:35 +1000 4 | Subject: [PATCH] fltmgr.sys: Create import library 5 | 6 | Signed-off-by: Alistair Leslie-Hughes 7 | --- 8 | dlls/fltmgr.sys/Makefile.in | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/dlls/fltmgr.sys/Makefile.in b/dlls/fltmgr.sys/Makefile.in 12 | index bb1f34b4896..5540df35d6a 100644 13 | --- a/dlls/fltmgr.sys/Makefile.in 14 | +++ b/dlls/fltmgr.sys/Makefile.in 15 | @@ -1,4 +1,5 @@ 16 | MODULE = fltmgr.sys 17 | +IMPORTLIB = fltmgr 18 | EXTRADLLFLAGS = -Wl,--subsystem,native 19 | IMPORTS = ntoskrnl 20 | 21 | -- 22 | 2.33.0 23 | 24 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/fltmgr.sys-FltBuildDefaultSecurityDescriptor/0003-ntoskrnl.exe-Add-FltBuildDefaultSecurityDescriptor-t.patch: -------------------------------------------------------------------------------- 1 | From ba211cf9d8ca7a462c24a62334813c68d41b3fc0 Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Mon, 30 Aug 2021 15:16:06 +1000 4 | Subject: [PATCH] ntoskrnl.exe: Add FltBuildDefaultSecurityDescriptor test 5 | 6 | Signed-off-by: Alistair Leslie-Hughes 7 | --- 8 | dlls/ntoskrnl.exe/tests/Makefile.in | 2 +- 9 | dlls/ntoskrnl.exe/tests/driver.c | 65 +++++++++++++++++++++++++++++ 10 | 2 files changed, 66 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/dlls/ntoskrnl.exe/tests/Makefile.in b/dlls/ntoskrnl.exe/tests/Makefile.in 13 | index 052a8618a81..9028a392002 100644 14 | --- a/dlls/ntoskrnl.exe/tests/Makefile.in 15 | +++ b/dlls/ntoskrnl.exe/tests/Makefile.in 16 | @@ -2,7 +2,7 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES 17 | TESTDLL = ntoskrnl.exe 18 | IMPORTS = advapi32 crypt32 newdev setupapi user32 wintrust ws2_32 hid 19 | 20 | -driver_IMPORTS = winecrt0 ntoskrnl hal 21 | +driver_IMPORTS = winecrt0 ntoskrnl hal fltmgr 22 | driver_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native 23 | driver2_IMPORTS = winecrt0 ntoskrnl hal 24 | driver2_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native 25 | diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c 26 | index dabb3b73f15..187f00c8bcb 100644 27 | --- a/dlls/ntoskrnl.exe/tests/driver.c 28 | +++ b/dlls/ntoskrnl.exe/tests/driver.c 29 | @@ -32,6 +32,7 @@ 30 | #include "ddk/ntddk.h" 31 | #include "ddk/ntifs.h" 32 | #include "ddk/wdm.h" 33 | +#include "ddk/fltkernel.h" 34 | 35 | #include "driver.h" 36 | 37 | @@ -2338,6 +2339,69 @@ static void test_default_modules(void) 38 | ok(dxgmms1, "Failed to find dxgmms1.sys\n"); 39 | } 40 | 41 | +static void test_default_security(void) 42 | +{ 43 | + PSECURITY_DESCRIPTOR sd = NULL; 44 | + NTSTATUS status; 45 | + PSID group = NULL, owner = NULL; 46 | + BOOLEAN isdefault, present; 47 | + PACL acl = NULL; 48 | + PACCESS_ALLOWED_ACE ace; 49 | + SID_IDENTIFIER_AUTHORITY auth = { SECURITY_NULL_SID_AUTHORITY }; 50 | + PSID sid1, sid2; 51 | + 52 | + status = FltBuildDefaultSecurityDescriptor(&sd, STANDARD_RIGHTS_ALL); 53 | + ok(status == STATUS_SUCCESS, "got %#x\n", status); 54 | + ok(sd != NULL, "Failed to return descriptor\n"); 55 | + 56 | + status = RtlGetGroupSecurityDescriptor(sd, &group, &isdefault); 57 | + ok(status == STATUS_SUCCESS, "got %#x\n", status); 58 | + ok(group == NULL, "group isn't NULL\n"); 59 | + 60 | + status = RtlGetOwnerSecurityDescriptor(sd, &owner, &isdefault); 61 | + ok(status == STATUS_SUCCESS, "got %#x\n", status); 62 | + ok(owner == NULL, "owner isn't NULL\n"); 63 | + 64 | + status = RtlGetDaclSecurityDescriptor(sd, &present, &acl, &isdefault); 65 | + ok(status == STATUS_SUCCESS, "got %#x\n", status); 66 | + ok(acl != NULL, "acl is NULL\n"); 67 | + ok(acl->AceCount == 2, "got %d\n", acl->AceCount); 68 | + 69 | + sid1 = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, RtlLengthRequiredSid(2)); 70 | + RtlInitializeSid(sid1, &auth, 2); 71 | + *RtlSubAuthoritySid(sid1, 0) = SECURITY_BUILTIN_DOMAIN_RID; 72 | + *RtlSubAuthoritySid(sid1, 1) = DOMAIN_GROUP_RID_ADMINS; 73 | + 74 | + sid2 = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, RtlLengthRequiredSid(1)); 75 | + RtlInitializeSid(sid2, &auth, 1); 76 | + *RtlSubAuthoritySid(sid2, 0) = SECURITY_LOCAL_SYSTEM_RID; 77 | + 78 | + /* SECURITY_BUILTIN_DOMAIN_RID */ 79 | + status = RtlGetAce(acl, 0, (void**)&ace); 80 | + ok(status == STATUS_SUCCESS, "got %#x\n", status); 81 | + 82 | + ok(ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE, "got %#x\n", ace->Header.AceType); 83 | + ok(ace->Header.AceFlags == 0, "got %#x\n", ace->Header.AceFlags); 84 | + ok(ace->Mask == STANDARD_RIGHTS_ALL, "got %#x\n", ace->Mask); 85 | + 86 | + ok(RtlEqualSid(sid1, (PSID)&ace->SidStart), "SID not equal\n"); 87 | + 88 | + /* SECURITY_LOCAL_SYSTEM_RID */ 89 | + status = RtlGetAce(acl, 1, (void**)&ace); 90 | + ok(status == STATUS_SUCCESS, "got %#x\n", status); 91 | + 92 | + ok(ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE, "got %#x\n", ace->Header.AceType); 93 | + ok(ace->Header.AceFlags == 0, "got %#x\n", ace->Header.AceFlags); 94 | + ok(ace->Mask == STANDARD_RIGHTS_ALL, "got %#x\n", ace->Mask); 95 | + 96 | + ok(RtlEqualSid(sid2, (PSID)&ace->SidStart), "SID not equal\n"); 97 | + 98 | + RtlFreeHeap(GetProcessHeap(), 0, sid1); 99 | + RtlFreeHeap(GetProcessHeap(), 0, sid2); 100 | + 101 | + FltFreeSecurityDescriptor(sd); 102 | +} 103 | + 104 | static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *stack) 105 | { 106 | void *buffer = irp->AssociatedIrp.SystemBuffer; 107 | @@ -2382,6 +2446,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st 108 | test_dpc(); 109 | test_process_memory(test_input); 110 | test_permanence(); 111 | + test_default_security(); 112 | 113 | IoMarkIrpPending(irp); 114 | IoQueueWorkItem(work_item, main_test_task, DelayedWorkQueue, irp); 115 | -- 116 | 2.34.1 117 | 118 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/fltmgr.sys-FltBuildDefaultSecurityDescriptor/definition: -------------------------------------------------------------------------------- 1 | Fixes: [49089] fltmgr.sys: Implement FltBuildDefaultSecurityDescriptor 2 | Depends: winedevice-Default_Drivers 3 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/inseng-Implementation/definition: -------------------------------------------------------------------------------- 1 | Fixes: [39456] Implement CIF reader and download functionality in inseng.dll 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/loader-KeyboardLayouts/0002-user32-Improve-GetKeyboardLayoutList.patch: -------------------------------------------------------------------------------- 1 | From f57e7a06cffc47773c647a10ed4d298b58fbd408 Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Tue, 9 Jul 2019 14:13:28 +1000 4 | Subject: [PATCH] user32: Do not enumerate the registry in 5 | GetKeyboardLayoutList(). 6 | 7 | This function returns the current list of *installed* Keyboard layouts 8 | not the complete list from the registry. 9 | --- 10 | dlls/user32/input.c | 1 - 11 | dlls/user32/tests/input.c | 35 +++++++++++++++++++++++++++++++++++ 12 | dlls/win32u/input.c | 33 +-------------------------------- 13 | 3 files changed, 36 insertions(+), 33 deletions(-) 14 | 15 | diff --git a/dlls/user32/input.c b/dlls/user32/input.c 16 | index c5387cf9212..2507a86e3b6 100644 17 | --- a/dlls/user32/input.c 18 | +++ b/dlls/user32/input.c 19 | @@ -494,7 +494,6 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout ) 20 | return FALSE; 21 | } 22 | 23 | - 24 | /*********************************************************************** 25 | * EnableMouseInPointer (USER32.@) 26 | */ 27 | diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c 28 | index bf913b8e6a6..8ac46bedc71 100644 29 | --- a/dlls/user32/tests/input.c 30 | +++ b/dlls/user32/tests/input.c 31 | @@ -4837,6 +4837,40 @@ static void test_EnableMouseInPointer( char **argv, BOOL enable ) 32 | CloseHandle( info.hProcess ); 33 | } 34 | 35 | +static void test_GetKeyboardLayoutList(void) 36 | +{ 37 | + int cnt, cnt2; 38 | + HKL *layouts; 39 | + ULONG_PTR baselayout; 40 | + LANGID langid; 41 | + 42 | + baselayout = GetUserDefaultLCID(); 43 | + langid = PRIMARYLANGID(LANGIDFROMLCID(baselayout)); 44 | + if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) 45 | + baselayout = MAKELONG( baselayout, 0xe001 ); /* IME */ 46 | + else 47 | + baselayout |= baselayout << 16; 48 | + 49 | + cnt = GetKeyboardLayoutList(0, NULL); 50 | + /* Most users will not have more than a few keyboard layouts installed at a time. */ 51 | + ok(cnt > 0 && cnt < 10, "Layout count %d\n", cnt); 52 | + if (cnt > 0) 53 | + { 54 | + layouts = HeapAlloc(GetProcessHeap(), 0, sizeof(*layouts) * cnt ); 55 | + 56 | + cnt2 = GetKeyboardLayoutList(cnt, layouts); 57 | + ok(cnt == cnt2, "wrong value %d!=%d\n", cnt, cnt2); 58 | + for(cnt = 0; cnt < cnt2; cnt++) 59 | + { 60 | + if(layouts[cnt] == (HKL)baselayout) 61 | + break; 62 | + } 63 | + ok(cnt < cnt2, "Didnt find current keyboard\n"); 64 | + 65 | + HeapFree(GetProcessHeap(), 0, layouts); 66 | + } 67 | +} 68 | + 69 | START_TEST(input) 70 | { 71 | char **argv; 72 | @@ -4887,6 +4921,7 @@ START_TEST(input) 73 | test_GetRawInputBuffer(); 74 | test_RegisterRawInputDevices(); 75 | test_rawinput(argv[0]); 76 | + test_GetKeyboardLayoutList(); 77 | test_DefRawInputProc(); 78 | 79 | if(pGetMouseMovePointsEx) 80 | diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c 81 | index fd16d03f733..fb452843803 100644 82 | --- a/dlls/win32u/input.c 83 | +++ b/dlls/win32u/input.c 84 | @@ -934,11 +934,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags ) 85 | */ 86 | UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts ) 87 | { 88 | - char buffer[4096]; 89 | - KEY_NODE_INFORMATION *key_info = (KEY_NODE_INFORMATION *)buffer; 90 | - KEY_VALUE_PARTIAL_INFORMATION *value_info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer; 91 | - DWORD count, tmp, i = 0; 92 | - HKEY hkey, subkey; 93 | + DWORD count; 94 | HKL layout; 95 | 96 | TRACE_(keyboard)( "size %d, layouts %p.\n", size, layouts ); 97 | @@ -1277,33 +1273,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts ) 98 | if (size && layouts) 99 | { 100 | layouts[count - 1] = layout; 101 | - if (count == size) return count; 102 | - } 103 | - 104 | - if ((hkey = reg_open_key( NULL, keyboard_layouts_keyW, sizeof(keyboard_layouts_keyW) ))) 105 | - { 106 | - while (!NtEnumerateKey( hkey, i++, KeyNodeInformation, key_info, 107 | - sizeof(buffer) - sizeof(WCHAR), &tmp )) 108 | - { 109 | - if (!(subkey = reg_open_key( hkey, key_info->Name, key_info->NameLength ))) continue; 110 | - key_info->Name[key_info->NameLength / sizeof(WCHAR)] = 0; 111 | - tmp = wcstoul( key_info->Name, NULL, 16 ); 112 | - if (query_reg_ascii_value( subkey, "Layout Id", value_info, sizeof(buffer) ) && 113 | - value_info->Type == REG_SZ) 114 | - tmp = 0xf000 | (wcstoul( (const WCHAR *)value_info->Data, NULL, 16 ) & 0xfff); 115 | - NtClose( subkey ); 116 | - 117 | - tmp = MAKELONG( LOWORD( layout ), LOWORD( tmp ) ); 118 | - if (layout == UlongToHandle( tmp )) continue; 119 | - 120 | - count++; 121 | - if (size && layouts) 122 | - { 123 | - layouts[count - 1] = UlongToHandle( tmp ); 124 | - if (count == size) break; 125 | - } 126 | - } 127 | - NtClose( hkey ); 128 | } 129 | 130 | return count; 131 | -- 132 | 2.39.0 133 | 134 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-Exception/0002-ntdll-OutputDebugString-should-throw-the-exception-a.patch: -------------------------------------------------------------------------------- 1 | From da81169743bd7f070186ec5e58c89bab53d0bb7f Mon Sep 17 00:00:00 2001 2 | From: Sebastian Lackner 3 | Date: Sun, 28 Sep 2014 23:39:51 +0200 4 | Subject: [PATCH] ntdll: OutputDebugString should throw the exception a second 5 | time, if a debugger is attached. 6 | 7 | --- 8 | dlls/kernelbase/debug.c | 17 +++++++++++++++++ 9 | dlls/ntdll/tests/exception.c | 9 ++++----- 10 | 2 files changed, 21 insertions(+), 5 deletions(-) 11 | 12 | diff --git a/dlls/kernelbase/debug.c b/dlls/kernelbase/debug.c 13 | index 9e954e3ffbe..a6793c20204 100644 14 | --- a/dlls/kernelbase/debug.c 15 | +++ b/dlls/kernelbase/debug.c 16 | @@ -200,6 +200,23 @@ void WINAPI DECLSPEC_HOTPATCH OutputDebugStringA( LPCSTR str ) 17 | __ENDTRY 18 | if (caught_by_dbg) return; 19 | 20 | + /* for some unknown reason Windows sends the exception a second time, if a 21 | + * debugger is attached, and the event wasn't handled in the first attempt */ 22 | + if (NtCurrentTeb()->Peb->BeingDebugged) 23 | + { 24 | + __TRY 25 | + { 26 | + ULONG_PTR args[2]; 27 | + args[0] = strlen(str) + 1; 28 | + args[1] = (ULONG_PTR)str; 29 | + RaiseException( DBG_PRINTEXCEPTION_C, 0, 2, args ); 30 | + } 31 | + __EXCEPT(debug_exception_handler) 32 | + { 33 | + } 34 | + __ENDTRY 35 | + } 36 | + 37 | /* send string to a system-wide monitor */ 38 | if (!mutex_inited) 39 | { 40 | -- 41 | 2.36.1 42 | 43 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-Exception/definition: -------------------------------------------------------------------------------- 1 | Fixes: [44819] Throw second DBG_PRINTEXCEPTION_C when debugging. 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-RtlQueryPackageIdentity/0003-ntdll-tests-Add-basic-tests-for-RtlQueryPackageIdent.patch: -------------------------------------------------------------------------------- 1 | From 7e1c63548513ec95978c5cbc428555ac5ed7c1d2 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Sun, 17 Jan 2016 00:50:50 +0100 4 | Subject: [PATCH] ntdll/tests: Add basic tests for RtlQueryPackageIdentity. 5 | 6 | --- 7 | dlls/ntdll/tests/Makefile.in | 2 +- 8 | dlls/ntdll/tests/rtl.c | 80 ++++++++++++++++++++++++++++++++++++ 9 | 2 files changed, 81 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/dlls/ntdll/tests/Makefile.in b/dlls/ntdll/tests/Makefile.in 12 | index 90deb5865f8..428ebde23b3 100644 13 | --- a/dlls/ntdll/tests/Makefile.in 14 | +++ b/dlls/ntdll/tests/Makefile.in 15 | @@ -1,5 +1,5 @@ 16 | TESTDLL = ntdll.dll 17 | -IMPORTS = user32 advapi32 18 | +IMPORTS = user32 ole32 advapi32 19 | 20 | C_SRCS = \ 21 | atom.c \ 22 | diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c 23 | index 1e5e8c2580c..3690402c268 100644 24 | --- a/dlls/ntdll/tests/rtl.c 25 | +++ b/dlls/ntdll/tests/rtl.c 26 | @@ -28,6 +28,9 @@ 27 | #include "inaddr.h" 28 | #include "ip2string.h" 29 | #include "wine/asm.h" 30 | +#include "initguid.h" 31 | +#define COBJMACROS 32 | +#include "shobjidl.h" 33 | 34 | #ifndef __WINE_WINTERNL_H 35 | 36 | @@ -95,6 +98,9 @@ static BOOL (WINAPI *pRtlIsCriticalSectionLocked)(CRITICAL_SECTION *); 37 | static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION *); 38 | static NTSTATUS (WINAPI *pRtlInitializeCriticalSectionEx)(CRITICAL_SECTION *, ULONG, ULONG); 39 | static NTSTATUS (WINAPI *pLdrEnumerateLoadedModules)(void *, void *, void *); 40 | +static NTSTATUS (WINAPI *pRtlQueryPackageIdentity)(HANDLE, WCHAR*, SIZE_T*, WCHAR*, SIZE_T*, BOOLEAN*); 41 | +static NTSTATUS (WINAPI *pRtlMakeSelfRelativeSD)(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD); 42 | +static NTSTATUS (WINAPI *pRtlAbsoluteToSelfRelativeSD)(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PULONG); 43 | static NTSTATUS (WINAPI *pLdrRegisterDllNotification)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, void *, void **); 44 | static NTSTATUS (WINAPI *pLdrUnregisterDllNotification)(void *); 45 | 46 | @@ -137,6 +143,9 @@ static void InitFunctionPtrs(void) 47 | pRtlIsCriticalSectionLockedByThread = (void *)GetProcAddress(hntdll, "RtlIsCriticalSectionLockedByThread"); 48 | pRtlInitializeCriticalSectionEx = (void *)GetProcAddress(hntdll, "RtlInitializeCriticalSectionEx"); 49 | pLdrEnumerateLoadedModules = (void *)GetProcAddress(hntdll, "LdrEnumerateLoadedModules"); 50 | + pRtlQueryPackageIdentity = (void *)GetProcAddress(hntdll, "RtlQueryPackageIdentity"); 51 | + pRtlMakeSelfRelativeSD = (void *)GetProcAddress(hntdll, "RtlMakeSelfRelativeSD"); 52 | + pRtlAbsoluteToSelfRelativeSD = (void *)GetProcAddress(hntdll, "RtlAbsoluteToSelfRelativeSD"); 53 | pLdrRegisterDllNotification = (void *)GetProcAddress(hntdll, "LdrRegisterDllNotification"); 54 | pLdrUnregisterDllNotification = (void *)GetProcAddress(hntdll, "LdrUnregisterDllNotification"); 55 | } 56 | @@ -3775,6 +3784,76 @@ static void test_RtlFirstFreeAce(void) 57 | HeapFree(GetProcessHeap(), 0, acl); 58 | } 59 | 60 | +static void test_RtlQueryPackageIdentity(void) 61 | +{ 62 | + const WCHAR programW[] = {'M','i','c','r','o','s','o','f','t','.','W','i','n','d','o','w','s','.', 63 | + 'P','h','o','t','o','s','_','8','w','e','k','y','b','3','d','8','b','b','w','e','!','A','p','p',0}; 64 | + const WCHAR fullnameW[] = {'M','i','c','r','o','s','o','f','t','.','W','i','n','d','o','w','s','.', 65 | + 'P','h','o','t','o','s', 0}; 66 | + const WCHAR appidW[] = {'A','p','p',0}; 67 | + IApplicationActivationManager *manager; 68 | + WCHAR buf1[MAX_PATH], buf2[MAX_PATH]; 69 | + HANDLE process, token; 70 | + SIZE_T size1, size2; 71 | + NTSTATUS status; 72 | + DWORD processid; 73 | + HRESULT hr; 74 | + BOOL ret; 75 | + 76 | + if (!pRtlQueryPackageIdentity) 77 | + { 78 | + win_skip("RtlQueryPackageIdentity not available\n"); 79 | + return; 80 | + } 81 | + 82 | + size1 = size2 = MAX_PATH * sizeof(WCHAR); 83 | + status = pRtlQueryPackageIdentity((HANDLE)~(ULONG_PTR)3, buf1, &size1, buf2, &size2, NULL); 84 | + ok(status == STATUS_NOT_FOUND, "expected STATUS_NOT_FOUND, got %08x\n", status); 85 | + 86 | + CoInitializeEx(0, COINIT_APARTMENTTHREADED); 87 | + hr = CoCreateInstance(&CLSID_ApplicationActivationManager, NULL, CLSCTX_LOCAL_SERVER, 88 | + &IID_IApplicationActivationManager, (void **)&manager); 89 | + if (FAILED(hr)) 90 | + { 91 | + todo_wine win_skip("Failed to create ApplicationActivationManager (%x)\n", hr); 92 | + goto done; 93 | + } 94 | + 95 | + hr = IApplicationActivationManager_ActivateApplication(manager, programW, NULL, 96 | + AO_NOERRORUI, &processid); 97 | + if (FAILED(hr)) 98 | + { 99 | + todo_wine win_skip("Failed to start program (%x)\n", hr); 100 | + IApplicationActivationManager_Release(manager); 101 | + goto done; 102 | + } 103 | + 104 | + process = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_TERMINATE, FALSE, processid); 105 | + ok(process != NULL, "OpenProcess failed with %u\n", GetLastError()); 106 | + ret = OpenProcessToken(process, TOKEN_QUERY, &token); 107 | + ok(ret, "OpenProcessToken failed with error %u\n", GetLastError()); 108 | + 109 | + size1 = size2 = MAX_PATH * sizeof(WCHAR); 110 | + status = pRtlQueryPackageIdentity(token, buf1, &size1, buf2, &size2, NULL); 111 | + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); 112 | + 113 | + ok(!memcmp(buf1, fullnameW, sizeof(fullnameW) - sizeof(WCHAR)), 114 | + "Expected buf1 to begin with %s, got %s\n", wine_dbgstr_w(fullnameW), wine_dbgstr_w(buf1)); 115 | + ok(size1 >= sizeof(WCHAR) && !(size1 % sizeof(WCHAR)), "Unexpected size1 = %lu\n", size1); 116 | + ok(buf1[size1 / sizeof(WCHAR) - 1] == 0, "Expected buf1[%lu] == 0\n", size1 / sizeof(WCHAR) - 1); 117 | + 118 | + ok(!lstrcmpW(buf2, appidW), "Expected buf2 to be %s, got %s\n", wine_dbgstr_w(appidW), wine_dbgstr_w(buf2)); 119 | + ok(size2 >= sizeof(WCHAR) && !(size2 % sizeof(WCHAR)), "Unexpected size2 = %lu\n", size2); 120 | + ok(buf2[size2 / sizeof(WCHAR) - 1] == 0, "Expected buf2[%lu] == 0\n", size2 / sizeof(WCHAR) - 1); 121 | + 122 | + CloseHandle(token); 123 | + TerminateProcess(process, 0); 124 | + CloseHandle(process); 125 | + 126 | +done: 127 | + CoUninitialize(); 128 | +} 129 | + 130 | START_TEST(rtl) 131 | { 132 | InitFunctionPtrs(); 133 | @@ -3814,6 +3893,7 @@ START_TEST(rtl) 134 | test_RtlInitializeCriticalSectionEx(); 135 | test_RtlLeaveCriticalSection(); 136 | test_LdrEnumerateLoadedModules(); 137 | + test_RtlQueryPackageIdentity(); 138 | test_RtlMakeSelfRelativeSD(); 139 | test_LdrRegisterDllNotification(); 140 | test_DbgPrint(); 141 | -- 142 | 2.39.0 143 | 144 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-RtlQueryPackageIdentity/definition: -------------------------------------------------------------------------------- 1 | Fixes: Add stub for ntdll.RtlQueryPackageIdentity 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-Serial_Port_Detection/0001-ntdll-Do-a-device-check-before-returning-a-default-s.patch: -------------------------------------------------------------------------------- 1 | From 0c71b9c48afdc0478941417595998ab21fcf12ae Mon Sep 17 00:00:00 2001 2 | From: Alex Henrie 3 | Date: Tue, 29 Dec 2015 00:48:02 -0700 4 | Subject: [PATCH] mountmgr.sys: Do a device check before returning a default 5 | serial port name. 6 | 7 | Fixes https://bugs.winehq.org/show_bug.cgi?id=39793 8 | --- 9 | dlls/mountmgr.sys/device.c | 2 +- 10 | dlls/mountmgr.sys/unixlib.c | 22 ++++++++++++++++++++++ 11 | dlls/mountmgr.sys/unixlib.h | 1 + 12 | 3 files changed, 24 insertions(+), 1 deletion(-) 13 | 14 | diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c 15 | index 328b0b2f344..0757036c8e3 100644 16 | --- a/dlls/mountmgr.sys/device.c 17 | +++ b/dlls/mountmgr.sys/device.c 18 | @@ -1884,7 +1884,7 @@ static BOOL create_port_device( DRIVER_OBJECT *driver, int n, const char *unix_p 19 | UNICODE_STRING nt_name, symlink_name, default_name; 20 | DEVICE_OBJECT *dev_obj; 21 | NTSTATUS status; 22 | - struct set_dosdev_symlink_params params = { dosdevices_path, unix_path }; 23 | + struct set_dosdev_symlink_params params = { dosdevices_path, unix_path, driver == serial_driver }; 24 | 25 | /* create DOS device */ 26 | if (MOUNTMGR_CALL( set_dosdev_symlink, ¶ms )) return FALSE; 27 | diff --git a/dlls/mountmgr.sys/unixlib.c b/dlls/mountmgr.sys/unixlib.c 28 | index 13f6fbecf09..0332f6f6018 100644 29 | --- a/dlls/mountmgr.sys/unixlib.c 30 | +++ b/dlls/mountmgr.sys/unixlib.c 31 | @@ -36,6 +36,7 @@ 32 | #ifdef HAVE_SYS_STATVFS_H 33 | # include 34 | #endif 35 | +#include 36 | #include 37 | 38 | #include "unixlib.h" 39 | @@ -304,6 +305,27 @@ static NTSTATUS set_dosdev_symlink( void *args ) 40 | char *path; 41 | NTSTATUS status = STATUS_SUCCESS; 42 | 43 | +#ifdef linux 44 | + /* Serial port device files almost always exist on Linux even if the corresponding serial 45 | + * ports don't exist. Do a basic functionality check before advertising a serial port. */ 46 | + if (params->serial) 47 | + { 48 | + struct termios tios; 49 | + int fd; 50 | + 51 | + if ((fd = open( params->dest, O_RDONLY )) == -1) 52 | + return FALSE; 53 | + 54 | + if (tcgetattr( fd, &tios ) == -1) 55 | + { 56 | + close( fd ); 57 | + return FALSE; 58 | + } 59 | + 60 | + close( fd ); 61 | + } 62 | +#endif 63 | + 64 | if (!(path = get_dosdevices_path( params->dev ))) return STATUS_NO_MEMORY; 65 | 66 | if (params->dest && params->dest[0]) 67 | diff --git a/dlls/mountmgr.sys/unixlib.h b/dlls/mountmgr.sys/unixlib.h 68 | index d70371876fa..ef5b10732f6 100644 69 | --- a/dlls/mountmgr.sys/unixlib.h 70 | +++ b/dlls/mountmgr.sys/unixlib.h 71 | @@ -90,6 +90,7 @@ struct set_dosdev_symlink_params 72 | { 73 | const char *dev; 74 | const char *dest; 75 | + BOOL serial; 76 | }; 77 | 78 | struct get_volume_dos_devices_params 79 | -- 80 | 2.37.2 81 | 82 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-Serial_Port_Detection/definition: -------------------------------------------------------------------------------- 1 | Fixes: [39793] Do a device check before returning a default serial port name 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/0001-ntdll-Trigger-write-watches-before-passing-userdata-.patch: -------------------------------------------------------------------------------- 1 | From 00a5e4e8b55ad439d5c3d8faa876d08df8be759f Mon Sep 17 00:00:00 2001 2 | From: Sebastian Lackner 3 | Date: Sat, 4 Oct 2014 02:35:44 +0200 4 | Subject: [PATCH] ntdll: Trigger write watches before passing userdata pointer 5 | to wait_reply. 6 | 7 | --- 8 | dlls/ntdll/unix/server.c | 8 ++++++++ 9 | 1 file changed, 8 insertions(+) 10 | 11 | diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c 12 | index 6af8effe9e1..6dbd9cb3ea0 100644 13 | --- a/dlls/ntdll/unix/server.c 14 | +++ b/dlls/ntdll/unix/server.c 15 | @@ -282,9 +282,17 @@ unsigned int server_call_unlocked( void *req_ptr ) 16 | */ 17 | unsigned int CDECL wine_server_call( void *req_ptr ) 18 | { 19 | + struct __server_request_info * const req = req_ptr; 20 | sigset_t old_set; 21 | unsigned int ret; 22 | 23 | + /* trigger write watches, otherwise read() might return EFAULT */ 24 | + if (req->u.req.request_header.reply_size && 25 | + !virtual_check_buffer_for_write( req->reply_data, req->u.req.request_header.reply_size )) 26 | + { 27 | + return STATUS_ACCESS_VIOLATION; 28 | + } 29 | + 30 | pthread_sigmask( SIG_BLOCK, &server_block_set, &old_set ); 31 | ret = server_call_unlocked( req_ptr ); 32 | pthread_sigmask( SIG_SETMASK, &old_set, NULL ); 33 | -- 34 | 2.20.1 35 | 36 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/0003-ntdll-Setup-a-temporary-signal-handler-during-proces.patch: -------------------------------------------------------------------------------- 1 | From d87b3ff060a52b851aec1f66ff4b04fceebfc8ab Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Sat, 4 Oct 2014 02:53:22 +0200 4 | Subject: [PATCH] ntdll: Setup a temporary signal handler during process 5 | startup to handle page faults. (v2) 6 | 7 | --- 8 | dlls/ntdll/unix/loader.c | 2 ++ 9 | dlls/ntdll/unix/signal_arm.c | 6 ++++ 10 | dlls/ntdll/unix/signal_arm64.c | 6 ++++ 11 | dlls/ntdll/unix/signal_i386.c | 52 +++++++++++++++++++++++++++++++++ 12 | dlls/ntdll/unix/signal_x86_64.c | 6 ++++ 13 | dlls/ntdll/unix/unix_private.h | 1 + 14 | dlls/ntdll/unix/virtual.c | 2 +- 15 | 7 files changed, 74 insertions(+), 1 deletion(-) 16 | 17 | diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c 18 | index 4d95c29ab24..4406c1eb634 100644 19 | --- a/dlls/ntdll/unix/loader.c 20 | +++ b/dlls/ntdll/unix/loader.c 21 | @@ -2532,6 +2532,8 @@ void __wine_main( int argc, char *argv[], char *envp[] ) 22 | #endif 23 | 24 | virtual_init(); 25 | + signal_init_early(); 26 | + 27 | init_environment( argc, argv, envp ); 28 | 29 | #ifdef __APPLE__ 30 | diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c 31 | index fe51629838c..a39f158530a 100644 32 | --- a/dlls/ntdll/unix/signal_arm.c 33 | +++ b/dlls/ntdll/unix/signal_arm.c 34 | @@ -1584,6 +1584,12 @@ void signal_init_process(void) 35 | exit(1); 36 | } 37 | 38 | +/********************************************************************** 39 | + * signal_init_early 40 | + */ 41 | +void signal_init_early(void) 42 | +{ 43 | +} 44 | 45 | /*********************************************************************** 46 | * call_init_thunk 47 | diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c 48 | index 794aa7b2925..bf8e69f1661 100644 49 | --- a/dlls/ntdll/unix/signal_arm64.c 50 | +++ b/dlls/ntdll/unix/signal_arm64.c 51 | @@ -1381,6 +1381,12 @@ void signal_init_process(void) 52 | exit(1); 53 | } 54 | 55 | +/********************************************************************** 56 | + * signal_init_early 57 | + */ 58 | +void signal_init_early(void) 59 | +{ 60 | +} 61 | 62 | /*********************************************************************** 63 | * call_init_thunk 64 | diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c 65 | index cc8605c2a4f..bfd0c3eb7ef 100644 66 | --- a/dlls/ntdll/unix/signal_i386.c 67 | +++ b/dlls/ntdll/unix/signal_i386.c 68 | @@ -1839,6 +1839,30 @@ static BOOL handle_syscall_trap( ucontext_t *sigcontext ) 69 | } 70 | 71 | 72 | +/********************************************************************** 73 | + * segv_handler_early 74 | + * 75 | + * Handler for SIGSEGV and related errors. Used only during the initialization 76 | + * of the process to handle virtual faults. 77 | + */ 78 | +static void segv_handler_early( int signal, siginfo_t *siginfo, void *sigcontext ) 79 | +{ 80 | + ucontext_t *ucontext = sigcontext; 81 | + 82 | + switch (TRAP_sig(ucontext)) 83 | + { 84 | + case TRAP_x86_PAGEFLT: /* Page fault */ 85 | + if (!virtual_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09, 86 | + NULL)) 87 | + return; 88 | + /* fall-through */ 89 | + default: 90 | + WINE_ERR( "Got unexpected trap %d during process initialization\n", TRAP_sig(ucontext) ); 91 | + abort_thread(1); 92 | + break; 93 | + } 94 | +} 95 | + 96 | /********************************************************************** 97 | * segv_handler 98 | * 99 | @@ -2410,6 +2434,34 @@ void signal_init_process(void) 100 | exit(1); 101 | } 102 | 103 | +/********************************************************************** 104 | + * signal_init_early 105 | + */ 106 | +void signal_init_early(void) 107 | +{ 108 | + struct sigaction sig_act; 109 | + 110 | + sig_act.sa_mask = server_block_set; 111 | + sig_act.sa_flags = SA_SIGINFO | SA_RESTART; 112 | +#ifdef SA_ONSTACK 113 | + sig_act.sa_flags |= SA_ONSTACK; 114 | +#endif 115 | +#ifdef __ANDROID__ 116 | + sig_act.sa_flags |= SA_RESTORER; 117 | + sig_act.sa_restorer = rt_sigreturn; 118 | +#endif 119 | + sig_act.sa_sigaction = segv_handler_early; 120 | + if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) goto error; 121 | + if (sigaction( SIGILL, &sig_act, NULL ) == -1) goto error; 122 | +#ifdef SIGBUS 123 | + if (sigaction( SIGBUS, &sig_act, NULL ) == -1) goto error; 124 | +#endif 125 | + return; 126 | + 127 | +error: 128 | + perror("sigaction"); 129 | + exit(1); 130 | +} 131 | 132 | /*********************************************************************** 133 | * call_init_thunk 134 | diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c 135 | index cc070dda5ae..3b0f671afe2 100644 136 | --- a/dlls/ntdll/unix/signal_x86_64.c 137 | +++ b/dlls/ntdll/unix/signal_x86_64.c 138 | @@ -2462,6 +2462,12 @@ void signal_init_process(void) 139 | exit(1); 140 | } 141 | 142 | +/********************************************************************** 143 | + * signal_init_early 144 | + */ 145 | +void signal_init_early(void) 146 | +{ 147 | +} 148 | 149 | /*********************************************************************** 150 | * call_init_thunk 151 | diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h 152 | index fa7b97117ff..12a484d079a 100644 153 | --- a/dlls/ntdll/unix/unix_private.h 154 | +++ b/dlls/ntdll/unix/unix_private.h 155 | @@ -241,6 +241,7 @@ extern void signal_init_threading(void) DECLSPEC_HIDDEN; 156 | extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN; 157 | extern void signal_free_thread( TEB *teb ) DECLSPEC_HIDDEN; 158 | extern void signal_init_process(void) DECLSPEC_HIDDEN; 159 | +extern void signal_init_early(void) DECLSPEC_HIDDEN; 160 | extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE entry, void *arg, 161 | BOOL suspend, TEB *teb ) DECLSPEC_HIDDEN; 162 | extern void DECLSPEC_NORETURN signal_exit_thread( int status, void (*func)(int), TEB *teb ) DECLSPEC_HIDDEN; 163 | diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c 164 | index 45089ae5845..0a9c4f2feb0 100644 165 | --- a/dlls/ntdll/unix/virtual.c 166 | +++ b/dlls/ntdll/unix/virtual.c 167 | @@ -3279,7 +3279,7 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack ) 168 | 169 | mutex_lock( &virtual_mutex ); /* no need for signal masking inside signal handler */ 170 | vprot = get_page_vprot( page ); 171 | - if (!is_inside_signal_stack( stack ) && (vprot & VPROT_GUARD)) 172 | + if (stack && !is_inside_signal_stack( stack ) && (vprot & VPROT_GUARD)) 173 | { 174 | struct thread_stack_info stack_info; 175 | if (!is_inside_thread_stack( page, &stack_info )) 176 | -- 177 | 2.38.1 178 | 179 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/0004-ntdll-Properly-handle-PAGE_WRITECOPY-protection.-try.patch: -------------------------------------------------------------------------------- 1 | From 4a297f731112822e51086826f975bf5db9178e52 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Sat, 4 Oct 2014 03:22:09 +0200 4 | Subject: [PATCH] ntdll: Properly handle PAGE_WRITECOPY protection. (try 5) 5 | 6 | For now, only enable it when a special environment variable is set. 7 | --- 8 | dlls/ntdll/unix/virtual.c | 46 +++++++++++++++++++++++++++++++++------ 9 | 1 file changed, 39 insertions(+), 7 deletions(-) 10 | 11 | diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c 12 | index cf0c1598720..ff585c647bc 100644 13 | --- a/dlls/ntdll/unix/virtual.c 14 | +++ b/dlls/ntdll/unix/virtual.c 15 | @@ -495,6 +495,21 @@ static void reserve_area( void *addr, void *end ) 16 | #endif /* __APPLE__ */ 17 | } 18 | 19 | +/* This might look like a hack, but it actually isn't - the 'experimental' version 20 | + * is correct, but it already has revealed a couple of additional Wine bugs, which 21 | + * were not triggered before, and there are probably some more. 22 | + * To avoid breaking Wine for everyone, the new correct implementation has to be 23 | + * manually enabled, until it is tested a bit more. */ 24 | +static inline BOOL experimental_WRITECOPY( void ) 25 | +{ 26 | + static int enabled = -1; 27 | + if (enabled == -1) 28 | + { 29 | + const char *str = getenv("WINE_SIMULATE_WRITECOPY"); 30 | + enabled = str && (atoi(str) != 0); 31 | + } 32 | + return enabled; 33 | +} 34 | 35 | static void mmap_init( const struct preload_info *preload_info ) 36 | { 37 | @@ -852,8 +867,19 @@ static int get_unix_prot( BYTE vprot ) 38 | { 39 | if (vprot & VPROT_READ) prot |= PROT_READ; 40 | if (vprot & VPROT_WRITE) prot |= PROT_WRITE | PROT_READ; 41 | - if (vprot & VPROT_WRITECOPY) prot |= PROT_WRITE | PROT_READ; 42 | if (vprot & VPROT_EXEC) prot |= PROT_EXEC | PROT_READ; 43 | +#if defined(__i386__) 44 | + if (vprot & VPROT_WRITECOPY) 45 | + { 46 | + if (experimental_WRITECOPY()) 47 | + prot = (prot & ~PROT_WRITE) | PROT_READ; 48 | + else 49 | + prot |= PROT_WRITE | PROT_READ; 50 | + } 51 | +#else 52 | + /* FIXME: Architecture needs implementation of signal_init_early. */ 53 | + if (vprot & VPROT_WRITECOPY) prot |= PROT_WRITE | PROT_READ; 54 | +#endif 55 | if (vprot & VPROT_WRITEWATCH && !use_kernel_writewatch) prot &= ~PROT_WRITE; 56 | } 57 | if (!prot) prot = PROT_NONE; 58 | @@ -1457,7 +1483,7 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size 59 | { 60 | TRACE( "updating watch %p-%p-%p\n", base, (char *)base + accessed_size, (char *)base + size ); 61 | /* clear write watch flag on accessed pages */ 62 | - set_page_vprot_bits( base, accessed_size, 0, VPROT_WRITEWATCH ); 63 | + set_page_vprot_bits( base, accessed_size, VPROT_WRITE, VPROT_WRITEWATCH | VPROT_WRITECOPY ); 64 | /* restore page protections on the entire range */ 65 | mprotect_range( base, size, 0, 0 ); 66 | } 67 | @@ -2985,12 +3011,13 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack ) 68 | set_page_vprot_bits( page, page_size, 0, VPROT_WRITEWATCH ); 69 | mprotect_range( page, page_size, 0, 0 ); 70 | } 71 | - /* ignore fault if page is writable now */ 72 | - if (get_unix_prot( get_page_vprot( page )) & PROT_WRITE) 73 | + if (vprot & VPROT_WRITECOPY) 74 | { 75 | - if ((vprot & VPROT_WRITEWATCH) || is_write_watch_range( page, page_size )) 76 | - ret = STATUS_SUCCESS; 77 | + set_page_vprot_bits( page, page_size, VPROT_WRITE, VPROT_WRITECOPY ); 78 | + mprotect_range( page, page_size, 0, 0 ); 79 | } 80 | + /* ignore fault if page is writable now */ 81 | + if (get_unix_prot( get_page_vprot( page ) ) & PROT_WRITE) ret = STATUS_SUCCESS; 82 | } 83 | mutex_unlock( &virtual_mutex ); 84 | return ret; 85 | @@ -3067,11 +3094,16 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat 86 | { 87 | BYTE vprot = get_page_vprot( addr + i ); 88 | if (!use_kernel_writewatch && vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE; 89 | + if (!use_kernel_writewatch && vprot & VPROT_WRITECOPY) 90 | + { 91 | + vprot = (vprot & ~VPROT_WRITECOPY) | VPROT_WRITE; 92 | + *has_write_watch = TRUE; 93 | + } 94 | if (!(get_unix_prot( vprot & ~VPROT_WRITEWATCH ) & PROT_WRITE)) 95 | return STATUS_INVALID_USER_BUFFER; 96 | } 97 | if (!use_kernel_writewatch && *has_write_watch) 98 | - mprotect_range( addr, size, 0, VPROT_WRITEWATCH ); /* temporarily enable write access */ 99 | + mprotect_range( addr, size, VPROT_WRITE, VPROT_WRITEWATCH | VPROT_WRITECOPY ); /* temporarily enable write access */ 100 | return STATUS_SUCCESS; 101 | } 102 | 103 | -- 104 | 2.28.0 105 | 106 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/0005-ntdll-Track-if-a-WRITECOPY-page-has-been-modified.patch: -------------------------------------------------------------------------------- 1 | From b6a6f7448cb4f202edec1a2644315e745b709afe Mon Sep 17 00:00:00 2001 2 | From: Andrew Wesie 3 | Date: Fri, 24 Apr 2020 14:55:14 -0500 4 | Subject: [PATCH] ntdll: Track if a WRITECOPY page has been modified. 5 | 6 | Once a WRITECOPY page is modified, it should be mapped as if it is a normal 7 | read-write page. 8 | 9 | Signed-off-by: Andrew Wesie 10 | --- 11 | dlls/ntdll/unix/virtual.c | 24 +++++++++++++++++++----- 12 | 1 file changed, 19 insertions(+), 5 deletions(-) 13 | 14 | diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c 15 | index 578ef4139b8..ff15840adb6 100644 16 | --- a/dlls/ntdll/unix/virtual.c 17 | +++ b/dlls/ntdll/unix/virtual.c 18 | @@ -1072,7 +1073,7 @@ static int get_unix_prot( BYTE vprot ) 19 | #if defined(__i386__) 20 | if (vprot & VPROT_WRITECOPY) 21 | { 22 | - if (experimental_WRITECOPY()) 23 | + if (experimental_WRITECOPY() && !(vprot & VPROT_COPIED)) 24 | prot = (prot & ~PROT_WRITE) | PROT_READ; 25 | else 26 | prot |= PROT_WRITE | PROT_READ; 27 | @@ -1746,12 +1751,21 @@ static BOOL set_vprot( struct file_view *view, void *base, size_t size, BYTE vpr 28 | if (view->protect & VPROT_WRITEWATCH) 29 | { 30 | /* each page may need different protections depending on write watch flag */ 31 | - set_page_vprot_bits( base, size, vprot & ~VPROT_WRITEWATCH, ~vprot & ~VPROT_WRITEWATCH ); 32 | + set_page_vprot_bits( base, size, vprot & ~VPROT_WRITEWATCH, ~vprot & ~(VPROT_WRITEWATCH|VPROT_COPIED) ); 33 | mprotect_range( base, size, 0, 0 ); 34 | return TRUE; 35 | } 36 | + 37 | + /* check that we can map this memory with PROT_WRITE since we cannot fail later */ 38 | + if (vprot & VPROT_WRITECOPY) 39 | + unix_prot |= PROT_WRITE; 40 | + 41 | if (mprotect_exec( base, size, unix_prot )) return FALSE; 42 | - set_page_vprot( base, size, vprot ); 43 | + /* each page may need different protections depending on writecopy */ 44 | + set_page_vprot_bits( base, size, vprot, ~vprot & ~VPROT_COPIED ); 45 | + if (vprot & VPROT_WRITECOPY) 46 | + mprotect_range( base, size, 0, 0 ); 47 | + 48 | return TRUE; 49 | } 50 | 51 | @@ -3325,7 +3339,7 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack ) 52 | } 53 | if (vprot & VPROT_WRITECOPY) 54 | { 55 | - set_page_vprot_bits( page, page_size, VPROT_WRITE, VPROT_WRITECOPY ); 56 | + set_page_vprot_bits( page, page_size, VPROT_WRITE | VPROT_COPIED, VPROT_WRITECOPY ); 57 | mprotect_range( page, page_size, 0, 0 ); 58 | } 59 | /* ignore fault if page is writable now */ 60 | -- 61 | 2.38.1 62 | 63 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/0006-ntdll-Support-WRITECOPY-on-x64.patch: -------------------------------------------------------------------------------- 1 | From 153825fbb1dfc7e8624808681fd44f244b5c7c0e Mon Sep 17 00:00:00 2001 2 | From: Andrew Wesie 3 | Date: Fri, 24 Apr 2020 14:55:15 -0500 4 | Subject: [PATCH] ntdll: Support WRITECOPY on x64. 5 | 6 | Signed-off-by: Andrew Wesie 7 | --- 8 | dlls/ntdll/unix/signal_x86_64.c | 41 +++++++++++++++++++++++++++++++++ 9 | dlls/ntdll/unix/virtual.c | 2 +- 10 | 2 files changed, 42 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c 13 | index db608b358ea..741d0ebed5f 100644 14 | --- a/dlls/ntdll/unix/signal_x86_64.c 15 | +++ b/dlls/ntdll/unix/signal_x86_64.c 16 | @@ -2266,6 +2266,30 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec, 17 | } 18 | 19 | 20 | +/********************************************************************** 21 | + * segv_handler_early 22 | + * 23 | + * Handler for SIGSEGV and related errors. Used only during the initialization 24 | + * of the process to handle virtual faults. 25 | + */ 26 | +static void segv_handler_early( int signal, siginfo_t *siginfo, void *sigcontext ) 27 | +{ 28 | + ucontext_t *ucontext = sigcontext; 29 | + 30 | + switch(TRAP_sig(ucontext)) 31 | + { 32 | + case TRAP_x86_PAGEFLT: /* Page fault */ 33 | + if (!virtual_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09, 34 | + NULL )) 35 | + return; 36 | + /* fall-through */ 37 | + default: 38 | + WINE_ERR( "Got unexpected trap %lld during process initialization\n", TRAP_sig(ucontext) ); 39 | + abort_thread(1); 40 | + break; 41 | + } 42 | +} 43 | + 44 | /********************************************************************** 45 | * segv_handler 46 | * 47 | @@ -2641,6 +2665,23 @@ void signal_init_process(void) 48 | */ 49 | void signal_init_early(void) 50 | { 51 | + struct sigaction sig_act; 52 | + 53 | + sig_act.sa_mask = server_block_set; 54 | + sig_act.sa_flags = SA_RESTART | SA_SIGINFO | SA_ONSTACK; 55 | + 56 | + sig_act.sa_sigaction = segv_handler_early; 57 | + if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) goto error; 58 | + if (sigaction( SIGILL, &sig_act, NULL ) == -1) goto error; 59 | +#ifdef SIGBUS 60 | + if (sigaction( SIGBUS, &sig_act, NULL ) == -1) goto error; 61 | +#endif 62 | + 63 | + return; 64 | + 65 | + error: 66 | + perror("sigaction"); 67 | + exit(1); 68 | } 69 | 70 | /*********************************************************************** 71 | diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c 72 | index 21760152115..534f99a7064 100644 73 | --- a/dlls/ntdll/unix/virtual.c 74 | +++ b/dlls/ntdll/unix/virtual.c 75 | @@ -820,7 +820,7 @@ static int get_unix_prot( BYTE vprot ) 76 | if (vprot & VPROT_READ) prot |= PROT_READ; 77 | if (vprot & VPROT_WRITE) prot |= PROT_WRITE | PROT_READ; 78 | if (vprot & VPROT_EXEC) prot |= PROT_EXEC | PROT_READ; 79 | -#if defined(__i386__) 80 | +#if defined(__i386__) || defined(__x86_64__) 81 | if (vprot & VPROT_WRITECOPY) 82 | { 83 | if (experimental_WRITECOPY() && !(vprot & VPROT_COPIED)) 84 | -- 85 | 2.28.0 86 | 87 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/0007-ntdll-Report-unmodified-WRITECOPY-pages-as-shared.patch: -------------------------------------------------------------------------------- 1 | From 52baf4b2f68a78a2d0a0ad16fac8e25af70400ff Mon Sep 17 00:00:00 2001 2 | From: Andrew Wesie 3 | Date: Fri, 24 Apr 2020 14:55:17 -0500 4 | Subject: [PATCH] ntdll: Report unmodified WRITECOPY pages as shared. 5 | 6 | We also need to clear the modified bit after we clear memory in map_image to 7 | match the behavior of Windows. 8 | 9 | Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48665 10 | Signed-off-by: Andrew Wesie 11 | --- 12 | dlls/ntdll/unix/virtual.c | 4 +++- 13 | 1 file changed, 3 insertions(+), 1 deletion(-) 14 | 15 | diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c 16 | index 6c530304442..05d4d517aeb 100644 17 | --- a/dlls/ntdll/unix/virtual.c 18 | +++ b/dlls/ntdll/unix/virtual.c 19 | @@ -4420,7 +4422,7 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr, 20 | } 21 | 22 | p->VirtualAttributes.Valid = !(vprot & VPROT_GUARD) && (vprot & 0x0f) && (pagemap >> 63); 23 | - p->VirtualAttributes.Shared = !is_view_valloc( view ) && ((pagemap >> 61) & 1); 24 | + p->VirtualAttributes.Shared = (!is_view_valloc( view ) && ((pagemap >> 61) & 1)) || ((view->protect & VPROT_WRITECOPY) && !(vprot & VPROT_COPIED)); 25 | if (p->VirtualAttributes.Shared && p->VirtualAttributes.Valid) 26 | p->VirtualAttributes.ShareCount = 1; /* FIXME */ 27 | if (p->VirtualAttributes.Valid) 28 | -- 29 | 2.35.1 30 | 31 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/0008-ntdll-Fallback-to-copy-pages-for-WRITECOPY.patch: -------------------------------------------------------------------------------- 1 | From f26f4f9338473fee2ad3901fe5b259ac26e66f3c Mon Sep 17 00:00:00 2001 2 | From: Andrew Wesie 3 | Date: Tue, 28 Apr 2020 03:27:16 -0500 4 | Subject: [PATCH] ntdll: Fallback to copy pages for WRITECOPY. 5 | 6 | When a file is first mapped, whether it is mapped shared or private is 7 | determined by whether it is mapped with WRITECOPY. If the page protection later 8 | changes to include WRITECOPY, then virtual_handle_fault needs to change the page 9 | from shared to private. The only way to do this on Linux is to copy the page 10 | contents to a temporary location, map an anonymous page to the old location, 11 | then copy the contents to the new page. 12 | 13 | Signed-off-by: Andrew Wesie 14 | --- 15 | dlls/ntdll/unix/virtual.c | 25 +++++++++++++++++++++---- 16 | 1 file changed, 21 insertions(+), 4 deletions(-) 17 | 18 | diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c 19 | index 8346baf77a9..457468b47d9 100644 20 | --- a/dlls/ntdll/unix/virtual.c 21 | +++ b/dlls/ntdll/unix/virtual.c 22 | @@ -1587,8 +1587,9 @@ static BOOL set_vprot( struct file_view *view, void *base, size_t size, BYTE vpr 23 | return TRUE; 24 | } 25 | 26 | - /* check that we can map this memory with PROT_WRITE since we cannot fail later */ 27 | - if (vprot & VPROT_WRITECOPY) 28 | + /* check that we can map this memory with PROT_WRITE since we cannot fail later, 29 | + * but we fallback to copying pages for read-only mappings in virtual_handle_fault */ 30 | + if ((vprot & VPROT_WRITECOPY) && (view->protect & VPROT_WRITECOPY)) 31 | unix_prot |= PROT_WRITE; 32 | 33 | if (mprotect_exec( base, size, unix_prot )) return FALSE; 34 | @@ -3335,10 +3336,26 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack ) 35 | set_page_vprot_bits( page, page_size, 0, VPROT_WRITEWATCH ); 36 | mprotect_range( page, page_size, 0, 0 ); 37 | } 38 | - if (vprot & VPROT_WRITECOPY) 39 | + if ((vprot & VPROT_WRITECOPY) && (vprot & VPROT_COMMITTED)) 40 | { 41 | + struct file_view *view = find_view( page, 0 ); 42 | + 43 | set_page_vprot_bits( page, page_size, VPROT_WRITE | VPROT_COPIED, VPROT_WRITECOPY ); 44 | - mprotect_range( page, page_size, 0, 0 ); 45 | + if (view->protect & VPROT_WRITECOPY) 46 | + { 47 | + mprotect_range( page, page_size, 0, 0 ); 48 | + } 49 | + else 50 | + { 51 | + static BYTE *temp_page = NULL; 52 | + if (!temp_page) 53 | + temp_page = anon_mmap_alloc( page_size, PROT_READ | PROT_WRITE ); 54 | + 55 | + /* original mapping is shared, replace with a private page */ 56 | + memcpy( temp_page, page, page_size ); 57 | + anon_mmap_fixed( page, page_size, get_unix_prot( vprot | VPROT_WRITE | VPROT_COPIED ), 0 ); 58 | + memcpy( page, temp_page, page_size ); 59 | + } 60 | } 61 | /* ignore fault if page is writable now */ 62 | if (get_unix_prot( get_page_vprot( page ) ) & PROT_WRITE) ret = STATUS_SUCCESS; 63 | -- 64 | 2.30.2 65 | 66 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/0009-kernel32-tests-psapi-tests-Update-tests.patch: -------------------------------------------------------------------------------- 1 | From ada6b6d8363f2eeac8d8ed99d50f61610b047efe Mon Sep 17 00:00:00 2001 2 | From: Andrew Wesie 3 | Date: Mon, 27 Apr 2020 15:32:22 +0300 4 | Subject: [PATCH] kernel32/tests, psapi/tests: Update tests. 5 | 6 | --- 7 | dlls/kernel32/tests/virtual.c | 19 ++----------------- 8 | dlls/psapi/tests/psapi_main.c | 3 +++ 9 | 2 files changed, 5 insertions(+), 17 deletions(-) 10 | 11 | diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c 12 | index 365194b9065..8055e93faa0 100644 13 | --- a/dlls/kernel32/tests/virtual.c 14 | +++ b/dlls/kernel32/tests/virtual.c 15 | @@ -3604,9 +3604,7 @@ static void test_CreateFileMapping_protection(void) 16 | SetLastError(0xdeadbeef); 17 | ret = VirtualQuery(base, &info, sizeof(info)); 18 | ok(ret, "VirtualQuery failed %ld\n", GetLastError()); 19 | - /* FIXME: remove the condition below once Wine is fixed */ 20 | - todo_wine_if (td[i].prot == PAGE_WRITECOPY || td[i].prot == PAGE_EXECUTE_WRITECOPY) 21 | - ok(info.Protect == td[i].prot_after_write, "%ld: got %#lx != expected %#lx\n", i, info.Protect, td[i].prot_after_write); 22 | + ok(info.Protect == td[i].prot_after_write, "%ld: got %#lx != expected %#lx\n", i, info.Protect, td[i].prot_after_write); 23 | } 24 | } 25 | else 26 | @@ -3620,9 +3618,7 @@ static void test_CreateFileMapping_protection(void) 27 | SetLastError(0xdeadbeef); 28 | ret = VirtualProtect(base, si.dwPageSize, PAGE_NOACCESS, &old_prot); 29 | ok(ret, "%ld: VirtualProtect error %ld\n", i, GetLastError()); 30 | - /* FIXME: remove the condition below once Wine is fixed */ 31 | - todo_wine_if (td[i].prot == PAGE_WRITECOPY || td[i].prot == PAGE_EXECUTE_WRITECOPY) 32 | - ok(old_prot == td[i].prot_after_write, "%ld: got %#lx != expected %#lx\n", i, old_prot, td[i].prot_after_write); 33 | + ok(old_prot == td[i].prot_after_write, "%ld: got %#lx != expected %#lx\n", i, old_prot, td[i].prot_after_write); 34 | 35 | UnmapViewOfFile(base); 36 | } 37 | @@ -3975,15 +3971,12 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) 38 | continue; 39 | } 40 | 41 | - todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) 42 | ok(ret, "VirtualProtect error %ld, map %#lx, view %#lx, requested prot %#lx\n", GetLastError(), page_prot[i], view[j].prot, page_prot[k]); 43 | - todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) 44 | ok(old_prot == prev_prot, "got %#lx, expected %#lx\n", old_prot, prev_prot); 45 | prev_prot = actual_prot; 46 | 47 | ret = VirtualQuery(base, &info, sizeof(info)); 48 | ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); 49 | - todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) 50 | ok(info.Protect == actual_prot, 51 | "VirtualProtect wrong prot, map %#lx, view %#lx, requested prot %#lx got %#lx\n", 52 | page_prot[i], view[j].prot, page_prot[k], info.Protect ); 53 | @@ -4038,15 +4031,12 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) 54 | if (!anon_mapping && is_compatible_protection(alloc_prot, PAGE_WRITECOPY)) 55 | { 56 | ret = VirtualProtect(base, sec_flags & SEC_IMAGE ? si.dwPageSize : 2*si.dwPageSize, PAGE_WRITECOPY, &old_prot); 57 | - todo_wine_if(readonly && view[j].prot != PAGE_WRITECOPY) 58 | ok(ret, "VirtualProtect error %ld, map %#lx, view %#lx\n", GetLastError(), page_prot[i], view[j].prot); 59 | if (ret) *(DWORD*)base = 0xdeadbeef; 60 | ret = VirtualQuery(base, &info, sizeof(info)); 61 | ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); 62 | - todo_wine 63 | ok(info.Protect == PAGE_READWRITE, "VirtualProtect wrong prot, map %#lx, view %#lx got %#lx\n", 64 | page_prot[i], view[j].prot, info.Protect ); 65 | - todo_wine_if (!(sec_flags & SEC_IMAGE)) 66 | ok(info.RegionSize == si.dwPageSize, "wrong region size %#Ix after write, map %#lx, view %#lx got %#lx\n", 67 | info.RegionSize, page_prot[i], view[j].prot, info.Protect ); 68 | 69 | @@ -4057,7 +4047,6 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) 70 | { 71 | ret = VirtualQuery((char*)base + si.dwPageSize, &info, sizeof(info)); 72 | ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); 73 | - todo_wine_if(readonly && view[j].prot != PAGE_WRITECOPY) 74 | ok(info.Protect == PAGE_WRITECOPY, "wrong prot, map %#lx, view %#lx got %#lx\n", 75 | page_prot[i], view[j].prot, info.Protect); 76 | } 77 | @@ -4077,14 +4066,11 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags, BOOL readonly ) 78 | continue; 79 | } 80 | 81 | - todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) 82 | ok(ret, "VirtualProtect error %ld, map %#lx, view %#lx, requested prot %#lx\n", GetLastError(), page_prot[i], view[j].prot, page_prot[k]); 83 | - todo_wine_if(readonly && page_prot[k] == PAGE_WRITECOPY && view[j].prot != PAGE_WRITECOPY) 84 | ok(old_prot == prev_prot, "got %#lx, expected %#lx\n", old_prot, prev_prot); 85 | 86 | ret = VirtualQuery(base, &info, sizeof(info)); 87 | ok(ret, "%ld: VirtualQuery failed %ld\n", j, GetLastError()); 88 | - todo_wine_if( map_prot_written( page_prot[k] ) != actual_prot ) 89 | ok(info.Protect == map_prot_written( page_prot[k] ), 90 | "VirtualProtect wrong prot, map %#lx, view %#lx, requested prot %#lx got %#lx\n", 91 | page_prot[i], view[j].prot, page_prot[k], info.Protect ); 92 | @@ -4125,7 +4111,6 @@ static void test_mappings(void) 93 | SetFilePointer(hfile, 0, NULL, FILE_BEGIN); 94 | ok(ReadFile(hfile, &data, sizeof(data), &num_bytes, NULL), "ReadFile failed\n"); 95 | ok(num_bytes == sizeof(data), "num_bytes = %ld\n", num_bytes); 96 | - todo_wine 97 | ok(!data, "data = %lx\n", data); 98 | 99 | CloseHandle( hfile ); 100 | diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c 101 | index 185a4062092..1721968395d 100644 102 | --- a/dlls/psapi/tests/psapi_main.c 103 | +++ b/dlls/psapi/tests/psapi_main.c 104 | @@ -821,6 +821,9 @@ static void test_QueryWorkingSetEx(void) 105 | check_QueryWorkingSetEx(addr, "exe,readonly1", 0, 0, 1, TRUE); 106 | 107 | *(volatile char *)addr; 108 | + check_QueryWorkingSetEx(addr, "exe,readonly2", 1, PAGE_READONLY, 1, FALSE); 109 | + 110 | + ret = VirtualProtect(addr, 0x1000, PAGE_EXECUTE_READWRITE, &prot); 111 | ok(ret, "VirtualProtect failed with %ld\n", GetLastError()); 112 | check_QueryWorkingSetEx(addr, "exe,readonly2", 1, PAGE_READONLY, 1, FALSE); 113 | 114 | -- 115 | 2.35.1 116 | 117 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-WRITECOPY/definition: -------------------------------------------------------------------------------- 1 | Fixes: [29384] Multiple applications expect correct handling of WRITECOPY memory protection (Voobly fails to launch Age of Empires II, MSYS2) 2 | #Depends: ntdll-ForceBottomUpAlloc 3 | # Causes regressions? 4 | # https://bugs.wine-staging.com/show_bug.cgi?id=207 5 | # https://bugs.wine-staging.com/show_bug.cgi?id=521 6 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-ext4-case-folder/0002-ntdll-server-Mark-drive_c-as-case-insensitive-when-c.patch: -------------------------------------------------------------------------------- 1 | From 1fbb361023f9474a3522762aae32ad64d056e37e Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= 3 | Date: Fri, 24 May 2019 15:09:35 +0300 4 | Subject: [PATCH] ntdll/server: Mark drive_c as case-insensitive when created 5 | MIME-Version: 1.0 6 | Content-Type: text/plain; charset=UTF-8 7 | Content-Transfer-Encoding: 8bit 8 | 9 | Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47099 10 | Signed-off-by: Gabriel Ivăncescu 11 | --- 12 | dlls/ntdll/unix/server.c | 43 ++++++++++++++++++++++++++++++++++++++++ 13 | 1 file changed, 43 insertions(+) 14 | 15 | diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c 16 | index ab9d99c4f47..f40897757e3 100644 17 | --- a/dlls/ntdll/unix/server.c 18 | +++ b/dlls/ntdll/unix/server.c 19 | @@ -49,6 +49,10 @@ 20 | #ifdef HAVE_SYS_UN_H 21 | #include 22 | #endif 23 | +#include 24 | +#ifdef HAVE_LINUX_IOCTL_H 25 | +#include 26 | +#endif 27 | #ifdef HAVE_SYS_PRCTL_H 28 | # include 29 | #endif 30 | @@ -83,6 +87,22 @@ 31 | 32 | WINE_DEFAULT_DEBUG_CHANNEL(server); 33 | 34 | +/* just in case... */ 35 | +#undef EXT2_IOC_GETFLAGS 36 | +#undef EXT2_IOC_SETFLAGS 37 | +#undef EXT4_CASEFOLD_FL 38 | + 39 | +#ifdef __linux__ 40 | + 41 | +/* Define the ext2 ioctls for handling extra attributes */ 42 | +#define EXT2_IOC_GETFLAGS _IOR('f', 1, long) 43 | +#define EXT2_IOC_SETFLAGS _IOW('f', 2, long) 44 | + 45 | +/* Case-insensitivity attribute */ 46 | +#define EXT4_CASEFOLD_FL 0x40000000 47 | + 48 | +#endif 49 | + 50 | #ifndef MSG_CMSG_CLOEXEC 51 | #define MSG_CMSG_CLOEXEC 0 52 | #endif 53 | @@ -1137,6 +1157,28 @@ static const char *init_server_dir( dev_t dev, ino_t ino ) 54 | } 55 | 56 | 57 | +/*********************************************************************** 58 | + * set_case_insensitive 59 | + * 60 | + * Make the supplied directory case insensitive, if available. 61 | + */ 62 | +static void set_case_insensitive(const char *dir) 63 | +{ 64 | +#if defined(EXT2_IOC_GETFLAGS) && defined(EXT2_IOC_SETFLAGS) && defined(EXT4_CASEFOLD_FL) 65 | + int flags, fd; 66 | + 67 | + if ((fd = open(dir, O_RDONLY | O_NONBLOCK | O_LARGEFILE)) == -1) 68 | + return; 69 | + if (ioctl(fd, EXT2_IOC_GETFLAGS, &flags) != -1 && !(flags & EXT4_CASEFOLD_FL)) 70 | + { 71 | + flags |= EXT4_CASEFOLD_FL; 72 | + ioctl(fd, EXT2_IOC_SETFLAGS, &flags); 73 | + } 74 | + close(fd); 75 | +#endif 76 | +} 77 | + 78 | + 79 | /*********************************************************************** 80 | * setup_config_dir 81 | * 82 | @@ -1173,6 +1215,7 @@ static int setup_config_dir(void) 83 | if (!mkdir( "dosdevices", 0777 )) 84 | { 85 | mkdir( "drive_c", 0777 ); 86 | + set_case_insensitive( "drive_c" ); 87 | symlink( "../drive_c", "dosdevices/c:" ); 88 | symlink( "/", "dosdevices/z:" ); 89 | } 90 | -- 91 | 2.34.1 92 | 93 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/ntdll-ext4-case-folder/definition: -------------------------------------------------------------------------------- 1 | Fixes: [47099] Support for EXT4 case folding per directory. 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/packager-DllMain/0001-packager-Prefer-native-version.patch: -------------------------------------------------------------------------------- 1 | From cea29373b287ae84e28adca9834ffdbb97844ffe Mon Sep 17 00:00:00 2001 2 | From: Sebastian Lackner 3 | Date: Sun, 6 Aug 2017 02:50:23 +0200 4 | Subject: [PATCH] packager: Prefer native version. 5 | 6 | --- 7 | dlls/packager/Makefile.in | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/dlls/packager/Makefile.in b/dlls/packager/Makefile.in 11 | index f539cb6f095..faef8deb263 100644 12 | --- a/dlls/packager/Makefile.in 13 | +++ b/dlls/packager/Makefile.in 14 | @@ -2,6 +2,8 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES 15 | MODULE = packager.dll 16 | IMPORTS = uuid shell32 shlwapi user32 17 | 18 | +EXTRADLLFLAGS = -Wb,--prefer-native 19 | + 20 | C_SRCS = \ 21 | packager_main.c 22 | 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/packager-DllMain/definition: -------------------------------------------------------------------------------- 1 | Fixes: [43472] Prefer native version of packager.dll 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/rawinput/0006-winex11.drv-Send-relative-RawMotion-events-unprocess.patch: -------------------------------------------------------------------------------- 1 | From 7e0df0539b242a4a87b8189232eefb3164fe4617 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?R=C3=A9mi=20Bernon?= 3 | Date: Mon, 25 Oct 2021 11:48:00 +0200 4 | Subject: [PATCH] winex11.drv: Send relative RawMotion events unprocessed. 5 | 6 | This makes relative raw input independent from cursor speed, as it is 7 | the case on Windows. Absolute raw input is already translated to 8 | virtual desktop space, and cursor speed is meaningless in this case. 9 | 10 | This does not support mixed relative/absolute X/Y axis. 11 | --- 12 | dlls/winex11.drv/mouse.c | 24 ++++++++++++------------ 13 | 1 file changed, 12 insertions(+), 12 deletions(-) 14 | 15 | diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c 16 | index 739960b083e..b5f91634e94 100644 17 | --- a/dlls/winex11.drv/mouse.c 18 | +++ b/dlls/winex11.drv/mouse.c 19 | @@ -1925,12 +1925,12 @@ static BOOL X11DRV_XIDeviceChangedEvent( XIDeviceChangedEvent *event ) 20 | return TRUE; 21 | } 22 | 23 | -static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) 24 | +static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input, RAWINPUT *rawinput ) 25 | { 26 | struct x11drv_thread_data *thread_data = x11drv_thread_data(); 27 | XIValuatorClassInfo *x = &thread_data->x_valuator, *y = &thread_data->y_valuator; 28 | - double x_value = 0, y_value = 0, x_scale, y_scale, user_to_real_scale; 29 | - const double *values = event->valuators.values; 30 | + const double *values = event->valuators.values, *raw_values = event->raw_values; 31 | + double x_raw = 0, y_raw = 0, x_value = 0, y_value = 0, x_scale, y_scale, user_to_real_scale; 32 | RECT virtual_rect; 33 | HMONITOR monitor; 34 | POINT pt; 35 | @@ -1961,33 +1961,36 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) 36 | if (!XIMaskIsSet( event->valuators.mask, i )) continue; 37 | if (i == x->number) 38 | { 39 | + x_raw = *raw_values; 40 | x_value = *values; 41 | if (x->mode == XIModeRelative) x->value += x_value * x_scale; 42 | else x->value = (x_value - x->min) * x_scale; 43 | } 44 | if (i == y->number) 45 | { 46 | + y_raw = *raw_values; 47 | y_value = *values; 48 | if (y->mode == XIModeRelative) y->value += y_value * y_scale; 49 | else y->value = (y_value - y->min) * y_scale; 50 | } 51 | + raw_values++; 52 | values++; 53 | } 54 | 55 | input->u.mi.dx = round( x->value ); 56 | input->u.mi.dy = round( y->value ); 57 | 58 | + if (x->mode != XIModeAbsolute) rawinput->data.mouse.lLastX = x_raw; 59 | + else rawinput->data.mouse.lLastX = input->u.mi.dx; 60 | + if (y->mode != XIModeAbsolute) rawinput->data.mouse.lLastY = y_raw; 61 | + else rawinput->data.mouse.lLastY = input->u.mi.dy; 62 | + 63 | TRACE( "event %f,%f value %f,%f input %d,%d\n", x_value, y_value, x->value, y->value, 64 | (int)input->u.mi.dx, (int)input->u.mi.dy ); 65 | 66 | x->value -= input->u.mi.dx; 67 | y->value -= input->u.mi.dy; 68 | 69 | - if (!(input->u.mi.dwFlags & MOUSEEVENTF_ABSOLUTE) && !input->u.mi.dx && !input->u.mi.dy) 70 | - { 71 | - TRACE( "accumulating motion\n" ); 72 | - return FALSE; 73 | - } 74 | 75 | if (input->u.mi.dwFlags & MOUSEEVENTF_ABSOLUTE) 76 | fs_hack_point_real_to_user( (POINT *)&input->u.mi.dx ); 77 | @@ -2029,7 +2032,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) 78 | input.u.mi.dwExtraInfo = 0; 79 | input.u.mi.dx = 0; 80 | input.u.mi.dy = 0; 81 | - if (!map_raw_event_coords( event, &input )) return FALSE; 82 | + if (!map_raw_event_coords( event, &input, &rawinput )) return FALSE; 83 | 84 | if (!thread_data->xi2_rawinput_only) 85 | __wine_send_input( 0, &input, NULL ); 86 | @@ -2043,8 +2046,6 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) 87 | rawinput.data.mouse.ulRawButtons = 0; 88 | rawinput.data.mouse.u.usButtonData = 0; 89 | rawinput.data.mouse.u.usButtonFlags = 0; 90 | - rawinput.data.mouse.lLastX = input.u.mi.dx; 91 | - rawinput.data.mouse.lLastY = input.u.mi.dy; 92 | rawinput.data.mouse.ulExtraInformation = 0; 93 | 94 | input.type = INPUT_HARDWARE; 95 | @@ -2231,7 +2232,7 @@ static BOOL X11DRV_RawTouchEvent( XGenericEventCookie *xev ) 96 | POINT pos; 97 | 98 | if (!thread_data->xi2_rawinput_only) return FALSE; 99 | - if (!map_raw_event_coords( event, &input )) return FALSE; 100 | + if (!map_raw_event_coords( event, &input, &rawinput )) return FALSE; 101 | if (!(input.u.mi.dwFlags & MOUSEEVENTF_ABSOLUTE)) return FALSE; 102 | pos.x = input.u.mi.dx; 103 | pos.y = input.u.mi.dy; 104 | -- 105 | 2.38.1 106 | 107 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/shell32-NewMenu_Interface/definition: -------------------------------------------------------------------------------- 1 | Fixes: [24812] Implement shell32 NewMenu class with new folder item 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/shell32-registry-lookup-app/0001-shell32-Append-.exe-when-registry-lookup-fails-first.patch: -------------------------------------------------------------------------------- 1 | From 70e0b924b2c89bae3f5723c6397fb00df6283586 Mon Sep 17 00:00:00 2001 2 | From: Louis Lenders 3 | Date: Thu, 4 Nov 2021 21:01:24 +1100 4 | Subject: [PATCH] shell32: Append .exe when registry lookup fails first time 5 | 6 | --- 7 | dlls/shell32/shlexec.c | 5 ++++- 8 | 1 file changed, 4 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c 11 | index 2d1830ad838..5e2ba987502 100644 12 | --- a/dlls/shell32/shlexec.c 13 | +++ b/dlls/shell32/shlexec.c 14 | @@ -437,7 +437,10 @@ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env) 15 | 16 | wcscat(buffer, szName); 17 | res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp); 18 | - if (res) goto end; 19 | + if (res) 20 | + res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, lstrcatW(buffer, L".exe"), 0, KEY_READ, &hkApp); 21 | + if (res) 22 | + goto end; 23 | 24 | len = MAX_PATH*sizeof(WCHAR); 25 | res = RegQueryValueW(hkApp, NULL, lpResult, &len); 26 | -- 27 | 2.33.0 28 | 29 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/shell32-registry-lookup-app/definition: -------------------------------------------------------------------------------- 1 | Fixes: [51957] Append .exe, if registry lookup fails first. 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/user32-FlashWindowEx/0001-user32-Improve-FlashWindowEx-message-and-return-valu.patch: -------------------------------------------------------------------------------- 1 | From a295be388db4bbe50867b295d09a57726321261c Mon Sep 17 00:00:00 2001 2 | From: James Coonradt 3 | Date: Tue, 19 Sep 2017 12:28:50 -0600 4 | Subject: [PATCH] user32: Improve FlashWindowEx message and return value. 5 | 6 | --- 7 | dlls/user32/tests/win.c | 4 ++-- 8 | dlls/user32/win.c | 1 - 9 | dlls/win32u/window.c | 5 ++--- 10 | 3 files changed, 4 insertions(+), 6 deletions(-) 11 | 12 | diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c 13 | index 496c3f9ab07..2718d4c96c9 100644 14 | --- a/dlls/user32/tests/win.c 15 | +++ b/dlls/user32/tests/win.c 16 | @@ -9825,7 +9825,7 @@ static void test_FlashWindowEx(void) 17 | 18 | SetLastError(0xdeadbeef); 19 | ret = pFlashWindowEx(&finfo); 20 | - todo_wine ok(!ret, "previous window state should not be active\n"); 21 | + ok(!ret, "previous window state should not be active\n"); 22 | 23 | finfo.cbSize = sizeof(FLASHWINFO) - 1; 24 | SetLastError(0xdeadbeef); 25 | @@ -9876,7 +9876,7 @@ static void test_FlashWindowEx(void) 26 | finfo.dwFlags = FLASHW_STOP; 27 | SetLastError(0xdeadbeef); 28 | ret = pFlashWindowEx(&finfo); 29 | - ok(prev != ret, "previous window state should be different\n"); 30 | + todo_wine ok(prev != ret, "previous window state should be different\n"); 31 | 32 | DestroyWindow( hwnd ); 33 | } 34 | diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c 35 | index 70f73cb0fb3..e677e21af5d 100644 36 | --- a/dlls/win32u/window.c 37 | +++ b/dlls/win32u/window.c 38 | @@ -4551,8 +4551,7 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info ) 39 | if (!win || win == WND_OTHER_PROCESS || win == WND_DESKTOP) return FALSE; 40 | hwnd = win->obj.handle; /* make it a full handle */ 41 | 42 | - if (info->dwFlags) wparam = !(win->flags & WIN_NCACTIVATED); 43 | - else wparam = (hwnd == NtUserGetForegroundWindow()); 44 | + wparam = (win->flags & WIN_NCACTIVATED) != 0; 45 | 46 | release_win_ptr( win ); 47 | 48 | @@ -4560,7 +4559,7 @@ BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info ) 49 | send_notify_message( hwnd, WM_NCACTIVATE, wparam, 0, 0 ); 50 | 51 | user_driver->pFlashWindowEx( info ); 52 | - return wparam; 53 | + return (info->dwFlags & FLASHW_CAPTION) ? TRUE : wparam; 54 | } 55 | } 56 | 57 | -- 58 | 2.35.1 59 | 60 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/user32-FlashWindowEx/definition: -------------------------------------------------------------------------------- 1 | Fixes: [43124] FlashWindowEx: WM_NCACTIVATE behavior is incorrect 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/windows.networking.connectivity-new-dll/0002-include-Add-windows.networking.idl.patch: -------------------------------------------------------------------------------- 1 | From e98050400335c07a044c28774c802647ff075af5 Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Tue, 1 Jun 2021 10:26:28 +1000 4 | Subject: [PATCH] include: Add windows.networking.idl 5 | 6 | --- 7 | include/Makefile.in | 1 + 8 | include/windows.networking.idl | 87 ++++++++++++++++++++++++++++++++++ 9 | 2 files changed, 88 insertions(+) 10 | create mode 100644 include/windows.networking.idl 11 | 12 | diff --git a/include/Makefile.in b/include/Makefile.in 13 | index e379070caa9..043f1436216 100644 14 | --- a/include/Makefile.in 15 | +++ b/include/Makefile.in 16 | @@ -786,6 +786,7 @@ SOURCES = \ 17 | windows.media.devices.idl \ 18 | windows.media.idl \ 19 | windows.media.speechsynthesis.idl \ 20 | + windows.networking.idl \ 21 | windows.networking.connectivity.idl \ 22 | windows.security.cryptography.idl \ 23 | windows.security.exchangeactivesyncprovisioning.idl \ 24 | diff --git a/include/windows.networking.idl b/include/windows.networking.idl 25 | new file mode 100644 26 | index 00000000000..160cd78e540 27 | --- /dev/null 28 | +++ b/include/windows.networking.idl 29 | @@ -0,0 +1,87 @@ 30 | +/* 31 | + * Copyright 2021 Alistair Leslie-Hughes 32 | + * 33 | + * This library is free software; you can redistribute it and/or 34 | + * modify it under the terms of the GNU Lesser General Public 35 | + * License as published by the Free Software Foundation; either 36 | + * version 2.1 of the License, or (at your option) any later version. 37 | + * 38 | + * This library is distributed in the hope that it will be useful, 39 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of 40 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 41 | + * Lesser General Public License for more details. 42 | + * 43 | + * You should have received a copy of the GNU Lesser General Public 44 | + * License along with this library; if not, write to the Free Software 45 | + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 46 | + */ 47 | + 48 | +#ifdef __WIDL__ 49 | +#pragma winrt ns_prefix 50 | +#endif 51 | + 52 | +import "inspectable.idl"; 53 | +import "asyncinfo.idl"; 54 | +import "eventtoken.idl"; 55 | +import "windowscontracts.idl"; 56 | +import "windows.foundation.idl"; 57 | +import "windows.networking.connectivity.idl"; 58 | + 59 | +namespace Windows 60 | +{ 61 | + namespace Networking 62 | + { 63 | + typedef enum HostNameType HostNameType; 64 | + 65 | + runtimeclass HostName; 66 | + 67 | + [contract(Windows.Foundation.UniversalApiContract, 1.0)] 68 | + enum HostNameType 69 | + { 70 | + DomainName, 71 | + Ipv4, 72 | + Ipv6, 73 | + Bluetooth 74 | + }; 75 | + 76 | + [contract(Windows.Foundation.UniversalApiContract, 1.0)] 77 | + [exclusiveto(Windows.Networking.HostName)] 78 | + [uuid(bf8ecaad-ed96-49a7-9084-d416cae88dcb)] 79 | + interface IHostName : IInspectable 80 | + { 81 | + [propget] HRESULT IPInformation([out, retval] Windows.Networking.Connectivity.IPInformation** value); 82 | + [propget] HRESULT RawName([out, retval] HSTRING* value); 83 | + [propget] HRESULT DisplayName([out, retval] HSTRING* value); 84 | + [propget] HRESULT CanonicalName([out, retval] HSTRING* value); 85 | + [propget] HRESULT Type([out, retval] Windows.Networking.HostNameType* value); 86 | + HRESULT IsEqual([in] Windows.Networking.HostName* hostName, [out, retval] boolean* equal); 87 | + } 88 | + 89 | + [contract(Windows.Foundation.UniversalApiContract, 1.0)] 90 | + [exclusiveto(Windows.Networking.HostName)] 91 | + [uuid(458c23ed-712f-4576-adf1-c20b2c643558)] 92 | + interface IHostNameFactory : IInspectable 93 | + { 94 | + HRESULT CreateHostName([in] HSTRING hostname, [out, retval] Windows.Networking.HostName** value); 95 | + } 96 | + 97 | + [contract(Windows.Foundation.UniversalApiContract, 1.0)] 98 | + [exclusiveto(Windows.Networking.HostName)] 99 | + [uuid(f68cd4bf-a388-4e8b-91ea-54dd6dd901c0)] 100 | + interface IHostNameStatics : IInspectable 101 | + { 102 | + HRESULT Compare([in] HSTRING value1, [in] HSTRING value2, [out, retval] INT32* result); 103 | + } 104 | + 105 | + /*[activatable(Windows.Networking.IHostNameFactory, Windows.Foundation.UniversalApiContract, 1.0)]*/ 106 | + [contract(Windows.Foundation.UniversalApiContract, 1.0)] 107 | + [marshaling_behavior(agile)] 108 | + [static(Windows.Networking.IHostNameStatics, Windows.Foundation.UniversalApiContract, 1.0)] 109 | + [threading(both)] 110 | + runtimeclass HostName 111 | + { 112 | + [default] interface Windows.Networking.IHostName; 113 | + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Foundation.IStringable; 114 | + } 115 | + } 116 | +} 117 | \ No newline at end of file 118 | -- 119 | 2.33.0 120 | 121 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/windows.networking.connectivity-new-dll/0003-windows.networking.connectivity-Add-stub-dll.patch: -------------------------------------------------------------------------------- 1 | From a446063a84d5b48ac4c8aa05abca98da8a386467 Mon Sep 17 00:00:00 2001 2 | From: Esdras Tarsis 3 | Date: Wed, 2 Sep 2020 23:41:19 -0300 4 | Subject: [PATCH 3/8] windows.networking.connectivity: Add stub dll. 5 | 6 | Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46534 7 | Signed-off-by: Esdras Tarsis 8 | --- 9 | configure.ac | 1 + 10 | .../Makefile.in | 7 ++++ 11 | .../windows.networking.connectivity.spec | 3 ++ 12 | .../windows.networking.connectivity_main.c | 35 +++++++++++++++++++ 13 | 4 files changed, 46 insertions(+) 14 | create mode 100644 dlls/windows.networking.connectivity/Makefile.in 15 | create mode 100644 dlls/windows.networking.connectivity/windows.networking.connectivity.spec 16 | create mode 100644 dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 17 | 18 | diff --git a/configure.ac b/configure.ac 19 | index 7ea0d824cee..e8d0d8a9023 100644 20 | --- a/configure.ac 21 | +++ b/configure.ac 22 | @@ -3775,6 +3775,7 @@ WINE_CONFIG_MAKEFILE(dlls/windows.media.devices) 23 | WINE_CONFIG_MAKEFILE(dlls/windows.media.speech) 24 | WINE_CONFIG_MAKEFILE(dlls/windows.media.speech/tests) 25 | WINE_CONFIG_MAKEFILE(dlls/windows.networking) 26 | +WINE_CONFIG_MAKEFILE(dlls/windows.networking.connectivity) 27 | WINE_CONFIG_MAKEFILE(dlls/windowscodecs) 28 | WINE_CONFIG_MAKEFILE(dlls/windowscodecs/tests) 29 | WINE_CONFIG_MAKEFILE(dlls/windowscodecsext) 30 | diff --git a/dlls/windows.networking.connectivity/Makefile.in b/dlls/windows.networking.connectivity/Makefile.in 31 | new file mode 100644 32 | index 00000000000..6fc24a72feb 33 | --- /dev/null 34 | +++ b/dlls/windows.networking.connectivity/Makefile.in 35 | @@ -0,0 +1,7 @@ 36 | +MODULE = windows.networking.connectivity 37 | +IMPORTS = combase uuid 38 | + 39 | +EXTRADLLFLAGS = -mno-cygwin 40 | + 41 | +C_SRCS = \ 42 | + windows.networking.connectivity_main.c 43 | diff --git a/dlls/windows.networking.connectivity/windows.networking.connectivity.spec b/dlls/windows.networking.connectivity/windows.networking.connectivity.spec 44 | new file mode 100644 45 | index 00000000000..4b286869e02 46 | --- /dev/null 47 | +++ b/dlls/windows.networking.connectivity/windows.networking.connectivity.spec 48 | @@ -0,0 +1,3 @@ 49 | +@ stdcall -private DllCanUnloadNow() 50 | +@ stdcall -private DllGetActivationFactory(ptr ptr) 51 | +@ stdcall -private DllGetClassObject(ptr ptr ptr) 52 | \ No newline at end of file 53 | diff --git a/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c b/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 54 | new file mode 100644 55 | index 00000000000..96ff0ea5af2 56 | --- /dev/null 57 | +++ b/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 58 | @@ -0,0 +1,35 @@ 59 | +#include 60 | + 61 | +#define COBJMACROS 62 | +#include "windef.h" 63 | +#include "winbase.h" 64 | +#include "winstring.h" 65 | +#include "wine/debug.h" 66 | + 67 | +#include "objbase.h" 68 | +#include "initguid.h" 69 | + 70 | +#include "activation.h" 71 | + 72 | +WINE_DEFAULT_DEBUG_CHANNEL(network); 73 | + 74 | +static const char *debugstr_hstring(HSTRING hstr) 75 | +{ 76 | + const WCHAR *str; 77 | + UINT32 len; 78 | + if (hstr && !((ULONG_PTR)hstr >> 16)) return "(invalid)"; 79 | + str = WindowsGetStringRawBuffer(hstr, &len); 80 | + return wine_dbgstr_wn(str, len); 81 | +} 82 | + 83 | +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, LPVOID *object) 84 | +{ 85 | + FIXME("clsid %s, riid %s, object %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), object); 86 | + return CLASS_E_CLASSNOTAVAILABLE; 87 | +} 88 | + 89 | +HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory) 90 | +{ 91 | + FIXME("classid %s, factory %p stub!\n", debugstr_hstring(classid), factory); 92 | + return E_NOINTERFACE; 93 | +} 94 | \ No newline at end of file 95 | -- 96 | 2.30.2 97 | 98 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/windows.networking.connectivity-new-dll/0004-windows.networking.connectivity-Implement-IActivatio.patch: -------------------------------------------------------------------------------- 1 | From 587e8baeef029940518223d13b754b4e6c0352cd Mon Sep 17 00:00:00 2001 2 | From: Esdras Tarsis 3 | Date: Wed, 2 Sep 2020 23:53:28 -0300 4 | Subject: [PATCH 4/8] windows.networking.connectivity: Implement 5 | IActivationFactory stubs. 6 | 7 | v2: 8 | Add Proper QueryInterface 9 | Fixed Initial Reference Count value. 10 | --- 11 | .../windows.networking.connectivity_main.c | 104 +++++++++++++++++- 12 | 1 file changed, 101 insertions(+), 3 deletions(-) 13 | 14 | diff --git a/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c b/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 15 | index 96ff0ea5af2..2463cc2c93c 100644 16 | --- a/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 17 | +++ b/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 18 | @@ -22,6 +22,102 @@ static const char *debugstr_hstring(HSTRING hstr) 19 | return wine_dbgstr_wn(str, len); 20 | } 21 | 22 | +struct windows_networking_connectivity 23 | +{ 24 | + IActivationFactory IActivationFactory_iface; 25 | + LONG refcount; 26 | +}; 27 | + 28 | +static inline struct windows_networking_connectivity *impl_from_IActivationFactory(IActivationFactory *iface) 29 | +{ 30 | + return CONTAINING_RECORD(iface, struct windows_networking_connectivity, IActivationFactory_iface); 31 | +} 32 | + 33 | +static HRESULT STDMETHODCALLTYPE windows_networking_connectivity_QueryInterface( 34 | + IActivationFactory *iface, REFIID iid, void **object) 35 | +{ 36 | + TRACE("iface %p, iid %s, object %p stub!\n", iface, debugstr_guid(iid), object); 37 | + 38 | + if (IsEqualGUID(iid, &IID_IUnknown) || 39 | + IsEqualGUID(iid, &IID_IInspectable) || 40 | + IsEqualGUID(iid, &IID_IAgileObject) || 41 | + IsEqualGUID(iid, &IID_IActivationFactory)) 42 | + { 43 | + IUnknown_AddRef(iface); 44 | + *object = &impl->INetworkInformationStatics_iface; 45 | + return S_OK; 46 | + } 47 | + 48 | + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); 49 | + *object = NULL; 50 | + return E_NOINTERFACE; 51 | +} 52 | + 53 | +static ULONG STDMETHODCALLTYPE windows_networking_connectivity_AddRef( 54 | + IActivationFactory *iface) 55 | +{ 56 | + struct windows_networking_connectivity *impl = impl_from_IActivationFactory(iface); 57 | + ULONG rc = InterlockedIncrement(&impl->refcount); 58 | + TRACE("%p increasing refcount to %u.\n", impl, rc); 59 | + return rc; 60 | +} 61 | + 62 | +static ULONG STDMETHODCALLTYPE windows_networking_connectivity_Release( 63 | + IActivationFactory *iface) 64 | +{ 65 | + struct windows_networking_connectivity *impl = impl_from_IActivationFactory(iface); 66 | + ULONG rc = InterlockedDecrement(&impl->refcount); 67 | + TRACE("%p decreasing refcount to %u.\n", impl, rc); 68 | + return rc; 69 | +} 70 | + 71 | +static HRESULT STDMETHODCALLTYPE windows_networking_connectivity_GetIids( 72 | + IActivationFactory *iface, ULONG *iid_count, IID **iids) 73 | +{ 74 | + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); 75 | + return E_NOTIMPL; 76 | +} 77 | + 78 | +static HRESULT STDMETHODCALLTYPE windows_networking_connectivity_GetRuntimeClassName( 79 | + IActivationFactory *iface, HSTRING *class_name) 80 | +{ 81 | + FIXME("iface %p, class_name %p stub!\n", iface, class_name); 82 | + return E_NOTIMPL; 83 | +} 84 | + 85 | +static HRESULT STDMETHODCALLTYPE windows_networking_connectivity_GetTrustLevel( 86 | + IActivationFactory *iface, TrustLevel *trust_level) 87 | +{ 88 | + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); 89 | + return E_NOTIMPL; 90 | +} 91 | + 92 | +static HRESULT STDMETHODCALLTYPE windows_networking_connectivity_ActivateInstance( 93 | + IActivationFactory *iface, IInspectable **instance) 94 | +{ 95 | + FIXME("iface %p, instance %p stub!\n", iface, instance); 96 | + return E_NOTIMPL; 97 | +} 98 | + 99 | +static const struct IActivationFactoryVtbl activation_factory_vtbl = 100 | +{ 101 | + windows_networking_connectivity_QueryInterface, 102 | + windows_networking_connectivity_AddRef, 103 | + windows_networking_connectivity_Release, 104 | + /* IInspectable methods */ 105 | + windows_networking_connectivity_GetIids, 106 | + windows_networking_connectivity_GetRuntimeClassName, 107 | + windows_networking_connectivity_GetTrustLevel, 108 | + /* IActivationFactory methods */ 109 | + windows_networking_connectivity_ActivateInstance, 110 | +}; 111 | + 112 | +static struct windows_networking_connectivity windows_networking_connectivity = 113 | +{ 114 | + {&activation_factory_vtbl}, 115 | + 1 116 | +}; 117 | + 118 | HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, LPVOID *object) 119 | { 120 | FIXME("clsid %s, riid %s, object %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), object); 121 | @@ -30,6 +126,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, LPVOID *object) 122 | 123 | HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory) 124 | { 125 | - FIXME("classid %s, factory %p stub!\n", debugstr_hstring(classid), factory); 126 | - return E_NOINTERFACE; 127 | -} 128 | \ No newline at end of file 129 | + TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory); 130 | + *factory = &windows_networking_connectivity.IActivationFactory_iface; 131 | + IUnknown_AddRef(*factory); 132 | + return S_OK; 133 | +} 134 | -- 135 | 2.30.2 136 | 137 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/windows.networking.connectivity-new-dll/0006-windows.networking.connectivity-Registry-DLL.patch: -------------------------------------------------------------------------------- 1 | From 911464a8aba1d14e5191daf47501e39f78b3c9a1 Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Mon, 31 May 2021 09:45:56 +1000 4 | Subject: [PATCH 6/8] windows.networking.connectivity: Registry DLL 5 | 6 | This is a temp solution until the IDL can used for registration. 7 | --- 8 | .../Makefile.in | 3 +++ 9 | .../network.rgs | 19 ++++++++++++++++++ 10 | dlls/windows.networking.connectivity/rsrc.rc | 20 +++++++++++++++++++ 11 | 3 files changed, 42 insertions(+) 12 | create mode 100644 dlls/windows.networking.connectivity/network.rgs 13 | create mode 100644 dlls/windows.networking.connectivity/rsrc.rc 14 | 15 | diff --git a/dlls/windows.networking.connectivity/Makefile.in b/dlls/windows.networking.connectivity/Makefile.in 16 | index 6fc24a72feb..5785430da2c 100644 17 | --- a/dlls/windows.networking.connectivity/Makefile.in 18 | +++ b/dlls/windows.networking.connectivity/Makefile.in 19 | @@ -5,3 +5,6 @@ EXTRADLLFLAGS = -mno-cygwin 20 | 21 | C_SRCS = \ 22 | windows.networking.connectivity_main.c 23 | + 24 | +RC_SRCS = rsrc.rc 25 | + 26 | diff --git a/dlls/windows.networking.connectivity/network.rgs b/dlls/windows.networking.connectivity/network.rgs 27 | new file mode 100644 28 | index 00000000000..59d6f739a72 29 | --- /dev/null 30 | +++ b/dlls/windows.networking.connectivity/network.rgs 31 | @@ -0,0 +1,19 @@ 32 | +HKLM 33 | +{ 34 | + NoRemove Software 35 | + { 36 | + NoRemove Microsoft 37 | + { 38 | + NoRemove WindowsRuntime 39 | + { 40 | + NoRemove ActivatableClassId 41 | + { 42 | + ForceRemove Windows.Networking.Connectivity.NetworkInformation 43 | + { 44 | + val 'DllPath' = s '%MODULE%' 45 | + } 46 | + } 47 | + } 48 | + } 49 | + } 50 | +} 51 | diff --git a/dlls/windows.networking.connectivity/rsrc.rc b/dlls/windows.networking.connectivity/rsrc.rc 52 | new file mode 100644 53 | index 00000000000..3ebeb3a7000 54 | --- /dev/null 55 | +++ b/dlls/windows.networking.connectivity/rsrc.rc 56 | @@ -0,0 +1,20 @@ 57 | +/* 58 | + * Copyright 2021 Alistair Leslie-Hughes 59 | + * 60 | + * This library is free software; you can redistribute it and/or 61 | + * modify it under the terms of the GNU Lesser General Public 62 | + * License as published by the Free Software Foundation; either 63 | + * version 2.1 of the License, or (at your option) any later version. 64 | + * 65 | + * This library is distributed in the hope that it will be useful, 66 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of 67 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 68 | + * Lesser General Public License for more details. 69 | + * 70 | + * You should have received a copy of the GNU Lesser General Public 71 | + * License along with this library; if not, write to the Free Software 72 | + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 73 | + */ 74 | + 75 | +/* @makedep: network.rgs */ 76 | +1 WINE_REGISTRY network.rgs 77 | -- 78 | 2.30.2 79 | 80 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/windows.networking.connectivity-new-dll/0007-windows.networking.connectivity-Implement-INetworkIn.patch: -------------------------------------------------------------------------------- 1 | From ef41fa79b32aa3d211e1e8b64b9ace89f8fa5876 Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Tue, 1 Jun 2021 13:13:57 +1000 4 | Subject: [PATCH 7/8] windows.networking.connectivity: Implement 5 | INetworkInformationStatics GetInternetConnectionProfile 6 | 7 | --- 8 | .../windows.networking.connectivity_main.c | 163 +++++++++++++++++- 9 | 1 file changed, 161 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c b/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 12 | index b96e6c4f0a4..ba1f5a5401d 100644 13 | --- a/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 14 | +++ b/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 15 | @@ -5,6 +5,7 @@ 16 | #include "winbase.h" 17 | #include "winstring.h" 18 | #include "wine/debug.h" 19 | +#include "wine/heap.h" 20 | 21 | #include "objbase.h" 22 | #include "initguid.h" 23 | @@ -201,12 +202,170 @@ static HRESULT STDMETHODCALLTYPE network_information_statics_GetConnectionProfil 24 | return S_OK; 25 | } 26 | 27 | -static HRESULT STDMETHODCALLTYPE network_information_statics_GetInternetConnectionProfile(INetworkInformationStatics *iface, IConnectionProfile **value) 28 | +struct connection_profile 29 | { 30 | - FIXME("iface %p, %p stub!\n", iface, value); 31 | + IConnectionProfile IConnectionProfile_iface; 32 | + LONG ref; 33 | +}; 34 | + 35 | +static inline struct connection_profile *impl_from_IConnectionProfile(IConnectionProfile *iface) 36 | +{ 37 | + return CONTAINING_RECORD(iface, struct connection_profile, IConnectionProfile_iface); 38 | +} 39 | + 40 | +static HRESULT WINAPI connection_profile_QueryInterface(IConnectionProfile *iface, REFIID riid, void **object) 41 | +{ 42 | + TRACE("iface %p, iid %s, object %p stub!\n", iface, debugstr_guid(riid), object); 43 | + 44 | + if (IsEqualGUID(riid, &IID_IUnknown) || 45 | + IsEqualGUID(riid, &IID_IInspectable) || 46 | + IsEqualGUID(riid, &IID_IConnectionProfile)) 47 | + { 48 | + IUnknown_AddRef(iface); 49 | + *object = iface; 50 | + return S_OK; 51 | + } 52 | + 53 | + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); 54 | + *object = NULL; 55 | + return E_NOINTERFACE; 56 | +} 57 | + 58 | +static ULONG WINAPI connection_profile_AddRef(IConnectionProfile *iface) 59 | +{ 60 | + struct connection_profile *impl = impl_from_IConnectionProfile(iface); 61 | + ULONG rc = InterlockedIncrement(&impl->ref); 62 | + TRACE("%p increasing refcount to %u.\n", impl, rc); 63 | + return rc; 64 | +} 65 | + 66 | +static ULONG WINAPI connection_profile_Release(IConnectionProfile *iface) 67 | +{ 68 | + struct connection_profile *impl = impl_from_IConnectionProfile(iface); 69 | + ULONG rc = InterlockedIncrement(&impl->ref); 70 | + TRACE("%p increasing refcount to %u.\n", impl, rc); 71 | + return rc; 72 | +} 73 | + 74 | +static HRESULT WINAPI connection_profile_GetIids(IConnectionProfile *iface, ULONG *iid_count, IID **iids) 75 | +{ 76 | + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); 77 | + return E_NOTIMPL; 78 | +} 79 | + 80 | +static HRESULT WINAPI connection_profile_GetRuntimeClassName(IConnectionProfile *iface, HSTRING *class_name) 81 | +{ 82 | + FIXME("iface %p, class_name %p stub!\n", iface, class_name); 83 | + return E_NOTIMPL; 84 | +} 85 | + 86 | +static HRESULT WINAPI connection_profile_GetTrustLevel(IConnectionProfile *iface, TrustLevel *trust_level) 87 | +{ 88 | + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); 89 | + return E_NOTIMPL; 90 | +} 91 | + 92 | +static HRESULT WINAPI connection_profile_get_ProfileName(IConnectionProfile *iface, HSTRING *value) 93 | +{ 94 | + FIXME("iface %p, value %p stub!\n", iface, value); 95 | return E_NOTIMPL; 96 | } 97 | 98 | +static HRESULT WINAPI connection_profile_GetNetworkConnectivityLevel(IConnectionProfile *iface, 99 | + enum __x_ABI_CWindows_CNetworking_CConnectivity_CNetworkConnectivityLevel *value) 100 | +{ 101 | + FIXME("iface %p, value %p stub!\n", iface, value); 102 | + return E_NOTIMPL; 103 | +} 104 | + 105 | +static HRESULT WINAPI connection_profile_GetNetworkNames(IConnectionProfile *iface, __FIVectorView_1_HSTRING **value) 106 | +{ 107 | + FIXME("iface %p, value %p stub!\n", iface, value); 108 | + return E_NOTIMPL; 109 | +} 110 | + 111 | +static HRESULT WINAPI connection_profile_GetConnectionCost(IConnectionProfile *iface, 112 | + __x_ABI_CWindows_CNetworking_CConnectivity_CIConnectionCost **value) 113 | +{ 114 | + FIXME("iface %p, value %p stub!\n", iface, value); 115 | + return E_NOTIMPL; 116 | +} 117 | + 118 | +static HRESULT WINAPI connection_profile_GetDataPlanStatus(IConnectionProfile *iface, 119 | + __x_ABI_CWindows_CNetworking_CConnectivity_CIDataPlanStatus **value) 120 | +{ 121 | + FIXME("iface %p, value %p stub!\n", iface, value); 122 | + return E_NOTIMPL; 123 | +} 124 | + 125 | +static HRESULT WINAPI connection_profile_get_NetworkAdapter(IConnectionProfile *iface, 126 | + __x_ABI_CWindows_CNetworking_CConnectivity_CINetworkAdapter **value) 127 | +{ 128 | + FIXME("iface %p, value %p stub!\n", iface, value); 129 | + return E_NOTIMPL; 130 | +} 131 | + 132 | +static HRESULT WINAPI connection_profile_GetLocalUsage(IConnectionProfile *iface, 133 | + struct __x_ABI_CWindows_CFoundation_CDateTime start, struct __x_ABI_CWindows_CFoundation_CDateTime end, 134 | + __x_ABI_CWindows_CNetworking_CConnectivity_CIDataUsage **value) 135 | +{ 136 | + FIXME("iface %p, value %p stub!\n", iface, value); 137 | + return E_NOTIMPL; 138 | +} 139 | + 140 | +static HRESULT WINAPI connection_profile_GetLocalUsagePerRoamingStates(IConnectionProfile *iface, 141 | + struct __x_ABI_CWindows_CFoundation_CDateTime start, struct __x_ABI_CWindows_CFoundation_CDateTime end, 142 | + enum __x_ABI_CWindows_CNetworking_CConnectivity_CRoamingStates states, 143 | + __x_ABI_CWindows_CNetworking_CConnectivity_CIDataUsage **value) 144 | +{ 145 | + FIXME("iface %p, value %p stub!\n", iface, value); 146 | + return E_NOTIMPL; 147 | +} 148 | + 149 | +static HRESULT WINAPI connection_profile_get_NetworkSecuritySettings(IConnectionProfile *iface, 150 | + __x_ABI_CWindows_CNetworking_CConnectivity_CINetworkSecuritySettings **value) 151 | +{ 152 | + FIXME("iface %p, value %p stub!\n", iface, value); 153 | + return E_NOTIMPL; 154 | +} 155 | + 156 | +struct __x_ABI_CWindows_CNetworking_CConnectivity_CIConnectionProfileVtbl connection_vtbl = 157 | +{ 158 | + connection_profile_QueryInterface, 159 | + connection_profile_AddRef, 160 | + connection_profile_Release, 161 | + connection_profile_GetIids, 162 | + connection_profile_GetRuntimeClassName, 163 | + connection_profile_GetTrustLevel, 164 | + connection_profile_get_ProfileName, 165 | + connection_profile_GetNetworkConnectivityLevel, 166 | + connection_profile_GetNetworkNames, 167 | + connection_profile_GetConnectionCost, 168 | + connection_profile_GetDataPlanStatus, 169 | + connection_profile_get_NetworkAdapter, 170 | + connection_profile_GetLocalUsage, 171 | + connection_profile_GetLocalUsagePerRoamingStates, 172 | + connection_profile_get_NetworkSecuritySettings 173 | +}; 174 | + 175 | +static HRESULT STDMETHODCALLTYPE network_information_statics_GetInternetConnectionProfile(INetworkInformationStatics *iface, IConnectionProfile **value) 176 | +{ 177 | + struct windows_networking_connectivity *impl = impl_from_INetworkInformationStatics(iface); 178 | + struct connection_profile *profile; 179 | + 180 | + FIXME("iface %p, %p stub!\n", impl, value); 181 | + 182 | + profile = heap_alloc(sizeof(struct connection_profile)); 183 | + if (!profile) 184 | + return E_OUTOFMEMORY; 185 | + 186 | + profile->IConnectionProfile_iface.lpVtbl = &connection_vtbl; 187 | + profile->ref = 1; 188 | + 189 | + *value = &profile->IConnectionProfile_iface; 190 | + return S_OK; 191 | +} 192 | + 193 | static HRESULT STDMETHODCALLTYPE network_information_statics_GetLanIdentifiers(INetworkInformationStatics *iface, __FIVectorView_1_Windows__CNetworking__CConnectivity__CLanIdentifier **value) 194 | { 195 | FIXME("iface %p, %p stub!\n", iface, value); 196 | -- 197 | 2.30.2 198 | 199 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/windows.networking.connectivity-new-dll/0008-windows.networking.connectivity-IConnectionProfile-G.patch: -------------------------------------------------------------------------------- 1 | From 308cffe2fdf351c360870cd96c04b3384a70bd7a Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Tue, 1 Jun 2021 13:24:16 +1000 4 | Subject: [PATCH 8/8] windows.networking.connectivity: IConnectionProfile 5 | GetNetworkConnectivityLevel always return internet access 6 | 7 | --- 8 | .../windows.networking.connectivity_main.c | 6 ++++-- 9 | 1 file changed, 4 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c b/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 12 | index ba1f5a5401d..0e8f4e699f0 100644 13 | --- a/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 14 | +++ b/dlls/windows.networking.connectivity/windows.networking.connectivity_main.c 15 | @@ -274,8 +274,10 @@ static HRESULT WINAPI connection_profile_get_ProfileName(IConnectionProfile *ifa 16 | static HRESULT WINAPI connection_profile_GetNetworkConnectivityLevel(IConnectionProfile *iface, 17 | enum __x_ABI_CWindows_CNetworking_CConnectivity_CNetworkConnectivityLevel *value) 18 | { 19 | - FIXME("iface %p, value %p stub!\n", iface, value); 20 | - return E_NOTIMPL; 21 | + struct connection_profile *impl = impl_from_IConnectionProfile(iface); 22 | + FIXME("iface %p, value %p stub!\n", impl, value); 23 | + *value = NetworkConnectivityLevel_InternetAccess; 24 | + return S_OK; 25 | } 26 | 27 | static HRESULT WINAPI connection_profile_GetNetworkNames(IConnectionProfile *iface, __FIVectorView_1_HSTRING **value) 28 | -- 29 | 2.30.2 30 | 31 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/windows.networking.connectivity-new-dll/definition: -------------------------------------------------------------------------------- 1 | Fixes: [46534] Implement INetworkInformationStatics interface 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wineboot-ProxySettings/0001-wineboot-Initialize-proxy-settings-registry-key.patch: -------------------------------------------------------------------------------- 1 | From 584eecc73a8cba537b8f50932769729a29fe7d3d Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Mon, 26 Dec 2016 16:37:40 +0100 4 | Subject: [PATCH] wineboot: Initialize proxy settings registry key. 5 | 6 | --- 7 | programs/wineboot/Makefile.in | 2 +- 8 | programs/wineboot/wineboot.c | 9 +++++++++ 9 | 2 files changed, 10 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in 12 | index 667f8f48702..4a1747ad047 100644 13 | --- a/programs/wineboot/Makefile.in 14 | +++ b/programs/wineboot/Makefile.in 15 | @@ -1,6 +1,6 @@ 16 | MODULE = wineboot.exe 17 | IMPORTS = uuid advapi32 ws2_32 kernelbase 18 | -DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev crypt32 19 | +DELAYIMPORTS = shell32 shlwapi version user32 setupapi newdev crypt32 wininet 20 | 21 | EXTRADLLFLAGS = -mconsole 22 | 23 | diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c 24 | index 14943b005ef..9aab3b68e5b 100644 25 | --- a/programs/wineboot/wineboot.c 26 | +++ b/programs/wineboot/wineboot.c 27 | @@ -77,6 +77,7 @@ 28 | #include 29 | #include 30 | #include 31 | +#include 32 | #include 33 | #include "resource.h" 34 | 35 | @@ -1002,6 +1003,13 @@ static void create_volatile_environment_registry_key(void) 36 | RegCloseKey( hkey ); 37 | } 38 | 39 | +static void create_proxy_settings(void) 40 | +{ 41 | + HINTERNET inet; 42 | + inet = InternetOpenA( "Wine", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 ); 43 | + if (inet) InternetCloseHandle( inet ); 44 | +} 45 | + 46 | /* Performs the rename operations dictated in %SystemRoot%\Wininit.ini. 47 | * Returns FALSE if there was an error, or otherwise if all is ok. 48 | */ 49 | @@ -1812,6 +1820,7 @@ int __cdecl main( int argc, char *argv[] ) 50 | if (init || update) update_wineprefix( update ); 51 | 52 | create_volatile_environment_registry_key(); 53 | + create_proxy_settings(); 54 | 55 | ProcessRunKeys( HKEY_LOCAL_MACHINE, L"RunOnce", TRUE, TRUE ); 56 | 57 | -- 58 | 2.33.0 59 | 60 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wineboot-ProxySettings/definition: -------------------------------------------------------------------------------- 1 | Fixes: [42024] Create ProxyEnable key on wineprefix update 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/winepulse-PulseAudio_Support/0001-winepulse.drv-Use-a-separate-mainloop-and-ctx-for-pu.patch: -------------------------------------------------------------------------------- 1 | From 2700c7d5ef1b90ecb2140736e8380c07a1decd13 Mon Sep 17 00:00:00 2001 2 | From: Sebastian Lackner 3 | Date: Wed, 4 Nov 2015 02:57:56 +0100 4 | Subject: [PATCH] winepulse.drv: Use a separate mainloop and ctx for 5 | pulse_test_connect. 6 | 7 | --- 8 | dlls/winepulse.drv/pulse.c | 62 ++++++++++++++++++-------------------- 9 | 1 file changed, 30 insertions(+), 32 deletions(-) 10 | 11 | diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c 12 | index cbd9b3b97ae..abd0f286ffc 100644 13 | --- a/dlls/winepulse.drv/pulse.c 14 | +++ b/dlls/winepulse.drv/pulse.c 15 | @@ -669,7 +669,8 @@ static void convert_channel_map(const pa_channel_map *pa_map, WAVEFORMATEXTENSIB 16 | fmt->dwChannelMask = pa_mask; 17 | } 18 | 19 | -static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATEXTENSIBLE *fmt, REFERENCE_TIME *def_period, REFERENCE_TIME *min_period) 20 | +static void pulse_probe_settings(pa_mainloop *ml, pa_context *ctx, int render, const char *pulse_name, 21 | + WAVEFORMATEXTENSIBLE *fmt, REFERENCE_TIME *def_period, REFERENCE_TIME *min_period) 22 | { 23 | WAVEFORMATEX *wfx = &fmt->Format; 24 | pa_stream *stream; 25 | @@ -692,7 +693,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE 26 | attr.minreq = attr.fragsize = pa_frame_size(&ss); 27 | attr.prebuf = 0; 28 | 29 | - stream = pa_stream_new(pulse_ctx, "format test stream", &ss, &map); 30 | + stream = pa_stream_new(ctx, "format test stream", &ss, &map); 31 | if (stream) 32 | pa_stream_set_state_callback(stream, pulse_stream_state, NULL); 33 | if (!stream) 34 | @@ -703,7 +704,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE 35 | else 36 | ret = pa_stream_connect_record(stream, pulse_name, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS); 37 | if (ret >= 0) { 38 | - while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 && 39 | + while (pa_mainloop_iterate(ml, 1, &ret) >= 0 && 40 | pa_stream_get_state(stream) == PA_STREAM_CREATING) 41 | {} 42 | if (pa_stream_get_state(stream) == PA_STREAM_READY) { 43 | @@ -714,7 +715,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE 44 | else 45 | length = pa_stream_get_buffer_attr(stream)->fragsize; 46 | pa_stream_disconnect(stream); 47 | - while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 && 48 | + while (pa_mainloop_iterate(ml, 1, &ret) >= 0 && 49 | pa_stream_get_state(stream) == PA_STREAM_READY) 50 | {} 51 | } 52 | @@ -761,31 +762,32 @@ static NTSTATUS pulse_test_connect(void *args) 53 | PhysDevice *dev; 54 | pa_operation *o; 55 | int ret; 56 | + pa_mainloop *ml; 57 | + pa_context *ctx; 58 | 59 | pulse_lock(); 60 | - pulse_ml = pa_mainloop_new(); 61 | + ml = pa_mainloop_new(); 62 | 63 | - pa_mainloop_set_poll_func(pulse_ml, pulse_poll_func, NULL); 64 | + pa_mainloop_set_poll_func(ml, pulse_poll_func, NULL); 65 | 66 | - pulse_ctx = pa_context_new(pa_mainloop_get_api(pulse_ml), params->name); 67 | - if (!pulse_ctx) { 68 | + ctx = pa_context_new(pa_mainloop_get_api(ml), params->name); 69 | + if (!ctx) { 70 | ERR("Failed to create context\n"); 71 | - pa_mainloop_free(pulse_ml); 72 | - pulse_ml = NULL; 73 | + pa_mainloop_free(ml); 74 | pulse_unlock(); 75 | params->priority = Priority_Unavailable; 76 | return STATUS_SUCCESS; 77 | } 78 | 79 | - pa_context_set_state_callback(pulse_ctx, pulse_contextcallback, NULL); 80 | + pa_context_set_state_callback(ctx, pulse_contextcallback, NULL); 81 | 82 | - TRACE("libpulse protocol version: %u. API Version %u\n", pa_context_get_protocol_version(pulse_ctx), PA_API_VERSION); 83 | - if (pa_context_connect(pulse_ctx, NULL, 0, NULL) < 0) 84 | + TRACE("libpulse protocol version: %u. API Version %u\n", pa_context_get_protocol_version(ctx), PA_API_VERSION); 85 | + if (pa_context_connect(ctx, NULL, 0, NULL) < 0) 86 | goto fail; 87 | 88 | /* Wait for connection */ 89 | - while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0) { 90 | - pa_context_state_t state = pa_context_get_state(pulse_ctx); 91 | + while (pa_mainloop_iterate(ml, 1, &ret) >= 0) { 92 | + pa_context_state_t state = pa_context_get_state(ctx); 93 | 94 | if (state == PA_CONTEXT_FAILED || state == PA_CONTEXT_TERMINATED) 95 | goto fail; 96 | @@ -794,12 +796,12 @@ static NTSTATUS pulse_test_connect(void *args) 97 | break; 98 | } 99 | 100 | - if (pa_context_get_state(pulse_ctx) != PA_CONTEXT_READY) 101 | + if (pa_context_get_state(ctx) != PA_CONTEXT_READY) 102 | goto fail; 103 | 104 | TRACE("Test-connected to server %s with protocol version: %i.\n", 105 | - pa_context_get_server(pulse_ctx), 106 | - pa_context_get_server_protocol_version(pulse_ctx)); 107 | + pa_context_get_server(ctx), 108 | + pa_context_get_server_protocol_version(ctx)); 109 | 110 | free_phys_device_lists(); 111 | list_init(&g_phys_speakers); 112 | @@ -808,34 +810,32 @@ static NTSTATUS pulse_test_connect(void *args) 113 | pulse_add_device(&g_phys_speakers, NULL, 0, Speakers, 0, "", "Pulse Audio"); 114 | pulse_add_device(&g_phys_sources, NULL, 0, Microphone, 0, "", "Pulse Audio"); 115 | 116 | - o = pa_context_get_sink_info_list(pulse_ctx, &pulse_phys_speakers_cb, NULL); 117 | + o = pa_context_get_sink_info_list(ctx, &pulse_phys_speakers_cb, NULL); 118 | if (o) { 119 | - while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 && 120 | + while (pa_mainloop_iterate(ml, 1, &ret) >= 0 && 121 | pa_operation_get_state(o) == PA_OPERATION_RUNNING) 122 | {} 123 | pa_operation_unref(o); 124 | } 125 | 126 | - o = pa_context_get_source_info_list(pulse_ctx, &pulse_phys_sources_cb, NULL); 127 | + o = pa_context_get_source_info_list(ctx, &pulse_phys_sources_cb, NULL); 128 | if (o) { 129 | - while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 && 130 | + while (pa_mainloop_iterate(ml, 1, &ret) >= 0 && 131 | pa_operation_get_state(o) == PA_OPERATION_RUNNING) 132 | {} 133 | pa_operation_unref(o); 134 | } 135 | 136 | LIST_FOR_EACH_ENTRY(dev, &g_phys_speakers, PhysDevice, entry) { 137 | - pulse_probe_settings(1, dev->pulse_name, &dev->fmt, &dev->def_period, &dev->min_period); 138 | + pulse_probe_settings(ml, ctx, 1, dev->pulse_name, &dev->fmt, &dev->def_period, &dev->min_period); 139 | } 140 | 141 | LIST_FOR_EACH_ENTRY(dev, &g_phys_sources, PhysDevice, entry) { 142 | - pulse_probe_settings(0, dev->pulse_name, &dev->fmt, &dev->def_period, &dev->min_period); 143 | + pulse_probe_settings(ml, ctx, 0, dev->pulse_name, &dev->fmt, &dev->def_period, &dev->min_period); 144 | } 145 | 146 | - pa_context_unref(pulse_ctx); 147 | - pulse_ctx = NULL; 148 | - pa_mainloop_free(pulse_ml); 149 | - pulse_ml = NULL; 150 | + pa_context_unref(ctx); 151 | + pa_mainloop_free(ml); 152 | 153 | pulse_unlock(); 154 | 155 | @@ -843,10 +843,8 @@ static NTSTATUS pulse_test_connect(void *args) 156 | return STATUS_SUCCESS; 157 | 158 | fail: 159 | - pa_context_unref(pulse_ctx); 160 | - pulse_ctx = NULL; 161 | - pa_mainloop_free(pulse_ml); 162 | - pulse_ml = NULL; 163 | + pa_context_unref(ctx); 164 | + pa_mainloop_free(ml); 165 | pulse_unlock(); 166 | params->priority = Priority_Unavailable; 167 | return STATUS_SUCCESS; 168 | -- 169 | 2.35.1 170 | 171 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/winepulse-PulseAudio_Support/definition: -------------------------------------------------------------------------------- 1 | Fixes: Allow selection of audio device for PulseAudio backend 2 | Fixes: [37042] Implement exclusive mode in PulseAudio backend 3 | Fixes: Add support for GetPropValue to PulseAudio backend 4 | Fixes: Use actual program name if available to describe PulseAudio streams 5 | Fixes: Expose PKEY_AudioEndpoint_PhysicalSpeakers device property in PulseAudio driver 6 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/winex11-Vulkan_support/0001-winex11-Specify-a-default-vulkan-driver-if-one-not-f.patch: -------------------------------------------------------------------------------- 1 | From b6c918acf5996c494bece9efb1439fe00b81a274 Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Fri, 1 Jun 2018 14:03:26 +1000 4 | Subject: [PATCH] winex11: Specify a default vulkan driver if one not found at 5 | build time 6 | 7 | We cannot specify it as a dependency since Debian Jessie has the 8 | vulkan library in backports and not everybody will have this mapped. 9 | --- 10 | dlls/winex11.drv/vulkan.c | 38 ++++++++++++++++---------------------- 11 | 1 file changed, 16 insertions(+), 22 deletions(-) 12 | 13 | diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c 14 | index f4fe202dfaf..1768444b2e5 100644 15 | --- a/dlls/winex11.drv/vulkan.c 16 | +++ b/dlls/winex11.drv/vulkan.c 17 | @@ -40,10 +40,12 @@ 18 | #include "wine/vulkan_driver.h" 19 | 20 | WINE_DEFAULT_DEBUG_CHANNEL(vulkan); 21 | - 22 | -#ifdef SONAME_LIBVULKAN 23 | WINE_DECLARE_DEBUG_CHANNEL(fps); 24 | 25 | +#ifndef SONAME_LIBVULKAN 26 | +#define SONAME_LIBVULKAN "" 27 | +#endif 28 | + 29 | static pthread_mutex_t vulkan_mutex; 30 | 31 | static XContext vulkan_hwnd_context; 32 | @@ -104,14 +106,23 @@ static void *vulkan_handle; 33 | 34 | static void wine_vk_init(void) 35 | { 36 | - init_recursive_mutex(&vulkan_mutex); 37 | + const char *libvulkan_candidates[] = {SONAME_LIBVULKAN, 38 | + "libvulkan.so.1", 39 | + "libvulkan.so", 40 | + NULL}; 41 | + int i; 42 | 43 | - if (!(vulkan_handle = dlopen(SONAME_LIBVULKAN, RTLD_NOW))) 44 | + for (i=0; libvulkan_candidates[i] && !vulkan_handle; i++) 45 | + vulkan_handle = dlopen(libvulkan_candidates[i], RTLD_NOW); 46 | + 47 | + if (!vulkan_handle) 48 | { 49 | - ERR("Failed to load %s.\n", SONAME_LIBVULKAN); 50 | + ERR("Failed to load vulkan library\n"); 51 | return; 52 | } 53 | 54 | + init_recursive_mutex(&vulkan_mutex); 55 | + 56 | #define LOAD_FUNCPTR(f) if (!(p##f = dlsym(vulkan_handle, #f))) goto fail 57 | #define LOAD_OPTIONAL_FUNCPTR(f) p##f = dlsym(vulkan_handle, #f) 58 | LOAD_FUNCPTR(vkCreateInstance); 59 | @@ -1270,32 +1270,3 @@ const struct vulkan_funcs *get_vulkan_driver(UINT version) 60 | return NULL; 61 | } 62 | 63 | -#else /* No vulkan */ 64 | - 65 | -const struct vulkan_funcs *get_vulkan_driver(UINT version) 66 | -{ 67 | - ERR("Wine was built without Vulkan support.\n"); 68 | - return NULL; 69 | -} 70 | - 71 | -void destroy_vk_surface(HWND hwnd) 72 | -{ 73 | -} 74 | - 75 | -void resize_vk_surfaces(HWND hwnd, Window active, int mask, XWindowChanges *changes) 76 | -{ 77 | -} 78 | - 79 | -void sync_vk_surface(HWND hwnd, BOOL known_child) 80 | -{ 81 | -} 82 | - 83 | -void invalidate_vk_surfaces(HWND hwnd) 84 | -{ 85 | -} 86 | - 87 | -void vulkan_thread_detach(void) 88 | -{ 89 | -} 90 | - 91 | -#endif /* SONAME_LIBVULKAN */ 92 | -- 93 | 2.35.1 94 | 95 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/winex11-Vulkan_support/definition: -------------------------------------------------------------------------------- 1 | Fixes: [44775] Allow vulkan support to be detected at runtime. 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch: -------------------------------------------------------------------------------- 1 | From b157667185244a4e963fa3c161c76ea53410d16d Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Fri, 15 May 2015 20:37:19 +0200 4 | Subject: [PATCH] wininet/tests: Add more tests for cookies. 5 | 6 | --- 7 | dlls/wininet/tests/http.c | 92 +++++++++++++++++++++++++++++++++++++-- 8 | 1 file changed, 89 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c 11 | index 98d1b74ca85..308d6a74c20 100644 12 | --- a/dlls/wininet/tests/http.c 13 | +++ b/dlls/wininet/tests/http.c 14 | @@ -2105,6 +2105,14 @@ static const char largemsg[] = 15 | "Content-Length: %I64u\r\n" 16 | "\r\n"; 17 | 18 | +static const char okmsg_cookie_path[] = 19 | +"HTTP/1.1 200 OK\r\n" 20 | +"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" 21 | +"Server: winetest\r\n" 22 | +"Content-Length: 0\r\n" 23 | +"Set-Cookie: subcookie2=data; path=/test_cookie_set_path\r\n" 24 | +"\r\n"; 25 | + 26 | static const char notokmsg[] = 27 | "HTTP/1.1 400 Bad Request\r\n" 28 | "Server: winetest\r\n" 29 | @@ -2524,6 +2532,32 @@ static DWORD CALLBACK server_thread(LPVOID param) 30 | else 31 | send(c, noauthmsg, sizeof noauthmsg-1, 0); 32 | } 33 | + if (strstr(buffer, "/test_cookie_path1")) 34 | + { 35 | + if (strstr(buffer, "subcookie=data")) 36 | + send(c, okmsg, sizeof okmsg-1, 0); 37 | + else 38 | + send(c, notokmsg, sizeof notokmsg-1, 0); 39 | + } 40 | + if (strstr(buffer, "/test_cookie_path2")) 41 | + { 42 | + if (strstr(buffer, "subcookie2=data")) 43 | + send(c, okmsg, sizeof okmsg-1, 0); 44 | + else 45 | + send(c, notokmsg, sizeof notokmsg-1, 0); 46 | + } 47 | + if (strstr(buffer, "/test_cookie_set_path")) 48 | + { 49 | + send(c, okmsg_cookie_path, sizeof okmsg_cookie_path-1, 0); 50 | + } 51 | + if (strstr(buffer, "/test_cookie_merge")) 52 | + { 53 | + if (strstr(buffer, "subcookie=data") && 54 | + !strstr(buffer, "manual_cookie=test")) 55 | + send(c, okmsg, sizeof okmsg-1, 0); 56 | + else 57 | + send(c, notokmsg, sizeof notokmsg-1, 0); 58 | + } 59 | if (strstr(buffer, "/test_host_override")) 60 | { 61 | if (strstr(buffer, host_header_override)) 62 | @@ -4037,7 +4071,7 @@ static void test_cookie_header(int port) 63 | HINTERNET ses, con, req; 64 | DWORD size, error; 65 | BOOL ret; 66 | - char buffer[64]; 67 | + char buffer[256]; 68 | 69 | ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); 70 | ok(ses != NULL, "InternetOpen failed\n"); 71 | @@ -4065,7 +4099,7 @@ static void test_cookie_header(int port) 72 | size = sizeof(buffer); 73 | ret = HttpQueryInfoA(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); 74 | ok(ret, "HttpQueryInfo failed: %lu\n", GetLastError()); 75 | - ok(!strcmp(buffer, "cookie=not biscuit"), "got '%s' expected \'cookie=not biscuit\'\n", buffer); 76 | + ok(!!strstr(buffer, "cookie=not biscuit"), "got '%s' expected \'cookie=not biscuit\'\n", buffer); 77 | 78 | ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 79 | ok(ret, "HttpSendRequest failed: %lu\n", GetLastError()); 80 | @@ -4076,9 +4110,61 @@ static void test_cookie_header(int port) 81 | size = sizeof(buffer); 82 | ret = HttpQueryInfoA(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); 83 | ok(ret, "HttpQueryInfo failed: %lu\n", GetLastError()); 84 | - ok(!strcmp(buffer, "cookie=biscuit"), "got '%s' expected \'cookie=biscuit\'\n", buffer); 85 | + ok(!strstr(buffer, "cookie=not biscuit"), "'%s' should not contain \'cookie=not biscuit\'\n", buffer); 86 | + ok(!!strstr(buffer, "cookie=biscuit"), "'%s' should contain \'cookie=biscuit\'\n", buffer); 87 | 88 | InternetCloseHandle(req); 89 | + 90 | + InternetSetCookieA("http://localhost/testCCCC", "subcookie", "data"); 91 | + 92 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_path1", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 93 | + ok(req != NULL, "HttpOpenRequest failed\n"); 94 | + 95 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 96 | + ok(ret, "HttpSendRequest failed\n"); 97 | + 98 | + test_status_code(req, 200); 99 | + InternetCloseHandle(req); 100 | + 101 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_path1/abc", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 102 | + ok(req != NULL, "HttpOpenRequest failed\n"); 103 | + 104 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 105 | + ok(ret, "HttpSendRequest failed\n"); 106 | + 107 | + test_status_code(req, 200); 108 | + InternetCloseHandle(req); 109 | + 110 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_set_path", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 111 | + ok(req != NULL, "HttpOpenRequest failed\n"); 112 | + 113 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 114 | + ok(ret, "HttpSendRequest failed\n"); 115 | + 116 | + test_status_code(req, 200); 117 | + InternetCloseHandle(req); 118 | + 119 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_path2", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 120 | + ok(req != NULL, "HttpOpenRequest failed\n"); 121 | + 122 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 123 | + ok(ret, "HttpSendRequest failed\n"); 124 | + 125 | + test_status_code(req, 400); 126 | + InternetCloseHandle(req); 127 | + 128 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_merge", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 129 | + ok(req != NULL, "HttpOpenRequest failed\n"); 130 | + 131 | + ret = HttpAddRequestHeadersA(req, "Cookie: manual_cookie=test\r\n", ~0u, HTTP_ADDREQ_FLAG_ADD); 132 | + ok(ret, "HttpAddRequestHeaders failed: %lu\n", GetLastError()); 133 | + 134 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 135 | + ok(ret, "HttpSendRequest failed\n"); 136 | + 137 | + test_status_code(req, 200); 138 | + InternetCloseHandle(req); 139 | + 140 | InternetCloseHandle(con); 141 | InternetCloseHandle(ses); 142 | } 143 | -- 144 | 2.35.1 145 | 146 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wininet-Cleanup/0002-wininet-tests-Test-auth-credential-reusage-with-host.patch: -------------------------------------------------------------------------------- 1 | From 303a7d54eca11f350f200bf3747646349a84536f Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Fri, 15 May 2015 21:18:37 +0200 4 | Subject: [PATCH] wininet/tests: Test auth credential reusage with host 5 | override. 6 | 7 | --- 8 | dlls/wininet/tests/http.c | 93 +++++++++++++++++++++++++++++++++++++++ 9 | 1 file changed, 93 insertions(+) 10 | 11 | diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c 12 | index b06bd6c04d1..59689baf87e 100644 13 | --- a/dlls/wininet/tests/http.c 14 | +++ b/dlls/wininet/tests/http.c 15 | @@ -2496,12 +2496,27 @@ static DWORD CALLBACK server_thread(LPVOID param) 16 | { 17 | send(c, okmsg, sizeof(okmsg)-1, 0); 18 | } 19 | + 20 | if (strstr(buffer, "HEAD /test_large_content")) 21 | { 22 | char msg[sizeof(largemsg) + 16]; 23 | sprintf(msg, largemsg, content_length); 24 | send(c, msg, strlen(msg), 0); 25 | } 26 | + if (strstr(buffer, "HEAD /test_auth_host1")) 27 | + { 28 | + if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzcw==")) 29 | + send(c, okmsg, sizeof okmsg-1, 0); 30 | + else 31 | + send(c, noauthmsg, sizeof noauthmsg-1, 0); 32 | + } 33 | + if (strstr(buffer, "HEAD /test_auth_host2")) 34 | + { 35 | + if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzczI=")) 36 | + send(c, okmsg, sizeof okmsg-1, 0); 37 | + else 38 | + send(c, noauthmsg, sizeof noauthmsg-1, 0); 39 | + } 40 | shutdown(c, 2); 41 | closesocket(c); 42 | c = -1; 43 | @@ -3200,6 +3215,84 @@ static void test_header_override(int port) 44 | InternetCloseHandle(req); 45 | InternetCloseHandle(con); 46 | InternetCloseHandle(ses); 47 | + 48 | + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); 49 | + ok(ses != NULL, "InternetOpenA failed\n"); 50 | + 51 | + con = InternetConnectA(ses, "localhost", port, "test1", "pass", INTERNET_SERVICE_HTTP, 0, 0); 52 | + ok(con != NULL, "InternetConnectA failed %lu\n", GetLastError()); 53 | + 54 | + req = HttpOpenRequestA( con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); 55 | + ok(req != NULL, "HttpOpenRequestA failed %lu\n", GetLastError()); 56 | + 57 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 58 | + ok(ret, "HttpSendRequestA failed %lu\n", GetLastError()); 59 | + 60 | + test_status_code(req, 200); 61 | + 62 | + InternetCloseHandle(req); 63 | + InternetCloseHandle(con); 64 | + InternetCloseHandle(ses); 65 | + 66 | + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); 67 | + ok(ses != NULL, "InternetOpenA failed\n"); 68 | + 69 | + con = InternetConnectA( ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); 70 | + ok(con != NULL, "InternetConnectA failed %lu\n", GetLastError()); 71 | + 72 | + req = HttpOpenRequestA(con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); 73 | + ok(req != NULL, "HttpOpenRequestA failed %lu\n", GetLastError()); 74 | + 75 | + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); 76 | + ok(ret, "HttpAddRequestHeaders failed\n"); 77 | + 78 | + ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); 79 | + ok( ret, "HttpSendRequestA failed %lu\n", GetLastError() ); 80 | + 81 | + test_status_code(req, 200); 82 | + 83 | + InternetCloseHandle(req); 84 | + InternetCloseHandle(con); 85 | + InternetCloseHandle(ses); 86 | + 87 | + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); 88 | + ok(ses != NULL, "InternetOpenA failed\n"); 89 | + 90 | + con = InternetConnectA(ses, "localhost", port, "test1", "pass2", INTERNET_SERVICE_HTTP, 0, 0); 91 | + ok(con != NULL, "InternetConnectA failed %lu\n", GetLastError()); 92 | + 93 | + req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); 94 | + ok(req != NULL, "HttpOpenRequestA failed %lu\n", GetLastError()); 95 | + 96 | + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); 97 | + ok(ret, "HttpAddRequestHeaders failed\n"); 98 | + 99 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 100 | + ok(ret, "HttpSendRequestA failed %lu\n", GetLastError()); 101 | + 102 | + test_status_code(req, 200); 103 | + 104 | + InternetCloseHandle(req); 105 | + InternetCloseHandle(con); 106 | + InternetCloseHandle(ses); 107 | + 108 | + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); 109 | + ok(ses != NULL, "InternetOpenA failed\n"); 110 | + 111 | + con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); 112 | + ok(con != NULL, "InternetConnectA failed %lu\n", GetLastError()); 113 | + 114 | + req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); 115 | + ok(req != NULL, "HttpOpenRequestA failed %lu\n", GetLastError()); 116 | + 117 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 118 | + ok(ret, "HttpSendRequestA failed %lu\n", GetLastError()); 119 | + 120 | + test_status_code(req, 200); 121 | + 122 | + InternetCloseHandle(req); 123 | + InternetCloseHandle(con); 124 | + InternetCloseHandle(ses); 125 | } 126 | 127 | static void test_connection_closing(int port) 128 | -- 129 | 2.17.1 130 | 131 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wininet-Cleanup/0003-wininet-tests-Check-cookie-behaviour-when-overriding.patch: -------------------------------------------------------------------------------- 1 | From 691cc2563d203b7b8862406fbd373f61bccea9e2 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Fri, 15 May 2015 23:09:20 +0200 4 | Subject: [PATCH] wininet/tests: Check cookie behaviour when overriding host. 5 | 6 | --- 7 | dlls/wininet/tests/http.c | 95 +++++++++++++++++++++++++++++++++++++++ 8 | 1 file changed, 95 insertions(+) 9 | 10 | diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c 11 | index 43eba2db172..2ccba48fa2f 100644 12 | --- a/dlls/wininet/tests/http.c 13 | +++ b/dlls/wininet/tests/http.c 14 | @@ -2113,6 +2113,14 @@ static const char okmsg_cookie_path[] = 15 | "Set-Cookie: subcookie2=data; path=/test_cookie_set_path\r\n" 16 | "\r\n"; 17 | 18 | +static const char okmsg_cookie[] = 19 | +"HTTP/1.1 200 OK\r\n" 20 | +"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" 21 | +"Server: winetest\r\n" 22 | +"Content-Length: 0\r\n" 23 | +"Set-Cookie: testcookie=testvalue\r\n" 24 | +"\r\n"; 25 | + 26 | static const char notokmsg[] = 27 | "HTTP/1.1 400 Bad Request\r\n" 28 | "Server: winetest\r\n" 29 | @@ -2558,6 +2566,25 @@ static DWORD CALLBACK server_thread(LPVOID param) 30 | else 31 | send(c, notokmsg, sizeof notokmsg-1, 0); 32 | } 33 | + if (strstr(buffer, "/test_cookie_set_host_override")) 34 | + { 35 | + send(c, okmsg_cookie, sizeof okmsg_cookie-1, 0); 36 | + } 37 | + if (strstr(buffer, "/test_cookie_check_host_override")) 38 | + { 39 | + if (strstr(buffer, "Cookie:") && strstr(buffer, "testcookie=testvalue")) 40 | + send(c, okmsg, sizeof okmsg-1, 0); 41 | + else 42 | + send(c, notokmsg, sizeof notokmsg-1, 0); 43 | + } 44 | + if (strstr(buffer, "/test_cookie_check_different_host")) 45 | + { 46 | + if (!strstr(buffer, "foo") && 47 | + strstr(buffer, "cookie=biscuit")) 48 | + send(c, okmsg, sizeof okmsg-1, 0); 49 | + else 50 | + send(c, notokmsg, sizeof notokmsg-1, 0); 51 | + } 52 | if (strstr(buffer, "/test_host_override")) 53 | { 54 | if (strstr(buffer, host_header_override)) 55 | @@ -3305,6 +3332,74 @@ static void test_header_override(int port) 56 | test_status_code(req, 400); 57 | } 58 | 59 | + InternetCloseHandle(req); 60 | + InternetSetCookieA("http://localhost", "cookie", "biscuit"); 61 | + req = HttpOpenRequestA(con, NULL, "/testC", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 62 | + ok(req != NULL, "HttpOpenRequest failed\n"); 63 | + 64 | + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); 65 | + ok(ret, "HttpAddRequestHeaders failed\n"); 66 | + 67 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 68 | + ok(ret, "HttpSendRequest failed\n"); 69 | + 70 | + test_status_code(req, 200); 71 | + 72 | + InternetCloseHandle(req); 73 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_set_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 74 | + ok(req != NULL, "HttpOpenRequest failed\n"); 75 | + 76 | + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); 77 | + ok(ret, "HttpAddRequestHeaders failed\n"); 78 | + 79 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 80 | + ok(ret, "HttpSendRequest failed\n"); 81 | + 82 | + test_status_code(req, 200); 83 | + 84 | + InternetCloseHandle(req); 85 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 86 | + ok(req != NULL, "HttpOpenRequest failed\n"); 87 | + 88 | + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); 89 | + ok(ret, "HttpAddRequestHeaders failed\n"); 90 | + 91 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 92 | + ok(ret, "HttpSendRequest failed\n"); 93 | + 94 | + test_status_code_todo(req, 200); 95 | + 96 | + InternetCloseHandle(req); 97 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 98 | + ok(req != NULL, "HttpOpenRequest failed\n"); 99 | + 100 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 101 | + ok(ret, "HttpSendRequest failed\n"); 102 | + 103 | + test_status_code_todo(req, 200); 104 | + 105 | + InternetCloseHandle(req); 106 | + InternetSetCookieA("http://test.local", "foo", "bar"); 107 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 108 | + ok(req != NULL, "HttpOpenRequest failed\n"); 109 | + 110 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 111 | + ok(ret, "HttpSendRequest failed\n"); 112 | + 113 | + test_status_code(req, 200); 114 | + 115 | + InternetCloseHandle(req); 116 | + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 117 | + ok(req != NULL, "HttpOpenRequest failed\n"); 118 | + 119 | + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); 120 | + ok(ret, "HttpAddRequestHeaders failed\n"); 121 | + 122 | + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 123 | + ok(ret, "HttpSendRequest failed\n"); 124 | + 125 | + test_status_code(req, 200); 126 | + 127 | InternetCloseHandle(req); 128 | InternetCloseHandle(con); 129 | InternetCloseHandle(ses); 130 | -- 131 | 2.35.1 132 | 133 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wininet-Cleanup/0004-wininet-Strip-filename-if-no-path-is-set-in-cookie.patch: -------------------------------------------------------------------------------- 1 | From 20e7de7c8f73fb27f7eeffbc5de646fc27fe1bb7 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Sat, 16 May 2015 00:24:35 +0200 4 | Subject: [PATCH] wininet: Strip filename if no path is set in cookie. 5 | 6 | The order of the stored cookies doesn't match in /testC, so 7 | be a bit less strict in the test. 8 | --- 9 | dlls/wininet/http.c | 11 ++++++++++- 10 | dlls/wininet/tests/http.c | 6 +++--- 11 | 2 files changed, 13 insertions(+), 4 deletions(-) 12 | 13 | diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c 14 | index c770c312ba9..d95b39bd9ce 100644 15 | --- a/dlls/wininet/http.c 16 | +++ b/dlls/wininet/http.c 17 | @@ -654,10 +654,18 @@ static void HTTP_ProcessCookies( http_request_t *request ) 18 | int HeaderIndex; 19 | int numCookies = 0; 20 | LPHTTPHEADERW setCookieHeader; 21 | + WCHAR *path, *tmp; 22 | 23 | if(request->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) 24 | return; 25 | 26 | + path = wcsdup(request->path); 27 | + if (!path) 28 | + return; 29 | + 30 | + tmp = wcsrchr(path, '/'); 31 | + if (tmp && tmp[1]) tmp[1] = 0; 32 | + 33 | EnterCriticalSection( &request->headers_section ); 34 | 35 | while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, L"Set-Cookie", numCookies++, FALSE)) != -1) 36 | @@ -676,10 +684,11 @@ static void HTTP_ProcessCookies( http_request_t *request ) 37 | 38 | name = substr(setCookieHeader->lpszValue, data - setCookieHeader->lpszValue); 39 | data++; 40 | - set_cookie(substrz(request->server->name), substrz(request->path), name, substrz(data), INTERNET_COOKIE_HTTPONLY); 41 | + set_cookie(substrz(request->server->name), substrz(path), name, substrz(data), INTERNET_COOKIE_HTTPONLY); 42 | } 43 | 44 | LeaveCriticalSection( &request->headers_section ); 45 | + free(path); 46 | } 47 | 48 | static void strip_spaces(LPWSTR start) 49 | diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c 50 | index 510c3ac5232..b98e648c276 100644 51 | --- a/dlls/wininet/tests/http.c 52 | +++ b/dlls/wininet/tests/http.c 53 | @@ -2363,7 +2363,7 @@ static DWORD CALLBACK server_thread(LPVOID param) 54 | } 55 | if (strstr(buffer, "/testC")) 56 | { 57 | - if (strstr(buffer, "Cookie: cookie=biscuit")) 58 | + if (strstr(buffer, "cookie=biscuit")) 59 | send(c, okmsg, sizeof okmsg-1, 0); 60 | else 61 | send(c, notokmsg, sizeof notokmsg-1, 0); 62 | @@ -3351,7 +3351,7 @@ static void test_header_override(int port) 63 | ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 64 | ok(ret, "HttpSendRequest failed\n"); 65 | 66 | - test_status_code_todo(req, 200); 67 | + test_status_code(req, 200); 68 | 69 | InternetCloseHandle(req); 70 | req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); 71 | @@ -3360,7 +3360,7 @@ static void test_header_override(int port) 72 | ret = HttpSendRequestA(req, NULL, 0, NULL, 0); 73 | ok(ret, "HttpSendRequest failed\n"); 74 | 75 | - test_status_code_todo(req, 200); 76 | + test_status_code(req, 200); 77 | 78 | InternetCloseHandle(req); 79 | InternetSetCookieA("http://test.local", "foo", "bar"); 80 | -- 81 | 2.29.2 82 | 83 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wininet-Cleanup/0005-wininet-Replacing-header-fields-should-fail-if-they-.patch: -------------------------------------------------------------------------------- 1 | From 10bdb80d18fa95c3bffd61217015e1512b14e0d7 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Michael=20M=C3=BCller?= 3 | Date: Sat, 16 May 2015 03:16:15 +0200 4 | Subject: [PATCH] wininet: Replacing header fields should fail if they do not 5 | exist yet. 6 | 7 | A lot of details are not properly covered by tests yet and were 8 | marked with FIXME comments. The implementation was written in such 9 | a way that it behaves identical to the old code in such situations. 10 | --- 11 | dlls/wininet/http.c | 197 ++++++++++++++++++++++---------------------- 12 | 1 file changed, 99 insertions(+), 98 deletions(-) 13 | 14 | diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c 15 | index 18be0683d3a..645e7825a5a 100644 16 | --- a/dlls/wininet/http.c 17 | +++ b/dlls/wininet/http.c 18 | @@ -6113,130 +6113,131 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) 19 | 20 | static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR value, DWORD dwModifier) 21 | { 22 | - LPHTTPHEADERW lphttpHdr = NULL; 23 | + LPHTTPHEADERW lphttpHdr; 24 | INT index; 25 | BOOL request_only = !!(dwModifier & HTTP_ADDHDR_FLAG_REQ); 26 | - DWORD res = ERROR_HTTP_INVALID_HEADER; 27 | + DWORD res = ERROR_SUCCESS; 28 | 29 | TRACE("--> %s: %s - 0x%08lx\n", debugstr_w(field), debugstr_w(value), dwModifier); 30 | 31 | EnterCriticalSection( &request->headers_section ); 32 | 33 | - /* REPLACE wins out over ADD */ 34 | - if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE) 35 | - dwModifier &= ~HTTP_ADDREQ_FLAG_ADD; 36 | + index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); 37 | + if (index >= 0) 38 | + { 39 | + lphttpHdr = &request->custHeaders[index]; 40 | 41 | - if (dwModifier & HTTP_ADDREQ_FLAG_ADD) 42 | - index = -1; 43 | - else 44 | - index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); 45 | - 46 | - if (index >= 0) 47 | - { 48 | - if (dwModifier & HTTP_ADDREQ_FLAG_ADD_IF_NEW) 49 | + /* replace existing header if FLAG_REPLACE is given */ 50 | + if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE) 51 | { 52 | - LeaveCriticalSection( &request->headers_section ); 53 | - return ERROR_HTTP_INVALID_HEADER; 54 | - } 55 | - lphttpHdr = &request->custHeaders[index]; 56 | - } 57 | - else if (value) 58 | - { 59 | - HTTPHEADERW hdr; 60 | + HTTP_DeleteCustomHeader( request, index ); 61 | 62 | - hdr.lpszField = (LPWSTR)field; 63 | - hdr.lpszValue = (LPWSTR)value; 64 | - hdr.wFlags = hdr.wCount = 0; 65 | + if (value && value[0]) 66 | + { 67 | + HTTPHEADERW hdr; 68 | 69 | - if (dwModifier & HTTP_ADDHDR_FLAG_REQ) 70 | - hdr.wFlags |= HDR_ISREQUEST; 71 | + hdr.lpszField = (LPWSTR)field; 72 | + hdr.lpszValue = (LPWSTR)value; 73 | + hdr.wFlags = hdr.wCount = 0; 74 | 75 | - res = HTTP_InsertCustomHeader(request, &hdr); 76 | - LeaveCriticalSection( &request->headers_section ); 77 | - return res; 78 | - } 79 | - /* no value to delete */ 80 | - else 81 | - { 82 | - LeaveCriticalSection( &request->headers_section ); 83 | - return ERROR_SUCCESS; 84 | - } 85 | + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) 86 | + hdr.wFlags |= HDR_ISREQUEST; 87 | 88 | - if (dwModifier & HTTP_ADDHDR_FLAG_REQ) 89 | - lphttpHdr->wFlags |= HDR_ISREQUEST; 90 | - else 91 | - lphttpHdr->wFlags &= ~HDR_ISREQUEST; 92 | + res = HTTP_InsertCustomHeader( request, &hdr ); 93 | + } 94 | 95 | - if (dwModifier & HTTP_ADDREQ_FLAG_REPLACE) 96 | - { 97 | - HTTP_DeleteCustomHeader( request, index ); 98 | + goto out; 99 | + } 100 | + 101 | + /* do not add new header if FLAG_ADD_IF_NEW is set */ 102 | + if (dwModifier & HTTP_ADDREQ_FLAG_ADD_IF_NEW) 103 | + { 104 | + res = ERROR_HTTP_INVALID_HEADER; /* FIXME */ 105 | + goto out; 106 | + } 107 | 108 | - if (value && value[0]) 109 | + /* handle appending to existing header */ 110 | + if (dwModifier & COALESCEFLAGS) 111 | { 112 | - HTTPHEADERW hdr; 113 | + LPWSTR lpsztmp; 114 | + WCHAR ch = 0; 115 | + INT len = 0; 116 | + INT origlen = lstrlenW(lphttpHdr->lpszValue); 117 | + INT valuelen = lstrlenW(value); 118 | + 119 | + /* FIXME: Should it really clear HDR_ISREQUEST? */ 120 | + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) 121 | + lphttpHdr->wFlags |= HDR_ISREQUEST; 122 | + else 123 | + lphttpHdr->wFlags &= ~HDR_ISREQUEST; 124 | 125 | - hdr.lpszField = (LPWSTR)field; 126 | - hdr.lpszValue = (LPWSTR)value; 127 | - hdr.wFlags = hdr.wCount = 0; 128 | + if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA) 129 | + { 130 | + ch = ','; 131 | + lphttpHdr->wFlags |= HDR_COMMADELIMITED; 132 | + } 133 | + else if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON) 134 | + { 135 | + ch = ';'; 136 | + lphttpHdr->wFlags |= HDR_COMMADELIMITED; 137 | + } 138 | 139 | - if (dwModifier & HTTP_ADDHDR_FLAG_REQ) 140 | - hdr.wFlags |= HDR_ISREQUEST; 141 | + len = origlen + valuelen + ((ch > 0) ? 2 : 0); 142 | 143 | - res = HTTP_InsertCustomHeader(request, &hdr); 144 | - LeaveCriticalSection( &request->headers_section ); 145 | - return res; 146 | - } 147 | + lpsztmp = realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); 148 | + if (lpsztmp) 149 | + { 150 | + lphttpHdr->lpszValue = lpsztmp; 151 | + /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ 152 | + if (ch > 0) 153 | + { 154 | + lphttpHdr->lpszValue[origlen] = ch; 155 | + origlen++; 156 | + lphttpHdr->lpszValue[origlen] = ' '; 157 | + origlen++; 158 | + } 159 | 160 | - LeaveCriticalSection( &request->headers_section ); 161 | - return ERROR_SUCCESS; 162 | - } 163 | - else if (dwModifier & COALESCEFLAGS) 164 | + memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); 165 | + lphttpHdr->lpszValue[len] = '\0'; 166 | + } 167 | + else 168 | + { 169 | + WARN("realloc (%d bytes) failed\n",len+1); 170 | + res = ERROR_OUTOFMEMORY; 171 | + } 172 | + 173 | + goto out; 174 | + } 175 | + } 176 | + 177 | + /* FIXME: What about other combinations? */ 178 | + if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDREQ_FLAG_REPLACE) 179 | { 180 | - LPWSTR lpsztmp; 181 | - WCHAR ch = 0; 182 | - INT len = 0; 183 | - INT origlen = lstrlenW(lphttpHdr->lpszValue); 184 | - INT valuelen = lstrlenW(value); 185 | + res = ERROR_HTTP_HEADER_NOT_FOUND; 186 | + goto out; 187 | + } 188 | 189 | - if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA) 190 | - { 191 | - ch = ','; 192 | - lphttpHdr->wFlags |= HDR_COMMADELIMITED; 193 | - } 194 | - else if (dwModifier & HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON) 195 | - { 196 | - ch = ';'; 197 | - lphttpHdr->wFlags |= HDR_COMMADELIMITED; 198 | - } 199 | + /* FIXME: What if value == ""? */ 200 | + if (value) 201 | + { 202 | + HTTPHEADERW hdr; 203 | 204 | - len = origlen + valuelen + ((ch > 0) ? 2 : 0); 205 | + hdr.lpszField = (LPWSTR)field; 206 | + hdr.lpszValue = (LPWSTR)value; 207 | + hdr.wFlags = hdr.wCount = 0; 208 | 209 | - lpsztmp = realloc(lphttpHdr->lpszValue, (len + 1) * sizeof(WCHAR)); 210 | - if (lpsztmp) 211 | - { 212 | - lphttpHdr->lpszValue = lpsztmp; 213 | - /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ 214 | - if (ch > 0) 215 | - { 216 | - lphttpHdr->lpszValue[origlen] = ch; 217 | - origlen++; 218 | - lphttpHdr->lpszValue[origlen] = ' '; 219 | - origlen++; 220 | - } 221 | + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) 222 | + hdr.wFlags |= HDR_ISREQUEST; 223 | 224 | - memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); 225 | - lphttpHdr->lpszValue[len] = '\0'; 226 | - res = ERROR_SUCCESS; 227 | - } 228 | - else 229 | - { 230 | - WARN("realloc (%d bytes) failed\n",len+1); 231 | - res = ERROR_OUTOFMEMORY; 232 | - } 233 | + res = HTTP_InsertCustomHeader( request, &hdr ); 234 | + goto out; 235 | } 236 | - TRACE("<-- %ld\n", res); 237 | - LeaveCriticalSection( &request->headers_section ); 238 | - return res; 239 | + 240 | + /* FIXME: What if value == NULL? */ 241 | +out: 242 | + TRACE("<-- %ld\n", res); 243 | + LeaveCriticalSection( &request->headers_section ); 244 | + return res; 245 | } 246 | 247 | /*********************************************************************** 248 | -- 249 | 2.38.1 250 | 251 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wininet-Cleanup/definition: -------------------------------------------------------------------------------- 1 | # Fixes: [28911] Add HTTP Host header in HttpSendRequest instead of HttpOpenRequest 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wintrust-WTHelperGetProvCertFromChain/0001-wintrust-Add-parameter-check-in-WTHelperGetProvCertF.patch: -------------------------------------------------------------------------------- 1 | From 563f0ccc4f47914e1e2952cc4bc5673cbb97a5ae Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Wed, 18 Apr 2018 03:55:16 +0000 4 | Subject: [PATCH] wintrust: Add parameter check in WTHelperGetProvCertFromChain 5 | 6 | Signed-off-by: Alistair Leslie-Hughes 7 | --- 8 | dlls/wintrust/wintrust_main.c | 2 +- 9 | 2 files changed, 10 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/dlls/wintrust/wintrust_main.c b/dlls/wintrust/wintrust_main.c 12 | index 58e3ac3..bb52282 100644 13 | --- a/dlls/wintrust/wintrust_main.c 14 | +++ b/dlls/wintrust/wintrust_main.c 15 | @@ -787,7 +787,7 @@ CRYPT_PROVIDER_CERT * WINAPI WTHelperGetProvCertFromChain( 16 | 17 | TRACE("(%p %ld)\n", pSgnr, idxCert); 18 | 19 | - if (idxCert >= pSgnr->csCertChain || !pSgnr->pasCertChain) 20 | + if (!pSgnr || idxCert >= pSgnr->csCertChain || !pSgnr->pasCertChain) 21 | return NULL; 22 | cert = &pSgnr->pasCertChain[idxCert]; 23 | TRACE("returning %p\n", cert); 24 | -- 25 | 1.9.1 26 | 27 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wintrust-WTHelperGetProvCertFromChain/definition: -------------------------------------------------------------------------------- 1 | Fixes: [44061] Check Parameter in WTHelperGetProvCertFromChain 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wscript-support-d-u-switches/0001-wscript-return-TRUE-for-d-and-u-stub-switches.patch: -------------------------------------------------------------------------------- 1 | From d68918425e249c5c218ee6f0c9418e2e2daf9931 Mon Sep 17 00:00:00 2001 2 | From: Dmitry Kislyuk 3 | Date: Wed, 28 Apr 2021 09:47:41 -0500 4 | Subject: [PATCH] wscript: return TRUE for /d and /u stub switches 5 | 6 | Patch by Robert Wilhelm from bug: 7 | https://bugs.winehq.org/show_bug.cgi?id=49905 8 | 9 | VbsEdit is able to execute scripts with this patch applied. 10 | 11 | Signed-off-by: Dmitry Kislyuk 12 | --- 13 | programs/wscript/main.c | 4 ++++ 14 | 1 file changed, 4 insertions(+) 15 | 16 | diff --git a/programs/wscript/main.c b/programs/wscript/main.c 17 | index a7005a9289c..6d6e8935149 100644 18 | --- a/programs/wscript/main.c 19 | +++ b/programs/wscript/main.c 20 | @@ -393,6 +393,10 @@ static BOOL set_host_properties(const WCHAR *prop) 21 | wshInteractive = VARIANT_FALSE; 22 | else if(wcsicmp(prop, L"nologo") == 0) 23 | WINE_FIXME("ignored %s switch\n", debugstr_w(L"nologo")); 24 | + else if(wcsicmp(prop, L"d") == 0) 25 | + WINE_FIXME("ignored %s switch\n", debugstr_w(L"d")); 26 | + else if(wcsicmp(prop, L"u") == 0) 27 | + WINE_FIXME("ignored %s switch\n", debugstr_w(L"u")); 28 | else 29 | { 30 | WINE_FIXME("unsupported switch %s\n", debugstr_w(prop)); 31 | -- 32 | 2.30.2 33 | 34 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/wscript-support-d-u-switches/definition: -------------------------------------------------------------------------------- 1 | Fixes: [49905] wscript: return TRUE for /d and /u stub switches 2 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/xactengine-initial/0001-x3daudio1_7-Create-import-library.patch: -------------------------------------------------------------------------------- 1 | From 9c11f23079351f107a3bbcd3cd274f0a5656518f Mon Sep 17 00:00:00 2001 2 | From: Alistair Leslie-Hughes 3 | Date: Thu, 1 Oct 2020 18:37:06 +1000 4 | Subject: [PATCH] x3daudio1_7: Create import library 5 | 6 | --- 7 | dlls/x3daudio1_7/Makefile.in | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/dlls/x3daudio1_7/Makefile.in b/dlls/x3daudio1_7/Makefile.in 11 | index c6a8ed5102a..323d3fad60a 100644 12 | --- a/dlls/x3daudio1_7/Makefile.in 13 | +++ b/dlls/x3daudio1_7/Makefile.in 14 | @@ -1,5 +1,6 @@ 15 | EXTRADEFS = -DX3DAUDIO1_VER=7 -DXAUDIO2_VER=7 16 | MODULE = x3daudio1_7.dll 17 | +IMPORTLIB = x3daudio1_7 18 | PARENTSRC = ../xaudio2_7 19 | IMPORTS = $(FAUDIO_PE_LIBS) 20 | EXTRAINCL = $(FAUDIO_PE_CFLAGS) 21 | -- 22 | 2.33.0 23 | 24 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/staging/xactengine-initial/definition: -------------------------------------------------------------------------------- 1 | Fixes: [31476] Support Bully Scholarship Edition xactengine3_1.dll. 2 | Fixes: [38615] DSA: Drakensang Demo fails on IXACTEngine::Initialize 3 | Fixes: [41030] Pac-Man Museum requires xactengine3_7 4 | Fixes: [41045] Captain Morgane requires xactengine3_4 5 | Fixes: [48684] BlazBlue: Calamity Trigger requires for xactengine 3.3 interface. 6 | -------------------------------------------------------------------------------- /patches/wine-hotfixes/upstream/2403.patch: -------------------------------------------------------------------------------- 1 | From 01c69eb3023d2b85827020a8da8bb43c19560450 Mon Sep 17 00:00:00 2001 2 | From: Tyson Whitehead 3 | Date: Tue, 14 Mar 2023 09:57:48 -0400 4 | Subject: [PATCH 1/3] crypt32: Add some CertGetNameStringW fallback cases. 5 | 6 | When called with CERT_NAME_ATTR_TYPE and pvTypePara=NULL, Windows 7 | did the first of email, CN, OU, or O while Wine just did email. 8 | --- 9 | dlls/crypt32/str.c | 19 +++++++++++++++---- 10 | 1 file changed, 15 insertions(+), 4 deletions(-) 11 | 12 | diff --git a/dlls/crypt32/str.c b/dlls/crypt32/str.c 13 | index d74df308e4a..42046369652 100644 14 | --- a/dlls/crypt32/str.c 15 | +++ b/dlls/crypt32/str.c 16 | @@ -965,11 +965,22 @@ static DWORD cert_get_name_from_rdn_attr(DWORD encodingType, 17 | if (CryptDecodeObjectEx(encodingType, X509_NAME, name->pbData, 18 | name->cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &nameInfo, &bytes)) 19 | { 20 | - PCERT_RDN_ATTR nameAttr; 21 | + PCERT_RDN_ATTR nameAttr = NULL; 22 | 23 | - if (!oid) 24 | - oid = szOID_RSA_emailAddr; 25 | - nameAttr = CertFindRDNAttr(oid, nameInfo); 26 | + if (oid) 27 | + nameAttr = CertFindRDNAttr(oid, nameInfo); 28 | + else 29 | + { 30 | + static const LPCSTR attributeOIDs[] = 31 | + { 32 | + szOID_RSA_emailAddr, szOID_COMMON_NAME, 33 | + szOID_ORGANIZATIONAL_UNIT_NAME, szOID_ORGANIZATION_NAME 34 | + }; 35 | + DWORD i; 36 | + 37 | + for (i = 0; !nameAttr && i < ARRAY_SIZE(attributeOIDs); i++) 38 | + nameAttr = CertFindRDNAttr(attributeOIDs[i], nameInfo); 39 | + } 40 | if (nameAttr) 41 | ret = rdn_value_to_strW(nameAttr->dwValueType, &nameAttr->Value, 42 | pszNameString, cchNameString, TRUE); 43 | -- 44 | GitLab 45 | 46 | 47 | From 554a23d22765f89d64169516d3088aad3a660354 Mon Sep 17 00:00:00 2001 48 | From: Tyson Whitehead 49 | Date: Fri, 17 Mar 2023 18:25:12 -0400 50 | Subject: [PATCH 2/3] crypt32/tests: Test for CertGetNameStringW fallback 51 | cases. 52 | 53 | --- 54 | dlls/crypt32/tests/str.c | 72 ++++++++++++++++++++++++++++++++++++++++ 55 | 1 file changed, 72 insertions(+) 56 | 57 | diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c 58 | index 29a948ed0e9..fd4ed957e40 100644 59 | --- a/dlls/crypt32/tests/str.c 60 | +++ b/dlls/crypt32/tests/str.c 61 | @@ -113,6 +113,70 @@ static const BYTE cert[] = 62 | 0x65,0xd3,0xce,0xae,0x26,0x19,0x3,0x2e,0x4f,0x78,0xa5,0xa,0x97,0x7e,0x4f,0xc4, 63 | 0x91,0x8a,0xf8,0x5,0xef,0x5b,0x3b,0x49,0xbf,0x5f,0x2b}; 64 | 65 | +/* 66 | +Certificate: 67 | + Data: 68 | + Version: 1 (0x0) 69 | + Serial Number: 70 | + 59:9e:db:44:80:da:6c:92:f9:38:be:d8:fe:7a:20:77:57:c7:71:5b 71 | + Signature Algorithm: md5WithRSAEncryption 72 | + Issuer: C = US, ST = Minnesota, L = Minneapolis, O = CodeWeavers, OU = Wine Development, CN = localhost 73 | + Validity 74 | + Not Before: Mar 17 22:20:44 2023 GMT 75 | + Not After : Apr 16 22:20:44 2023 GMT 76 | + Subject: C = US, ST = Minnesota, L = Minneapolis, O = CodeWeavers, OU = Wine Development, CN = localhost 77 | + Subject Public Key Info: 78 | + Public Key Algorithm: rsaEncryption 79 | + Public-Key: (1024 bit) 80 | + Modulus: 81 | +... 82 | + Exponent: 65537 (0x10001) 83 | + Signature Algorithm: md5WithRSAEncryption 84 | +... 85 | +*/ 86 | +static const BYTE cert_no_email[] = { 87 | + 0x30,0x82,0x02,0x7a,0x30,0x82,0x01,0xe3,0x02,0x14,0x59,0x9e,0xdb,0x44,0x80,0xda, 88 | + 0x6c,0x92,0xf9,0x38,0xbe,0xd8,0xfe,0x7a,0x20,0x77,0x57,0xc7,0x71,0x5b,0x30,0x0d, 89 | + 0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x04,0x05,0x00,0x30,0x7c,0x31, 90 | + 0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x12,0x30,0x10, 91 | + 0x06,0x03,0x55,0x04,0x08,0x0c,0x09,0x4d,0x69,0x6e,0x6e,0x65,0x73,0x6f,0x74,0x61, 92 | + 0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x07,0x0c,0x0b,0x4d,0x69,0x6e,0x6e,0x65, 93 | + 0x61,0x70,0x6f,0x6c,0x69,0x73,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0a,0x0c, 94 | + 0x0b,0x43,0x6f,0x64,0x65,0x57,0x65,0x61,0x76,0x65,0x72,0x73,0x31,0x19,0x30,0x17, 95 | + 0x06,0x03,0x55,0x04,0x0b,0x0c,0x10,0x57,0x69,0x6e,0x65,0x20,0x44,0x65,0x76,0x65, 96 | + 0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x03, 97 | + 0x0c,0x09,0x6c,0x6f,0x63,0x61,0x6c,0x68,0x6f,0x73,0x74,0x30,0x1e,0x17,0x0d,0x32, 98 | + 0x33,0x30,0x33,0x31,0x37,0x32,0x32,0x32,0x30,0x34,0x34,0x5a,0x17,0x0d,0x32,0x33, 99 | + 0x30,0x34,0x31,0x36,0x32,0x32,0x32,0x30,0x34,0x34,0x5a,0x30,0x7c,0x31,0x0b,0x30, 100 | + 0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x12,0x30,0x10,0x06,0x03, 101 | + 0x55,0x04,0x08,0x0c,0x09,0x4d,0x69,0x6e,0x6e,0x65,0x73,0x6f,0x74,0x61,0x31,0x14, 102 | + 0x30,0x12,0x06,0x03,0x55,0x04,0x07,0x0c,0x0b,0x4d,0x69,0x6e,0x6e,0x65,0x61,0x70, 103 | + 0x6f,0x6c,0x69,0x73,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0a,0x0c,0x0b,0x43, 104 | + 0x6f,0x64,0x65,0x57,0x65,0x61,0x76,0x65,0x72,0x73,0x31,0x19,0x30,0x17,0x06,0x03, 105 | + 0x55,0x04,0x0b,0x0c,0x10,0x57,0x69,0x6e,0x65,0x20,0x44,0x65,0x76,0x65,0x6c,0x6f, 106 | + 0x70,0x6d,0x65,0x6e,0x74,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x03,0x0c,0x09, 107 | + 0x6c,0x6f,0x63,0x61,0x6c,0x68,0x6f,0x73,0x74,0x30,0x81,0x9f,0x30,0x0d,0x06,0x09, 108 | + 0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8d,0x00,0x30, 109 | + 0x81,0x89,0x02,0x81,0x81,0x00,0xc4,0xdd,0x00,0xa7,0xdb,0xec,0x95,0x68,0xee,0xf0, 110 | + 0x3f,0xed,0xb2,0xcb,0x6f,0xf4,0x34,0x2f,0xbe,0x13,0xa9,0x24,0x95,0xf3,0xca,0x3c, 111 | + 0x2b,0xd3,0x41,0x7c,0x32,0xe7,0x95,0x4e,0xdd,0xef,0xcc,0x45,0x0d,0xf2,0x71,0x42, 112 | + 0x12,0x78,0xb1,0x17,0x88,0xf4,0x12,0xba,0x92,0x2d,0x5c,0xfc,0x2c,0x8a,0x53,0xbf, 113 | + 0xee,0x23,0x3f,0x7b,0x11,0x46,0x5e,0x1d,0xb8,0xff,0xa3,0x70,0x5c,0x5f,0x6b,0xa8, 114 | + 0x3c,0x47,0x75,0xa5,0x3a,0x80,0x61,0x15,0x10,0x56,0x57,0x1f,0x82,0x6a,0xb2,0xb8, 115 | + 0xdc,0x3a,0xe0,0x1c,0x9c,0x83,0xd9,0x11,0x26,0xa6,0xb6,0x85,0x0a,0x27,0x45,0xb7, 116 | + 0xff,0xfa,0x26,0xbd,0x11,0x29,0x23,0x59,0xaa,0x19,0x77,0x3f,0x86,0x32,0x9f,0x48, 117 | + 0x43,0x4f,0xd0,0x03,0x7a,0x09,0x02,0x03,0x01,0x00,0x01,0x30,0x0d,0x06,0x09,0x2a, 118 | + 0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x04,0x05,0x00,0x03,0x81,0x81,0x00,0xa3,0xf0, 119 | + 0x23,0xfc,0x80,0x05,0xac,0x76,0x26,0xbb,0xfc,0x79,0x03,0x10,0xa0,0xfb,0x7a,0x3e, 120 | + 0xf9,0xa7,0xdd,0xb1,0x9e,0x7c,0x22,0x83,0xa6,0xee,0x77,0x88,0xa2,0x74,0x64,0x35, 121 | + 0x4f,0x66,0x82,0x88,0x4a,0x83,0xc9,0xda,0x7e,0xc4,0xa0,0xd1,0xfb,0xe1,0x3e,0x22, 122 | + 0x1e,0xa8,0xdc,0x1b,0xd4,0xda,0x64,0x63,0xfc,0x1b,0x61,0x4f,0x52,0x1b,0xab,0x61, 123 | + 0x05,0xcd,0xb8,0x2d,0xb0,0x73,0xa7,0x5d,0x78,0xff,0x3f,0x4d,0x12,0x3a,0x38,0x69, 124 | + 0xc4,0x9f,0x77,0x35,0xce,0xe2,0xf9,0xd6,0x23,0x47,0xc2,0x15,0xff,0xbf,0x3e,0x65, 125 | + 0xf3,0xc0,0x0a,0x58,0x76,0x10,0x8e,0xd5,0xa9,0x30,0x3e,0x25,0x4b,0x6d,0xb7,0xb2, 126 | + 0x64,0x96,0x0e,0x27,0x88,0x55,0xfc,0xaa,0x18,0x65,0x2a,0xe9,0xf4,0x23 127 | +}; 128 | + 129 | /* 130 | Certificate: 131 | Data: 132 | @@ -961,6 +1025,14 @@ static void test_CertGetNameString(void) 133 | 134 | CertFreeCertificateContext(context); 135 | 136 | + context = CertCreateCertificateContext(X509_ASN_ENCODING, cert_no_email, 137 | + sizeof(cert_no_email)); 138 | + ok(!!context, "CertCreateCertificateContext failed, err %lu\n", GetLastError()); 139 | + 140 | + test_CertGetNameString_value(context, CERT_NAME_ATTR_TYPE, 0, NULL, localhost); 141 | + 142 | + CertFreeCertificateContext(context); 143 | + 144 | ok(cert_v3[CERT_V3_SAN_OID_OFFSET] == 0x55, "Incorrect CERT_V3_SAN_OID_OFFSET.\n"); 145 | ok(cert_v3[CERT_V3_IAN_OID_OFFSET] == 0x55, "Incorrect CERT_V3_IAN_OID_OFFSET.\n"); 146 | cert_v3[CERT_V3_SAN_OID_OFFSET + 2] = 7; /* legacy OID_SUBJECT_ALT_NAME */ 147 | -- 148 | GitLab 149 | 150 | 151 | From 0065b2449ad4b18408e530d7e7b6b2e7ce6775fe Mon Sep 17 00:00:00 2001 152 | From: Tyson Whitehead 153 | Date: Sat, 18 Mar 2023 08:49:26 -0400 154 | Subject: [PATCH 3/3] crypt32/tests: Document fields in original test 155 | certificate. 156 | 157 | --- 158 | dlls/crypt32/tests/str.c | 21 +++++++++++++++++++++ 159 | 1 file changed, 21 insertions(+) 160 | 161 | diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c 162 | index fd4ed957e40..9e4ca37bcd6 100644 163 | --- a/dlls/crypt32/tests/str.c 164 | +++ b/dlls/crypt32/tests/str.c 165 | @@ -66,6 +66,27 @@ static BYTE bin12[] = { 0x20, 0x61, 0x62, 0x63, 0x20 }; 166 | static BYTE bin13[] = { 0x22, 0x64, 0x65, 0x66, 0x22 }; 167 | static BYTE bin14[] = { 0x31, 0x3b, 0x33 }; 168 | 169 | +/* 170 | +Certificate: 171 | + Data: 172 | + Version: 1 (0x0) 173 | + Serial Number: 174 | + e3:5a:10:f1:fc:4b:f3:a2 175 | + Signature Algorithm: md5WithRSAEncryption 176 | + Issuer: C = US, ST = Minnesota, L = Minneapolis, O = CodeWeavers, OU = Wine Development, CN = localhost, emailAddress = aric@codeweavers.com 177 | + Validity 178 | + Not Before: Jan 25 13:57:24 2006 GMT 179 | + Not After : Feb 24 13:57:24 2006 GMT 180 | + Subject: C = US, ST = Minnesota, L = Minneapolis, O = CodeWeavers, OU = Wine Development, CN = localhost, emailAddress = aric@codeweavers.com 181 | + Subject Public Key Info: 182 | + Public Key Algorithm: rsaEncryption 183 | + Public-Key: (1024 bit) 184 | + Modulus: 185 | +... 186 | + Exponent: 65537 (0x10001) 187 | + Signature Algorithm: md5WithRSAEncryption 188 | +... 189 | +*/ 190 | static const BYTE cert[] = 191 | {0x30,0x82,0x2,0xbb,0x30,0x82,0x2,0x24,0x2,0x9,0x0,0xe3,0x5a,0x10,0xf1,0xfc, 192 | 0x4b,0xf3,0xa2,0x30,0xd,0x6,0x9,0x2a,0x86,0x48,0x86,0xf7,0xd,0x1,0x1,0x4,0x5, 193 | -- 194 | GitLab 195 | 196 | --------------------------------------------------------------------------------