winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
July 2016
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
680 discussions
Start a n
N
ew thread
Ken Thomases : ntdll: For Mac 64-bit, poke the TEB address to %gs: 0x30 and re-enable the inlining of NtCurrentTeb().
by Alexandre Julliard
28 Jul '16
28 Jul '16
Module: wine Branch: master Commit: 7501942008f91a9a137fe598ce5ce7cb47de5522 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7501942008f91a9a137fe598c…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Jul 27 10:42:29 2016 -0500 ntdll: For Mac 64-bit, poke the TEB address to %gs:0x30 and re-enable the inlining of NtCurrentTeb(). 64-bit Windows apps have hard-coded accesses to %gs:0x30 baked into them. They need to find the TEB self pointer there. Technically, the gsbase register and the memory it points to belong to the pthread implementation on macOS. It's used for the pthread TLS implementation. However, study of the sources and experimentation reveal that TLS slot 6 (offset 0x30) is not currently used. Furthermore, Apple has promised to not use that slot in the future. So, we hijack it for our purposes. Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll.spec | 2 +- dlls/ntdll/signal_x86_64.c | 34 +++------------------------------- include/winnt.h | 2 +- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index f6e7edf..e0c0746 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -149,7 +149,7 @@ @ stdcall NtCreateTimer(ptr long ptr long) @ stub NtCreateToken # @ stub NtCreateWaitablePort -@ stdcall NtCurrentTeb() +@ stdcall -arch=win32,arm64 NtCurrentTeb() # @ stub NtDebugActiveProcess # @ stub NtDebugContinue @ stdcall NtDelayExecution(long ptr) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 1db3a23..10faaea 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -241,8 +241,6 @@ static inline int arch_prctl( int func, void *ptr ) { return syscall( __NR_arch_ #define FPU_sig(context) ((XMM_SAVE_AREA32 *)((context)->uc_mcontext.__fpregs)) #elif defined (__APPLE__) -static pthread_key_t teb_key; - #define RAX_sig(context) ((context)->uc_mcontext->__ss.__rax) #define RBX_sig(context) ((context)->uc_mcontext->__ss.__rbx) #define RCX_sig(context) ((context)->uc_mcontext->__ss.__rcx) @@ -2834,13 +2832,6 @@ void signal_free_thread( TEB *teb ) NtFreeVirtualMemory( NtCurrentProcess(), (void **)&teb, &size, MEM_RELEASE ); } -#ifdef __APPLE__ -static void init_teb_key(void) -{ - pthread_key_create( &teb_key, NULL ); -} -#endif - /********************************************************************** * signal_init_thread */ @@ -2849,10 +2840,6 @@ void signal_init_thread( TEB *teb ) const WORD fpu_cw = 0x27f; stack_t ss; -#ifdef __APPLE__ - static pthread_once_t init_once = PTHREAD_ONCE_INIT; -#endif - #if defined __linux__ arch_prctl( ARCH_SET_GS, teb ); #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) @@ -2860,9 +2847,9 @@ void signal_init_thread( TEB *teb ) #elif defined(__NetBSD__) sysarch( X86_64_SET_GSBASE, &teb ); #elif defined (__APPLE__) - /* FIXME: Actually setting %gs needs support from the OS */ - pthread_once( &init_once, init_teb_key ); - pthread_setspecific( teb_key, teb ); + __asm__ volatile (".byte 0x65\n\tmovq %0,%c1" + : + : "r" (teb->Tib.Self), "n" (FIELD_OFFSET(TEB, Tib.Self))); #else # error Please define setting %gs for your architecture #endif @@ -3847,19 +3834,4 @@ __ASM_STDCALL_FUNC( DbgBreakPoint, 0, "int $3; ret") */ __ASM_STDCALL_FUNC( DbgUserBreakPoint, 0, "int $3; ret") -/********************************************************************** - * NtCurrentTeb (NTDLL.@) - * - * FIXME: This isn't exported from NTDLL on real NT. This should be - * removed if and when we can set the GSBASE MSR on Mac OS X. - */ -#ifdef __APPLE__ -TEB * WINAPI NtCurrentTeb(void) -{ - return pthread_getspecific( teb_key ); -} -#else -__ASM_STDCALL_FUNC( NtCurrentTeb, 0, ".byte 0x65\n\tmovq 0x30,%rax\n\tret" ) -#endif - #endif /* __x86_64__ */ diff --git a/include/winnt.h b/include/winnt.h index 2705373..96722a4 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2331,7 +2331,7 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) __asm mov teb, eax; return teb; } -#elif defined(__x86_64__) && defined(__GNUC__) && !defined(__APPLE__) +#elif defined(__x86_64__) && defined(__GNUC__) static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) { struct _TEB *teb;
1
0
0
0
Ken Thomases : kernel32: For Mac 64-bit, re-enable the inlining of various functions, leveraging the TEB self pointer at %gs:0x30.
by Alexandre Julliard
28 Jul '16
28 Jul '16
Module: wine Branch: master Commit: 2e636d4fe8facb841e3f1ab2a413b07e5f743dab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e636d4fe8facb841e3f1ab2a…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Jul 27 10:42:30 2016 -0500 kernel32: For Mac 64-bit, re-enable the inlining of various functions, leveraging the TEB self pointer at %gs:0x30. On other platforms, gsbase is set to point to Wine's TEB. So, these functions can use %gs-relative addressing with the field offsets to access the fields of the TEB. On the Mac, gsbase points to internals of the pthread implementation and that wouldn't work. However, Wine hijacks %gs:0x30 and stores the TEB address there. So, we access the TEB fields by first loading the TEB address and then accessing its fields relative to that. Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/thread.c | 38 +++++++++++++++++++++++++++++++++++++- include/winbase.h | 32 +++++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/thread.c b/dlls/kernel32/thread.c index 6630e7f..82ccebe 100644 --- a/dlls/kernel32/thread.c +++ b/dlls/kernel32/thread.c @@ -682,7 +682,41 @@ __ASM_STDCALL_FUNC( GetCurrentThreadId, 0, ".byte 0x64\n\tmovl 0x24,%eax\n\tret" /* HANDLE WINAPI GetProcessHeap(void) */ __ASM_STDCALL_FUNC( GetProcessHeap, 0, ".byte 0x64\n\tmovl 0x30,%eax\n\tmovl 0x18(%eax),%eax\n\tret"); -#elif defined(__x86_64__) && !defined(__APPLE__) +#elif defined(__x86_64__) + +#ifdef __APPLE__ + +/*********************************************************************** + * SetLastError (KERNEL32.@) + */ +/* void WINAPI SetLastError( DWORD error ); */ +__ASM_STDCALL_FUNC( SetLastError, 8, ".byte 0x65\n\tmovq 0x30,%rax\n\tmovl %ecx,0x68(%rax)\n\tret" ); + +/*********************************************************************** + * GetLastError (KERNEL32.@) + */ +/* DWORD WINAPI GetLastError(void); */ +__ASM_STDCALL_FUNC( GetLastError, 0, ".byte 0x65\n\tmovq 0x30,%rax\n\tmovl 0x68(%rax),%eax\n\tret" ); + +/*********************************************************************** + * GetCurrentProcessId (KERNEL32.@) + */ +/* DWORD WINAPI GetCurrentProcessId(void) */ +__ASM_STDCALL_FUNC( GetCurrentProcessId, 0, ".byte 0x65\n\tmovq 0x30,%rax\n\tmovl 0x40(%rax),%eax\n\tret" ); + +/*********************************************************************** + * GetCurrentThreadId (KERNEL32.@) + */ +/* DWORD WINAPI GetCurrentThreadId(void) */ +__ASM_STDCALL_FUNC( GetCurrentThreadId, 0, ".byte 0x65\n\tmovq 0x30,%rax\n\tmovl 0x48(%rax),%eax\n\tret" ); + +/*********************************************************************** + * GetProcessHeap (KERNEL32.@) + */ +/* HANDLE WINAPI GetProcessHeap(void) */ +__ASM_STDCALL_FUNC( GetProcessHeap, 0, ".byte 0x65\n\tmovq 0x30,%rax\n\tmovq 0x60(%rax),%rax\n\tmovq 0x30(%rax),%rax\n\tret"); + +#else /*********************************************************************** * SetLastError (KERNEL32.@) @@ -714,6 +748,8 @@ __ASM_STDCALL_FUNC( GetCurrentThreadId, 0, ".byte 0x65\n\tmovl 0x48,%eax\n\tret" /* HANDLE WINAPI GetProcessHeap(void) */ __ASM_STDCALL_FUNC( GetProcessHeap, 0, ".byte 0x65\n\tmovq 0x60,%rax\n\tmovq 0x30(%rax),%rax\n\tret"); +#endif /* __APPLE__ */ + #else /* __x86_64__ */ /********************************************************************** diff --git a/include/winbase.h b/include/winbase.h index 5d8b1ff..220a057 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2904,13 +2904,19 @@ static FORCEINLINE LONG WINAPI InterlockedDecrement( LONG volatile *dest ) /* A few optimizations for gcc */ -#if defined(__GNUC__) && !defined(__MINGW32__) && (defined(__i386__) || (defined(__x86_64__) && !defined(__APPLE__))) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) +#if defined(__GNUC__) && !defined(__MINGW32__) && (defined(__i386__) || defined(__x86_64__)) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) static FORCEINLINE DWORD WINAPI GetLastError(void) { DWORD ret; #ifdef __x86_64__ +#ifdef __APPLE__ + DWORD* teb; + __asm__ __volatile__( ".byte 0x65\n\tmovq 0x30,%0" : "=r" (teb) ); + ret = teb[0x68 / sizeof(DWORD)]; +#else __asm__ __volatile__( ".byte 0x65\n\tmovl 0x68,%0" : "=r" (ret) ); +#endif #else __asm__ __volatile__( ".byte 0x64\n\tmovl 0x34,%0" : "=r" (ret) ); #endif @@ -2921,7 +2927,13 @@ static FORCEINLINE DWORD WINAPI GetCurrentProcessId(void) { DWORD ret; #ifdef __x86_64__ +#ifdef __APPLE__ + DWORD* teb; + __asm__ __volatile__( ".byte 0x65\n\tmovq 0x30,%0" : "=r" (teb) ); + ret = teb[0x40 / sizeof(DWORD)]; +#else __asm__ __volatile__( ".byte 0x65\n\tmovl 0x40,%0" : "=r" (ret) ); +#endif #else __asm__ __volatile__( ".byte 0x64\n\tmovl 0x20,%0" : "=r" (ret) ); #endif @@ -2932,7 +2944,13 @@ static FORCEINLINE DWORD WINAPI GetCurrentThreadId(void) { DWORD ret; #ifdef __x86_64__ +#ifdef __APPLE__ + DWORD* teb; + __asm__ __volatile__( ".byte 0x65\n\tmovq 0x30,%0" : "=r" (teb) ); + ret = teb[0x48 / sizeof(DWORD)]; +#else __asm__ __volatile__( ".byte 0x65\n\tmovl 0x48,%0" : "=r" (ret) ); +#endif #else __asm__ __volatile__( ".byte 0x64\n\tmovl 0x24,%0" : "=r" (ret) ); #endif @@ -2942,7 +2960,13 @@ static FORCEINLINE DWORD WINAPI GetCurrentThreadId(void) static FORCEINLINE void WINAPI SetLastError( DWORD err ) { #ifdef __x86_64__ +#ifdef __APPLE__ + DWORD* teb; + __asm__ __volatile__( ".byte 0x65\n\tmovq 0x30,%0" : "=r" (teb) ); + teb[0x68 / sizeof(DWORD)] = err; +#else __asm__ __volatile__( ".byte 0x65\n\tmovl %0,0x68" : : "r" (err) : "memory" ); +#endif #else __asm__ __volatile__( ".byte 0x64\n\tmovl %0,0x34" : : "r" (err) : "memory" ); #endif @@ -2952,7 +2976,13 @@ static FORCEINLINE HANDLE WINAPI GetProcessHeap(void) { HANDLE *pdb; #ifdef __x86_64__ +#ifdef __APPLE__ + HANDLE** teb; + __asm__ __volatile__( ".byte 0x65\n\tmovq 0x30,%0" : "=r" (teb) ); + pdb = teb[0x60 / sizeof(HANDLE*)]; +#else __asm__ __volatile__( ".byte 0x65\n\tmovq 0x60,%0" : "=r" (pdb) ); +#endif return pdb[0x30 / sizeof(HANDLE)]; /* get dword at offset 0x30 in pdb */ #else __asm__ __volatile__( ".byte 0x64\n\tmovl 0x30,%0" : "=r" (pdb) );
1
0
0
0
Martin Storsjo : ucrtbase: Expose the fabsf function on arm.
by Alexandre Julliard
27 Jul '16
27 Jul '16
Module: wine Branch: master Commit: b05704dbbd429a5325132c77a3e13fcb88b2995f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b05704dbbd429a5325132c77a…
Author: Martin Storsjo <martin(a)martin.st> Date: Wed Jul 27 13:21:17 2016 +0300 ucrtbase: Expose the fabsf function on arm. It isn't available in the x86 or x64 versions of ucrtbase.dll or api-ms-win-crt-math-l1-1-0.dll, but exists (and gets used by MSVC 2015) on arm. Signed-off-by: Martin Storsjo <martin(a)martin.st> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec | 1 + dlls/ucrtbase/ucrtbase.spec | 1 + 2 files changed, 2 insertions(+) diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec index f752c83..05a0ac0 100644 --- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec +++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec @@ -235,6 +235,7 @@ @ stub expm1f @ stub expm1l @ cdecl fabs(double) ucrtbase.fabs +@ cdecl -arch=arm fabsf(float) ucrtbase.fabsf @ stub fdim @ stub fdimf @ stub fdiml diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 7058990..90639a2 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2281,6 +2281,7 @@ @ stub expm1f @ stub expm1l @ cdecl fabs(double) MSVCRT_fabs +@ cdecl -arch=arm fabsf(float) MSVCRT_fabsf @ cdecl fclose(ptr) MSVCRT_fclose @ stub fdim @ stub fdimf
1
0
0
0
Hugh McMaster : reg/tests: Add some tests for 'reg import'.
by Alexandre Julliard
27 Jul '16
27 Jul '16
Module: wine Branch: master Commit: 78fecb03975d7d5ccdab93562b99fa245ae44cac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=78fecb03975d7d5ccdab93562…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Jul 25 07:54:21 2016 +0000 reg/tests: Add some tests for 'reg import'. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/reg.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 0339e6e..b163cf0 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdio.h> #include <windows.h> #include "wine/test.h" @@ -675,9 +676,37 @@ static void test_v_flags(void) ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); } +static BOOL write_reg_file(const char *value, char *tmp_name) +{ + static const char regedit4[] = "REGEDIT4"; + static const char key[] = "[HKEY_CURRENT_USER\\" KEY_BASE "]"; + char file_data[MAX_PATH], tmp_path[MAX_PATH]; + HANDLE hfile; + DWORD written; + BOOL ret; + + sprintf(file_data, "%s\n\n%s\n%s\n", regedit4, key, value); + + GetTempPathA(MAX_PATH, tmp_path); + GetTempFileNameA(tmp_path, "reg", 0, tmp_name); + + hfile = CreateFileA(tmp_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + if (hfile == INVALID_HANDLE_VALUE) + return FALSE; + + ret = WriteFile(hfile, file_data, strlen(file_data), &written, NULL); + CloseHandle(hfile); + return ret; +} + static void test_import(void) { - DWORD r; + DWORD r, dword = 0x123; + char test1_reg[MAX_PATH], test2_reg[MAX_PATH]; + char cmdline[MAX_PATH]; + char test_string[] = "Test string"; + HKEY hkey; + LONG err; run_reg_exe("reg import", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); @@ -687,6 +716,37 @@ static void test_import(void) run_reg_exe("reg import missing.reg", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + /* Create test files */ + ok(write_reg_file("\"Wine\"=dword:00000123", test1_reg), "Failed to write registry file\n"); + ok(write_reg_file("@=\"Test string\"", test2_reg), "Failed to write registry file\n"); + + sprintf(cmdline, "reg import %s", test1_reg); + run_reg_exe(cmdline, &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + sprintf(cmdline, "reg import %s", test2_reg); + run_reg_exe(cmdline, &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey); + todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); + + todo_wine verify_reg(hkey, "Wine", REG_DWORD, &dword, sizeof(dword), 0); + todo_wine verify_reg(hkey, "", REG_SZ, test_string, sizeof(test_string), 0); + + err = RegCloseKey(hkey); + todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); + + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + todo_wine ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err); + + sprintf(cmdline, "reg import %s %s", test1_reg, test2_reg); + run_reg_exe(cmdline, &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + DeleteFileA(test1_reg); + DeleteFileA(test2_reg); } START_TEST(reg)
1
0
0
0
Andrey Gusev : wined3d: Fix a typo in state_zwriteenable() function name.
by Alexandre Julliard
27 Jul '16
27 Jul '16
Module: wine Branch: master Commit: cf69c12c544ba2f2ddeadcbbb316145f7ecab258 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cf69c12c544ba2f2ddeadcbbb…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Wed Jul 27 11:08:06 2016 +0300 wined3d: Fix a typo in state_zwriteenable() function name. Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index a35f9c8..42416a1 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -204,7 +204,7 @@ static void state_ditherenable(struct wined3d_context *context, const struct win } } -static void state_zwritenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +static void state_zwriteenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -4962,7 +4962,7 @@ const struct StateEntryTemplate misc_state_template[] = { STATE_RENDER(WINED3D_RS_MONOENABLE), { STATE_RENDER(WINED3D_RS_MONOENABLE), state_monoenable }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ROP2), { STATE_RENDER(WINED3D_RS_ROP2), state_rop2 }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_PLANEMASK), { STATE_RENDER(WINED3D_RS_PLANEMASK), state_planemask }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_ZWRITEENABLE), { STATE_RENDER(WINED3D_RS_ZWRITEENABLE), state_zwritenable }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_ZWRITEENABLE), { STATE_RENDER(WINED3D_RS_ZWRITEENABLE), state_zwriteenable }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_LASTPIXEL), { STATE_RENDER(WINED3D_RS_LASTPIXEL), state_lastpixel }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_CULLMODE), { STATE_RENDER(WINED3D_RS_CULLMODE), state_cullmode }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ZFUNC), { STATE_RENDER(WINED3D_RS_ZFUNC), state_zfunc }, WINED3D_GL_EXT_NONE },
1
0
0
0
Francois Gouget : d3drm/tests: Spelling fixes for a couple of ok() messages.
by Alexandre Julliard
27 Jul '16
27 Jul '16
Module: wine Branch: master Commit: 429e5325f3dae24f8fa0aa3eef4789a36ca490e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=429e5325f3dae24f8fa0aa3ee…
Author: Francois Gouget <fgouget(a)free.fr> Date: Tue Jul 26 16:52:35 2016 +0200 d3drm/tests: Spelling fixes for a couple of ok() messages. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3drm/tests/d3drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 76e4fb4..db9a774 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -4487,7 +4487,7 @@ static void test_create_device_from_d3d2(void) hr = IDirect3DRMDevice2_GetDirect3DDevice2(device2, &d3drm_d3ddevice2); ok(SUCCEEDED(hr), "Cannot get IDirect3DDevice2 interface (hr = %#x).\n", hr); - ok(d3ddevice2 == d3drm_d3ddevice2, "Expected Immediate Mode deivce created == %p, got %p.\n", d3ddevice2, + ok(d3ddevice2 == d3drm_d3ddevice2, "Expected Immediate Mode device created == %p, got %p.\n", d3ddevice2, d3drm_d3ddevice2); /* Check properties of render target and depth surfaces */ @@ -4768,7 +4768,7 @@ static void test_create_device_from_d3d3(void) hr = IDirect3DRMDevice3_GetDirect3DDevice2(device3, &d3drm_d3ddevice2); ok(SUCCEEDED(hr), "Cannot get IDirect3DDevice2 interface (hr = %#x).\n", hr); - ok(d3ddevice2 == d3drm_d3ddevice2, "Expected Immediate Mode deivce created == %p, got %p.\n", d3ddevice2, + ok(d3ddevice2 == d3drm_d3ddevice2, "Expected Immediate Mode device created == %p, got %p.\n", d3ddevice2, d3drm_d3ddevice2); /* Check properties of render target and depth surfaces */
1
0
0
0
Francois Gouget : d3drm: Make d3drm_device_set_ddraw_device_d3d() static.
by Alexandre Julliard
27 Jul '16
27 Jul '16
Module: wine Branch: master Commit: 43cf833c5d69deebf3ab5dd9ff3fdf4052d0d68c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43cf833c5d69deebf3ab5dd9f…
Author: Francois Gouget <fgouget(a)free.fr> Date: Tue Jul 26 16:52:04 2016 +0200 d3drm: Make d3drm_device_set_ddraw_device_d3d() static. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3drm/d3drm_private.h | 2 -- dlls/d3drm/device.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index 4394fcc..9bf7dff 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -106,8 +106,6 @@ HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, I void d3drm_device_destroy(struct d3drm_device *device) DECLSPEC_HIDDEN; HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw *ddraw, IDirectDrawSurface *surface, BOOL create_z_surface) DECLSPEC_HIDDEN; -HRESULT d3drm_device_set_ddraw_device_d3d(struct d3drm_device *device, - IDirect3D *d3d, IDirect3DDevice *d3d_device) DECLSPEC_HIDDEN; void d3drm_object_init(struct d3drm_object *object) DECLSPEC_HIDDEN; HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN; diff --git a/dlls/d3drm/device.c b/dlls/d3drm/device.c index 449135a..fb83342 100644 --- a/dlls/d3drm/device.c +++ b/dlls/d3drm/device.c @@ -208,7 +208,7 @@ HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw return hr; } -HRESULT d3drm_device_set_ddraw_device_d3d(struct d3drm_device *device, IDirect3D *d3d, IDirect3DDevice *d3d_device) +static HRESULT d3drm_device_set_ddraw_device_d3d(struct d3drm_device *device, IDirect3D *d3d, IDirect3DDevice *d3d_device) { IDirectDraw *ddraw; IDirectDrawSurface *surface;
1
0
0
0
Józef Kucia : d3d11/tests: Add test for DXGI_FORMAT_R10G10B10A2_UINT vertex format.
by Alexandre Julliard
27 Jul '16
27 Jul '16
Module: wine Branch: master Commit: c3cee86d75da5d5d3e16b9ebab1c094637a3b43c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3cee86d75da5d5d3e16b9eba…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Jul 26 12:16:38 2016 +0200 d3d11/tests: Add test for DXGI_FORMAT_R10G10B10A2_UINT vertex format. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index d7cda84..c86e0d1 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -8725,6 +8725,7 @@ static void test_input_assembler(void) LAYOUT_UNORM8, LAYOUT_SNORM8, LAYOUT_UNORM10_2, + LAYOUT_UINT10_2, LAYOUT_COUNT, }; @@ -8759,6 +8760,7 @@ static void test_input_assembler(void) DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R10G10B10A2_UNORM, + DXGI_FORMAT_R10G10B10A2_UINT, }; static const struct { @@ -8933,6 +8935,16 @@ static void test_input_assembler(void) {0.0f, 0.0f, 0.0f, 1.0f}}, {LAYOUT_UNORM10_2, sizeof(unorm10_2_data), &unorm10_2_data, {1.0f, 0.0f, 512.0f / 1023.0f, 2.0f / 3.0f}}, + {LAYOUT_UINT10_2, sizeof(uint32_zero), &uint32_zero, + {0.0f, 0.0f, 0.0f, 0.0f}}, + {LAYOUT_UINT10_2, sizeof(uint32_max), &uint32_max, + {1023.0f, 1023.0f, 1023.0f, 3.0f}}, + {LAYOUT_UINT10_2, sizeof(g10_data), &g10_data, + {0.0f, 1023.0f, 0.0f, 0.0f}}, + {LAYOUT_UINT10_2, sizeof(a2_data), &a2_data, + {0.0f, 0.0f, 0.0f, 3.0f}}, + {LAYOUT_UINT10_2, sizeof(unorm10_2_data), &unorm10_2_data, + {1023.0f, 0.0f, 512.0f, 2.0f}}, }; if (!init_test_context(&test_context, NULL)) @@ -8954,9 +8966,11 @@ static void test_input_assembler(void) for (i = 0; i < LAYOUT_COUNT; ++i) { input_layout_desc[1].Format = layout_formats[i]; + input_layout[i] = NULL; hr = ID3D11Device_CreateInputLayout(device, input_layout_desc, sizeof(input_layout_desc) / sizeof(*input_layout_desc), vs_float_code, sizeof(vs_float_code), &input_layout[i]); + todo_wine_if(input_layout_desc[1].Format == DXGI_FORMAT_R10G10B10A2_UINT) ok(SUCCEEDED(hr), "Failed to create input layout for format %#x, hr %#x.\n", layout_formats[i], hr); } @@ -8992,6 +9006,9 @@ static void test_input_assembler(void) { D3D11_BOX box = {0, 0, 0, 1, 1, 1}; + if (tests[i].layout_id == LAYOUT_UINT10_2) + continue; + assert(tests[i].layout_id < LAYOUT_COUNT); ID3D11DeviceContext_IASetInputLayout(context, input_layout[tests[i].layout_id]); @@ -9011,6 +9028,7 @@ static void test_input_assembler(void) switch (layout_formats[tests[i].layout_id]) { case DXGI_FORMAT_R16G16B16A16_UINT: + case DXGI_FORMAT_R10G10B10A2_UINT: case DXGI_FORMAT_R8G8B8A8_UINT: ID3D11DeviceContext_VSSetShader(context, vs_uint, NULL, 0); break; @@ -9041,7 +9059,10 @@ static void test_input_assembler(void) ID3D11Buffer_Release(vb_attribute); ID3D11Buffer_Release(vb_position); for (i = 0; i < LAYOUT_COUNT; ++i) - ID3D11InputLayout_Release(input_layout[i]); + { + if (input_layout[i]) + ID3D11InputLayout_Release(input_layout[i]); + } ID3D11PixelShader_Release(ps); ID3D11VertexShader_Release(vs_float); ID3D11VertexShader_Release(vs_uint);
1
0
0
0
Józef Kucia : wined3d: Introduce R10G10B10X2 vertex formats for D3D8/9.
by Alexandre Julliard
27 Jul '16
27 Jul '16
Module: wine Branch: master Commit: 8b493d769efd54251d2c11a03a22be25d0de93ae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b493d769efd54251d2c11a03…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Jul 26 12:16:37 2016 +0200 wined3d: Introduce R10G10B10X2 vertex formats for D3D8/9. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/vertexdeclaration.c | 4 ++-- dlls/d3d9/vertexdeclaration.c | 4 ++-- dlls/wined3d/state.c | 4 ++-- dlls/wined3d/utils.c | 8 ++++++-- include/wine/wined3d.h | 2 ++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/d3d8/vertexdeclaration.c b/dlls/d3d8/vertexdeclaration.c index 7900325..9206a2c 100644 --- a/dlls/d3d8/vertexdeclaration.c +++ b/dlls/d3d8/vertexdeclaration.c @@ -220,8 +220,8 @@ static const enum wined3d_format_id wined3d_format_lookup[] = /*WINED3DDECLTYPE_SHORT4N*/ WINED3DFMT_R16G16B16A16_SNORM, /*WINED3DDECLTYPE_USHORT2N*/ WINED3DFMT_R16G16_UNORM, /*WINED3DDECLTYPE_USHORT4N*/ WINED3DFMT_R16G16B16A16_UNORM, - /*WINED3DDECLTYPE_UDEC3*/ WINED3DFMT_R10G10B10A2_UINT, - /*WINED3DDECLTYPE_DEC3N*/ WINED3DFMT_R10G10B10A2_SNORM, + /*WINED3DDECLTYPE_UDEC3*/ WINED3DFMT_R10G10B10X2_UINT, + /*WINED3DDECLTYPE_DEC3N*/ WINED3DFMT_R10G10B10X2_SNORM, /*WINED3DDECLTYPE_FLOAT16_2*/ WINED3DFMT_R16G16_FLOAT, /*WINED3DDECLTYPE_FLOAT16_4*/ WINED3DFMT_R16G16B16A16_FLOAT, }; diff --git a/dlls/d3d9/vertexdeclaration.c b/dlls/d3d9/vertexdeclaration.c index 914de24..b66827f 100644 --- a/dlls/d3d9/vertexdeclaration.c +++ b/dlls/d3d9/vertexdeclaration.c @@ -45,8 +45,8 @@ d3d_dtype_lookup[] = /* D3DDECLTYPE_SHORT4N */ {WINED3DFMT_R16G16B16A16_SNORM, 4, sizeof(short int)}, /* D3DDECLTYPE_USHORT2N */ {WINED3DFMT_R16G16_UNORM, 2, sizeof(short int)}, /* D3DDECLTYPE_USHORT4N */ {WINED3DFMT_R16G16B16A16_UNORM, 4, sizeof(short int)}, - /* D3DDECLTYPE_UDEC3 */ {WINED3DFMT_R10G10B10A2_UINT, 3, sizeof(short int)}, - /* D3DDECLTYPE_DEC3N */ {WINED3DFMT_R10G10B10A2_SNORM, 3, sizeof(short int)}, + /* D3DDECLTYPE_UDEC3 */ {WINED3DFMT_R10G10B10X2_UINT, 3, sizeof(short int)}, + /* D3DDECLTYPE_DEC3N */ {WINED3DFMT_R10G10B10X2_SNORM, 3, sizeof(short int)}, /* D3DDECLTYPE_FLOAT16_2 */ {WINED3DFMT_R16G16_FLOAT, 2, sizeof(short int)}, /* D3DDECLTYPE_FLOAT16_4 */ {WINED3DFMT_R16G16B16A16_FLOAT, 4, sizeof(short int)} }; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 30ea1c7..a35f9c8 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4110,11 +4110,11 @@ static void load_numbered_arrays(struct wined3d_context *context, GL_EXTCALL(glVertexAttrib4Nusv(i, (const GLushort *)ptr)); break; - case WINED3DFMT_R10G10B10A2_UINT: + case WINED3DFMT_R10G10B10X2_UINT: FIXME("Unsure about WINED3DDECLTYPE_UDEC3.\n"); /*glVertexAttrib3usvARB(i, (const GLushort *)ptr); Does not exist */ break; - case WINED3DFMT_R10G10B10A2_SNORM: + case WINED3DFMT_R10G10B10X2_SNORM: FIXME("Unsure about WINED3DDECLTYPE_DEC3N.\n"); /*glVertexAttrib3NusvARB(i, (const GLushort *)ptr); Does not exist */ break; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 3406fdd..b686b09 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -124,6 +124,8 @@ static const struct wined3d_format_channels formats[] = {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, 8, 8, 0, 0, 0, 8, 0, 0, 4, 0, 0}, {WINED3DFMT_R8G8B8A8_SNORM, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0}, {WINED3DFMT_R10G11B11_SNORM, 10, 11, 11, 0, 0, 10, 21, 0, 4, 0, 0}, + {WINED3DFMT_R10G10B10X2_UINT, 10, 10, 10, 0, 0, 10, 20, 0, 4, 0, 0}, + {WINED3DFMT_R10G10B10X2_SNORM, 10, 10, 10, 0, 0, 10, 20, 0, 4, 0, 0}, {WINED3DFMT_R10G10B10_SNORM_A2_UNORM, 10, 10, 10, 2, 0, 10, 20, 30, 4, 0, 0}, /* Depth stencil formats */ {WINED3DFMT_D16_LOCKABLE, 0, 0, 0, 0, 0, 0, 0, 0, 2, 16, 0}, @@ -348,8 +350,8 @@ static const struct wined3d_format_vertex_info format_vertex_info[] = {WINED3DFMT_R16G16B16A16_SNORM, WINED3D_FFP_EMIT_SHORT4N, 4, GL_SHORT, GL_TRUE }, {WINED3DFMT_R16G16_UNORM, WINED3D_FFP_EMIT_USHORT2N, 2, GL_UNSIGNED_SHORT, GL_TRUE }, {WINED3DFMT_R16G16B16A16_UNORM, WINED3D_FFP_EMIT_USHORT4N, 4, GL_UNSIGNED_SHORT, GL_TRUE }, - {WINED3DFMT_R10G10B10A2_UINT, WINED3D_FFP_EMIT_UDEC3, 3, GL_UNSIGNED_SHORT, GL_FALSE}, - {WINED3DFMT_R10G10B10A2_SNORM, WINED3D_FFP_EMIT_DEC3N, 3, GL_SHORT, GL_TRUE }, + {WINED3DFMT_R10G10B10X2_UINT, WINED3D_FFP_EMIT_UDEC3, 3, GL_UNSIGNED_SHORT, GL_FALSE}, + {WINED3DFMT_R10G10B10X2_SNORM, WINED3D_FFP_EMIT_DEC3N, 3, GL_SHORT, GL_TRUE }, {WINED3DFMT_R10G10B10A2_UNORM, WINED3D_FFP_EMIT_INVALID, 4, GL_UNSIGNED_INT_2_10_10_10_REV, GL_TRUE, ARB_VERTEX_TYPE_2_10_10_10_REV}, {WINED3DFMT_R16G16_FLOAT, WINED3D_FFP_EMIT_FLOAT16_2, 2, GL_HALF_FLOAT, GL_FALSE}, @@ -3613,6 +3615,8 @@ const char *debug_d3dformat(enum wined3d_format_id format_id) FMT_TO_STR(WINED3DFMT_R5G5_SNORM_L6_UNORM); FMT_TO_STR(WINED3DFMT_R8G8_SNORM_L8X8_UNORM); FMT_TO_STR(WINED3DFMT_R10G11B11_SNORM); + FMT_TO_STR(WINED3DFMT_R10G10B10X2_UINT); + FMT_TO_STR(WINED3DFMT_R10G10B10X2_SNORM); FMT_TO_STR(WINED3DFMT_R10G10B10_SNORM_A2_UNORM); FMT_TO_STR(WINED3DFMT_UYVY); FMT_TO_STR(WINED3DFMT_YUY2); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index a425ac5..ff1a949 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -113,6 +113,8 @@ enum wined3d_format_id WINED3DFMT_R5G5_SNORM_L6_UNORM, WINED3DFMT_R8G8_SNORM_L8X8_UNORM, WINED3DFMT_R10G11B11_SNORM, + WINED3DFMT_R10G10B10X2_UINT, + WINED3DFMT_R10G10B10X2_SNORM, WINED3DFMT_R10G10B10_SNORM_A2_UNORM, WINED3DFMT_D16_LOCKABLE, WINED3DFMT_D32_UNORM,
1
0
0
0
Józef Kucia : d3d10core/tests: Add test for index buffer offset.
by Alexandre Julliard
27 Jul '16
27 Jul '16
Module: wine Branch: master Commit: 47283b5b89332db8ed1afef9f6caca499032f303 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47283b5b89332db8ed1afef9f…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Jul 26 12:16:36 2016 +0200 d3d10core/tests: Add test for index buffer offset. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10core/tests/device.c | 176 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index f0935d2..c6fc480 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -8932,6 +8932,181 @@ static void test_uint_shader_instructions(void) release_test_context(&test_context); } +static void test_index_buffer_offset(void) +{ + struct d3d10core_test_context test_context; + ID3D10Buffer *vb, *ib, *so_buffer; + ID3D10InputLayout *input_layout; + struct resource_readback rb; + ID3D10GeometryShader *gs; + const struct vec4 *data; + ID3D10VertexShader *vs; + ID3D10Device *device; + UINT stride, offset; + unsigned int i; + HRESULT hr; + + static const DWORD vs_code[] = + { +#if 0 + void main(float4 position : SV_POSITION, float4 attrib : ATTRIB, + out float4 out_position : SV_Position, out float4 out_attrib : ATTRIB) + { + out_position = position; + out_attrib = attrib; + } +#endif + 0x43425844, 0xd7716716, 0xe23207f3, 0xc8af57c0, 0x585e2919, 0x00000001, 0x00000144, 0x00000003, + 0x0000002c, 0x00000080, 0x000000d4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52545441, 0xab004249, + 0x4e47534f, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x505f5653, 0x7469736f, 0x006e6f69, 0x52545441, 0xab004249, 0x52444853, 0x00000068, 0x00010040, + 0x0000001a, 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, 0x001010f2, 0x00000001, 0x04000067, + 0x001020f2, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x05000036, 0x001020f2, + 0x00000000, 0x00101e46, 0x00000000, 0x05000036, 0x001020f2, 0x00000001, 0x00101e46, 0x00000001, + 0x0100003e, + }; + static const DWORD gs_code[] = + { +#if 0 + struct vertex + { + float4 position : SV_POSITION; + float4 attrib : ATTRIB; + }; + + [maxvertexcount(1)] + void main(point vertex input[1], inout PointStream<vertex> output) + { + output.Append(input[0]); + output.RestartStrip(); + } +#endif + 0x43425844, 0x3d1dc497, 0xdf450406, 0x284ab03b, 0xa4ec0fd6, 0x00000001, 0x00000170, 0x00000003, + 0x0000002c, 0x00000080, 0x000000d4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000f0f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52545441, 0xab004249, + 0x4e47534f, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x505f5653, 0x5449534f, 0x004e4f49, 0x52545441, 0xab004249, 0x52444853, 0x00000094, 0x00020040, + 0x00000025, 0x05000061, 0x002010f2, 0x00000001, 0x00000000, 0x00000001, 0x0400005f, 0x002010f2, + 0x00000001, 0x00000001, 0x0100085d, 0x0100085c, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x03000065, 0x001020f2, 0x00000001, 0x0200005e, 0x00000001, 0x06000036, 0x001020f2, 0x00000000, + 0x00201e46, 0x00000000, 0x00000000, 0x06000036, 0x001020f2, 0x00000001, 0x00201e46, 0x00000000, + 0x00000001, 0x01000013, 0x01000009, 0x0100003e, + }; + static const D3D10_INPUT_ELEMENT_DESC input_desc[] = + { + {"SV_POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0}, + {"ATTRIB", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 16, D3D10_INPUT_PER_VERTEX_DATA, 0}, + }; + static const D3D10_SO_DECLARATION_ENTRY so_declaration[] = + { + {"SV_Position", 0, 0, 4, 0}, + {"ATTRIB", 0, 0, 4, 0}, + }; + static const struct + { + struct vec4 position; + struct vec4 attrib; + } + vertices[] = + { + {{-1.0f, -1.0f, 0.0f, 1.0f}, {1.0f}}, + {{-1.0f, 1.0f, 0.0f, 1.0f}, {2.0f}}, + {{ 1.0f, -1.0f, 0.0f, 1.0f}, {3.0f}}, + {{ 1.0f, 1.0f, 0.0f, 1.0f}, {4.0f}}, + }; + static const unsigned int indices[] = + { + 0, 1, 2, 3, + 3, 2, 1, 0, + 1, 3, 2, 0, + }; + static const struct vec4 expected_data[] = + { + {-1.0f, -1.0f, 0.0f, 1.0f}, {1.0f}, + {-1.0f, 1.0f, 0.0f, 1.0f}, {2.0f}, + { 1.0f, -1.0f, 0.0f, 1.0f}, {3.0f}, + { 1.0f, 1.0f, 0.0f, 1.0f}, {4.0f}, + + { 1.0f, 1.0f, 0.0f, 1.0f}, {4.0f}, + { 1.0f, -1.0f, 0.0f, 1.0f}, {3.0f}, + {-1.0f, 1.0f, 0.0f, 1.0f}, {2.0f}, + {-1.0f, -1.0f, 0.0f, 1.0f}, {1.0f}, + + {-1.0f, 1.0f, 0.0f, 1.0f}, {2.0f}, + { 1.0f, 1.0f, 0.0f, 1.0f}, {4.0f}, + { 1.0f, -1.0f, 0.0f, 1.0f}, {3.0f}, + {-1.0f, -1.0f, 0.0f, 1.0f}, {1.0f}, + }; + + if (!init_test_context(&test_context)) + return; + + device = test_context.device; + + hr = ID3D10Device_CreateInputLayout(device, input_desc, sizeof(input_desc) / sizeof(*input_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + stride = 32; + hr = ID3D10Device_CreateGeometryShaderWithStreamOutput(device, gs_code, sizeof(gs_code), + so_declaration, sizeof(so_declaration) / sizeof(*so_declaration), + stride, &gs); + todo_wine ok(SUCCEEDED(hr), "Failed to create geometry shader with stream output, hr %#x.\n", hr); + if (FAILED(hr)) goto cleanup; + + hr = ID3D10Device_CreateVertexShader(device, vs_code, sizeof(vs_code), &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + + vb = create_buffer(device, D3D10_BIND_VERTEX_BUFFER, sizeof(vertices), vertices); + ib = create_buffer(device, D3D10_BIND_INDEX_BUFFER, sizeof(indices), indices); + so_buffer = create_buffer(device, D3D10_BIND_STREAM_OUTPUT, 1024, NULL); + + ID3D10Device_VSSetShader(device, vs); + ID3D10Device_GSSetShader(device, gs); + + ID3D10Device_IASetInputLayout(device, input_layout); + ID3D10Device_IASetPrimitiveTopology(device, D3D10_PRIMITIVE_TOPOLOGY_POINTLIST); + stride = sizeof(*vertices); + offset = 0; + ID3D10Device_IASetVertexBuffers(device, 0, 1, &vb, &stride, &offset); + + offset = 0; + ID3D10Device_SOSetTargets(device, 1, &so_buffer, &offset); + + ID3D10Device_IASetIndexBuffer(device, ib, DXGI_FORMAT_R32_UINT, 0); + ID3D10Device_DrawIndexed(device, 4, 0, 0); + + ID3D10Device_IASetIndexBuffer(device, ib, DXGI_FORMAT_R32_UINT, 4 * sizeof(*indices)); + ID3D10Device_DrawIndexed(device, 4, 0, 0); + + ID3D10Device_IASetIndexBuffer(device, ib, DXGI_FORMAT_R32_UINT, 8 * sizeof(*indices)); + ID3D10Device_DrawIndexed(device, 4, 0, 0); + + get_buffer_readback(so_buffer, &rb); + for (i = 0; i < sizeof(expected_data) / sizeof(*expected_data); ++i) + { + data = get_readback_vec4(&rb, i, 0); + ok(compare_vec4(data, &expected_data[i], 0), + "Got unexpected result {%.8e, %.8e, %.8e, %.8e} at %u.\n", + data->x, data->y, data->z, data->w, i); + } + release_resource_readback(&rb); + + ID3D10Buffer_Release(so_buffer); + ID3D10Buffer_Release(ib); + ID3D10Buffer_Release(vb); + ID3D10VertexShader_Release(vs); + ID3D10GeometryShader_Release(gs); +cleanup: + ID3D10InputLayout_Release(input_layout); + release_test_context(&test_context); +} + START_TEST(device) { test_feature_level(); @@ -8980,4 +9155,5 @@ START_TEST(device) test_immediate_constant_buffer(); test_fp_specials(); test_uint_shader_instructions(); + test_index_buffer_offset(); }
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
68
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Results per page:
10
25
50
100
200