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
March 2019
----- 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
1097 discussions
Start a n
N
ew thread
Piotr Caban : msvcr100: Add _NonReentrantPPLLock class implementation.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: f9524f64473d2206f5d563a216fe8fb95797dfcf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f9524f64473d2206f5d563a2…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Feb 2 16:36:22 2018 +0100 msvcr100: Add _NonReentrantPPLLock class implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 8d105ac7c27428fe9f599711c7061e369f515d5e) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcrt/lock.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c index 61cbc46..c3927a3 100644 --- a/dlls/msvcrt/lock.c +++ b/dlls/msvcrt/lock.c @@ -548,7 +548,9 @@ typedef struct DEFINE_THISCALL_WRAPPER(_NonReentrantPPLLock_ctor, 4) _NonReentrantPPLLock* __thiscall _NonReentrantPPLLock_ctor(_NonReentrantPPLLock *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + + critical_section_ctor(&this->cs); return this; } @@ -557,7 +559,8 @@ _NonReentrantPPLLock* __thiscall _NonReentrantPPLLock_ctor(_NonReentrantPPLLock DEFINE_THISCALL_WRAPPER(_NonReentrantPPLLock__Acquire, 8) void __thiscall _NonReentrantPPLLock__Acquire(_NonReentrantPPLLock *this, cs_queue *q) { - FIXME("(%p %p) stub\n", this, q); + TRACE("(%p %p)\n", this, q); + cs_lock(&this->cs, q); } /* ?_Release@_NonReentrantPPLLock@details@Concurrency@@QAEXXZ */ @@ -565,7 +568,8 @@ void __thiscall _NonReentrantPPLLock__Acquire(_NonReentrantPPLLock *this, cs_que DEFINE_THISCALL_WRAPPER(_NonReentrantPPLLock__Release, 4) void __thiscall _NonReentrantPPLLock__Release(_NonReentrantPPLLock *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + critical_section_unlock(&this->cs); } /* ?_GetConcurrency@details@Concurrency@@YAIXZ */
1
0
0
0
Piotr Caban : msvcr100: Use scoped_lock internal buffer when locking critical_section.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: 50ec64a0cf4f24aa1c3213b0a59dbf5a305df4b0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=50ec64a0cf4f24aa1c3213b0…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Feb 2 16:36:18 2018 +0100 msvcr100: Use scoped_lock internal buffer when locking critical_section. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit f042c4ea4a3bcf211288fe69ed6014687995e1de) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcrt/lock.c | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c index 2e0865d..61cbc46 100644 --- a/dlls/msvcrt/lock.c +++ b/dlls/msvcrt/lock.c @@ -357,32 +357,38 @@ static inline void cs_set_head(critical_section *cs, cs_queue *q) cs->head = &cs->unk_active; } -/* ?lock@critical_section@Concurrency@@QAEXXZ */ -/* ?lock@critical_section@Concurrency@@QEAAXXZ */ -DEFINE_THISCALL_WRAPPER(critical_section_lock, 4) -void __thiscall critical_section_lock(critical_section *this) +static inline void cs_lock(critical_section *cs, cs_queue *q) { - cs_queue q, *last; - - TRACE("(%p)\n", this); + cs_queue *last; - if(this->unk_thread_id == GetCurrentThreadId()) + if(cs->unk_thread_id == GetCurrentThreadId()) throw_exception(EXCEPTION_IMPROPER_LOCK, 0, "Already locked"); - memset(&q, 0, sizeof(q)); - last = InterlockedExchangePointer(&this->tail, &q); + memset(q, 0, sizeof(*q)); + last = InterlockedExchangePointer(&cs->tail, q); if(last) { - last->next = &q; - NtWaitForKeyedEvent(keyed_event, &q, 0, NULL); + last->next = q; + NtWaitForKeyedEvent(keyed_event, q, 0, NULL); } - cs_set_head(this, &q); - if(InterlockedCompareExchangePointer(&this->tail, &this->unk_active, &q) != &q) { - spin_wait_for_next_cs(&q); - this->unk_active.next = q.next; + cs_set_head(cs, q); + if(InterlockedCompareExchangePointer(&cs->tail, &cs->unk_active, q) != q) { + spin_wait_for_next_cs(q); + cs->unk_active.next = q->next; } } +/* ?lock@critical_section@Concurrency@@QAEXXZ */ +/* ?lock@critical_section@Concurrency@@QEAAXXZ */ +DEFINE_THISCALL_WRAPPER(critical_section_lock, 4) +void __thiscall critical_section_lock(critical_section *this) +{ + cs_queue q; + + TRACE("(%p)\n", this); + cs_lock(this, &q); +} + /* ?try_lock@critical_section@Concurrency@@QAE_NXZ */ /* ?try_lock@critical_section@Concurrency@@QEAA_NXZ */ DEFINE_THISCALL_WRAPPER(critical_section_try_lock, 4) @@ -502,8 +508,13 @@ MSVCRT_bool __thiscall critical_section_try_lock_for( typedef struct { critical_section *cs; - void *unknown[4]; - int unknown2[2]; + union { + cs_queue q; + struct { + void *unknown[4]; + int unknown2[2]; + } unknown; + } lock; } critical_section_scoped_lock; /* ??0scoped_lock@critical_section@Concurrency@@QAE@AAV12@@Z */ @@ -514,7 +525,7 @@ critical_section_scoped_lock* __thiscall critical_section_scoped_lock_ctor( { TRACE("(%p %p)\n", this, cs); this->cs = cs; - critical_section_lock(this->cs); + cs_lock(this->cs, &this->lock.q); return this; }
1
0
0
0
Piotr Caban : msvcp140: Added _Winerror_message implementation.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: 63205ec85e983cfbbbbb818f0a7dead22e338dea URL:
https://source.winehq.org/git/wine.git/?a=commit;h=63205ec85e983cfbbbbb818f…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Oct 3 18:49:43 2018 +0200 msvcp140: Added _Winerror_message implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit c69eba9278597935a3a3eb75071a40e7a63fd7aa) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcp140/msvcp140.spec | 4 ++-- dlls/msvcp140/tests/msvcp140.c | 23 +++++++++++++++++++++++ dlls/msvcp90/misc.c | 12 ++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 473f466..66c23e6 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1670,8 +1670,8 @@ @ stub -arch=i386 ?_W_Gettnames@_Locinfo@std@@QBE?AV_Timevec@2@XZ @ stub -arch=win64 ?_W_Gettnames@_Locinfo@std@@QEBA?AV_Timevec@2@XZ @ stub ?_Winerror_map@std@@YAHH@Z -@ stub -arch=win32 ?_Winerror_message@std@@YAKKPADK@Z -@ stub -arch=win64 ?_Winerror_message@std@@YAKKPEADK@Z +@ cdecl -arch=win32 ?_Winerror_message@std@@YAKKPADK@Z(long ptr long) _Winerror_message +@ cdecl -arch=win64 ?_Winerror_message@std@@YAKKPEADK@Z(long ptr long) _Winerror_message @ stub ?_XGetLastError@std@@YAXXZ @ stub ?_XLgamma@std@@YAMM@Z @ stub ?_XLgamma@std@@YANN@Z diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index dcaa6d2..606fb83 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -191,6 +191,7 @@ static WCHAR* (__cdecl *p_Temp_get)(WCHAR *); static int (__cdecl *p_To_byte)(const WCHAR *src, char *dst); static int (__cdecl *p_To_wide)(const char *src, WCHAR *dst); static int (__cdecl *p_Unlink)(WCHAR const*); +static ULONG (__cdecl *p__Winerror_message)(ULONG, char*, ULONG); static BOOLEAN (WINAPI *pCreateSymbolicLinkW)(const WCHAR *, const WCHAR *, DWORD); @@ -227,6 +228,7 @@ static BOOL init(void) SET(p__Schedule_chore, "?_Schedule_chore@details@Concurrency@@YAHPEAU_Threadpool_chore@12@@Z"); SET(p__Reschedule_chore, "?_Reschedule_chore@details@Concurrency@@YAHPEBU_Threadpool_chore@12@@Z"); SET(p__Release_chore, "?_Release_chore@details@Concurrency@@YAXPEAU_Threadpool_chore@12@@Z"); + SET(p__Winerror_message, "?_Winerror_message@std@@YAKKPEADK@Z"); } else { #ifdef __arm__ SET(p_task_continuation_context_ctor, "??0task_continuation_context@Concurrency@@AAA@XZ"); @@ -256,6 +258,7 @@ static BOOL init(void) SET(p__Schedule_chore, "?_Schedule_chore@details@Concurrency@@YAHPAU_Threadpool_chore@12@@Z"); SET(p__Reschedule_chore, "?_Reschedule_chore@details@Concurrency@@YAHPBU_Threadpool_chore@12@@Z"); SET(p__Release_chore, "?_Release_chore@details@Concurrency@@YAXPAU_Threadpool_chore@12@@Z"); + SET(p__Winerror_message, "?_Winerror_message@std@@YAKKPADK@Z"); } SET(p_Close_dir, "_Close_dir"); @@ -1282,6 +1285,25 @@ static void test_Last_write_time(void) ok(SetCurrentDirectoryW(origin_path), "SetCurrentDirectoryW to origin_path failed\n"); } +static void test__Winerror_message(void) +{ + char buf[256], buf_fm[256]; + ULONG ret, ret_fm; + + ret_fm = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, 0, 0, buf_fm, sizeof(buf_fm), NULL); + + memset(buf, 'a', sizeof(buf)); + ret = p__Winerror_message(0, buf, sizeof(buf)); + ok(ret == ret_fm, "ret = %u, expected %u\n", ret, ret_fm); + ok(!strcmp(buf, buf_fm), "buf = %s, expected %s\n", buf, buf_fm); + + memset(buf, 'a', sizeof(buf)); + ret = p__Winerror_message(0, buf, 2); + ok(!ret, "ret = %u\n", ret); + ok(buf[0] == 'a', "buf = %s\n", buf); +} + START_TEST(msvcp140) { if(!init()) return; @@ -1303,5 +1325,6 @@ START_TEST(msvcp140) test_Temp_get(); test_Rename(); test_Last_write_time(); + test__Winerror_message(); FreeLibrary(msvcp); } diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index f510a4a..7a682b6 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -2133,3 +2133,15 @@ const char* __cdecl _Syserror_map(int err) return NULL; } #endif + +#if _MSVCP_VER >= 140 +/* ?_Winerror_message@std@@YAKKPADK@Z */ +/* ?_Winerror_message@std@@YAKKPEADK@Z */ +ULONG __cdecl _Winerror_message(ULONG err, char *buf, ULONG size) +{ + TRACE("(%u %p %u)\n", err, buf, size); + + return FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, err, 0, buf, size, NULL); +} +#endif
1
0
0
0
Stefan Dösinger : msvcp140/tests: Test _Last_write_time and _Set_last_write_time.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: 4bfd9ec37113f45a95d74833bbfd964ce0f8d577 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4bfd9ec37113f45a95d74833…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Wed Aug 15 12:43:41 2018 +0200 msvcp140/tests: Test _Last_write_time and _Set_last_write_time. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 5a4112c73a51c49bcf24ede9556b3af982d5b186) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcp110/tests/msvcp110.c | 35 ++++++++++++-- dlls/msvcp120/tests/msvcp120.c | 9 ++++ dlls/msvcp140/tests/msvcp140.c | 101 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 4 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=4bfd9ec37113f45a95d7…
1
0
0
0
Stefan Dösinger : msvcp140: Export _Rename.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: bade5bd4f157d4e862d222467ba185325b6361a8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bade5bd4f157d4e862d22246…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Thu Jul 19 21:14:17 2018 +0200 msvcp140: Export _Rename. Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 1604cdae9085194ebfffee279cb986aa82bc6937) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcp140/msvcp140.spec | 2 +- dlls/msvcp140/tests/msvcp140.c | 97 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index ef58db6..473f466 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -3694,7 +3694,7 @@ @ cdecl -ret64 _Query_perf_frequency() @ cdecl _Read_dir(ptr ptr ptr) tr2_sys__Read_dir_wchar @ cdecl _Remove_dir(wstr) tr2_sys__Remove_dir_wchar -@ stub _Rename +@ cdecl _Rename(wstr wstr) tr2_sys__Rename_wchar @ stub _Resize @ cdecl _Set_last_write_time(wstr int64) @ stub _Sinh diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index 6620b95..1edc725 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -176,6 +176,7 @@ static int (__cdecl *p_Make_dir)(WCHAR const*); static void* (__cdecl *p_Open_dir)(WCHAR*, WCHAR const*, int *, enum file_type*); static WCHAR* (__cdecl *p_Read_dir)(WCHAR*, void*, enum file_type*); static MSVCP_bool (__cdecl *p_Remove_dir)(WCHAR const*); +static int (__cdecl *p_Rename)(WCHAR const*, WCHAR const*); static enum file_type (__cdecl *p_Stat)(WCHAR const *, int *); static int (__cdecl *p_Symlink)(WCHAR const*, WCHAR const*); static WCHAR* (__cdecl *p_Temp_get)(WCHAR *); @@ -259,6 +260,7 @@ static BOOL init(void) SET(p_Open_dir, "_Open_dir"); SET(p_Read_dir, "_Read_dir"); SET(p_Remove_dir, "_Remove_dir"); + SET(p_Rename, "_Rename"); SET(p_Stat, "_Stat"); SET(p_Symlink, "_Symlink"); SET(p_Temp_get, "_Temp_get"); @@ -1086,6 +1088,100 @@ static void test_Temp_get(void) todo_wine ok(path[len + 1] == 0xaaaa, "Too many bytes were zeroed - %x\n", path[len + 1]); } +static void test_Rename(void) +{ + int ret, i; + HANDLE file, h1, h2; + BY_HANDLE_FILE_INFORMATION info1, info2; + WCHAR temp_path[MAX_PATH], current_path[MAX_PATH]; + LARGE_INTEGER file_size; + static const WCHAR wine_test_dirW[] = + {'w','i','n','e','_','t','e','s','t','_','d','i','r',0}; + static const WCHAR f1W[] = + {'w','i','n','e','_','t','e','s','t','_','d','i','r','\\','f','1',0}; + static const WCHAR f1_renameW[] = + {'w','i','n','e','_','t','e','s','t','_','d','i','r','\\','f','1','_','r','e','n','a','m','e',0}; + static const WCHAR f1_rename2W[] = + {'w','i','n','e','_','t','e','s','t','_','d','i','r','\\','f','1','_','r','e','n','a','m','e','2',0}; + static const WCHAR not_existW[] = + {'w','i','n','e','_','t','e','s','t','_','d','i','r','\\','n','o','t','_','e','x','i','s','t',0}; + static const WCHAR not_exist2W[] = + {'w','i','n','e','_','t','e','s','t','_','d','i','r','\\','n','o','t','_','e','x','i','s','t','2',0}; + static const WCHAR invalidW[] = + {'w','i','n','e','_','t','e','s','t','_','d','i','r','\\','?','?','i','n','v','a','l','i','d','>',0}; + static const struct { + const WCHAR *old_path; + const WCHAR *new_path; + int val; + } tests[] = { + { f1W, f1_renameW, ERROR_SUCCESS }, + { f1W, NULL, ERROR_FILE_NOT_FOUND }, + { f1W, f1_renameW, ERROR_FILE_NOT_FOUND }, + { NULL, f1_rename2W, ERROR_PATH_NOT_FOUND }, + { f1_renameW, invalidW, ERROR_INVALID_NAME }, + { not_existW, not_exist2W, ERROR_FILE_NOT_FOUND }, + { not_existW, invalidW, ERROR_FILE_NOT_FOUND } + }; + + memset(current_path, 0, MAX_PATH); + GetCurrentDirectoryW(MAX_PATH, current_path); + memset(temp_path, 0, MAX_PATH); + GetTempPathW(MAX_PATH, temp_path); + ok(SetCurrentDirectoryW(temp_path), "SetCurrentDirectoryW to temp_path failed\n"); + ret = p_Make_dir(wine_test_dirW); + + ok(ret == 1, "_Make_dir(): expect 1 got %d\n", ret); + file = CreateFileW(f1W, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + CloseHandle(file); + + ret = p_Rename(f1W, f1W); + todo_wine ok(ERROR_SUCCESS == ret, "_Rename(): expect: ERROR_SUCCESS, got %d\n", ret); + for(i=0; i<ARRAY_SIZE(tests); i++) { + errno = 0xdeadbeef; + if(tests[i].val == ERROR_SUCCESS) { + h1 = CreateFileW(tests[i].old_path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, 0); + ok(h1 != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(GetFileInformationByHandle(h1, &info1), "GetFileInformationByHandle failed\n"); + CloseHandle(h1); + } + SetLastError(0xdeadbeef); + ret = p_Rename(tests[i].old_path, tests[i].new_path); + ok(ret == tests[i].val, "_Rename(): test %d expect: %d, got %d\n", i+1, tests[i].val, ret); + ok(errno == 0xdeadbeef, "_Rename(): test %d errno expect 0xdeadbeef, got %d\n", i+1, errno); + if(ret == ERROR_SUCCESS) { + h2 = CreateFileW(tests[i].new_path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, 0); + ok(h2 != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(GetFileInformationByHandle(h2, &info2), "GetFileInformationByHandle failed\n"); + CloseHandle(h2); + ok(info1.nFileIndexHigh == info2.nFileIndexHigh + && info1.nFileIndexLow == info2.nFileIndexLow, + "test_tr2_sys__Rename(): test %d expect two files equivalent\n", i+1); + } + } + + file = CreateFileW(f1W, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + file_size.QuadPart = 7; + ok(SetFilePointerEx(file, file_size, NULL, FILE_BEGIN), "SetFilePointerEx failed\n"); + ok(SetEndOfFile(file), "SetEndOfFile failed\n"); + CloseHandle(file); + ret = p_Rename(f1W, f1_renameW); + ok(ret == ERROR_ALREADY_EXISTS, "_Rename(): expect: ERROR_ALREADY_EXISTS, got %d\n", ret); + ok(p_File_size(f1W) == 7, "_Rename(): expect: 7, got %s\n", + wine_dbgstr_longlong(p_File_size(f1W))); + ok(p_File_size(f1_renameW) == 0, "test_tr2_sys__Rename(): expect: 0, got %s\n", + wine_dbgstr_longlong(p_File_size(f1_renameW))); + + ok(DeleteFileW(f1_renameW), "expect f1_rename to exist\n"); + ok(DeleteFileW(f1W), "expect f1 to exist\n"); + ret = p_Remove_dir(wine_test_dirW); + ok(ret == 1, "_Remove_dir(): expect %d got %d\n", 1, ret); + ok(SetCurrentDirectoryW(current_path), "SetCurrentDirectoryW failed\n"); +} + START_TEST(msvcp140) { if(!init()) return; @@ -1105,5 +1201,6 @@ START_TEST(msvcp140) test_dir_operation(); test_Unlink(); test_Temp_get(); + test_Rename(); FreeLibrary(msvcp); }
1
0
0
0
Stefan Dösinger : msvcp120: Tr2:: _Rename_wchar NULL ptr handling differs from tr2::_Rename.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: 0b8ee31d79c3c78b852bda40ad59b4262dcf1476 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0b8ee31d79c3c78b852bda40…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Thu Jul 19 21:14:16 2018 +0200 msvcp120: Tr2::_Rename_wchar NULL ptr handling differs from tr2::_Rename. Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 84b2d69a76dbaa5fec4b31c9cc2d375722894b0e) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcp120/tests/msvcp120.c | 58 +++++++++++++++++++++++++++++++++++++----- dlls/msvcp90/ios.c | 3 --- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c index c0d6f18..76d5fdf 100644 --- a/dlls/msvcp120/tests/msvcp120.c +++ b/dlls/msvcp120/tests/msvcp120.c @@ -1192,9 +1192,8 @@ static void test_tr2_sys__Rename(void) BY_HANDLE_FILE_INFORMATION info1, info2; char temp_path[MAX_PATH], current_path[MAX_PATH]; LARGE_INTEGER file_size; - WCHAR testW[] = {'t','r','2','_','t','e','s','t','_','d','i','r','/','f','1',0}; - WCHAR testW2[] = {'t','r','2','_','t','e','s','t','_','d','i','r','/','f','w',0}; - struct { + static const WCHAR testW[] = {'t','r','2','_','t','e','s','t','_','d','i','r','/','f','1',0}; + static const struct { char const *old_path; char const *new_path; int val; @@ -1206,6 +1205,29 @@ static void test_tr2_sys__Rename(void) { "tr2_test_dir\\f1_rename", "tr2_test_dir\\??invalid_name>>", ERROR_INVALID_NAME }, { "tr2_test_dir\\not_exist_file", "tr2_test_dir\\not_exist_rename", ERROR_FILE_NOT_FOUND } }; + static const WCHAR f1_renameW[] = + {'t','r','2','_','t','e','s','t','_','d','i','r','\\','f','1','_','r','e','n','a','m','e',0}; + static const WCHAR f1_rename2W[] = + {'t','r','2','_','t','e','s','t','_','d','i','r','\\','f','1','_','r','e','n','a','m','e','2',0}; + static const WCHAR not_existW[] = + {'t','r','2','_','t','e','s','t','_','d','i','r','\\','n','o','t','_','e','x','i','s','t',0}; + static const WCHAR not_exist2W[] = + {'t','r','2','_','t','e','s','t','_','d','i','r','\\','n','o','t','_','e','x','i','s','t','2',0}; + static const WCHAR invalidW[] = + {'t','r','2','_','t','e','s','t','_','d','i','r','\\','?','?','i','n','v','a','l','i','d','>',0}; + static const struct { + const WCHAR *old_path; + const WCHAR *new_path; + int val; + } testsW[] = { + { testW, f1_renameW, ERROR_SUCCESS }, + { testW, NULL, ERROR_FILE_NOT_FOUND }, /* Differs from the A version */ + { testW, f1_renameW, ERROR_FILE_NOT_FOUND }, + { NULL, f1_rename2W, ERROR_PATH_NOT_FOUND }, /* Differs from the A version */ + { f1_renameW, invalidW, ERROR_INVALID_NAME }, + { not_existW, not_exist2W, ERROR_FILE_NOT_FOUND }, + { not_existW, invalidW, ERROR_FILE_NOT_FOUND } + }; memset(current_path, 0, MAX_PATH); GetCurrentDirectoryA(MAX_PATH, current_path); @@ -1256,10 +1278,34 @@ static void test_tr2_sys__Rename(void) ok(ret == ERROR_ALREADY_EXISTS, "test_tr2_sys__Rename(): expect: ERROR_ALREADY_EXISTS, got %d\n", ret); ok(p_tr2_sys__File_size("tr2_test_dir\\f1") == 7, "test_tr2_sys__Rename(): expect: 7, got %s\n", wine_dbgstr_longlong(p_tr2_sys__File_size("tr2_test_dir\\f1"))); ok(p_tr2_sys__File_size("tr2_test_dir\\f1_rename") == 0, "test_tr2_sys__Rename(): expect: 0, got %s\n",wine_dbgstr_longlong(p_tr2_sys__File_size("tr2_test_dir\\f1_rename"))); - ret = p_tr2_sys__Rename_wchar(testW, testW2); - ok(ret == ERROR_SUCCESS, "tr2_sys__Rename_wchar(): expect: ERROR_SUCCESS, got %d\n", ret); - ok(DeleteFileW(testW2), "expect fw to exist\n"); + ok(DeleteFileA("tr2_test_dir\\f1_rename"), "expect f1_rename to exist\n"); + + for(i=0; i<ARRAY_SIZE(testsW); i++) { + errno = 0xdeadbeef; + if(testsW[i].val == ERROR_SUCCESS) { + h1 = CreateFileW(testsW[i].old_path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, 0); + ok(h1 != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(GetFileInformationByHandle(h1, &info1), "GetFileInformationByHandle failed\n"); + CloseHandle(h1); + } + SetLastError(0xdeadbeef); + ret = p_tr2_sys__Rename_wchar(testsW[i].old_path, testsW[i].new_path); + ok(ret == testsW[i].val, "test_tr2_sys__Rename_wchar(): test %d expect: %d, got %d\n", i+1, testsW[i].val, ret); + ok(errno == 0xdeadbeef, "test_tr2_sys__Rename_wchar(): test %d errno expect 0xdeadbeef, got %d\n", i+1, errno); + if(ret == ERROR_SUCCESS) { + h2 = CreateFileW(testsW[i].new_path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, 0); + ok(h2 != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(GetFileInformationByHandle(h2, &info2), "GetFileInformationByHandle failed\n"); + CloseHandle(h2); + ok(info1.nFileIndexHigh == info2.nFileIndexHigh + && info1.nFileIndexLow == info2.nFileIndexLow, + "test_tr2_sys__Rename_wchar(): test %d expect two files equivalent\n", i+1); + } + } + ok(DeleteFileA("tr2_test_dir\\f1_rename"), "expect f1_rename to exist\n"); ret = p_tr2_sys__Remove_dir("tr2_test_dir"); ok(ret == 1, "test_tr2_sys__Remove_dir(): expect %d got %d\n", 1, ret); diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index 88cd454..61acf19 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -15694,9 +15694,6 @@ int __cdecl tr2_sys__Rename_wchar(WCHAR const* old_path, WCHAR const* new_path) { TRACE("(%s %s)\n", debugstr_w(old_path), debugstr_w(new_path)); - if(!old_path || !new_path) - return ERROR_INVALID_PARAMETER; - if(MoveFileExW(old_path, new_path, MOVEFILE_COPY_ALLOWED)) return ERROR_SUCCESS; return GetLastError();
1
0
0
0
Stefan Dösinger : msvcp140: Implement _Temp_get.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: 2f3e5e7f1008530cba11b538e6cf7437909c4720 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2f3e5e7f1008530cba11b538…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Fri Jul 20 10:51:54 2018 +0200 msvcp140: Implement _Temp_get. Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 17c203ea86fa9f7b1739c638c9ca20f34b8c9d1d) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msvcp140/msvcp140.spec | 2 +- dlls/msvcp140/tests/msvcp140.c | 26 ++++++++++++++++++++++++++ dlls/msvcp90/ios.c | 6 ++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 0efd785..ef58db6 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -3718,7 +3718,7 @@ @ stub _Strxfrm @ cdecl _Symlink(wstr wstr) tr2_sys__Symlink_wchar @ stub _Symlink_get -@ stub _Temp_get +@ cdecl _Temp_get(ptr) @ stub _Thrd_abort @ cdecl _Thrd_create(ptr ptr ptr) _Thrd_create @ cdecl -norelay _Thrd_current() diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index 593e0ce..6620b95 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -178,6 +178,7 @@ static WCHAR* (__cdecl *p_Read_dir)(WCHAR*, void*, enum file_type*); static MSVCP_bool (__cdecl *p_Remove_dir)(WCHAR const*); static enum file_type (__cdecl *p_Stat)(WCHAR const *, int *); static int (__cdecl *p_Symlink)(WCHAR const*, WCHAR const*); +static WCHAR* (__cdecl *p_Temp_get)(WCHAR *); static int (__cdecl *p_To_byte)(const WCHAR *src, char *dst); static int (__cdecl *p_To_wide)(const char *src, WCHAR *dst); static int (__cdecl *p_Unlink)(WCHAR const*); @@ -260,6 +261,7 @@ static BOOL init(void) SET(p_Remove_dir, "_Remove_dir"); SET(p_Stat, "_Stat"); SET(p_Symlink, "_Symlink"); + SET(p_Temp_get, "_Temp_get"); SET(p_To_byte, "_To_byte"); SET(p_To_wide, "_To_wide"); SET(p_Unlink, "_Unlink"); @@ -1061,6 +1063,29 @@ static void test_Unlink(void) ok(SetCurrentDirectoryW(current_path), "SetCurrentDirectoryW failed\n"); } +static void test_Temp_get(void) +{ + WCHAR path[MAX_PATH + 1], temp_path[MAX_PATH]; + WCHAR *retval; + DWORD len; + + GetTempPathW(ARRAY_SIZE(temp_path), temp_path); + + /* This crashes on Windows, the input pointer is not validated. */ + if (0) + { + retval = p_Temp_get(NULL); + ok(!retval, "_Temp_get(): Got %p\n", retval); + } + + memset(path, 0xaa, sizeof(path)); + retval = p_Temp_get(path); + ok(retval == path, "_Temp_get(): Got %p, expected %p\n", retval, path); + ok(!wcscmp(path, temp_path), "Expected path %s, got %s\n", wine_dbgstr_w(temp_path), wine_dbgstr_w(path)); + len = wcslen(path); + todo_wine ok(path[len + 1] == 0xaaaa, "Too many bytes were zeroed - %x\n", path[len + 1]); +} + START_TEST(msvcp140) { if(!init()) return; @@ -1079,5 +1104,6 @@ START_TEST(msvcp140) test_Stat(); test_dir_operation(); test_Unlink(); + test_Temp_get(); FreeLibrary(msvcp); } diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index 4778aad..88cd454 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -15798,6 +15798,12 @@ enum file_type __cdecl _Lstat(WCHAR const* path, int* permissions) return _Stat(path, permissions); } +WCHAR * __cdecl _Temp_get(WCHAR *dst) +{ + GetTempPathW(MAX_PATH, dst); + return dst; +} + /* ??1_Winit@std@@QAE@XZ */ /* ??1_Winit@std@@QAE@XZ */ DEFINE_THISCALL_WRAPPER(_Winit_dtor, 4)
1
0
0
0
Bernhard Übelacker : user32: Let nulldrv return some dummy monitor information.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: 178d9f1cb6f590298d4c66027e04aa159fb105fd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=178d9f1cb6f590298d4c6602…
Author: Bernhard Übelacker <bernhardu(a)mailbox.org> Date: Tue Oct 2 16:27:41 2018 +0200 user32: Let nulldrv return some dummy monitor information. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=43187
Signed-off-by: Bernhard Übelacker <bernhardu(a)mailbox.org> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit f5bb76f69a96e2b5a5b0953817035a8cbe94153a) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/user32/driver.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index d59a2ea..9201660 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -197,6 +197,8 @@ void USER_unload_driver(void) * These are fallbacks for entry points that are not implemented in the real driver. */ +#define NULLDRV_DEFAULT_HMONITOR ((HMONITOR)(UINT_PTR)(0x10000 + 1)) + static HKL CDECL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags ) { return 0; @@ -354,7 +356,12 @@ static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode static BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp ) { - return FALSE; + RECT r = {0, 0, 640, 480}; + + TRACE("(%p, %p, %p, 0x%lx)\n", hdc, rect, proc, lp); + + proc(NULLDRV_DEFAULT_HMONITOR, hdc, &r, lp); + return TRUE; } static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags ) @@ -364,7 +371,23 @@ static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVM static BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) { - return FALSE; + RECT r = {0, 0, 640, 480}; + static const WCHAR device[] = {'W','i','n','D','i','s','c',0}; + + TRACE("(%p, %p)\n", handle, info); + + if (handle != NULLDRV_DEFAULT_HMONITOR) + { + SetLastError(ERROR_INVALID_MONITOR_HANDLE); + return FALSE; + } + + info->rcMonitor = r; + info->rcWork = r; + info->dwFlags = MONITORINFOF_PRIMARY; + if (info->cbSize >= sizeof(MONITORINFOEXW)) + lstrcpyW( ((MONITORINFOEXW *)info)->szDevice, device ); + return TRUE; } static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd )
1
0
0
0
Hans Leidekker : msi: Allow recursive changes to the target folder path.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: 05dec73ba8c3e67a01f52fa32436fdd09da2adcd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=05dec73ba8c3e67a01f52fa3…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 26 15:17:19 2018 +0200 msi: Allow recursive changes to the target folder path. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 7bf2a1b2099b534fd4472962d2e945bc9ab9e2b8) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msi/action.c | 10 +++------- dlls/msi/tests/msi.c | 24 ++++++++---------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index ad8b285..d7965d2 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -2351,15 +2351,11 @@ void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL loa else path = msi_build_directory_name( 2, folder->TargetDefault, NULL ); } + normalized_path = msi_normalize_path( path ); - msi_free( path ); - if (folder->ResolvedTarget && !strcmpiW( normalized_path, folder->ResolvedTarget )) - { - TRACE("%s already resolved to %s\n", debugstr_w(name), debugstr_w(folder->ResolvedTarget)); - msi_free( normalized_path ); - return; - } msi_set_property( package->db, folder->Directory, normalized_path, -1 ); + msi_free( path ); + msi_free( folder->ResolvedTarget ); folder->ResolvedTarget = normalized_path; diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 85ab7ba..82574e9 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -671,16 +671,18 @@ static const char spf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n" "s72\ti2\tS64\tS0\tS255\n" "CustomAction\tAction\n" - "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n"; + "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n" + "SetFolderProp2\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\\added2\t\n"; static const char spf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" "InstallExecuteSequence\tAction\n" - "CostFinalize\t\t1000\n" "CostInitialize\t\t800\n" "FileCost\t\t900\n" "SetFolderProp\t\t950\n" + "SetFolderProp2\t\t960\n" + "CostFinalize\t\t1000\n" "InstallFiles\t\t4000\n" "InstallServices\t\t5000\n" "InstallFinalize\t\t6600\n" @@ -14556,7 +14558,6 @@ static void test_setpropertyfolder(void) { UINT r; CHAR path[MAX_PATH]; - DWORD attr; if (is_process_limited()) { @@ -14581,19 +14582,10 @@ static void test_setpropertyfolder(void) goto error; } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - attr = GetFileAttributesA(path); - if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY)) - { - ok(delete_pf("msitest\\added\\maximus", TRUE), "File not installed\n"); - ok(delete_pf("msitest\\added", FALSE), "Directory not created\n"); - ok(delete_pf("msitest", FALSE), "Directory not created\n"); - } - else - { - trace("changing folder property not supported\n"); - ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n"); - ok(delete_pf("msitest", FALSE), "Directory not created\n"); - } + ok(delete_pf("msitest\\added\\added2\\maximus", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\added\\added2", FALSE), "Directory not created\n"); + ok(delete_pf("msitest\\added", FALSE), "Directory not created\n"); + ok(delete_pf("msitest", FALSE), "Directory not created\n"); error: DeleteFileA(msifile);
1
0
0
0
Sebastian Lackner : opengl32: Add wrappers for glDebugMessageCallback to handle calling convention differences.
by Alexandre Julliard
03 Mar '19
03 Mar '19
Module: wine Branch: oldstable Commit: 6aa959e05cbc0ac04c686d0819a5b9f84304fc76 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6aa959e05cbc0ac04c686d08…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Oct 5 04:20:30 2018 +0000 opengl32: Add wrappers for glDebugMessageCallback to handle calling convention differences. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=38402
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit e07230ed4e8302efce99ce1924389c229d90adfd) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/opengl32/make_opengl | 3 +++ dlls/opengl32/opengl_ext.c | 24 +++---------------- dlls/opengl32/tests/opengl.c | 44 ++++++++++++++++++++++++++++++++++ dlls/opengl32/wgl.c | 57 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 21 deletions(-) diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index d5d614b..26baa62 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -414,6 +414,9 @@ sub needs_wrapper($$) my %funcs = ( "glDebugEntry" => 1, + "glDebugMessageCallback" => 1, + "glDebugMessageCallbackAMD" => 1, + "glDebugMessageCallbackARB" => 1, "glGetIntegerv" => 1, "glGetString" => 1, "glGetStringi" => 1, diff --git a/dlls/opengl32/opengl_ext.c b/dlls/opengl32/opengl_ext.c index aa84c8b..90ad751 100644 --- a/dlls/opengl32/opengl_ext.c +++ b/dlls/opengl32/opengl_ext.c @@ -2313,27 +2313,6 @@ static void WINAPI glCurrentPaletteMatrixARB( GLint index ) funcs->ext.p_glCurrentPaletteMatrixARB( index ); } -static void WINAPI glDebugMessageCallback( GLDEBUGPROC callback, const void *userParam ) -{ - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - TRACE( "(%p, %p)\n", callback, userParam ); - funcs->ext.p_glDebugMessageCallback( callback, userParam ); -} - -static void WINAPI glDebugMessageCallbackAMD( GLDEBUGPROCAMD callback, void *userParam ) -{ - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - TRACE( "(%p, %p)\n", callback, userParam ); - funcs->ext.p_glDebugMessageCallbackAMD( callback, userParam ); -} - -static void WINAPI glDebugMessageCallbackARB( GLDEBUGPROCARB callback, const void *userParam ) -{ - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - TRACE( "(%p, %p)\n", callback, userParam ); - funcs->ext.p_glDebugMessageCallbackARB( callback, userParam ); -} - static void WINAPI glDebugMessageControl( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) { const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -18518,6 +18497,9 @@ static BOOL WINAPI wglSwapIntervalEXT( int interval ) return funcs->ext.p_wglSwapIntervalEXT( interval ); } +extern void WINAPI glDebugMessageCallback( GLDEBUGPROC callback, const void *userParam ) DECLSPEC_HIDDEN; +extern void WINAPI glDebugMessageCallbackAMD( GLDEBUGPROCAMD callback, void *userParam ) DECLSPEC_HIDDEN; +extern void WINAPI glDebugMessageCallbackARB( GLDEBUGPROCARB callback, const void *userParam ) DECLSPEC_HIDDEN; extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ) DECLSPEC_HIDDEN; extern BOOL WINAPI wglBindTexImageARB( HPBUFFERARB hPbuffer, int iBuffer ) DECLSPEC_HIDDEN; extern HGLRC WINAPI wglCreateContextAttribsARB( HDC hDC, HGLRC hShareContext, const int *attribList ) DECLSPEC_HIDDEN; diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 8126fbf..a928a9c 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -48,6 +48,11 @@ static HDC (WINAPI *pwglGetPbufferDCARB)(HPBUFFERARB); static BOOL (WINAPI *pwglSwapIntervalEXT)(int interval); static int (WINAPI *pwglGetSwapIntervalEXT)(void); +/* GL_ARB_debug_output */ +static void (WINAPI *pglDebugMessageCallbackARB)(void *, void *); +static void (WINAPI *pglDebugMessageControlARB)(GLenum, GLenum, GLenum, GLsizei, const GLuint *, GLboolean); +static void (WINAPI *pglDebugMessageInsertARB)(GLenum, GLenum, GLuint, GLenum, GLsizei, const char *); + static const char* wgl_extensions = NULL; static void init_functions(void) @@ -80,6 +85,11 @@ static void init_functions(void) GET_PROC(wglSwapIntervalEXT) GET_PROC(wglGetSwapIntervalEXT) + /* GL_ARB_debug_output */ + GET_PROC(glDebugMessageCallbackARB) + GET_PROC(glDebugMessageControlARB) + GET_PROC(glDebugMessageInsertARB) + #undef GET_PROC } @@ -304,6 +314,39 @@ static void test_choosepixelformat(void) pfd.cAuxBuffers = 0; } +static void WINAPI gl_debug_message_callback(GLenum source, GLenum type, GLuint id, GLenum severity, + GLsizei length, const GLchar *message, const void *userParam) +{ + DWORD *count = (DWORD *)userParam; + (*count)++; +} + +static void test_debug_message_callback(void) +{ + static const char testmsg[] = "Hello World"; + DWORD count; + + if (!pglDebugMessageCallbackARB) + { + skip("glDebugMessageCallbackARB not supported\n"); + return; + } + + glEnable(GL_DEBUG_OUTPUT); + glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); + + pglDebugMessageCallbackARB(gl_debug_message_callback, &count); + pglDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE); + + count = 0; + pglDebugMessageInsertARB(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, 0x42424242, + GL_DEBUG_SEVERITY_LOW, sizeof(testmsg), testmsg); + ok(count == 1, "expected count == 1, got %u\n", count); + + glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS); + glDisable(GL_DEBUG_OUTPUT); +} + static void test_setpixelformat(HDC winhdc) { int res = 0; @@ -1787,6 +1830,7 @@ START_TEST(opengl) } test_choosepixelformat(); + test_debug_message_callback(); test_setpixelformat(hdc); test_destroy(hdc); test_sharelists(hdc); diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index b73920c..a839928 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -58,6 +58,9 @@ struct opengl_context DWORD tid; /* thread that the context is current in */ HDC draw_dc; /* current drawing DC */ HDC read_dc; /* current reading DC */ + void (CALLBACK *debug_callback)(GLenum, GLenum, GLuint, GLenum, + GLsizei, const GLchar *, const void *); /* debug callback */ + const void *debug_user; /* debug user parameter */ GLubyte *extensions; /* extension string */ GLuint *disabled_exts; /* indices of disabled extensions */ struct wgl_context *drv_ctx; /* driver context */ @@ -1746,6 +1749,60 @@ const GLubyte * WINAPI glGetString( GLenum name ) return ret; } +/* wrapper for glDebugMessageCallback* functions */ +static void gl_debug_message_callback( GLenum source, GLenum type, GLuint id, GLenum severity, + GLsizei length, const GLchar *message,const void *userParam ) +{ + struct wgl_handle *ptr = (struct wgl_handle *)userParam; + if (!ptr->u.context->debug_callback) return; + ptr->u.context->debug_callback( source, type, id, severity, length, message, ptr->u.context->debug_user ); +} + +/*********************************************************************** + * glDebugMessageCallback + */ +void WINAPI glDebugMessageCallback( GLDEBUGPROC callback, const void *userParam ) +{ + struct wgl_handle *ptr = get_current_context_ptr(); + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + + TRACE( "(%p, %p)\n", callback, userParam ); + + ptr->u.context->debug_callback = callback; + ptr->u.context->debug_user = userParam; + funcs->ext.p_glDebugMessageCallback( gl_debug_message_callback, ptr ); +} + +/*********************************************************************** + * glDebugMessageCallbackAMD + */ +void WINAPI glDebugMessageCallbackAMD( GLDEBUGPROCAMD callback, void *userParam ) +{ + struct wgl_handle *ptr = get_current_context_ptr(); + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + + TRACE( "(%p, %p)\n", callback, userParam ); + + ptr->u.context->debug_callback = callback; + ptr->u.context->debug_user = userParam; + funcs->ext.p_glDebugMessageCallbackAMD( gl_debug_message_callback, ptr ); +} + +/*********************************************************************** + * glDebugMessageCallbackARB + */ +void WINAPI glDebugMessageCallbackARB( GLDEBUGPROCARB callback, const void *userParam ) +{ + struct wgl_handle *ptr = get_current_context_ptr(); + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + + TRACE( "(%p, %p)\n", callback, userParam ); + + ptr->u.context->debug_callback = callback; + ptr->u.context->debug_user = userParam; + funcs->ext.p_glDebugMessageCallbackARB( gl_debug_message_callback, ptr ); +} + /*********************************************************************** * OpenGL initialisation routine */
1
0
0
0
← Newer
1
...
99
100
101
102
103
104
105
...
110
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Results per page:
10
25
50
100
200