Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2022
- 68 participants
- 3274 messages
Re: [PATCH 1/1] winedbg: Fix typos in manpage.
by Zebediah Figura
On 6/18/22 11:41, Jinoh Kang wrote:
> .IP \fIwpid\fR
> -\fBwinedbg\fR will attach to the process which Windows pid is \fIwpid\fR.
> +\fBwinedbg\fR will attach to the process of which Windows pid is \fIwpid\fR.
> Use the \fBinfo proc\fR command within \fBwinedbg\fR to list running processes
> and their Windows pids.
I don't think this is grammatical English either. I'd suggest "process
whose Windows pid is" instead.
June 18, 2022
[PATCH 1/1] include: Add _tcsto[u]ll declarations.
by Daniel Lehman
From: Daniel Lehman <dlehman25(a)gmail.com>
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
---
include/msvcrt/corecrt_wstdlib.h | 4 ++++
include/msvcrt/stdlib.h | 4 ++--
include/tchar.h | 4 ++++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/msvcrt/corecrt_wstdlib.h b/include/msvcrt/corecrt_wstdlib.h
index 53acdfe5a08..eef1fa26e0b 100644
--- a/include/msvcrt/corecrt_wstdlib.h
+++ b/include/msvcrt/corecrt_wstdlib.h
@@ -57,6 +57,10 @@ _ACRTIMP __int64 __cdecl _wcstoi64(const wchar_t*,wchar_t**,int);
_ACRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t*,wchar_t**,int,_locale_t);
_ACRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t*,wchar_t**,int);
_ACRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t*,wchar_t**,int,_locale_t);
+_ACRTIMP __int64 __cdecl wcstoll(const wchar_t*,wchar_t**,int);
+_ACRTIMP __int64 __cdecl _wcstoll_l(const wchar_t*,wchar_t**,int,_locale_t);
+_ACRTIMP unsigned __int64 __cdecl wcstoull(const wchar_t*,wchar_t**,int);
+_ACRTIMP unsigned __int64 __cdecl _wcstoull_l(const wchar_t*,wchar_t**,int,_locale_t);
#ifdef __cplusplus
}
diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h
index 7a2a774dfb5..f7acdda73cb 100644
--- a/include/msvcrt/stdlib.h
+++ b/include/msvcrt/stdlib.h
@@ -227,8 +227,8 @@ _ACRTIMP float __cdecl strtof(const char*,char**);
_ACRTIMP double __cdecl strtod(const char*,char**);
_ACRTIMP __msvcrt_long __cdecl strtol(const char*,char**,int);
_ACRTIMP __msvcrt_ulong __cdecl strtoul(const char*,char**,int);
-_ACRTIMP __int64 __cdecl strtoll_l(const char*,char**,int,_locale_t);
-_ACRTIMP unsigned __int64 __cdecl strtoull_l(const char*,char**,int,_locale_t);
+_ACRTIMP __int64 __cdecl _strtoll_l(const char*,char**,int,_locale_t);
+_ACRTIMP unsigned __int64 __cdecl _strtoull_l(const char*,char**,int,_locale_t);
_ACRTIMP __int64 __cdecl strtoimax(const char*,char**,int);
_ACRTIMP __int64 __cdecl strtoimax_l(const char*,char**,int,_locale_t);
_ACRTIMP unsigned __int64 __cdecl strtoumax(const char*,char**,int);
diff --git a/include/tchar.h b/include/tchar.h
index 526565ee0b5..a51bd5b359f 100644
--- a/include/tchar.h
+++ b/include/tchar.h
@@ -150,7 +150,11 @@ extern "C" {
#define _tcstod WINE_tchar_routine(strtod, strtod, wcstod)
#define _tcstok WINE_tchar_routine(strtok, _mbstok, _wcstok)
#define _tcstol WINE_tchar_routine(strtol, strtol, wcstol)
+#define _tcstoll WINE_tchar_routine(strtoll, strtoll, wcstoll)
+#define _tcstoll_l WINE_tchar_routine(_strtoll_l, _strtoll_l, _wcstoll_l)
#define _tcstoul WINE_tchar_routine(strtoul, strtoul, wcstoul)
+#define _tcstoull WINE_tchar_routine(strtoull, strtoull, wcstoull)
+#define _tcstoull_l WINE_tchar_routine(_strtoull_l, _strtoull_l, _wcstoull_l)
#define _tcsupr WINE_tchar_routine(_strupr, _mbsupr, _wcsupr)
#define _tcsupr_s WINE_tchar_routine(_strupr_s, _mbsupr_s, _wcsupr_s)
#define _tcsxfrm WINE_tchar_routine(strxfrm, strxfrm, wcsxfrm)
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/276
June 18, 2022
[PATCH 0/1] MR276: include: Add _tcsto[u]ll declarations.
by Daniel Lehman (@dlehman25)
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/276
June 18, 2022
[PATCH 4/4] ntdll: Add zero_bits parameter to load_builtin.
by Brendan Shanks
From: Brendan Shanks <bshanks(a)codeweavers.com>
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
dlls/ntdll/unix/loader.c | 6 +++---
dlls/ntdll/unix/unix_private.h | 2 +-
dlls/ntdll/unix/virtual.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index a69bf49b705..2fd4acc06b9 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -1644,7 +1644,7 @@ done:
* Return STATUS_IMAGE_ALREADY_LOADED if we should keep the native one that we have found.
*/
NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename,
- void **module, SIZE_T *size )
+ void **module, SIZE_T *size, ULONG_PTR zero_bits )
{
WORD machine = image_info->machine; /* request same machine as the native one */
NTSTATUS status;
@@ -1675,9 +1675,9 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename,
case LO_NATIVE_BUILTIN:
return STATUS_IMAGE_ALREADY_LOADED;
case LO_BUILTIN:
- return find_builtin_dll( &nt_name, module, size, &info, 0, machine, FALSE );
+ return find_builtin_dll( &nt_name, module, size, &info, zero_bits, machine, FALSE );
default:
- status = find_builtin_dll( &nt_name, module, size, &info, 0, machine, (loadorder == LO_DEFAULT) );
+ status = find_builtin_dll( &nt_name, module, size, &info, zero_bits, machine, (loadorder == LO_DEFAULT) );
if (status == STATUS_DLL_NOT_FOUND || status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH)
return STATUS_IMAGE_ALREADY_LOADED;
return status;
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 8a213bdc65f..39b667ddd4a 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -150,7 +150,7 @@ extern void *create_startup_info( const UNICODE_STRING *nt_image, const RTL_USER
extern char **build_envp( const WCHAR *envW ) DECLSPEC_HIDDEN;
extern NTSTATUS exec_wineloader( char **argv, int socketfd, const pe_image_info_t *pe_info ) DECLSPEC_HIDDEN;
extern NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename,
- void **addr_ptr, SIZE_T *size_ptr ) DECLSPEC_HIDDEN;
+ void **addr_ptr, SIZE_T *size_ptr, ULONG_PTR zero_bits ) DECLSPEC_HIDDEN;
extern BOOL is_builtin_path( const UNICODE_STRING *path, WORD *machine ) DECLSPEC_HIDDEN;
extern NTSTATUS load_main_exe( const WCHAR *name, const char *unix_name, const WCHAR *curdir, WCHAR **image,
void **module ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 0f65db69fbb..a93d5b4174a 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -2539,7 +2539,7 @@ static NTSTATUS virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_PTR z
{
filename = (WCHAR *)(image_info + 1);
/* check if we can replace that mapping with the builtin */
- res = load_builtin( image_info, filename, addr_ptr, size_ptr );
+ res = load_builtin( image_info, filename, addr_ptr, size_ptr, zero_bits );
if (res == STATUS_IMAGE_ALREADY_LOADED)
res = virtual_map_image( handle, access, addr_ptr, size_ptr, zero_bits, shared_file,
alloc_type, image_info, filename, FALSE );
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/275
June 18, 2022
[PATCH 3/4] ntdll: Add zero_bits parameter to find_builtin_dll.
by Brendan Shanks
From: Brendan Shanks <bshanks(a)codeweavers.com>
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
dlls/ntdll/unix/loader.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index cd8b79e2d52..a69bf49b705 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -1530,7 +1530,8 @@ static NTSTATUS open_builtin_so_file( const char *name, OBJECT_ATTRIBUTES *attr,
* find_builtin_dll
*/
static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T *size_ptr,
- SECTION_IMAGE_INFORMATION *image_info, WORD machine, BOOL prefer_native )
+ SECTION_IMAGE_INFORMATION *image_info,
+ ULONG_PTR zero_bits, WORD machine, BOOL prefer_native )
{
unsigned int i, pos, namepos, namelen, maxlen = 0;
unsigned int len = nt_name->Length / sizeof(WCHAR);
@@ -1572,7 +1573,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
ptr = prepend( ptr, ptr, namelen );
ptr = prepend( ptr, "/dlls", sizeof("/dlls") - 1 );
ptr = prepend( ptr, build_dir, strlen(build_dir) );
- status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
+ status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, zero_bits, machine, prefer_native );
if (status != STATUS_DLL_NOT_FOUND) goto done;
strcpy( file + pos + len + 1, ".so" );
status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
@@ -1586,7 +1587,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
ptr = prepend( ptr, ptr, namelen );
ptr = prepend( ptr, "/programs", sizeof("/programs") - 1 );
ptr = prepend( ptr, build_dir, strlen(build_dir) );
- status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
+ status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, zero_bits, machine, prefer_native );
if (status != STATUS_DLL_NOT_FOUND) goto done;
strcpy( file + pos + len + 1, ".so" );
status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
@@ -1599,7 +1600,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
file[pos + len + 1] = 0;
ptr = prepend( ptr, pe_dir, strlen(pe_dir) );
ptr = prepend( ptr, dll_paths[i], strlen(dll_paths[i]) );
- status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
+ status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, zero_bits, machine, prefer_native );
/* use so dir for unix lib */
ptr = file + pos;
ptr = prepend( ptr, so_dir, strlen(so_dir) );
@@ -1610,7 +1611,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
if (status != STATUS_DLL_NOT_FOUND) goto done;
file[pos + len + 1] = 0;
ptr = prepend( file + pos, dll_paths[i], strlen(dll_paths[i]) );
- status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
+ status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, zero_bits, machine, prefer_native );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH)
{
found_image = TRUE;
@@ -1674,9 +1675,9 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename,
case LO_NATIVE_BUILTIN:
return STATUS_IMAGE_ALREADY_LOADED;
case LO_BUILTIN:
- return find_builtin_dll( &nt_name, module, size, &info, machine, FALSE );
+ return find_builtin_dll( &nt_name, module, size, &info, 0, machine, FALSE );
default:
- status = find_builtin_dll( &nt_name, module, size, &info, machine, (loadorder == LO_DEFAULT) );
+ status = find_builtin_dll( &nt_name, module, size, &info, 0, machine, (loadorder == LO_DEFAULT) );
if (status == STATUS_DLL_NOT_FOUND || status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH)
return STATUS_IMAGE_ALREADY_LOADED;
return status;
@@ -1839,7 +1840,7 @@ NTSTATUS load_main_exe( const WCHAR *dos_name, const char *unix_name, const WCHA
/* if path is in system dir, we can load the builtin even if the file itself doesn't exist */
if (loadorder != LO_NATIVE && is_builtin_path( &nt_name, &machine ))
{
- status = find_builtin_dll( &nt_name, module, &size, &main_image_info, machine, FALSE );
+ status = find_builtin_dll( &nt_name, module, &size, &main_image_info, 0, machine, FALSE );
if (status != STATUS_DLL_NOT_FOUND) return status;
}
if (!contains_path) return STATUS_DLL_NOT_FOUND;
@@ -1868,7 +1869,7 @@ NTSTATUS load_start_exe( WCHAR **image, void **module )
wcscpy( *image, get_machine_wow64_dir( current_machine ));
wcscat( *image, startW );
init_unicode_string( &nt_name, *image );
- status = find_builtin_dll( &nt_name, module, &size, &main_image_info, current_machine, FALSE );
+ status = find_builtin_dll( &nt_name, module, &size, &main_image_info, 0, current_machine, FALSE );
if (status)
{
MESSAGE( "wine: failed to load start.exe: %x\n", status );
@@ -2082,7 +2083,7 @@ static void load_wow64_ntdll( USHORT machine )
wcscpy( path, get_machine_wow64_dir( machine ));
wcscat( path, ntdllW );
init_unicode_string( &nt_name, path );
- status = find_builtin_dll( &nt_name, &module, &size, &info, machine, FALSE );
+ status = find_builtin_dll( &nt_name, &module, &size, &info, 0, machine, FALSE );
switch (status)
{
case STATUS_IMAGE_NOT_AT_BASE:
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/275
June 18, 2022
[PATCH 2/4] ntdll: Add zero_bits parameter to open_builtin_pe_file.
by Brendan Shanks
From: Brendan Shanks <bshanks(a)codeweavers.com>
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
dlls/ntdll/unix/loader.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index ef66d76e610..cd8b79e2d52 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -1477,7 +1477,7 @@ static NTSTATUS open_dll_file( const char *name, OBJECT_ATTRIBUTES *attr, HANDLE
*/
static NTSTATUS open_builtin_pe_file( const char *name, OBJECT_ATTRIBUTES *attr, void **module,
SIZE_T *size, SECTION_IMAGE_INFORMATION *image_info,
- WORD machine, BOOL prefer_native )
+ ULONG_PTR zero_bits, WORD machine, BOOL prefer_native )
{
NTSTATUS status;
HANDLE mapping;
@@ -1486,7 +1486,7 @@ static NTSTATUS open_builtin_pe_file( const char *name, OBJECT_ATTRIBUTES *attr,
status = open_dll_file( name, attr, &mapping );
if (!status)
{
- status = virtual_map_builtin_module( mapping, module, size, image_info, 0, machine, prefer_native );
+ status = virtual_map_builtin_module( mapping, module, size, image_info, zero_bits, machine, prefer_native );
NtClose( mapping );
}
return status;
@@ -1572,7 +1572,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
ptr = prepend( ptr, ptr, namelen );
ptr = prepend( ptr, "/dlls", sizeof("/dlls") - 1 );
ptr = prepend( ptr, build_dir, strlen(build_dir) );
- status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, machine, prefer_native );
+ status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
if (status != STATUS_DLL_NOT_FOUND) goto done;
strcpy( file + pos + len + 1, ".so" );
status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
@@ -1586,7 +1586,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
ptr = prepend( ptr, ptr, namelen );
ptr = prepend( ptr, "/programs", sizeof("/programs") - 1 );
ptr = prepend( ptr, build_dir, strlen(build_dir) );
- status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, machine, prefer_native );
+ status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
if (status != STATUS_DLL_NOT_FOUND) goto done;
strcpy( file + pos + len + 1, ".so" );
status = open_builtin_so_file( ptr, &attr, module, image_info, machine, prefer_native );
@@ -1599,7 +1599,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
file[pos + len + 1] = 0;
ptr = prepend( ptr, pe_dir, strlen(pe_dir) );
ptr = prepend( ptr, dll_paths[i], strlen(dll_paths[i]) );
- status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, machine, prefer_native );
+ status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
/* use so dir for unix lib */
ptr = file + pos;
ptr = prepend( ptr, so_dir, strlen(so_dir) );
@@ -1610,7 +1610,7 @@ static NTSTATUS find_builtin_dll( UNICODE_STRING *nt_name, void **module, SIZE_T
if (status != STATUS_DLL_NOT_FOUND) goto done;
file[pos + len + 1] = 0;
ptr = prepend( file + pos, dll_paths[i], strlen(dll_paths[i]) );
- status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, machine, prefer_native );
+ status = open_builtin_pe_file( ptr, &attr, module, size_ptr, image_info, 0, machine, prefer_native );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH)
{
found_image = TRUE;
@@ -1981,7 +1981,7 @@ static void load_ntdll(void)
name = malloc( strlen( ntdll_dir ) + strlen( pe_dir ) + sizeof("/ntdll.dll.so") );
if (build_dir) sprintf( name, "%s/ntdll.dll", ntdll_dir );
else sprintf( name, "%s%s/ntdll.dll", dll_dir, pe_dir );
- status = open_builtin_pe_file( name, &attr, &module, &size, &info, current_machine, FALSE );
+ status = open_builtin_pe_file( name, &attr, &module, &size, &info, 0, current_machine, FALSE );
if (status == STATUS_DLL_NOT_FOUND)
{
sprintf( name, "%s/ntdll.dll.so", ntdll_dir );
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/275
June 18, 2022
[PATCH 1/4] ntdll: Add zero_bits parameter to virtual_map_builtin_module.
by Brendan Shanks
From: Brendan Shanks <bshanks(a)codeweavers.com>
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
dlls/ntdll/unix/loader.c | 2 +-
dlls/ntdll/unix/unix_private.h | 4 ++--
dlls/ntdll/unix/virtual.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index 7f85582adf3..ef66d76e610 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -1486,7 +1486,7 @@ static NTSTATUS open_builtin_pe_file( const char *name, OBJECT_ATTRIBUTES *attr,
status = open_dll_file( name, attr, &mapping );
if (!status)
{
- status = virtual_map_builtin_module( mapping, module, size, image_info, machine, prefer_native );
+ status = virtual_map_builtin_module( mapping, module, size, image_info, 0, machine, prefer_native );
NtClose( mapping );
}
return status;
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 795fc148479..8a213bdc65f 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -195,8 +195,8 @@ extern void *anon_mmap_alloc( size_t size, int prot ) DECLSPEC_HIDDEN;
extern void virtual_init(void) DECLSPEC_HIDDEN;
extern ULONG_PTR get_system_affinity_mask(void) DECLSPEC_HIDDEN;
extern void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info, BOOL wow64 ) DECLSPEC_HIDDEN;
-extern NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size,
- SECTION_IMAGE_INFORMATION *info, WORD machine, BOOL prefer_native ) DECLSPEC_HIDDEN;
+extern NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size, SECTION_IMAGE_INFORMATION *info,
+ ULONG_PTR zero_bits, WORD machine, BOOL prefer_native ) DECLSPEC_HIDDEN;
extern NTSTATUS virtual_create_builtin_view( void *module, const UNICODE_STRING *nt_name,
pe_image_info_t *info, void *so_handle ) DECLSPEC_HIDDEN;
extern TEB *virtual_alloc_first_teb(void) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 6ecca9cb98a..0f65db69fbb 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -2756,8 +2756,8 @@ void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info, BOOL wow64 )
/***********************************************************************
* virtual_map_builtin_module
*/
-NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size,
- SECTION_IMAGE_INFORMATION *info, WORD machine, BOOL prefer_native )
+NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size, SECTION_IMAGE_INFORMATION *info,
+ ULONG_PTR zero_bits, WORD machine, BOOL prefer_native )
{
mem_size_t full_size;
unsigned int sec_flags;
@@ -2794,7 +2794,7 @@ NTSTATUS virtual_map_builtin_module( HANDLE mapping, void **module, SIZE_T *size
else
{
status = virtual_map_image( mapping, SECTION_MAP_READ | SECTION_MAP_EXECUTE,
- module, size, 0, shared_file, 0, image_info, filename, TRUE );
+ module, size, zero_bits, shared_file, 0, image_info, filename, TRUE );
virtual_fill_image_information( image_info, info );
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/275
June 18, 2022
[PATCH 0/4] MR275: ntdll: Plumb zero_bits parameter from virtual_map_section to virtual_map_builtin_module.
by Brendan Shanks (@bshanks)
When running a 32-bit EXE in Wow64 mode with a fairly full address space, a builtin DLL may be loaded above the 4GB line. This is due to virtual_map_builtin_module calling virtual_map_image with zero_bits hardcoded to 0.
virtual_map_section is called with the correct zero_bits, this patch propagates that parameter down through load_builtin, find_builtin_dll, open_builtin_pe_file, and virtual_map_builtin_module.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/275
June 18, 2022
[PATCH v3 9/9] d3dx10/tests: Add D3DX10CreateThreadPump tests.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/tests/d3dx10.c | 356 ++++++++++++++++++++++++++++++++++
1 file changed, 356 insertions(+)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c
index d1c772197b9..5300a568999 100644
--- a/dlls/d3dx10_43/tests/d3dx10.c
+++ b/dlls/d3dx10_43/tests/d3dx10.c
@@ -2066,6 +2066,361 @@ static void test_D3DX10CreateAsyncTextureProcessor(void)
ok(!ID3D10Device_Release(device), "Unexpected refcount.\n");
}
+static DWORD main_tid;
+static DWORD io_tid;
+
+struct data_object
+{
+ ID3DX10DataLoader ID3DX10DataLoader_iface;
+ ID3DX10DataProcessor ID3DX10DataProcessor_iface;
+
+ HANDLE load_started;
+ HANDLE load_done;
+ HANDLE decompress_done;
+ HRESULT load_ret;
+
+ DWORD process_tid;
+};
+
+static struct data_object* data_object_from_ID3DX10DataLoader(ID3DX10DataLoader *iface)
+{
+ return CONTAINING_RECORD(iface, struct data_object, ID3DX10DataLoader_iface);
+}
+
+static LONG data_loader_load_count;
+static WINAPI HRESULT data_loader_Load(ID3DX10DataLoader *iface)
+{
+ struct data_object *data_object = data_object_from_ID3DX10DataLoader(iface);
+ DWORD ret;
+
+ ok(InterlockedDecrement(&data_loader_load_count) >= 0, "unexpected call\n");
+
+ if (io_tid)
+ io_tid = GetCurrentThreadId();
+ ok(io_tid != main_tid, "Load called in main thread.\n");
+
+ SetEvent(data_object->load_started);
+ ret = WaitForSingleObject(data_object->load_done, INFINITE);
+ ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", ret);
+ return data_object->load_ret;
+}
+
+static LONG data_loader_decompress_count;
+static WINAPI HRESULT data_loader_Decompress(ID3DX10DataLoader *iface, void **data, SIZE_T *bytes)
+{
+ struct data_object *data_object = data_object_from_ID3DX10DataLoader(iface);
+ DWORD ret;
+
+ ok(InterlockedDecrement(&data_loader_decompress_count) >= 0, "unexpected call\n");
+ ok(data != NULL, "data == NULL\n");
+ ok(bytes != NULL, "bytes == NULL\n");
+
+ data_object->process_tid = GetCurrentThreadId();
+ ok(data_object->process_tid != main_tid, "Decompress called in main thread.\n");
+ ok(data_object->process_tid != io_tid, "Decompress called in IO thread.\n");
+
+ *data = (void*)0xdeadbeef;
+ *bytes = 0xdead;
+ ret = WaitForSingleObject(data_object->decompress_done, INFINITE);
+ ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", ret);
+ return S_OK;
+}
+
+static LONG data_loader_destroy_count;
+static WINAPI HRESULT data_loader_Destroy(ID3DX10DataLoader *iface)
+{
+ ok(InterlockedDecrement(&data_loader_destroy_count) >= 0, "unexpected call\n");
+ return S_OK;
+}
+
+static ID3DX10DataLoaderVtbl D3DX10DataLoaderVtbl =
+{
+ data_loader_Load,
+ data_loader_Decompress,
+ data_loader_Destroy
+};
+
+static struct data_object* data_object_from_ID3DX10DataProcessor(ID3DX10DataProcessor *iface)
+{
+ return CONTAINING_RECORD(iface, struct data_object, ID3DX10DataProcessor_iface);
+}
+
+static LONG data_processor_process_count;
+static HRESULT WINAPI data_processor_Process(ID3DX10DataProcessor *iface, void *data, SIZE_T bytes)
+{
+ struct data_object *data_object = data_object_from_ID3DX10DataProcessor(iface);
+
+ ok(InterlockedDecrement(&data_processor_process_count) >= 0, "unexpected call\n");
+ ok(GetCurrentThreadId() == data_object->process_tid, "Process called in different thread.\n");
+
+ ok(data == (void*)0xdeadbeef, "data = %p\n", data);
+ ok(bytes == 0xdead, "bytes = %lu\n", bytes);
+ return S_OK;
+}
+
+static LONG data_processor_create_count;
+static HRESULT WINAPI data_processor_CreateDeviceObject(ID3DX10DataProcessor *iface, void **object)
+{
+ ok(InterlockedDecrement(&data_processor_create_count) >= 0, "unexpected call\n");
+ ok(GetCurrentThreadId() == main_tid, "CreateDeviceObject not called in main thread.\n");
+
+ *object = (void*)0xdeadf00d;
+ return S_OK;
+}
+
+static LONG data_processor_destroy_count;
+static HRESULT WINAPI data_processor_Destroy(ID3DX10DataProcessor *iface)
+{
+ struct data_object *data_object = data_object_from_ID3DX10DataProcessor(iface);
+
+ ok(InterlockedDecrement(&data_processor_destroy_count) >= 0, "unexpected call\n");
+
+ CloseHandle(data_object->load_started);
+ CloseHandle(data_object->load_done);
+ CloseHandle(data_object->decompress_done);
+ free(data_object);
+ return S_OK;
+}
+
+static ID3DX10DataProcessorVtbl D3DX10DataProcessorVtbl =
+{
+ data_processor_Process,
+ data_processor_CreateDeviceObject,
+ data_processor_Destroy
+};
+
+static struct data_object* create_data_object(HRESULT load_ret)
+{
+ struct data_object *data_object = malloc(sizeof(*data_object));
+
+ data_object->ID3DX10DataLoader_iface.lpVtbl = &D3DX10DataLoaderVtbl;
+ data_object->ID3DX10DataProcessor_iface.lpVtbl = &D3DX10DataProcessorVtbl;
+
+ data_object->load_started = CreateEventW(NULL, FALSE, FALSE, NULL);
+ ok(data_object->load_started != NULL, "CreateEvent failed (%u)\n", GetLastError());
+ data_object->load_done = CreateEventW(NULL, FALSE, FALSE, NULL);
+ ok(data_object->load_done != NULL, "CreateEvent failed (%u)\n", GetLastError());
+ data_object->decompress_done = CreateEventW(NULL, FALSE, FALSE, NULL);
+ ok(data_object->decompress_done != NULL, "CreateEvent failed (%u)\n", GetLastError());
+ data_object->load_ret = load_ret;
+
+ return data_object;
+}
+
+static void test_D3DX10CreateThreadPump(void)
+{
+ UINT io_count, process_count, device_count, count;
+ struct data_object *data_object[2];
+ ID3DX10DataProcessor *processor;
+ D3DX10_IMAGE_INFO image_info;
+ ID3DX10DataLoader *loader;
+ HRESULT hr, work_item_hr;
+ ID3D10Resource *resource;
+ ID3DX10ThreadPump *pump;
+ ID3D10Device *device;
+ SYSTEM_INFO info;
+ void *object;
+ DWORD ret;
+ int i;
+
+ main_tid = GetCurrentThreadId();
+
+ hr = D3DX10CreateThreadPump(1024, 0, &pump);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ hr = D3DX10CreateThreadPump(0, 1024, &pump);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+
+ GetSystemInfo(&info);
+ if (info.dwNumberOfProcessors > 1)
+ hr = D3DX10CreateThreadPump(0, 0, &pump);
+ else
+ hr = D3DX10CreateThreadPump(0, 2, &pump);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+
+ count = ID3DX10ThreadPump_GetWorkItemCount(pump);
+ ok(!count, "GetWorkItemCount returned %u.\n", count);
+ hr = ID3DX10ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(!io_count, "Got unexpected io_count = %u.\n", io_count);
+ ok(!process_count, "Got unexpected process_count = %u.\n", process_count);
+ ok(!device_count, "Got unexpected device_count = %u.\n", device_count);
+
+ data_object[0] = create_data_object(E_NOTIMPL);
+ data_object[1] = create_data_object(S_OK);
+
+ data_loader_load_count = 1;
+ hr = ID3DX10ThreadPump_AddWorkItem(pump, &data_object[0]->ID3DX10DataLoader_iface,
+ &data_object[0]->ID3DX10DataProcessor_iface, &work_item_hr, NULL);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ret = WaitForSingleObject(data_object[0]->load_started, INFINITE);
+ ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x.\n", ret);
+ ok(!data_loader_load_count, "Got unexpected data_loader_load_count %d.\n", data_loader_load_count);
+ count = ID3DX10ThreadPump_GetWorkItemCount(pump);
+ ok(count == 1, "GetWorkItemCount returned %u.\n", count);
+ hr = ID3DX10ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(!io_count, "Got unexpected io_count = %u.\n", io_count);
+ ok(!process_count, "Got unexpected process_count = %u.\n", process_count);
+ ok(!device_count, "Got unexpected device_count = %u.\n", device_count);
+
+ hr = ID3DX10ThreadPump_AddWorkItem(pump, &data_object[1]->ID3DX10DataLoader_iface,
+ &data_object[1]->ID3DX10DataProcessor_iface, NULL, &object);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ret = WaitForSingleObject(data_object[0]->load_started, 50);
+ ok(ret == WAIT_TIMEOUT, "WaitForSingleObject returned %x.\n", ret);
+ count = ID3DX10ThreadPump_GetWorkItemCount(pump);
+ ok(count == 2, "GetWorkItemCount returned %u.\n", count);
+ hr = ID3DX10ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(io_count == 1, "Got unexpected io_count = %u.\n", io_count);
+ ok(!process_count, "Got unexpected process_count = %u.\n", process_count);
+ ok(!device_count, "Got unexpected device_count = %u.\n", device_count);
+
+ data_loader_load_count = 1;
+ data_loader_destroy_count = 1;
+ data_processor_destroy_count = 1;
+ SetEvent(data_object[0]->load_done);
+ ret = WaitForSingleObject(data_object[1]->load_started, INFINITE);
+ ok(ret == WAIT_OBJECT_0, "WaitForSingleObject returned %x.\n", ret);
+ ok(work_item_hr == E_NOTIMPL, "Got unexpected work_item_hr = %#x.\n", work_item_hr);
+ ok(!data_loader_destroy_count, "Got unexpected data_loader_destroy_count %d.\n", data_loader_destroy_count);
+ ok(!data_processor_destroy_count, "Got unexpected data_processor_destroy_count %d.\n",
+ data_processor_destroy_count);
+ ok(!data_loader_load_count, "Got unexpected data_loader_load_count %d.\n", data_loader_load_count);
+
+ data_loader_decompress_count = 1;
+ data_processor_process_count = 1;
+ SetEvent(data_object[1]->load_done);
+ SetEvent(data_object[1]->decompress_done);
+
+ data_processor_create_count = 1;
+ data_loader_destroy_count = 1;
+ data_processor_destroy_count = 1;
+ hr = ID3DX10ThreadPump_WaitForAllItems(pump);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(object == (void*)0xdeadf00d, "Got unexpected object = %p.\n", object);
+ ok(!data_loader_decompress_count, "Got unexpected data_loader_decompress_count %d.\n", data_loader_decompress_count);
+ ok(!data_processor_process_count, "Got unexpected data_processor_process_count %d.\n", data_processor_process_count);
+ ok(!data_processor_create_count, "Got unexpected data_processor_create_count %d.\n", data_processor_create_count);
+ ok(!data_loader_destroy_count, "Got unexpected data_loader_destroy_count %d.\n", data_loader_destroy_count);
+ ok(!data_processor_destroy_count, "Got unexpected data_processor_destroy_count %d.\n", data_processor_destroy_count);
+
+ data_object[0] = create_data_object(S_OK);
+ data_object[1] = create_data_object(S_OK);
+ SetEvent(data_object[0]->load_done);
+ SetEvent(data_object[1]->load_done);
+ SetEvent(data_object[1]->decompress_done);
+
+ data_loader_load_count = 2;
+ data_loader_decompress_count = 2;
+ data_processor_process_count = 1;
+ hr = ID3DX10ThreadPump_AddWorkItem(pump, &data_object[0]->ID3DX10DataLoader_iface,
+ &data_object[0]->ID3DX10DataProcessor_iface, NULL, &object);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10ThreadPump_AddWorkItem(pump, &data_object[1]->ID3DX10DataLoader_iface,
+ &data_object[1]->ID3DX10DataProcessor_iface, NULL, &object);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ while(1)
+ {
+ hr = ID3DX10ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count);
+ if (hr != S_OK || device_count)
+ break;
+ Sleep(1);
+ }
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(!io_count, "Got unexpected io_count = %u.\n", io_count);
+ ok(!process_count, "Got unexpected process_count = %u.\n", process_count);
+ ok(device_count == 1, "Got unexpected device_count = %u.\n", device_count);
+ ok(!data_loader_load_count, "Got unexpected data_loader_load_count %d.\n", data_loader_load_count);
+ ok(!data_loader_decompress_count, "Got unexpected data_loader_decompress_count %d.\n", data_loader_decompress_count);
+ ok(!data_processor_process_count, "Got unexpected data_processor_process_count %d.\n", data_processor_process_count);
+
+ hr = ID3DX10ThreadPump_ProcessDeviceWorkItems(pump, 0);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(!io_count, "Got unexpected io_count = %u.\n", io_count);
+ ok(!process_count, "Got unexpected process_count = %u.\n", process_count);
+ ok(device_count == 1, "Got unexpected device_count = %u.\n", device_count);
+
+ data_processor_create_count = 1;
+ data_loader_destroy_count = 1;
+ data_processor_destroy_count = 1;
+ hr = ID3DX10ThreadPump_ProcessDeviceWorkItems(pump, 1);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10ThreadPump_GetQueueStatus(pump, &io_count, &process_count, &device_count);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(!io_count, "Got unexpected io_count = %u.\n", io_count);
+ ok(!process_count, "Got unexpected process_count = %u.\n", process_count);
+ ok(!device_count, "Got unexpected device_count = %u.\n", device_count);
+ ok(!data_processor_create_count, "Got unexpected data_processor_create_count %d.\n", data_processor_create_count);
+ ok(!data_loader_destroy_count, "Got unexpected data_loader_destroy_count %d.\n", data_loader_destroy_count);
+ ok(!data_processor_destroy_count, "Got unexpected data_processor_destroy_count %d.\n", data_processor_destroy_count);
+
+ data_processor_process_count = 1;
+ data_loader_destroy_count = 1;
+ data_processor_destroy_count = 1;
+ SetEvent(data_object[0]->decompress_done);
+ hr = ID3DX10ThreadPump_PurgeAllItems(pump);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ data_processor_process_count = 0;
+ ok(!data_loader_destroy_count, "Got unexpected data_loader_destroy_count %d.\n", data_loader_destroy_count);
+ ok(!data_processor_destroy_count, "Got unexpected data_processor_destroy_count %d.\n", data_processor_destroy_count);
+
+ device = create_device();
+ if (!device)
+ {
+ skip("Failed to create device, skipping tests.\n");
+ ID3DX10ThreadPump_Release(pump);
+ return;
+ }
+
+ for (i = 0; i < ARRAY_SIZE(test_image); ++i)
+ {
+ winetest_push_context("Test %u", i);
+
+ hr = D3DX10CreateAsyncMemoryLoader(test_image[i].data, test_image[i].size, &loader);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = D3DX10CreateAsyncTextureInfoProcessor(&image_info, &processor);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, &work_item_hr, NULL);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10ThreadPump_WaitForAllItems(pump);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ ok(work_item_hr == S_OK || (work_item_hr == E_FAIL
+ && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
+ "Got unexpected hr %#x.\n", work_item_hr);
+ if (work_item_hr == S_OK)
+ check_image_info(&image_info, test_image + i, __LINE__);
+
+ hr = D3DX10CreateAsyncMemoryLoader(test_image[i].data, test_image[i].size, &loader);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = D3DX10CreateAsyncTextureProcessor(device, NULL, &processor);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, &work_item_hr, (void **)&resource);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ hr = ID3DX10ThreadPump_WaitForAllItems(pump);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ todo_wine_if(test_image[i].expected_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE)
+ ok(work_item_hr == S_OK || (work_item_hr == E_FAIL
+ && test_image[i].expected_info.ImageFileFormat == D3DX10_IFF_WMP),
+ "Got unexpected hr %#x.\n", work_item_hr);
+ if (work_item_hr == S_OK)
+ {
+ check_resource_info(resource, test_image + i, __LINE__);
+ check_resource_data(resource, test_image + i, __LINE__);
+ ID3D10Resource_Release(resource);
+ }
+
+ winetest_pop_context();
+ }
+
+ ok(!ID3D10Device_Release(device), "Unexpected refcount.\n");
+
+ ret = ID3DX10ThreadPump_Release(pump);
+ ok(!ret, "Got unexpected refcount %u.\n", ret);
+}
+
static void test_get_image_info(void)
{
static const WCHAR test_resource_name[] = L"resource.data";
@@ -3573,6 +3928,7 @@ START_TEST(d3dx10)
test_D3DX10CreateAsyncResourceLoader();
test_D3DX10CreateAsyncTextureInfoProcessor();
test_D3DX10CreateAsyncTextureProcessor();
+ test_D3DX10CreateThreadPump();
test_get_image_info();
test_create_texture();
test_font();
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/272
June 18, 2022
[PATCH v3 8/9] d3dx10: Add ID3DX10ThreadPump:PurgeAllItems implementation.
by Piotr Caban
From: Piotr Caban <piotr(a)codeweavers.com>
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
---
dlls/d3dx10_43/d3dx10_43_main.c | 48 +++++++++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c
index 5804a1058b0..df1e3f413f5 100644
--- a/dlls/d3dx10_43/d3dx10_43_main.c
+++ b/dlls/d3dx10_43/d3dx10_43_main.c
@@ -404,8 +404,52 @@ static HRESULT WINAPI thread_pump_ProcessDeviceWorkItems(ID3DX10ThreadPump *ifac
static HRESULT WINAPI thread_pump_PurgeAllItems(ID3DX10ThreadPump *iface)
{
- FIXME("iface %p stub!\n", iface);
- return E_NOTIMPL;
+ struct thread_pump *thread_pump = impl_from_ID3DX10ThreadPump(iface);
+ struct list list = LIST_INIT(list);
+ struct work_item *work_item;
+ LONG v;
+
+ TRACE("iface %p.\n", iface);
+
+ while (1)
+ {
+ AcquireSRWLockExclusive(&thread_pump->io_lock);
+ list_move_tail(&list, &thread_pump->io_queue);
+ thread_pump->io_count = 0;
+ ReleaseSRWLockExclusive(&thread_pump->io_lock);
+
+ AcquireSRWLockExclusive(&thread_pump->proc_lock);
+ list_move_tail(&list, &thread_pump->proc_queue);
+ thread_pump->proc_count = 0;
+ ReleaseSRWLockExclusive(&thread_pump->proc_lock);
+
+ while (!list_empty(&list))
+ {
+ work_item = LIST_ENTRY(list_head(&list), struct work_item, entry);
+ list_remove(&work_item->entry);
+ work_item_free(work_item, TRUE);
+ if (!InterlockedDecrement(&thread_pump->processing_count))
+ RtlWakeAddressAll((void *)&thread_pump->processing_count);
+ }
+
+ if (!(v = thread_pump->processing_count))
+ break;
+
+ RtlWaitOnAddress((void *)&thread_pump->processing_count, &v, sizeof(v), NULL);
+ }
+
+ AcquireSRWLockExclusive(&thread_pump->device_lock);
+ list_move_tail(&list, &thread_pump->device_queue);
+ thread_pump->device_count = 0;
+ ReleaseSRWLockExclusive(&thread_pump->device_lock);
+
+ while(!list_empty(&list))
+ {
+ work_item = LIST_ENTRY(list_head(&list), struct work_item, entry);
+ list_remove(&work_item->entry);
+ work_item_free(work_item, TRUE);
+ }
+ return S_OK;
}
static HRESULT WINAPI thread_pump_GetQueueStatus(ID3DX10ThreadPump *iface,
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/272
June 18, 2022