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 2009
----- 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
3 participants
1233 discussions
Start a n
N
ew thread
Marcus Meissner : msi: Removed unnecessary NULL check.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: e2f7946bbced9e9ec895946996619f9312eca5cb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e2f7946bbced9e9ec89594699…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Tue Dec 22 09:32:03 2009 +0100 msi: Removed unnecessary NULL check. --- dlls/msi/action.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 7904770..10338ad 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -5090,14 +5090,8 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) lstrcatW(newval, value); } } - - if (newval) - { - TRACE("setting %s to %s\n", debugstr_w(name), debugstr_w(newval)); - res = RegSetValueExW(env, name, 0, type, (LPVOID)newval, size); - } - else - res = ERROR_SUCCESS; + TRACE("setting %s to %s\n", debugstr_w(name), debugstr_w(newval)); + res = RegSetValueExW(env, name, 0, type, (LPVOID)newval, size); done: if (env) RegCloseKey(env);
1
0
0
0
Marcus Meissner : cryptnet: Remove an unnecessary variable (Coverity).
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: e235bfcca7ea5c830c9e514725e54787de5f1a2d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e235bfcca7ea5c830c9e51472…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Tue Dec 22 09:26:49 2009 +0100 cryptnet: Remove an unnecessary variable (Coverity). --- dlls/cryptnet/cryptnet_main.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index d4d0e2c..2306941 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -1798,7 +1798,6 @@ BOOL WINAPI CertDllVerifyRevocation(DWORD dwEncodingType, DWORD dwRevType, PCERT_REVOCATION_PARA pRevPara, PCERT_REVOCATION_STATUS pRevStatus) { DWORD error = 0, i; - BOOL ret; FILETIME now; LPFILETIME pTime = NULL; @@ -1837,8 +1836,7 @@ BOOL WINAPI CertDllVerifyRevocation(DWORD dwEncodingType, DWORD dwRevType, { SetLastError(error); pRevStatus->dwError = error; - ret = FALSE; } - TRACE("returning %d (%08x)\n", ret, error); - return ret; + TRACE("returning %d (%08x)\n", !error, error); + return !error; }
1
0
0
0
Hans Leidekker : wininet: Free per-thread error info upon exit from an async procedure.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 406b6e36d8ed1d5989eec7c6767a57639464bf1b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=406b6e36d8ed1d5989eec7c67…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Dec 22 09:08:30 2009 +0100 wininet: Free per-thread error info upon exit from an async procedure. Found by Valgrind. --- dlls/wininet/internet.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index dfbe032..969c079 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3132,8 +3132,13 @@ static DWORD CALLBACK INTERNET_WorkerThreadFunc(LPVOID lpvParam) HeapFree(GetProcessHeap(), 0, lpRequest); workRequest.asyncproc(&workRequest); - WININET_Release( workRequest.hdr ); + + if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES) + { + HeapFree(GetProcessHeap(), 0, TlsGetValue(g_dwTlsErrIndex)); + TlsSetValue(g_dwTlsErrIndex, NULL); + } return TRUE; }
1
0
0
0
Nikolay Sivov : kernel32: Fix a leak in ReplaceFileW.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 14058ccf2553f9deb6fe8c6b58624938d5dc5cd7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=14058ccf2553f9deb6fe8c6b5…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Dec 22 03:13:53 2009 +0300 kernel32: Fix a leak in ReplaceFileW. --- dlls/kernel32/file.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 8932dea..5c7ba20 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -1593,6 +1593,7 @@ BOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileNa NULL, 0); if (status == STATUS_SUCCESS) status = wine_nt_to_unix_file_name(&nt_backup_name, &unix_backup_name, FILE_OPEN_IF, FALSE); + RtlFreeUnicodeString(&nt_backup_name); if (status != STATUS_SUCCESS) { error = RtlNtStatusToDosError(status);
1
0
0
0
Nikolay Sivov : comctl32/updown: Simplify buddy subclassing using SetWindowSubclass chain.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 6cc141ff59d7da8788413e0139ab5900d36ab693 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6cc141ff59d7da8788413e013…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Dec 22 02:42:31 2009 +0300 comctl32/updown: Simplify buddy subclassing using SetWindowSubclass chain. --- dlls/comctl32/tests/updown.c | 3 +- dlls/comctl32/updown.c | 50 ++++++++++++++++-------------------------- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c index c2a5a4a..dacc460 100644 --- a/dlls/comctl32/tests/updown.c +++ b/dlls/comctl32/tests/updown.c @@ -481,8 +481,7 @@ static void test_updown_buddy(void) if (pSetWindowSubclass) { /* updown uses subclass helpers for buddy on >5.8x systems */ - todo_wine - ok(GetPropA(buddy, "CC32SubclassInfo") != NULL, "Expected CC32SubclassInfo property\n"); + ok(GetPropA(buddy, "CC32SubclassInfo") != NULL, "Expected CC32SubclassInfo property\n"); } DestroyWindow(updown); diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index f6b240a..127bb40 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -100,9 +100,9 @@ typedef struct #define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongPtrW (hwnd,0)) #define COUNT_OF(a) (sizeof(a)/sizeof(a[0])) -static const WCHAR BUDDY_UPDOWN_HWND[] = { 'b', 'u', 'd', 'd', 'y', 'U', 'p', 'D', 'o', 'w', 'n', 'H', 'W', 'N', 'D', 0 }; -static const WCHAR BUDDY_SUPERCLASS_WNDPROC[] = { 'b', 'u', 'd', 'd', 'y', 'S', 'u', 'p', 'p', 'e', 'r', - 'C', 'l', 'a', 's', 's', 'W', 'n', 'd', 'P', 'r', 'o', 'c', 0 }; +/* id used for SetWindowSubclass */ +#define BUDDY_SUBCLASSID 1 + static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action); /*********************************************************************** @@ -518,14 +518,13 @@ static LRESULT UPDOWN_MouseWheel(UPDOWN_INFO *infoPtr, WPARAM wParam) * control. */ static LRESULT CALLBACK -UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, + UINT_PTR uId, DWORD_PTR ref_data) { - WNDPROC superClassWndProc = (WNDPROC)GetPropW(hwnd, BUDDY_SUPERCLASS_WNDPROC); - HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND); - UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr(upDownHwnd); + UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr((HWND)ref_data); - TRACE("hwnd=%p, wndProc=%p, uMsg=%04x, wParam=%08lx, lParam=%08lx\n", - hwnd, superClassWndProc, uMsg, wParam, lParam); + TRACE("hwnd=%p, uMsg=%04x, wParam=%08lx, lParam=%08lx\n", + hwnd, uMsg, wParam, lParam); switch(uMsg) { @@ -542,7 +541,7 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; } - return CallWindowProcW( superClassWndProc, hwnd, uMsg, wParam, lParam); + return DefSubclassProc(hwnd, uMsg, wParam, lParam); } /*********************************************************************** @@ -559,7 +558,6 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud) { RECT budRect; /* new coord for the buddy */ int x, width; /* new x position and width for the up-down */ - WNDPROC baseWndProc; WCHAR buddyClass[40]; HWND ret; @@ -567,20 +565,15 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud) ret = infoPtr->Buddy; - /* there is already a body assigned */ - if (infoPtr->Buddy) RemovePropW(infoPtr->Buddy, BUDDY_UPDOWN_HWND); - - if(!IsWindow(bud)) - bud = 0; + /* there is already a buddy assigned */ + if (infoPtr->Buddy) RemoveWindowSubclass(infoPtr->Buddy, UPDOWN_Buddy_SubclassProc, + BUDDY_SUBCLASSID); + if (!IsWindow(bud)) bud = NULL; /* Store buddy window handle */ infoPtr->Buddy = bud; if(bud) { - - /* keep upDown ctrl hwnd in a buddy property */ - SetPropW( bud, BUDDY_UPDOWN_HWND, infoPtr->Self); - /* Store buddy window class type */ infoPtr->BuddyType = BUDDY_TYPE_UNKNOWN; if (GetClassNameW(bud, buddyClass, COUNT_OF(buddyClass))) { @@ -590,15 +583,9 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud) infoPtr->BuddyType = BUDDY_TYPE_LISTBOX; } - if (infoPtr->dwStyle & UDS_ARROWKEYS) { - /* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property - when we reset the upDown ctrl buddy to another buddy because it is not - good to break the window proc chain. */ - if (!GetPropW(bud, BUDDY_SUPERCLASS_WNDPROC)) { - baseWndProc = (WNDPROC)SetWindowLongPtrW(bud, GWLP_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc); - SetPropW(bud, BUDDY_SUPERCLASS_WNDPROC, baseWndProc); - } - } + if (infoPtr->dwStyle & UDS_ARROWKEYS) + SetWindowSubclass(bud, UPDOWN_Buddy_SubclassProc, BUDDY_SUBCLASSID, + (DWORD_PTR)infoPtr->Self); /* Get the rect of the buddy relative to its parent */ GetWindowRect(infoPtr->Buddy, &budRect); @@ -892,8 +879,9 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L case WM_DESTROY: Free (infoPtr->AccelVect); - if(infoPtr->Buddy) RemovePropW(infoPtr->Buddy, BUDDY_UPDOWN_HWND); - + if (infoPtr->Buddy) + RemoveWindowSubclass(infoPtr->Buddy, UPDOWN_Buddy_SubclassProc, + BUDDY_SUBCLASSID); Free (infoPtr); SetWindowLongPtrW (hwnd, 0, 0); theme = GetWindowTheme (hwnd);
1
0
0
0
Nikolay Sivov : comctl32/tests: Use win_skip() while skipping subclass tests.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 705aee525ab60cbb0f4356bf5f43560636ead99b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=705aee525ab60cbb0f4356bf5…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Dec 22 01:57:20 2009 +0300 comctl32/tests: Use win_skip() while skipping subclass tests. --- dlls/comctl32/tests/subclass.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c index f4d0b72..f5a74ba 100644 --- a/dlls/comctl32/tests/subclass.c +++ b/dlls/comctl32/tests/subclass.c @@ -293,7 +293,10 @@ START_TEST(subclass) pDefSubclassProc = (void*)GetProcAddress(hdll, (LPSTR)413); if(!pSetWindowSubclass || !pRemoveWindowSubclass || !pDefSubclassProc) + { + win_skip("SetWindowSubclass and friends are not available\n"); return; + } if(!RegisterWindowClasses()) assert(0);
1
0
0
0
Nikolay Sivov : comctl32/tests: Some tests for buddy procedure subclassing.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 48d42d4a93194868b5f0a02587b4b95ca789b8ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48d42d4a93194868b5f0a0258…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Dec 22 01:54:06 2009 +0300 comctl32/tests: Some tests for buddy procedure subclassing. --- dlls/comctl32/tests/updown.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 38 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c index df3fbbf..c2a5a4a 100644 --- a/dlls/comctl32/tests/updown.c +++ b/dlls/comctl32/tests/updown.c @@ -61,6 +61,8 @@ static HWND parent_wnd, g_edit; +static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); + static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; static const struct message add_updown_with_edit_seq[] = { @@ -436,7 +438,9 @@ static void test_updown_pos32(void) static void test_updown_buddy(void) { - HWND updown, buddyReturn; + HWND updown, buddyReturn, buddy; + WNDPROC proc; + DWORD style; updown = create_updown_control(UDS_ALIGNRIGHT, g_edit); @@ -455,6 +459,35 @@ static void test_updown_buddy(void) ok_sequence(sequences, EDIT_SEQ_INDEX, add_updown_with_edit_seq, "test updown buddy_edit", FALSE); DestroyWindow(updown); + + buddy = create_edit_control(); + proc = (WNDPROC)GetWindowLongPtrA(buddy, GWLP_WNDPROC); + + updown= create_updown_control(UDS_ALIGNRIGHT, buddy); + ok(proc == (WNDPROC)GetWindowLongPtrA(buddy, GWLP_WNDPROC), "No subclassing expected\n"); + + style = GetWindowLongA(updown, GWL_STYLE); + SetWindowLongA(updown, GWL_STYLE, style | UDS_ARROWKEYS); + style = GetWindowLongA(updown, GWL_STYLE); + ok(style & UDS_ARROWKEYS, "Expected UDS_ARROWKEYS\n"); + /* no subclass if UDS_ARROWKEYS set after creation */ + ok(proc == (WNDPROC)GetWindowLongPtrA(buddy, GWLP_WNDPROC), "No subclassing expected\n"); + + DestroyWindow(updown); + + updown= create_updown_control(UDS_ALIGNRIGHT | UDS_ARROWKEYS, buddy); + ok(proc != (WNDPROC)GetWindowLongPtrA(buddy, GWLP_WNDPROC), "Subclassing expected\n"); + + if (pSetWindowSubclass) + { + /* updown uses subclass helpers for buddy on >5.8x systems */ + todo_wine + ok(GetPropA(buddy, "CC32SubclassInfo") != NULL, "Expected CC32SubclassInfo property\n"); + } + + DestroyWindow(updown); + + DestroyWindow(buddy); } static void test_updown_base(void) @@ -687,6 +720,10 @@ static void test_UDS_SETBUDDYINT(void) START_TEST(updown) { + HMODULE mod = GetModuleHandleA("comctl32.dll"); + + pSetWindowSubclass = (void*)GetProcAddress(mod, (LPSTR)410); + InitCommonControls(); init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
1
0
0
0
Nikolay Sivov : comctl32/tests: Add ability to create any number of edit buddies.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 8fc96f20a33605a56e0ef72059c450eef3821e85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8fc96f20a33605a56e0ef7205…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Tue Dec 22 00:37:41 2009 +0300 comctl32/tests: Add ability to create any number of edit buddies. --- dlls/comctl32/tests/updown.c | 71 +++++++++++++++++++++-------------------- 1 files changed, 36 insertions(+), 35 deletions(-) diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c index 236706d..df3fbbf 100644 --- a/dlls/comctl32/tests/updown.c +++ b/dlls/comctl32/tests/updown.c @@ -59,7 +59,7 @@ #define EDIT_SEQ_INDEX 1 #define UPDOWN_SEQ_INDEX 2 -static HWND parent_wnd, edit; +static HWND parent_wnd, g_edit; static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; @@ -242,19 +242,20 @@ static LRESULT WINAPI edit_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, static HWND create_edit_control(void) { WNDPROC oldproc; + HWND hwnd; RECT rect; GetClientRect(parent_wnd, &rect); - edit = CreateWindowExA(0, "EDIT", NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, + hwnd = CreateWindowExA(0, WC_EDITA, NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, rect.right, rect.bottom, parent_wnd, NULL, GetModuleHandleA(NULL), NULL); - if (!edit) return NULL; + if (!hwnd) return NULL; - oldproc = (WNDPROC)SetWindowLongPtrA(edit, GWLP_WNDPROC, + oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)edit_subclass_proc); - SetWindowLongPtrA(edit, GWLP_USERDATA, (LONG_PTR)oldproc); + SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); - return edit; + return hwnd; } static LRESULT WINAPI updown_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -280,7 +281,7 @@ static LRESULT WINAPI updown_subclass_proc(HWND hwnd, UINT message, WPARAM wPara return ret; } -static HWND create_updown_control(DWORD style) +static HWND create_updown_control(DWORD style, HWND buddy) { WNDPROC oldproc; HWND updown; @@ -288,7 +289,7 @@ static HWND create_updown_control(DWORD style) GetClientRect(parent_wnd, &rect); updown = CreateUpDownControl(WS_CHILD | WS_BORDER | WS_VISIBLE | style, - 0, 0, rect.right, rect.bottom, parent_wnd, 1, GetModuleHandleA(NULL), edit, + 0, 0, rect.right, rect.bottom, parent_wnd, 1, GetModuleHandleA(NULL), buddy, 100, 0, 50); if (!updown) return NULL; @@ -304,7 +305,7 @@ static void test_updown_pos(void) HWND updown; int r; - updown = create_updown_control(UDS_ALIGNRIGHT); + updown = create_updown_control(UDS_ALIGNRIGHT, g_edit); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -365,7 +366,7 @@ static void test_updown_pos32(void) int r; int low, high; - updown = create_updown_control(UDS_ALIGNRIGHT); + updown = create_updown_control(UDS_ALIGNRIGHT, g_edit); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -437,18 +438,18 @@ static void test_updown_buddy(void) { HWND updown, buddyReturn; - updown = create_updown_control(UDS_ALIGNRIGHT); + updown = create_updown_control(UDS_ALIGNRIGHT, g_edit); flush_sequences(sequences, NUM_MSG_SEQUENCES); buddyReturn = (HWND)SendMessage(updown, UDM_GETBUDDY, 0 , 0 ); - ok(buddyReturn == edit, "Expected edit handle\n"); + ok(buddyReturn == g_edit, "Expected edit handle\n"); - buddyReturn = (HWND)SendMessage(updown, UDM_SETBUDDY, (WPARAM) edit, 0); - ok(buddyReturn == edit, "Expected edit handle\n"); + buddyReturn = (HWND)SendMessage(updown, UDM_SETBUDDY, (WPARAM) g_edit, 0); + ok(buddyReturn == g_edit, "Expected edit handle\n"); buddyReturn = (HWND)SendMessage(updown, UDM_GETBUDDY, 0 , 0 ); - ok(buddyReturn == edit, "Expected edit handle\n"); + ok(buddyReturn == g_edit, "Expected edit handle\n"); ok_sequence(sequences, UPDOWN_SEQ_INDEX, test_updown_buddy_seq, "test updown buddy", TRUE); ok_sequence(sequences, EDIT_SEQ_INDEX, add_updown_with_edit_seq, "test updown buddy_edit", FALSE); @@ -462,7 +463,7 @@ static void test_updown_base(void) int r; CHAR text[10]; - updown = create_updown_control(UDS_ALIGNRIGHT); + updown = create_updown_control(UDS_ALIGNRIGHT, g_edit); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -499,18 +500,18 @@ static void test_updown_base(void) DestroyWindow(updown); /* switch base with buddy attached */ - updown = create_updown_control(UDS_SETBUDDYINT | UDS_ALIGNRIGHT); + updown = create_updown_control(UDS_SETBUDDYINT | UDS_ALIGNRIGHT, g_edit); r = SendMessage(updown, UDM_SETPOS, 0, 10); expect(50, r); - GetWindowTextA(edit, text, sizeof(text)/sizeof(CHAR)); + GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); ok(lstrcmpA(text, "10") == 0, "Expected '10', got '%s'\n", text); r = SendMessage(updown, UDM_SETBASE, 16, 0); expect(10, r); - GetWindowTextA(edit, text, sizeof(text)/sizeof(CHAR)); + GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); /* FIXME: currently hex output isn't properly formatted, but for this test only change from initial text matters */ ok(lstrcmpA(text, "10") != 0, "Expected '0x000A', got '%s'\n", text); @@ -523,7 +524,7 @@ static void test_updown_unicode(void) HWND updown; int r; - updown = create_updown_control(UDS_ALIGNRIGHT); + updown = create_updown_control(UDS_ALIGNRIGHT, g_edit); flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -563,14 +564,14 @@ static void test_updown_create(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); - updown = create_updown_control(UDS_ALIGNRIGHT); + updown = create_updown_control(UDS_ALIGNRIGHT, g_edit); ok(updown != NULL, "Failed to create updown control\n"); ok_sequence(sequences, PARENT_SEQ_INDEX, add_updown_to_parent_seq, "add updown control to parent", TRUE); ok_sequence(sequences, EDIT_SEQ_INDEX, add_updown_with_edit_seq, "add updown control with edit", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); - GetWindowTextA(edit, text, MAX_PATH); + GetWindowTextA(g_edit, text, MAX_PATH); ok(lstrlenA(text) == 0, "Expected empty string\n"); ok_sequence(sequences, EDIT_SEQ_INDEX, get_edit_text_seq, "get edit text", FALSE); @@ -634,44 +635,44 @@ static void test_UDS_SETBUDDYINT(void) /* cleanup buddy */ text[0] = '\0'; - SetWindowTextA(edit, text); + SetWindowTextA(g_edit, text); /* creating without UDS_SETBUDDYINT */ - updown = create_updown_control(UDS_ALIGNRIGHT); + updown = create_updown_control(UDS_ALIGNRIGHT, g_edit); /* try to set UDS_SETBUDDYINT after creation */ style = GetWindowLongA(updown, GWL_STYLE); SetWindowLongA(updown, GWL_STYLE, style | UDS_SETBUDDYINT); style = GetWindowLongA(updown, GWL_STYLE); ok(style & UDS_SETBUDDYINT, "Expected UDS_SETBUDDY to be set\n"); SendMessage(updown, UDM_SETPOS, 0, 20); - GetWindowTextA(edit, text, sizeof(text)/sizeof(CHAR)); + GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); ok(lstrlenA(text) == 0, "Expected empty string\n"); DestroyWindow(updown); /* creating with UDS_SETBUDDYINT */ - updown = create_updown_control(UDS_SETBUDDYINT | UDS_ALIGNRIGHT); - GetWindowTextA(edit, text, sizeof(text)/sizeof(CHAR)); + updown = create_updown_control(UDS_SETBUDDYINT | UDS_ALIGNRIGHT, g_edit); + GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); /* 50 is initial value here */ ok(lstrcmpA(text, "50") == 0, "Expected '50', got '%s'\n", text); /* now remove style flag */ style = GetWindowLongA(updown, GWL_STYLE); SetWindowLongA(updown, GWL_STYLE, style & ~UDS_SETBUDDYINT); SendMessage(updown, UDM_SETPOS, 0, 20); - GetWindowTextA(edit, text, sizeof(text)/sizeof(CHAR)); + GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); ok(lstrcmpA(text, "20") == 0, "Expected '20', got '%s'\n", text); /* set edit text directly, check position */ strcpy(text, "10"); - SetWindowTextA(edit, text); + SetWindowTextA(g_edit, text); ret = SendMessageA(updown, UDM_GETPOS, 0, 0); expect(10, ret); strcpy(text, "11"); - SetWindowTextA(edit, text); + SetWindowTextA(g_edit, text); ret = SendMessageA(updown, UDM_GETPOS, 0, 0); expect(11, LOWORD(ret)); expect(0, HIWORD(ret)); /* set to invalid value */ strcpy(text, "21st"); - SetWindowTextA(edit, text); + SetWindowTextA(g_edit, text); ret = SendMessageA(updown, UDM_GETPOS, 0, 0); expect(11, LOWORD(ret)); expect(TRUE, HIWORD(ret)); @@ -679,7 +680,7 @@ static void test_UDS_SETBUDDYINT(void) style = GetWindowLongA(updown, GWL_STYLE); SetWindowLongA(updown, GWL_STYLE, style | UDS_SETBUDDYINT); SendMessage(updown, UDM_SETPOS, 0, 30); - GetWindowTextA(edit, text, sizeof(text)/sizeof(CHAR)); + GetWindowTextA(g_edit, text, sizeof(text)/sizeof(CHAR)); ok(lstrcmpA(text, "30") == 0, "Expected '30', got '%s'\n", text); DestroyWindow(updown); } @@ -691,8 +692,8 @@ START_TEST(updown) parent_wnd = create_parent_window(); ok(parent_wnd != NULL, "Failed to create parent window!\n"); - edit = create_edit_control(); - ok(edit != NULL, "Failed to create edit control\n"); + g_edit = create_edit_control(); + ok(g_edit != NULL, "Failed to create edit control\n"); test_updown_create(); test_updown_pos(); @@ -702,6 +703,6 @@ START_TEST(updown) test_updown_unicode(); test_UDS_SETBUDDYINT(); - DestroyWindow(edit); + DestroyWindow(g_edit); DestroyWindow(parent_wnd); }
1
0
0
0
Nikolay Sivov : kernel32: Fix SearchPath parameter validation with tests.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 6d270a1d48c193a40c5145758053b6083627fb2f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6d270a1d48c193a40c5145758…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Dec 21 23:00:38 2009 +0300 kernel32: Fix SearchPath parameter validation with tests. --- dlls/kernel32/path.c | 16 ++++++++- dlls/kernel32/tests/path.c | 77 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 7618dc9..a304cb2 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -758,6 +758,12 @@ DWORD WINAPI SearchPathW( LPCWSTR path, LPCWSTR name, LPCWSTR ext, DWORD buflen, { DWORD ret = 0; + if (!name || !name[0]) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + /* If the name contains an explicit path, ignore the path */ if (contains_pathW(name)) @@ -827,11 +833,17 @@ DWORD WINAPI SearchPathW( LPCWSTR path, LPCWSTR name, LPCWSTR ext, DWORD buflen, DWORD WINAPI SearchPathA( LPCSTR path, LPCSTR name, LPCSTR ext, DWORD buflen, LPSTR buffer, LPSTR *lastpart ) { - WCHAR *pathW = NULL, *nameW = NULL, *extW = NULL; + WCHAR *pathW = NULL, *nameW, *extW = NULL; WCHAR bufferW[MAX_PATH]; DWORD ret; - if (!name || !(nameW = FILE_name_AtoW( name, FALSE ))) return 0; + if (!name) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + if (!(nameW = FILE_name_AtoW( name, FALSE ))) return 0; if (path && !(pathW = FILE_name_AtoW( path, TRUE ))) return 0; if (ext && !(extW = FILE_name_AtoW( ext, TRUE ))) diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c index 4641c5e..4c0aac5 100644 --- a/dlls/kernel32/tests/path.c +++ b/dlls/kernel32/tests/path.c @@ -57,6 +57,9 @@ static DWORD (WINAPI *pGetLongPathNameW)(LPWSTR,LPWSTR,DWORD); static BOOL (WINAPI *pNeedCurrentDirectoryForExePathA)(LPCSTR); static BOOL (WINAPI *pNeedCurrentDirectoryForExePathW)(LPCWSTR); +static DWORD (WINAPI *pSearchPathA)(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*); +static DWORD (WINAPI *pSearchPathW)(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*); + /* a structure to deal with wine todos somewhat cleanly */ typedef struct { DWORD shortlen; @@ -1456,6 +1459,76 @@ static void test_drive_letter_case(void) #undef is_upper_case_letter } +static void test_SearchPathA(void) +{ + CHAR pathA[MAX_PATH], fileA[] = "", buffA[MAX_PATH]; + CHAR *ptrA = NULL; + DWORD ret; + + if (!pSearchPathA) + { + win_skip("SearchPathA isn't available\n"); + return; + } + + GetWindowsDirectoryA(pathA, sizeof(pathA)/sizeof(CHAR)); + + /* NULL filename */ + SetLastError(0xdeadbeef); + ret = pSearchPathA(pathA, NULL, NULL, sizeof(buffA)/sizeof(CHAR), buffA, &ptrA); + ok(ret == 0, "Expected failure, got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); + + /* empty filename */ + SetLastError(0xdeadbeef); + ret = pSearchPathA(pathA, fileA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, &ptrA); + ok(ret == 0, "Expected failure, got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER || + broken(GetLastError() == ERROR_FILE_NOT_FOUND) /* win9x */, + "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); +} + +static void test_SearchPathW(void) +{ + WCHAR pathW[MAX_PATH], fileW[] = { 0 }, buffW[MAX_PATH]; + WCHAR *ptrW = NULL; + DWORD ret; + + if (!pSearchPathW) + { + win_skip("SearchPathW isn't available\n"); + return; + } + + /* SearchPathW is a stub on win9x and doesn't return sane error, + so quess if it's implemented indirectly */ + SetLastError(0xdeadbeef); + GetWindowsDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + { + win_skip("SearchPathW not implemented\n"); + return; + } + +if (0) +{ + /* NULL filename, crashes on nt4 */ + SetLastError(0xdeadbeef); + ret = pSearchPathW(pathW, NULL, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, &ptrW); + ok(ret == 0, "Expected failure, got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); +} + + /* empty filename */ + SetLastError(0xdeadbeef); + ret = pSearchPathW(pathW, fileW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, &ptrW); + ok(ret == 0, "Expected failure, got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); +} + static void init_pointers(void) { HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); @@ -1465,6 +1538,8 @@ static void init_pointers(void) MAKEFUNC(GetLongPathNameW); MAKEFUNC(NeedCurrentDirectoryForExePathA); MAKEFUNC(NeedCurrentDirectoryForExePathW); + MAKEFUNC(SearchPathA); + MAKEFUNC(SearchPathW); #undef MAKEFUNC } @@ -1493,4 +1568,6 @@ START_TEST(path) test_NeedCurrentDirectoryForExePathA(); test_NeedCurrentDirectoryForExePathW(); test_drive_letter_case(); + test_SearchPathA(); + test_SearchPathW(); }
1
0
0
0
Nikolay Sivov : kernel32/tests: Init pointers in common way, add some win_skip() while skipping.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 08a778c568f628c1ac366f06100122fbb28f8d6f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=08a778c568f628c1ac366f061…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Dec 21 20:21:16 2009 +0300 kernel32/tests: Init pointers in common way, add some win_skip() while skipping. --- dlls/kernel32/tests/path.c | 46 ++++++++++++++++++++++++++----------------- 1 files changed, 28 insertions(+), 18 deletions(-) diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c index 1c899c8..4641c5e 100644 --- a/dlls/kernel32/tests/path.c +++ b/dlls/kernel32/tests/path.c @@ -1323,6 +1323,12 @@ static void test_GetWindowsDirectory(void) static void test_NeedCurrentDirectoryForExePathA(void) { + if (!pNeedCurrentDirectoryForExePathA) + { + win_skip("NeedCurrentDirectoryForExePathA is not available\n"); + return; + } + /* Crashes in Windows */ if (0) ok(pNeedCurrentDirectoryForExePathA(NULL), "returned FALSE for NULL\n"); @@ -1344,6 +1350,12 @@ static void test_NeedCurrentDirectoryForExePathW(void) const WCHAR fullpath[] = {'c', ':', '\\', 0}; const WCHAR cmdname[] = {'c', 'm', 'd', '.', 'e', 'x', 'e', 0}; + if (!pNeedCurrentDirectoryForExePathW) + { + win_skip("NeedCurrentDirectoryForExePathW is not available\n"); + return; + } + /* Crashes in Windows */ if (0) ok(pNeedCurrentDirectoryForExePathW(NULL), "returned FALSE for NULL\n"); @@ -1444,19 +1456,23 @@ static void test_drive_letter_case(void) #undef is_upper_case_letter } +static void init_pointers(void) +{ + HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); + +#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hKernel32, #f)) + MAKEFUNC(GetLongPathNameA); + MAKEFUNC(GetLongPathNameW); + MAKEFUNC(NeedCurrentDirectoryForExePathA); + MAKEFUNC(NeedCurrentDirectoryForExePathW); +#undef MAKEFUNC +} + START_TEST(path) { CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive; - pGetLongPathNameA = (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"), - "GetLongPathNameA" ); - pGetLongPathNameW = (void*)GetProcAddress(GetModuleHandleA("kernel32.dll") , - "GetLongPathNameW" ); - pNeedCurrentDirectoryForExePathA = - (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"), - "NeedCurrentDirectoryForExePathA" ); - pNeedCurrentDirectoryForExePathW = - (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"), - "NeedCurrentDirectoryForExePathW" ); + + init_pointers(); /* Report only once */ if (!pGetLongPathNameA) @@ -1474,13 +1490,7 @@ START_TEST(path) test_GetShortPathNameW(); test_GetSystemDirectory(); test_GetWindowsDirectory(); - if (pNeedCurrentDirectoryForExePathA) - { - test_NeedCurrentDirectoryForExePathA(); - } - if (pNeedCurrentDirectoryForExePathW) - { - test_NeedCurrentDirectoryForExePathW(); - } + test_NeedCurrentDirectoryForExePathA(); + test_NeedCurrentDirectoryForExePathW(); test_drive_letter_case(); }
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
124
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Results per page:
10
25
50
100
200