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
December 2017
----- 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
450 discussions
Start a n
N
ew thread
Fabian Maurer : msvcrt: Don' t crash if _vsnwprintf gets NULL as format string and add test.
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: 058be4304eb0c0e5f264e166b68991808a21001a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=058be4304eb0c0e5f264e166b…
Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Fri Dec 1 18:19:31 2017 +0100 msvcrt: Don't crash if _vsnwprintf gets NULL as format string and add test. Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcr90/tests/msvcr90.c | 31 +++++++++++++++++++++++++++++++ dlls/msvcrt/printf.h | 3 +++ 2 files changed, 34 insertions(+) diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index 0975d00..85dd80b 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -133,6 +133,7 @@ static char* (__cdecl *p_setlocale)(int, const char*); static int (__cdecl *p__fpieee_flt)(ULONG, EXCEPTION_POINTERS*, int (__cdecl *handler)(_FPIEEE_RECORD*)); static int (__cdecl *p__memicmp)(const char*, const char*, size_t); static int (__cdecl *p__memicmp_l)(const char*, const char*, size_t, _locale_t); +static int (__cdecl *p__vsnwprintf)(wchar_t *buffer,size_t count, const wchar_t *format, __ms_va_list valist); /* make sure we use the correct errno */ #undef errno @@ -401,6 +402,7 @@ static BOOL init(void) SET(p__fpieee_flt, "_fpieee_flt"); SET(p__memicmp, "_memicmp"); SET(p__memicmp_l, "_memicmp_l"); + SET(p__vsnwprintf, "_vsnwprintf"); if (sizeof(void *) == 8) { @@ -1864,6 +1866,34 @@ static void test__memicmp_l(void) ok(ret == -1, "got %d\n", ret); } +static int WINAPIV _vsnwprintf_wrapper(wchar_t *str, size_t len, const wchar_t *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = p__vsnwprintf(str, len, format, valist); + __ms_va_end(valist); + return ret; +} + +void test__vsnwprintf(void) +{ + int ret; + WCHAR str[2] = {0}; + + _invalid_parameter_handler old_handler = p_set_invalid_parameter_handler(test_invalid_parameter_handler); + + SET_EXPECT(invalid_parameter_handler); + errno = 0xdeadbeef; + str[0] = 'x'; + ret = _vsnwprintf_wrapper(str, 0, NULL); + ok(ret == -1, "got %d, expected -1\n", ret); + ok(str[0] == 'x', "Expected string to be unchanged.\n"); + CHECK_CALLED(invalid_parameter_handler, EINVAL); + + ok(p_set_invalid_parameter_handler(old_handler) == test_invalid_parameter_handler, "Cannot reset invalid parameter handler\n"); +} + START_TEST(msvcr90) { if(!init()) @@ -1897,6 +1927,7 @@ START_TEST(msvcr90) test__mbstok_s(); test__memicmp(); test__memicmp_l(); + test__vsnwprintf(); #ifdef __i386__ test__fpieee_flt(); #endif diff --git a/dlls/msvcrt/printf.h b/dlls/msvcrt/printf.h index 4ba02ba..ee8120e 100644 --- a/dlls/msvcrt/printf.h +++ b/dlls/msvcrt/printf.h @@ -376,6 +376,9 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API TRACE("Format is: %s\n", FUNC_NAME(debugstr)(fmt)); + if (!MSVCRT_CHECK_PMT(fmt != NULL)) + return -1; + if(!locale) locinfo = get_locinfo(); else
1
0
0
0
Alexandre Julliard : ntdll: Pass the stack pointer to virtual_clear_thread_stack().
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: b526a48a245c866a1e3e18234a82aeca09561e4a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b526a48a245c866a1e3e18234…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Dec 4 13:56:32 2017 +0100 ntdll: Pass the stack pointer to virtual_clear_thread_stack(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/signal_i386.c | 63 ++++++++++++++++++++++------------------------ dlls/ntdll/signal_x86_64.c | 30 +++++++++------------- dlls/ntdll/virtual.c | 8 +++--- 4 files changed, 47 insertions(+), 56 deletions(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 72c33fe..c9c79fb 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -168,7 +168,7 @@ extern void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info ) DECLSPEC_H extern NTSTATUS virtual_create_builtin_view( void *base ) DECLSPEC_HIDDEN; extern NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, SIZE_T commit_size, SIZE_T extra_size ) DECLSPEC_HIDDEN; -extern void virtual_clear_thread_stack(void) DECLSPEC_HIDDEN; +extern void virtual_clear_thread_stack( void *stack_end ) DECLSPEC_HIDDEN; extern BOOL virtual_handle_stack_fault( void *addr ) DECLSPEC_HIDDEN; extern BOOL virtual_is_valid_code_address( const void *addr, SIZE_T size ) DECLSPEC_HIDDEN; extern NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err, BOOL on_signal_stack ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 8623152..351b67c 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -1312,7 +1312,7 @@ __ASM_GLOBAL_FUNC( set_full_cpu_context, * * Set the new CPU context. Used by NtSetContextThread. */ -static void set_cpu_context( const CONTEXT *context ) +void DECLSPEC_HIDDEN set_cpu_context( const CONTEXT *context ) { DWORD flags = context->ContextFlags & ~CONTEXT_i386; @@ -2867,28 +2867,37 @@ __ASM_GLOBAL_FUNC( start_thread, "movl %ebp,(%eax)\n\t" /* build initial context on thread stack */ "movl %fs:4,%eax\n\t" /* NtCurrentTeb()->StackBase */ - "leal -0x2dc(%eax),%ecx\n\t" /* sizeof(context) + 16 */ - "movl $0x10007,(%ecx)\n\t" /* context->ContextFlags = CONTEXT_FULL */ - "movw %cs,0xbc(%ecx)\n\t" /* context->SegCs */ - "movw %ds,0x98(%ecx)\n\t" /* context->SegDs */ - "movw %es,0x94(%ecx)\n\t" /* context->SegEs */ - "movw %fs,0x90(%ecx)\n\t" /* context->SegFs */ - "movw %gs,0x8c(%ecx)\n\t" /* context->SegGs */ - "movw %ss,0xc8(%ecx)\n\t" /* context->SegSs */ + "leal -0x2dc(%eax),%esi\n\t" /* sizeof(context) + 16 */ + "movl $0x10007,(%esi)\n\t" /* context->ContextFlags = CONTEXT_FULL */ + "movw %cs,0xbc(%esi)\n\t" /* context->SegCs */ + "movw %ds,0x98(%esi)\n\t" /* context->SegDs */ + "movw %es,0x94(%esi)\n\t" /* context->SegEs */ + "movw %fs,0x90(%esi)\n\t" /* context->SegFs */ + "movw %gs,0x8c(%esi)\n\t" /* context->SegGs */ + "movw %ss,0xc8(%esi)\n\t" /* context->SegSs */ "movl 8(%ebp),%eax\n\t" - "movl %eax,0xb0(%ecx)\n\t" /* context->Eax = entry */ + "movl %eax,0xb0(%esi)\n\t" /* context->Eax = entry */ "movl 12(%ebp),%eax\n\t" - "movl %eax,0xa4(%ecx)\n\t" /* context->Ebx = arg */ + "movl %eax,0xa4(%esi)\n\t" /* context->Ebx = arg */ "movl 20(%ebp),%eax\n\t" - "movl %eax,0xb8(%ecx)\n\t" /* context->Eip = relay */ - "leal 0x2cc(%ecx),%eax\n\t" - "movl %eax,0xc4(%ecx)\n\t" /* context->Esp */ - /* switch to thread stack and call thread_startup() */ - "leal -12(%ecx),%esp\n\t" + "movl %eax,0xb8(%esi)\n\t" /* context->Eip = relay */ + "leal 0x2cc(%esi),%eax\n\t" + "movl %eax,0xc4(%esi)\n\t" /* context->Esp */ + /* switch to thread stack */ + "leal -12(%esi),%esp\n\t" + /* attach dlls */ "pushl 16(%ebp)\n\t" /* suspend */ - "pushl %ecx\n\t" /* context */ + "pushl %esi\n\t" /* context */ "xorl %ebp,%ebp\n\t" - "call " __ASM_NAME("thread_startup") ) + "call " __ASM_NAME("attach_dlls") "\n\t" + "addl $20,%esp\n\t" + /* clear the stack */ + "leal -0xd24(%esi),%eax\n\t" /* round down to page size */ + "pushl %eax\n\t" + "call " __ASM_NAME("virtual_clear_thread_stack") "\n\t" + /* switch to the initial context */ + "movl %esi,(%esp)\n\t" + "call " __ASM_NAME("set_cpu_context") ) extern void DECLSPEC_NORETURN call_thread_exit_func( int status, void (*func)(int), void *frame ); __ASM_GLOBAL_FUNC( call_thread_exit_func, @@ -2951,24 +2960,13 @@ void DECLSPEC_HIDDEN call_thread_func( LPTHREAD_START_ROUTINE entry, void *arg ) /*********************************************************************** - * thread_startup - */ -void DECLSPEC_HIDDEN thread_startup( CONTEXT *context, BOOL suspend ) -{ - attach_dlls( context, suspend ); - virtual_clear_thread_stack(); - set_cpu_context( context ); -} - -/*********************************************************************** * signal_start_thread * * Thread startup sequence: * signal_start_thread() * -> start_thread() - * -> thread_startup() - * -> call_thread_entry() - * -> call_thread_func() + * -> call_thread_entry() + * -> call_thread_func() */ void signal_start_thread( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend ) { @@ -2981,8 +2979,7 @@ void signal_start_thread( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend * Process startup sequence: * signal_start_process() * -> start_thread() - * -> thread_startup() - * -> kernel32_start_process() + * -> kernel32_start_process() */ void signal_start_process( LPTHREAD_START_ROUTINE entry, BOOL suspend ) { diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 83521ee..c955c4c 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1889,7 +1889,7 @@ __ASM_GLOBAL_FUNC( set_full_cpu_context, * * Set the new CPU context. Used by NtSetContextThread. */ -static void set_cpu_context( const CONTEXT *context ) +void DECLSPEC_HIDDEN set_cpu_context( const CONTEXT *context ) { DWORD flags = context->ContextFlags & ~CONTEXT_AMD64; @@ -4103,11 +4103,18 @@ __ASM_GLOBAL_FUNC( start_thread, "movq %rax,0x98(%r10)\n\t" /* context->Rsp */ "movq %rcx,0xf8(%r10)\n\t" /* context->Rip = relay */ "fxsave 0x100(%r10)\n\t" /* context->FtlSave */ - /* switch to thread stack and call thread_startup() */ + /* switch to thread stack */ "movq %r10,%rsp\n\t" + /* attach dlls */ "movq %r10,%rdi\n\t" /* context */ "movq %rdx,%rsi\n\t" /* suspend */ - "call " __ASM_NAME("thread_startup") ) + "call " __ASM_NAME("attach_dlls") "\n\t" + /* clear the stack */ + "leaq -0xb00(%rsp),%rdi\n\t" /* round down to page size */ + "call " __ASM_NAME("virtual_clear_thread_stack") "\n\t" + /* switch to the initial context */ + "movq %rsp,%rdi\n\t" + "call " __ASM_NAME("set_cpu_context") ) extern void DECLSPEC_NORETURN call_thread_exit_func( int status, void (*func)(int), void *frame ); __ASM_GLOBAL_FUNC( call_thread_exit_func, @@ -4123,24 +4130,12 @@ __ASM_GLOBAL_FUNC( call_thread_exit_func, /*********************************************************************** - * thread_startup - */ -void DECLSPEC_HIDDEN thread_startup( CONTEXT *context, BOOL suspend ) -{ - attach_dlls( context, suspend ); - virtual_clear_thread_stack(); - set_cpu_context( context ); -} - - -/*********************************************************************** * signal_start_thread * * Thread startup sequence: * signal_start_thread() * -> start_thread() - * -> thread_startup() - * -> call_thread_func() + * -> call_thread_func() */ void signal_start_thread( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend ) { @@ -4155,8 +4150,7 @@ void signal_start_thread( LPTHREAD_START_ROUTINE entry, void *arg, BOOL suspend * Process startup sequence: * signal_start_process() * -> start_thread() - * -> thread_startup() - * -> kernel32_start_process() + * -> kernel32_start_process() */ void signal_start_process( LPTHREAD_START_ROUTINE entry, BOOL suspend ) { diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 8325b28..1156fc1 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1825,13 +1825,13 @@ done: * * Clear the stack contents before calling the main entry point, some broken apps need that. */ -void virtual_clear_thread_stack(void) +void virtual_clear_thread_stack( void *stack_end ) { void *stack = NtCurrentTeb()->Tib.StackLimit; - size_t size = (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->Tib.StackLimit; + size_t size = (char *)stack_end - (char *)stack; - wine_anon_mmap( stack, size - page_size, PROT_READ | PROT_WRITE, MAP_FIXED ); - if (force_exec_prot) mprotect( stack, size - page_size, PROT_READ | PROT_WRITE | PROT_EXEC ); + wine_anon_mmap( stack, size, PROT_READ | PROT_WRITE, MAP_FIXED ); + if (force_exec_prot) mprotect( stack, size, PROT_READ | PROT_WRITE | PROT_EXEC ); }
1
0
0
0
Alexandre Julliard : ntdll: Start process execution directly at the kernel32 process entry point.
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: 23ec3ce2a3edc046872709733940dc51e77e0e91 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23ec3ce2a3edc046872709733…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Dec 4 13:13:05 2017 +0100 ntdll: Start process execution directly at the kernel32 process entry point. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/process.c | 39 +++++++++++++++++++++++++++++++-------- dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/signal_arm.c | 12 +++++++----- dlls/ntdll/signal_arm64.c | 16 +++++++++------- dlls/ntdll/signal_i386.c | 35 ++--------------------------------- dlls/ntdll/signal_powerpc.c | 16 +++++++++------- dlls/ntdll/signal_x86_64.c | 23 ++--------------------- dlls/ntdll/thread.c | 2 +- 8 files changed, 62 insertions(+), 83 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=23ec3ce2a3edc04687270…
1
0
0
0
Austin English : iexplore: Move WineHQ URLs to https.
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: 956a65347bf8aed0c1121e2d49bcd7eddf9db26b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=956a65347bf8aed0c1121e2d4…
Author: Austin English <austinenglish(a)gmail.com> Date: Thu Nov 30 12:57:08 2017 -0600 iexplore: Move WineHQ URLs to https. Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/iexplore/iexplore.inf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/iexplore/iexplore.inf b/programs/iexplore/iexplore.inf index 1886352..68c17e3 100644 --- a/programs/iexplore/iexplore.inf +++ b/programs/iexplore/iexplore.inf @@ -26,11 +26,11 @@ HKCR,"CLSID\%CLSID_InternetExplorerManager%\LocalServer32",,,"""%16422%\Internet [Settings.Reg] -HKCU,"Software\Microsoft\Internet Explorer\Main","Start Page",2,"
http://www.winehq.org
" -HKCU,"Software\Microsoft\Internet Explorer\Main","Search Page",2,"
http://www.google.com
" +HKCU,"Software\Microsoft\Internet Explorer\Main","Start Page",2,"
https://www.winehq.org
" +HKCU,"Software\Microsoft\Internet Explorer\Main","Search Page",2,"
https://www.google.com
" HKCU,"Software\Microsoft\Internet Explorer\Settings","Text Color",2,"0,0,0" HKCR,"Applications\iexplore.exe\shell\open\command",,2,"""%16422%\Internet Explorer\iexplore.exe"" %1" -HKLM,"Software\Microsoft\Internet Explorer\Main","Default_Page_URL",2,"
http://www.winehq.org
" +HKLM,"Software\Microsoft\Internet Explorer\Main","Default_Page_URL",2,"
https://www.winehq.org
" HKLM,"Software\Microsoft\Windows\CurrentVersion\App Paths\iexplore.exe",,,"%16422%\Internet Explorer\iexplore.exe" HKLM,"Software\Microsoft\Windows\CurrentVersion\App Paths\iexplore.exe","Path",,"%16422%\Internet Explorer;"
1
0
0
0
Nikolay Sivov : wininet/tests: Fix some leaks (Coverity).
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: aeb43942996e103f0a4fa0a898df394f8a2f4cbd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aeb43942996e103f0a4fa0a89…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Dec 4 15:49:54 2017 +0300 wininet/tests: Fix some leaks (Coverity). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wininet/tests/ftp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/wininet/tests/ftp.c b/dlls/wininet/tests/ftp.c index 567545d..d2118fa 100644 --- a/dlls/wininet/tests/ftp.c +++ b/dlls/wininet/tests/ftp.c @@ -112,6 +112,7 @@ static void test_connect(HINTERNET hInternet) ok ( hFtp != NULL, "InternetConnect failed : %d\n", GetLastError()); ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError()); + InternetCloseHandle(hFtp); SetLastError(0xdeadbeef); hFtp = InternetConnectA(hInternet, "
ftp.winehq.org
", INTERNET_DEFAULT_FTP_PORT, "", NULL, @@ -125,6 +126,7 @@ static void test_connect(HINTERNET hInternet) { ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError()); + InternetCloseHandle(hFtp); } }
1
0
0
0
Nikolay Sivov : comctl32/tests: Some tests for focus handling in owner-data listviews.
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: 3fe501fb602981876e09c9d396eb164b821740a6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3fe501fb602981876e09c9d39…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Dec 4 12:09:44 2017 +0300 comctl32/tests: Some tests for focus handling in owner-data listviews. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/listview.c | 122 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 0e12362..4e2efe4 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -193,6 +193,12 @@ static const struct message empty_seq[] = { { 0 } }; +static const struct message parent_focus_change_ownerdata_seq[] = { + { WM_NOTIFY, sent|id, 0, 0, LVN_ITEMCHANGED }, + { WM_NOTIFY, sent|id, 0, 0, LVN_GETDISPINFOA }, + { 0 } +}; + static const struct message forward_erasebkgnd_parent_seq[] = { { WM_ERASEBKGND, sent }, { 0 } @@ -5996,6 +6002,7 @@ static void test_oneclickactivate(void) static void test_callback_mask(void) { + LVITEMA item; DWORD mask; HWND hwnd; BOOL ret; @@ -6012,6 +6019,121 @@ static void test_callback_mask(void) ok(mask == ~0u, "got 0x%08x\n", mask); DestroyWindow(hwnd); + + /* LVS_OWNERDATA, mask LVIS_FOCUSED */ + hwnd = create_listview_control(LVS_REPORT | LVS_OWNERDATA); + + mask = SendMessageA(hwnd, LVM_GETCALLBACKMASK, 0, 0); + ok(mask == 0, "Unexpected callback mask %#x.\n", mask); + + ret = SendMessageA(hwnd, LVM_SETCALLBACKMASK, LVIS_FOCUSED, 0); + ok(ret, "Failed to set callback mask, %d\n", ret); + + mask = SendMessageA(hwnd, LVM_GETCALLBACKMASK, 0, 0); + ok(mask == LVIS_FOCUSED, "Unexpected callback mask %#x.\n", mask); + + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0); + ok(ret, "Failed to set item count.\n"); + + ret = SendMessageA(hwnd, LVM_GETSELECTIONMARK, 0, 0); + ok(ret == -1, "Unexpected selection mark, %d\n", ret); + + item.stateMask = LVIS_FOCUSED; + item.state = LVIS_FOCUSED; + ret = SendMessageA(hwnd, LVM_SETITEMSTATE, 0, (LPARAM)&item); + ok(ret, "Failed to set item state.\n"); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); +todo_wine + ok(ret == 0, "Unexpected focused item, ret %d\n", ret); + + ret = SendMessageA(hwnd, LVM_GETSELECTIONMARK, 0, 0); +todo_wine + ok(ret == 0, "Unexpected selection mark, %d\n", ret); + + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 0, 0); + ok(ret, "Failed to set item count.\n"); + + ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + ok(ret == -1, "Unexpected focused item, ret %d\n", ret); + + ret = SendMessageA(hwnd, LVM_GETSELECTIONMARK, 0, 0); + ok(ret == -1, "Unexpected selection mark, %d\n", ret); + + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0); + ok(ret, "Failed to set item count.\n"); + + ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + ok(ret == -1, "Unexpected focused item, ret %d\n", ret); + + ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent seq, owner data/focus 1", FALSE); + + /* LVS_OWNDERDATA, empty mask */ + ret = SendMessageA(hwnd, LVM_SETCALLBACKMASK, 0, 0); + ok(ret, "Failed to set callback mask, %d\n", ret); + + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0); + ok(ret, "Failed to set item count.\n"); + + ret = SendMessageA(hwnd, LVM_GETSELECTIONMARK, 0, 0); + ok(ret == -1, "Unexpected selection mark, %d\n", ret); + + item.stateMask = LVIS_FOCUSED; + item.state = LVIS_FOCUSED; + ret = SendMessageA(hwnd, LVM_SETITEMSTATE, 0, (LPARAM)&item); + ok(ret, "Failed to set item state.\n"); + + ret = SendMessageA(hwnd, LVM_GETSELECTIONMARK, 0, 0); + ok(ret == 0, "Unexpected selection mark, %d\n", ret); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + ok(ret == 0, "Unexpected focused item, ret %d\n", ret); + + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 0, 0); + ok(ret, "Failed to set item count.\n"); + + ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + ok(ret == -1, "Unexpected focused item, ret %d\n", ret); + + ret = SendMessageA(hwnd, LVM_GETSELECTIONMARK, 0, 0); +todo_wine + ok(ret == -1, "Unexpected selection mark, %d\n", ret); + + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0); + ok(ret, "Failed to set item count.\n"); + + ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); +todo_wine + ok(ret == -1, "Unexpected focused item, ret %d\n", ret); + + ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent seq, owner data/focus 2", TRUE); + + /* 2 items, focus on index 0, reduce to 1 item. */ + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 2, 0); + ok(ret, "Failed to set item count.\n"); + + ret = SendMessageA(hwnd, LVM_SETITEMSTATE, 0, (LPARAM)&item); + ok(ret, "Failed to set item state.\n"); + + ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + ok(ret == 0, "Unexpected focused item, ret %d\n", ret); + + ret = SendMessageA(hwnd, LVM_SETITEMCOUNT, 1, 0); + ok(ret, "Failed to set item count.\n"); + + ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); + ok(ret == 0, "Unexpected focused item, ret %d\n", ret); + + ok_sequence(sequences, PARENT_SEQ_INDEX, parent_focus_change_ownerdata_seq, + "parent seq, owner data/focus 3", TRUE); + + DestroyWindow(hwnd); } START_TEST(listview)
1
0
0
0
Louis Lenders : shell32: Add stub for Shell_NotifyIconGetRect.
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: 307b20b97b9439a40160cd9bd670684a3efc6dd1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=307b20b97b9439a40160cd9bd…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Wed Nov 29 19:24:54 2017 +0100 shell32: Add stub for Shell_NotifyIconGetRect. Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/shell32.spec | 1 + dlls/shell32/systray.c | 9 +++++++++ include/shellapi.h | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index c38591c..81fae6d 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -452,6 +452,7 @@ @ stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIconA @ stdcall Shell_NotifyIconA(long ptr) @ stdcall Shell_NotifyIconW(long ptr) +@ stdcall Shell_NotifyIconGetRect(ptr ptr) @ stdcall StrChrA(str long) shlwapi.StrChrA @ stdcall StrChrIA(str long) shlwapi.StrChrIA @ stdcall StrChrIW(wstr long) shlwapi.StrChrIW diff --git a/dlls/shell32/systray.c b/dlls/shell32/systray.c index a043912..0fcf73e 100644 --- a/dlls/shell32/systray.c +++ b/dlls/shell32/systray.c @@ -243,3 +243,12 @@ noicon: if (data != &data_buffer) HeapFree( GetProcessHeap(), 0, data ); return ret; } + +/************************************************************************* + * Shell_NotifyIconGetRect [SHELL32.@] + */ +HRESULT WINAPI Shell_NotifyIconGetRect(const NOTIFYICONIDENTIFIER* identifier, RECT* icon_location) +{ + FIXME("stub (%p) (%p)\n", identifier, icon_location); + return E_NOTIMPL; +} diff --git a/include/shellapi.h b/include/shellapi.h index eb09937..0e7d64c 100644 --- a/include/shellapi.h +++ b/include/shellapi.h @@ -434,6 +434,14 @@ typedef struct _NOTIFYICONDATAW HICON hBalloonIcon; } NOTIFYICONDATAW, *PNOTIFYICONDATAW; +typedef struct _NOTIFYICONIDENTIFIER +{ + DWORD cbSize; + HWND hWnd; + UINT uID; + GUID guidItem; +} NOTIFYICONIDENTIFIER, *PNOTIFYICONIDENTIFIER; + DECL_WINELIB_TYPE_AW(NOTIFYICONDATA) DECL_WINELIB_TYPE_AW(PNOTIFYICONDATA) @@ -442,6 +450,8 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW lpData); #define Shell_NotifyIcon WINELIB_NAME_AW(Shell_NotifyIcon) +HRESULT WINAPI Shell_NotifyIconGetRect(const NOTIFYICONIDENTIFIER* identifier, RECT* iconLocation); + /* pre IE 5.0 */ #define NOTIFYICONDATAA_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAA, szTip[64]) #define NOTIFYICONDATAW_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAW, szTip[64])
1
0
0
0
Hugh McMaster : reg: Recursively export all subkeys and data.
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: 72db61da978d7c825dd0f413ca13c1c99d2867ed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=72db61da978d7c825dd0f413c…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Sun Dec 3 06:50:24 2017 +0000 reg: Recursively export all subkeys and data. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/export.c | 33 +++++++++++++++++++++++++++++++-- programs/reg/reg.c | 2 +- programs/reg/reg.h | 1 + programs/reg/tests/reg.c | 4 ++-- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/programs/reg/export.c b/programs/reg/export.c index b566263..ac570a6 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -236,14 +236,18 @@ static void export_key_name(HANDLE hFile, WCHAR *name) heap_free(buf); } +#define MAX_SUBKEY_LEN 257 + static int export_registry_data(HANDLE hFile, HKEY key, WCHAR *path) { LONG rc; DWORD max_value_len = 256, value_len; DWORD max_data_bytes = 2048, data_size; - DWORD i, type; - WCHAR *value_name; + DWORD subkey_len; + DWORD i, type, path_len; + WCHAR *value_name, *subkey_name, *subkey_path; BYTE *data; + HKEY subkey; export_key_name(hFile, path); @@ -280,6 +284,31 @@ static int export_registry_data(HANDLE hFile, HKEY key, WCHAR *path) heap_free(data); heap_free(value_name); + + subkey_name = heap_xalloc(MAX_SUBKEY_LEN * sizeof(WCHAR)); + + path_len = lstrlenW(path); + + i = 0; + for (;;) + { + subkey_len = MAX_SUBKEY_LEN; + rc = RegEnumKeyExW(key, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL); + if (rc == ERROR_SUCCESS) + { + subkey_path = build_subkey_path(path, path_len, subkey_name, subkey_len); + if (!RegOpenKeyExW(key, subkey_name, 0, KEY_READ, &subkey)) + { + export_registry_data(hFile, subkey, subkey_path); + RegCloseKey(subkey); + } + heap_free(subkey_path); + i++; + } + else break; + } + + heap_free(subkey_name); return 0; } diff --git a/programs/reg/reg.c b/programs/reg/reg.c index a3e2cf7..33e381c 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -637,7 +637,7 @@ static void output_value(const WCHAR *value_name, DWORD type, BYTE *data, DWORD output_string(newlineW); } -static WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len) +WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len) { WCHAR *subkey_path; static const WCHAR fmt[] = {'%','s','\\','%','s',0}; diff --git a/programs/reg/reg.h b/programs/reg/reg.h index 35f22a5..2132e92 100644 --- a/programs/reg/reg.h +++ b/programs/reg/reg.h @@ -31,6 +31,7 @@ void output_writeconsole(const WCHAR *str, DWORD wlen); void WINAPIV output_message(unsigned int id, ...); BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info); HKEY path_get_rootkey(const WCHAR *path); +WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len); BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path, WCHAR **long_key); /* import.c */ diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 1ec9ca0..81c9495 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -4489,7 +4489,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", complex_test, TODO_REG_COMPARE), "compare_export() failed\n"); + ok(compare_export("file.reg", complex_test, 0), "compare_export() failed\n"); err = delete_tree(HKEY_CURRENT_USER, KEY_BASE); ok(err == ERROR_SUCCESS, "delete_tree() failed: %d\n", err); @@ -4503,7 +4503,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", key_order_test, TODO_REG_COMPARE), "compare_export() failed\n"); + ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n"); delete_key(hkey, "Subkey1"); delete_key(hkey, "Subkey2");
1
0
0
0
Hugh McMaster : reg: Export REG_DWORD values.
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: 491801063fae82b6cb63e3eaa710b0b698f76b38 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=491801063fae82b6cb63e3eaa…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Sun Dec 3 06:50:23 2017 +0000 reg: Export REG_DWORD values. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/export.c | 15 +++++++++++++++ programs/reg/tests/reg.c | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/programs/reg/export.c b/programs/reg/export.c index 6e59ca4..b566263 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -118,6 +118,14 @@ static void export_string_data(WCHAR **buf, WCHAR *data, size_t size) heap_free(str); } +static void export_dword_data(WCHAR **buf, DWORD *data) +{ + static const WCHAR fmt[] = {'d','w','o','r','d',':','%','0','8','x',0}; + + *buf = heap_xalloc(15 * sizeof(WCHAR)); + sprintfW(*buf, fmt, *data); +} + static size_t export_hex_data_type(HANDLE hFile, DWORD type) { static const WCHAR hex[] = {'h','e','x',':',0}; @@ -192,6 +200,13 @@ static void export_data(HANDLE hFile, WCHAR *value_name, DWORD value_len, case REG_SZ: export_string_data(&buf, data, size); break; + case REG_DWORD: + if (size) + { + export_dword_data(&buf, data); + break; + } + /* fall through */ case REG_NONE: case REG_EXPAND_SZ: case REG_BINARY: diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 88ec308..1ec9ca0 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -4451,7 +4451,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", simple_test, TODO_REG_COMPARE), "compare_export() failed\n"); + ok(compare_export("file.reg", simple_test, 0), "compare_export() failed\n"); /* Test registry export with a complex data structure */ add_key(hkey, "Subkey1", &subkey); @@ -4573,7 +4573,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", hex_types_test, TODO_REG_COMPARE), "compare_export() failed\n"); + ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n"); delete_key(HKEY_CURRENT_USER, KEY_BASE); }
1
0
0
0
Hugh McMaster : reg: Export hex data types.
by Alexandre Julliard
04 Dec '17
04 Dec '17
Module: wine Branch: master Commit: b31f16885dab1871c820ae6aaf788b4482cc78cf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b31f16885dab1871c820ae6aa…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Sun Dec 3 06:50:21 2017 +0000 reg: Export hex data types. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/export.c | 79 +++++++++++++++++++++++++++++++++++++++++++----- programs/reg/tests/reg.c | 4 +-- 2 files changed, 73 insertions(+), 10 deletions(-) diff --git a/programs/reg/export.c b/programs/reg/export.c index ff16963..6e59ca4 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -20,12 +20,9 @@ #include <stdlib.h> #include <wine/unicode.h> -#include <wine/debug.h> #include "reg.h" -WINE_DEFAULT_DEBUG_CHANNEL(reg); - static void write_file(HANDLE hFile, const WCHAR *str) { DWORD written; @@ -121,6 +118,62 @@ static void export_string_data(WCHAR **buf, WCHAR *data, size_t size) heap_free(str); } +static size_t export_hex_data_type(HANDLE hFile, DWORD type) +{ + static const WCHAR hex[] = {'h','e','x',':',0}; + static const WCHAR hexp_fmt[] = {'h','e','x','(','%','x',')',':',0}; + size_t line_len; + + if (type == REG_BINARY) + { + line_len = lstrlenW(hex); + write_file(hFile, hex); + } + else + { + WCHAR *buf = heap_xalloc(15 * sizeof(WCHAR)); + line_len = sprintfW(buf, hexp_fmt, type); + write_file(hFile, buf); + heap_free(buf); + } + + return line_len; +} + +#define MAX_HEX_CHARS 77 + +static void export_hex_data(HANDLE hFile, WCHAR **buf, DWORD type, + DWORD line_len, void *data, DWORD size) +{ + static const WCHAR fmt[] = {'%','0','2','x',0}; + static const WCHAR hex_concat[] = {'\\','\r','\n',' ',' ',0}; + size_t num_commas, i, pos; + + line_len += export_hex_data_type(hFile, type); + + if (!size) return; + + num_commas = size - 1; + *buf = heap_xalloc(size * 3 * sizeof(WCHAR)); + + for (i = 0, pos = 0; i < size; i++) + { + pos += sprintfW(*buf + pos, fmt, ((BYTE *)data)[i]); + if (i == num_commas) break; + (*buf)[pos++] = ','; + (*buf)[pos] = 0; + line_len += 3; + + if (line_len >= MAX_HEX_CHARS) + { + write_file(hFile, *buf); + write_file(hFile, hex_concat); + line_len = 2; + pos = 0; + } + } +} + static void export_newline(HANDLE hFile) { static const WCHAR newline[] = {'\r','\n',0}; @@ -132,17 +185,27 @@ static void export_data(HANDLE hFile, WCHAR *value_name, DWORD value_len, DWORD type, void *data, size_t size) { WCHAR *buf = NULL; + size_t line_len = export_value_name(hFile, value_name, value_len); - export_value_name(hFile, value_name, value_len); - - if (type == REG_SZ) + switch (type) { + case REG_SZ: export_string_data(&buf, data, size); + break; + case REG_NONE: + case REG_EXPAND_SZ: + case REG_BINARY: + case REG_MULTI_SZ: + default: + export_hex_data(hFile, &buf, type, line_len, data, size); + break; + } + + if (size || type == REG_SZ) + { write_file(hFile, buf); heap_free(buf); } - else - FIXME(": export of data type [0x%x] not yet implemented\n", type); export_newline(hFile); } diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index f1fa8e6..88ec308 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -4536,7 +4536,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", empty_hex_test, TODO_REG_COMPARE), "compare_export() failed\n"); + ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n"); delete_key(HKEY_CURRENT_USER, KEY_BASE); @@ -4554,7 +4554,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", empty_hex_test2, TODO_REG_COMPARE), "compare_export() failed\n"); + ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n"); delete_key(HKEY_CURRENT_USER, KEY_BASE);
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
45
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
Results per page:
10
25
50
100
200