ReactOS.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
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
List overview
Download
Ros-diffs
February 2017
----- 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
ros-diffs@reactos.org
13 participants
353 discussions
Start a n
N
ew thread
[khornicek] 73776: [REGEDIT] - Fix a possible null pointer dereference. CID 731448 - Check string length before copying into a fixed size buffer. CID 515207 - Bail out of _CmdWndProc if keyPath is ...
by khornicek@svn.reactos.org
Author: khornicek Date: Sat Feb 11 16:02:49 2017 New Revision: 73776 URL:
http://svn.reactos.org/svn/reactos?rev=73776&view=rev
Log: [REGEDIT] - Fix a possible null pointer dereference. CID 731448 - Check string length before copying into a fixed size buffer. CID 515207 - Bail out of _CmdWndProc if keyPath is null. CID 1102164 - Use strsafe functions. CID 1102477 Modified: trunk/reactos/base/applications/regedit/edit.c trunk/reactos/base/applications/regedit/find.c trunk/reactos/base/applications/regedit/framewnd.c trunk/reactos/base/applications/regedit/settings.c Modified: trunk/reactos/base/applications/regedit/edit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/edit.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/edit.c [iso-8859-1] Sat Feb 11 16:02:49 2017 @@ -1079,7 +1079,7 @@ editValueName = valueName; lRet = RegQueryValueExW(hKey, valueName, 0, &type, 0, &valueDataLen); - if (lRet != ERROR_SUCCESS && (!wcscmp(valueName, L"") || valueName == NULL)) + if (lRet != ERROR_SUCCESS && (valueName == NULL || !valueName[0])) { lRet = ERROR_SUCCESS; /* Allow editing of (Default) values which don't exist */ type = REG_SZ; Modified: trunk/reactos/base/applications/regedit/find.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/find.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/find.c [iso-8859-1] Sat Feb 11 16:02:49 2017 @@ -150,6 +150,9 @@ if (DoEvents()) return FALSE; + if(wcslen(pszSubKey) >= _countof(szSubKey)) + return FALSE; + wcscpy(szSubKey, pszSubKey); hSubKey = NULL; Modified: trunk/reactos/base/applications/regedit/framewnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] Sat Feb 11 16:02:49 2017 @@ -1125,11 +1125,13 @@ keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot); valueName = GetValueName(g_pChildWnd->hListWnd, -1); - if (keyPath) - { - lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey); - if (lRet != ERROR_SUCCESS) hKey = 0; - } + + if (!keyPath) + return TRUE; + + lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey); + if (lRet != ERROR_SUCCESS) + hKey = 0; switch (LOWORD(wParam)) { Modified: trunk/reactos/base/applications/regedit/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/settings.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/settings.c [iso-8859-1] Sat Feb 11 16:02:49 2017 @@ -20,6 +20,7 @@ */ #include "regedit.h" +#include <strsafe.h> const WCHAR g_szGeneralRegKey[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit"; @@ -129,11 +130,14 @@ rootName = get_root_key_name(hRootKey); /* Load "My Computer" string and complete it */ - LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer)); - wcscat(szBuffer, L"\\"); wcscat(szBuffer, rootName); - wcscat(szBuffer, L"\\"); wcscat(szBuffer, keyPath); - - RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE)szBuffer, (DWORD)wcslen(szBuffer) * sizeof(WCHAR)); + if (LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer)) && + SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\")) && + SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), rootName)) && + SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), L"\\")) && + SUCCEEDED(StringCbCatW(szBuffer, sizeof(szBuffer), keyPath))) + { + RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE)szBuffer, (DWORD)wcslen(szBuffer) * sizeof(WCHAR)); + } } /* Get statusbar settings */
7 years, 10 months
1
0
0
0
[tfaber] 73775: [CRT] - Add missing _sgdt declaration in intrin.h
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Feb 11 15:55:56 2017 New Revision: 73775 URL:
http://svn.reactos.org/svn/reactos?rev=73775&view=rev
Log: [CRT] - Add missing _sgdt declaration in intrin.h Modified: trunk/reactos/sdk/include/crt/intrin.h Modified: trunk/reactos/sdk/include/crt/intrin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/crt/intrin.h?r…
============================================================================== --- trunk/reactos/sdk/include/crt/intrin.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/crt/intrin.h [iso-8859-1] Sat Feb 11 15:55:56 2017 @@ -125,6 +125,7 @@ unsigned __int64 __readpmc(unsigned long); unsigned long __segmentlimit(unsigned long); void __sidt(void *); +void _sgdt(void *); void __stosb(unsigned char *, unsigned char, size_t); void __stosd(unsigned long *, unsigned long, size_t); void __stosw(unsigned short *, unsigned short, size_t);
7 years, 10 months
1
0
0
0
[tfaber] 73774: [IP] - Apparently MIN_TRACE isn't enough to get printed... CORE-10715
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Feb 11 13:36:05 2017 New Revision: 73774 URL:
http://svn.reactos.org/svn/reactos?rev=73774&view=rev
Log: [IP] - Apparently MIN_TRACE isn't enough to get printed... CORE-10715 Modified: trunk/reactos/sdk/lib/drivers/ip/transport/tcp/if.c Modified: trunk/reactos/sdk/lib/drivers/ip/transport/tcp/if.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/drivers/ip/transpo…
============================================================================== --- trunk/reactos/sdk/lib/drivers/ip/transport/tcp/if.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/drivers/ip/transport/tcp/if.c [iso-8859-1] Sat Feb 11 13:36:05 2017 @@ -52,9 +52,8 @@ if (p->tot_len != p->len || Packet.TotalSize != p->len) { - TI_DbgPrint(MIN_TRACE, - ("TCPSendDataCallback tot_len = %u, len = %u, TotalSize = %u\n", - p->tot_len, p->len, Packet.TotalSize)); + DbgPrint("TCPSendDataCallback: tot_len = %u, len = %u, TotalSize = %u\n", + p->tot_len, p->len, Packet.TotalSize); ASSERT(p->tot_len == p->len); ASSERT(Packet.TotalSize == p->len); }
7 years, 10 months
1
0
0
0
[gadamopoulos] 73773: [USER32] -class.c: Try to use 4 space indentation. Convert tabs to spaces.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sat Feb 11 12:18:06 2017 New Revision: 73773 URL:
http://svn.reactos.org/svn/reactos?rev=73773&view=rev
Log: [USER32] -class.c: Try to use 4 space indentation. Convert tabs to spaces. Modified: trunk/reactos/win32ss/user/user32/windows/class.c Modified: trunk/reactos/win32ss/user/user32/windows/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/class.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/class.c [iso-8859-1] Sat Feb 11 12:18:06 2017 @@ -37,80 +37,80 @@ HANDLE *pContext, BOOL bAnsi) { - NTSTATUS Status; - UNICODE_STRING SectionName; - WCHAR SeactionNameBuf[MAX_PATH] = {0}; - ACTCTX_SECTION_KEYED_DATA KeyedData = { sizeof(KeyedData) }; - - if (IS_ATOM(lpszClass)) - { - SectionName.Buffer = (LPWSTR)&SeactionNameBuf; - SectionName.MaximumLength = sizeof(SeactionNameBuf); - if(!NtUserGetAtomName(LOWORD((DWORD_PTR)lpszClass), &SectionName)) - { - return NULL; - } - } - else - { - if (bAnsi) - { - RtlCreateUnicodeStringFromAsciiz(&SectionName, (LPSTR)lpszClass); - } - else - { - RtlInitUnicodeString(&SectionName, lpszClass); - } - } - Status = RtlFindActivationContextSectionString( FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, - NULL, - ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, - &SectionName, - &KeyedData ); - - if (NT_SUCCESS(Status) && KeyedData.ulDataFormatVersion == 1) - { - struct dll_redirect *dll = KeyedData.lpSectionBase; - - if (plpLibFileName) *plpLibFileName = dll->name; - - if (lpszMenuName) - { - WCHAR * mnubuf; - LPWSTR mnuNameW; - LPSTR mnuNameA; - int len = 0; - struct entity *entity = KeyedData.lpData; - - FIXME("actctx: Needs to support menu name from redirected class!"); - - if (entity->clsid) - { - mnubuf = entity->clsid; - if (bAnsi) + NTSTATUS Status; + UNICODE_STRING SectionName; + WCHAR SeactionNameBuf[MAX_PATH] = {0}; + ACTCTX_SECTION_KEYED_DATA KeyedData = { sizeof(KeyedData) }; + + if (IS_ATOM(lpszClass)) + { + SectionName.Buffer = (LPWSTR)&SeactionNameBuf; + SectionName.MaximumLength = sizeof(SeactionNameBuf); + if(!NtUserGetAtomName(LOWORD((DWORD_PTR)lpszClass), &SectionName)) + { + return NULL; + } + } + else + { + if (bAnsi) + { + RtlCreateUnicodeStringFromAsciiz(&SectionName, (LPSTR)lpszClass); + } + else + { + RtlInitUnicodeString(&SectionName, lpszClass); + } + } + Status = RtlFindActivationContextSectionString( FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, + NULL, + ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, + &SectionName, + &KeyedData ); + + if (NT_SUCCESS(Status) && KeyedData.ulDataFormatVersion == 1) + { + struct dll_redirect *dll = KeyedData.lpSectionBase; + + if (plpLibFileName) *plpLibFileName = dll->name; + + if (lpszMenuName) + { + WCHAR * mnubuf; + LPWSTR mnuNameW; + LPSTR mnuNameA; + int len = 0; + struct entity *entity = KeyedData.lpData; + + FIXME("actctx: Needs to support menu name from redirected class!"); + + if (entity->clsid) { - mnuNameA = (LPSTR)lpszMenuName; - RtlUnicodeToMultiByteN( mnuNameA, 255, (PULONG)&len, mnubuf, strlenW(mnubuf) * sizeof(WCHAR) ); - mnuNameA[len] = 0; + mnubuf = entity->clsid; + if (bAnsi) + { + mnuNameA = (LPSTR)lpszMenuName; + RtlUnicodeToMultiByteN( mnuNameA, 255, (PULONG)&len, mnubuf, strlenW(mnubuf) * sizeof(WCHAR) ); + mnuNameA[len] = 0; + } + else + { + mnuNameW = (LPWSTR)lpszMenuName; + len = strlenW(mnubuf) * sizeof(WCHAR); + RtlCopyMemory((void *)mnuNameW, mnubuf, len); + mnuNameW[len] = 0; + } } - else - { - mnuNameW = (LPWSTR)lpszMenuName; - len = strlenW(mnubuf) * sizeof(WCHAR); - RtlCopyMemory((void *)mnuNameW, mnubuf, len); - mnuNameW[len] = 0; - } - } - } - if (pContext) *pContext = KeyedData.hActCtx; - } - - if (!IS_ATOM(lpszClass) && bAnsi) - RtlFreeUnicodeString(&SectionName); - if (KeyedData.hActCtx) - RtlReleaseActivationContext(KeyedData.hActCtx); - - return lpszClass; + } + if (pContext) *pContext = KeyedData.hActCtx; + } + + if (!IS_ATOM(lpszClass) && bAnsi) + RtlFreeUnicodeString(&SectionName); + if (KeyedData.hActCtx) + RtlReleaseActivationContext(KeyedData.hActCtx); + + return lpszClass; } // @@ -124,57 +124,57 @@ HANDLE Contex, HMODULE * phLibModule) { - BOOL Ret; - HMODULE hLibModule; - PREGISTERCLASSNAMEW pRegisterClassNameW; - UNICODE_STRING ClassName; - WCHAR ClassNameBuf[MAX_PATH] = {0}; - RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame = { sizeof(Frame), 1 }; - - RtlActivateActivationContextUnsafeFast(&Frame, Contex); - - Ret = FALSE; - hLibModule = NULL; - - _SEH2_TRY - { - hLibModule = LoadLibraryW(lpLibFileName); - if ( hLibModule ) - { - if ((pRegisterClassNameW = (void*) GetProcAddress(hLibModule, "RegisterClassNameW"))) - { - if (IS_ATOM(pszClass)) + BOOL Ret; + HMODULE hLibModule; + PREGISTERCLASSNAMEW pRegisterClassNameW; + UNICODE_STRING ClassName; + WCHAR ClassNameBuf[MAX_PATH] = {0}; + RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame = { sizeof(Frame), 1 }; + + RtlActivateActivationContextUnsafeFast(&Frame, Contex); + + Ret = FALSE; + hLibModule = NULL; + + _SEH2_TRY + { + hLibModule = LoadLibraryW(lpLibFileName); + if ( hLibModule ) + { + if ((pRegisterClassNameW = (void*) GetProcAddress(hLibModule, "RegisterClassNameW"))) { - ClassName.Buffer = (LPWSTR)&ClassNameBuf; - ClassName.MaximumLength = sizeof(ClassNameBuf); - if (!NtUserGetAtomName(LOWORD((DWORD_PTR)pszClass), &ClassName)) - { - _SEH2_YIELD(goto Error_Exit); - } - pszClass = (PCWSTR)&ClassNameBuf; + if (IS_ATOM(pszClass)) + { + ClassName.Buffer = (LPWSTR)&ClassNameBuf; + ClassName.MaximumLength = sizeof(ClassNameBuf); + if (!NtUserGetAtomName(LOWORD((DWORD_PTR)pszClass), &ClassName)) + { + _SEH2_YIELD(goto Error_Exit); + } + pszClass = (PCWSTR)&ClassNameBuf; + } + Ret = pRegisterClassNameW(pszClass); } - Ret = pRegisterClassNameW(pszClass); - } - } - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - } - _SEH2_END + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END Error_Exit: - if ( Ret || !hLibModule ) - { - if ( phLibModule ) *phLibModule = hLibModule; - } - else - { - DWORD save_error = GetLastError(); - FreeLibrary(hLibModule); - SetLastError(save_error); - } - - return Ret; + if ( Ret || !hLibModule ) + { + if ( phLibModule ) *phLibModule = hLibModule; + } + else + { + DWORD save_error = GetLastError(); + FreeLibrary(hLibModule); + SetLastError(save_error); + } + + return Ret; } // @@ -228,60 +228,60 @@ HANDLE Contex, HMODULE * phLibModule) { - // Should be lpLibFileName..... - static const WCHAR comctl32W[] = {'c','o','m','c','t','l','3','2','.','d','l','l',0}; - // - PREGISTERCLASSNAMEW pRegisterClassNameW; - UNICODE_STRING ClassName; - WCHAR ClassNameBuf[MAX_PATH] = {0}; - BOOL Ret = FALSE; - HMODULE hLibModule = NULL; - - if (!IS_ATOM(pszClass) && is_comctl32_class( pszClass )) - { - _SEH2_TRY - { - hLibModule = LoadLibraryW(comctl32W); - if ( hLibModule ) - { - if ((pRegisterClassNameW = (void*) GetProcAddress(hLibModule, "RegisterClassNameW"))) - { - if (IS_ATOM(pszClass)) + // Should be lpLibFileName..... + static const WCHAR comctl32W[] = {'c','o','m','c','t','l','3','2','.','d','l','l',0}; + // + PREGISTERCLASSNAMEW pRegisterClassNameW; + UNICODE_STRING ClassName; + WCHAR ClassNameBuf[MAX_PATH] = {0}; + BOOL Ret = FALSE; + HMODULE hLibModule = NULL; + + if (!IS_ATOM(pszClass) && is_comctl32_class( pszClass )) + { + _SEH2_TRY + { + hLibModule = LoadLibraryW(comctl32W); + if ( hLibModule ) { - ClassName.Buffer = (LPWSTR)&ClassNameBuf; - ClassName.MaximumLength = sizeof(ClassNameBuf); - if (!NtUserGetAtomName(LOWORD((DWORD_PTR)pszClass), &ClassName)) - { - ERR("Error while verifying ATOM\n"); - _SEH2_YIELD(goto Error_Exit); - } - pszClass = (PCWSTR)&ClassNameBuf; + if ((pRegisterClassNameW = (void*) GetProcAddress(hLibModule, "RegisterClassNameW"))) + { + if (IS_ATOM(pszClass)) + { + ClassName.Buffer = (LPWSTR)&ClassNameBuf; + ClassName.MaximumLength = sizeof(ClassNameBuf); + if (!NtUserGetAtomName(LOWORD((DWORD_PTR)pszClass), &ClassName)) + { + ERR("Error while verifying ATOM\n"); + _SEH2_YIELD(goto Error_Exit); + } + pszClass = (PCWSTR)&ClassNameBuf; + } + Ret = pRegisterClassNameW(pszClass); + } } - Ret = pRegisterClassNameW(pszClass); - } - } - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - } - _SEH2_END + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END Error_Exit: - if ( Ret || !hLibModule ) - { - if ( phLibModule ) *phLibModule = hLibModule; - } - else - { - DWORD save_error = GetLastError(); - FreeLibrary(hLibModule); - SetLastError(save_error); - } - TRACE( "%s retrying after loading comctl32\n", debugstr_w(pszClass) ); - return Ret; - } - TRACE("NO ComCtl32 Class %S!\n",pszClass); - return FALSE; + if ( Ret || !hLibModule ) + { + if ( phLibModule ) *phLibModule = hLibModule; + } + else + { + DWORD save_error = GetLastError(); + FreeLibrary(hLibModule); + SetLastError(save_error); + } + TRACE( "%s retrying after loading comctl32\n", debugstr_w(pszClass) ); + return Ret; + } + TRACE("NO ComCtl32 Class %S!\n",pszClass); + return FALSE; } // // @@ -310,8 +310,8 @@ if (!lpwcx) { - SetLastError( ERROR_NOACCESS ); - return FALSE; + SetLastError( ERROR_NOACCESS ); + return FALSE; } if (hInstance == User32Instance) @@ -347,35 +347,35 @@ for(;;) { - Ret = NtUserGetClassInfo( hInstance, - &ClassName, - (LPWNDCLASSEXW)lpwcx, - (LPWSTR *)&pszMenuName, + Ret = NtUserGetClassInfo( hInstance, + &ClassName, + (LPWNDCLASSEXW)lpwcx, + (LPWSTR *)&pszMenuName, TRUE); - if (Ret) break; - if (!ClassFound) - { - save_error = GetLastError(); - if ( save_error == ERROR_CANNOT_FIND_WND_CLASS || - save_error == ERROR_CLASS_DOES_NOT_EXIST ) - { - ClassFound = VersionRegisterClass(ClassName.Buffer, NULL, NULL, &hLibModule); - if (ClassFound) continue; - } - } - if (hLibModule) - { - save_error = GetLastError(); - FreeLibrary(hLibModule); - SetLastError(save_error); - hLibModule = 0; - } - break; + if (Ret) break; + if (!ClassFound) + { + save_error = GetLastError(); + if ( save_error == ERROR_CANNOT_FIND_WND_CLASS || + save_error == ERROR_CLASS_DOES_NOT_EXIST ) + { + ClassFound = VersionRegisterClass(ClassName.Buffer, NULL, NULL, &hLibModule); + if (ClassFound) continue; + } + } + if (hLibModule) + { + save_error = GetLastError(); + FreeLibrary(hLibModule); + SetLastError(save_error); + hLibModule = 0; + } + break; } if (Ret) { - lpwcx->lpszClassName = lpszClass; + lpwcx->lpszClassName = lpszClass; // lpwcx->lpszMenuName = pszMenuName; } @@ -447,35 +447,35 @@ for(;;) { - Ret = NtUserGetClassInfo( hInstance, - &ClassName, - lpwcx, - &pszMenuName, - FALSE); - if (Ret) break; - if (!ClassFound) - { - save_error = GetLastError(); - if ( save_error == ERROR_CANNOT_FIND_WND_CLASS || - save_error == ERROR_CLASS_DOES_NOT_EXIST ) - { - ClassFound = VersionRegisterClass(ClassName.Buffer, NULL, NULL, &hLibModule); - if (ClassFound) continue; - } - } - if (hLibModule) - { - save_error = GetLastError(); - FreeLibrary(hLibModule); - SetLastError(save_error); - hLibModule = 0; - } - break; + Ret = NtUserGetClassInfo( hInstance, + &ClassName, + lpwcx, + &pszMenuName, + FALSE); + if (Ret) break; + if (!ClassFound) + { + save_error = GetLastError(); + if ( save_error == ERROR_CANNOT_FIND_WND_CLASS || + save_error == ERROR_CLASS_DOES_NOT_EXIST ) + { + ClassFound = VersionRegisterClass(ClassName.Buffer, NULL, NULL, &hLibModule); + if (ClassFound) continue; + } + } + if (hLibModule) + { + save_error = GetLastError(); + FreeLibrary(hLibModule); + SetLastError(save_error); + hLibModule = 0; + } + break; } if (Ret) { - lpwcx->lpszClassName = lpszClass; + lpwcx->lpszClassName = lpszClass; // lpwcx->lpszMenuName = pszMenuName; } return Ret; @@ -549,51 +549,51 @@ ULONG_PTR FASTCALL IntGetClsWndProc(PWND pWnd, PCLS Class, BOOL Ansi) { - INT i; - ULONG_PTR gcpd, Ret = 0; + INT i; + ULONG_PTR gcpd, Ret = 0; // If server side, sweep through proc list and return the client side proc. - if (Class->CSF_flags & CSF_SERVERSIDEPROC) - { // Always scan through the list due to wine class "deftest". - for ( i = FNID_FIRST; i <= FNID_SWITCH; i++) - { - if (GETPFNSERVER(i) == Class->lpfnWndProc) - { - if (Ansi) - Ret = (ULONG_PTR)GETPFNCLIENTA(i); - else - Ret = (ULONG_PTR)GETPFNCLIENTW(i); - } - } - return Ret; - } - // Set return proc. - Ret = (ULONG_PTR)Class->lpfnWndProc; - // Return the proc if one of the FnId default class type. - if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON) - { - if (Ansi) - { // If match return the right proc by type. - if (GETPFNCLIENTW(Class->fnid) == Class->lpfnWndProc) - Ret = (ULONG_PTR)GETPFNCLIENTA(Class->fnid); - } - else - { - if (GETPFNCLIENTA(Class->fnid) == Class->lpfnWndProc) - Ret = (ULONG_PTR)GETPFNCLIENTW(Class->fnid); - } - } - // Return on change or Ansi/Unicode proc equal. - if ( Ret != (ULONG_PTR)Class->lpfnWndProc || - Ansi == !!(Class->CSF_flags & CSF_ANSIPROC) ) - return Ret; - - /* We have an Ansi and Unicode swap! If Ansi create Unicode proc handle. - This will force CallWindowProc to deal with it. */ - gcpd = NtUserGetCPD( UserHMGetHandle(pWnd), - (Ansi ? UserGetCPDA2U : UserGetCPDU2A )|UserGetCPDWndtoCls, - Ret); - - return (gcpd ? gcpd : Ret); + if (Class->CSF_flags & CSF_SERVERSIDEPROC) + { // Always scan through the list due to wine class "deftest". + for ( i = FNID_FIRST; i <= FNID_SWITCH; i++) + { + if (GETPFNSERVER(i) == Class->lpfnWndProc) + { + if (Ansi) + Ret = (ULONG_PTR)GETPFNCLIENTA(i); + else + Ret = (ULONG_PTR)GETPFNCLIENTW(i); + } + } + return Ret; + } + // Set return proc. + Ret = (ULONG_PTR)Class->lpfnWndProc; + // Return the proc if one of the FnId default class type. + if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON) + { + if (Ansi) + { // If match return the right proc by type. + if (GETPFNCLIENTW(Class->fnid) == Class->lpfnWndProc) + Ret = (ULONG_PTR)GETPFNCLIENTA(Class->fnid); + } + else + { + if (GETPFNCLIENTA(Class->fnid) == Class->lpfnWndProc) + Ret = (ULONG_PTR)GETPFNCLIENTW(Class->fnid); + } + } + // Return on change or Ansi/Unicode proc equal. + if ( Ret != (ULONG_PTR)Class->lpfnWndProc || + Ansi == !!(Class->CSF_flags & CSF_ANSIPROC) ) + return Ret; + + /* We have an Ansi and Unicode swap! If Ansi create Unicode proc handle. + This will force CallWindowProc to deal with it. */ + gcpd = NtUserGetCPD( UserHMGetHandle(pWnd), + (Ansi ? UserGetCPDA2U : UserGetCPDU2A )|UserGetCPDWndtoCls, + Ret); + + return (gcpd ? gcpd : Ret); } // @@ -602,71 +602,71 @@ WNDPROC FASTCALL IntGetWndProc(PWND pWnd, BOOL Ansi) { - INT i; - WNDPROC gcpd, Ret = 0; - PCLS Class = DesktopPtrToUser(pWnd->pcls); - - if (!Class) return Ret; - - if (pWnd->state & WNDS_SERVERSIDEWINDOWPROC) - { - for ( i = FNID_FIRST; i <= FNID_SWITCH; i++) - { - if (GETPFNSERVER(i) == pWnd->lpfnWndProc) - { + INT i; + WNDPROC gcpd, Ret = 0; + PCLS Class = DesktopPtrToUser(pWnd->pcls); + + if (!Class) return Ret; + + if (pWnd->state & WNDS_SERVERSIDEWINDOWPROC) + { + for ( i = FNID_FIRST; i <= FNID_SWITCH; i++) + { + if (GETPFNSERVER(i) == pWnd->lpfnWndProc) + { + if (Ansi) + Ret = GETPFNCLIENTA(i); + else + Ret = GETPFNCLIENTW(i); + } + } + return Ret; + } + // Wine Class tests: + /* Edit controls are special - they return a wndproc handle when + GetWindowLongPtr is called with a different A/W. + On the other hand there is no W->A->W conversion so this control + is treated specially. + */ + if (Class->fnid == FNID_EDIT) + Ret = pWnd->lpfnWndProc; + else + { + // Set return proc. + Ret = pWnd->lpfnWndProc; + + if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON) + { if (Ansi) - Ret = GETPFNCLIENTA(i); + { + if (GETPFNCLIENTW(Class->fnid) == pWnd->lpfnWndProc) + Ret = GETPFNCLIENTA(Class->fnid); + } else - Ret = GETPFNCLIENTW(i); - } - } - return Ret; - } - // Wine Class tests: - /* Edit controls are special - they return a wndproc handle when - GetWindowLongPtr is called with a different A/W. - On the other hand there is no W->A->W conversion so this control - is treated specially. - */ - if (Class->fnid == FNID_EDIT) - Ret = pWnd->lpfnWndProc; - else - { - // Set return proc. - Ret = pWnd->lpfnWndProc; - - if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON) - { - if (Ansi) - { - if (GETPFNCLIENTW(Class->fnid) == pWnd->lpfnWndProc) - Ret = GETPFNCLIENTA(Class->fnid); - } - else - { - if (GETPFNCLIENTA(Class->fnid) == pWnd->lpfnWndProc) - Ret = GETPFNCLIENTW(Class->fnid); - } - } - // Return on the change. - if ( Ret != pWnd->lpfnWndProc) + { + if (GETPFNCLIENTA(Class->fnid) == pWnd->lpfnWndProc) + Ret = GETPFNCLIENTW(Class->fnid); + } + } + // Return on the change. + if ( Ret != pWnd->lpfnWndProc) + return Ret; + } + + if ( Ansi == !!(pWnd->state & WNDS_ANSIWINDOWPROC) ) return Ret; - } - - if ( Ansi == !!(pWnd->state & WNDS_ANSIWINDOWPROC) ) - return Ret; - - gcpd = (WNDPROC)NtUserGetCPD( UserHMGetHandle(pWnd), - (Ansi ? UserGetCPDA2U : UserGetCPDU2A )|UserGetCPDWindow, - (ULONG_PTR)Ret); - - return (gcpd ? gcpd : Ret); + + gcpd = (WNDPROC)NtUserGetCPD( UserHMGetHandle(pWnd), + (Ansi ? UserGetCPDA2U : UserGetCPDU2A )|UserGetCPDWindow, + (ULONG_PTR)Ret); + + return (gcpd ? gcpd : Ret); } static ULONG_PTR FASTCALL IntGetClassLongA(PWND Wnd, PCLS Class, int nIndex) { - ULONG_PTR Ret = 0; + ULONG_PTR Ret = 0; if (nIndex >= 0) { @@ -735,13 +735,13 @@ } } - return Ret; + return Ret; } static ULONG_PTR FASTCALL IntGetClassLongW (PWND Wnd, PCLS Class, int nIndex) { - ULONG_PTR Ret = 0; + ULONG_PTR Ret = 0; if (nIndex >= 0) { @@ -809,7 +809,7 @@ } } - return Ret; + return Ret; } /* @@ -834,24 +834,24 @@ if (Class != NULL) { #ifdef _WIN64 - switch (nIndex) - { - case GCLP_HBRBACKGROUND: - case GCLP_HCURSOR: - case GCLP_HICON: - case GCLP_HICONSM: - case GCLP_HMODULE: - case GCLP_MENUNAME: - case GCLP_WNDPROC: - SetLastError(ERROR_INVALID_INDEX); - break; - - default: - Ret = IntGetClassLongA(Wnd, Class, nIndex); - break; - } + switch (nIndex) + { + case GCLP_HBRBACKGROUND: + case GCLP_HCURSOR: + case GCLP_HICON: + case GCLP_HICONSM: + case GCLP_HMODULE: + case GCLP_MENUNAME: + case GCLP_WNDPROC: + SetLastError(ERROR_INVALID_INDEX); + break; + + default: + Ret = IntGetClassLongA(Wnd, Class, nIndex); + break; + } #else - Ret = IntGetClassLongA(Wnd, Class, nIndex); + Ret = IntGetClassLongA(Wnd, Class, nIndex); #endif } else @@ -890,24 +890,24 @@ if (Class != NULL) { #ifdef _WIN64 - switch (nIndex) - { - case GCLP_HBRBACKGROUND: - case GCLP_HCURSOR: - case GCLP_HICON: - case GCLP_HICONSM: - case GCLP_HMODULE: - case GCLP_MENUNAME: - case GCLP_WNDPROC: - SetLastError(ERROR_INVALID_INDEX); - break; - - default: - Ret = IntGetClassLongW(Wnd, Class, nIndex); - break; - } + switch (nIndex) + { + case GCLP_HBRBACKGROUND: + case GCLP_HCURSOR: + case GCLP_HICON: + case GCLP_HICONSM: + case GCLP_HMODULE: + case GCLP_MENUNAME: + case GCLP_WNDPROC: + SetLastError(ERROR_INVALID_INDEX); + break; + + default: + Ret = IntGetClassLongW(Wnd, Class, nIndex); + break; + } #else - Ret = IntGetClassLongW(Wnd, Class, nIndex); + Ret = IntGetClassLongW(Wnd, Class, nIndex); #endif } else @@ -948,7 +948,7 @@ Class = DesktopPtrToUser(Wnd->pcls); if (Class != NULL) { - Ret = IntGetClassLongA(Wnd, Class, nIndex); + Ret = IntGetClassLongA(Wnd, Class, nIndex); } else { @@ -987,7 +987,7 @@ Class = DesktopPtrToUser(Wnd->pcls); if (Class != NULL) { - Ret = IntGetClassLongW(Wnd, Class, nIndex); + Ret = IntGetClassLongW(Wnd, Class, nIndex); } else { @@ -1133,15 +1133,15 @@ case GWLP_ID: retvalue = wndPtr->IDMenu; break; case GWLP_HINSTANCE: retvalue = (ULONG_PTR)wndPtr->hModule; break; case GWLP_WNDPROC: - { - if (!TestWindowProcess(wndPtr)) - { - SetLastError(ERROR_ACCESS_DENIED); - retvalue = 0; - } - retvalue = (ULONG_PTR)IntGetWndProc(wndPtr, !unicode); + { + if (!TestWindowProcess(wndPtr)) + { + SetLastError(ERROR_ACCESS_DENIED); + retvalue = 0; + } + retvalue = (ULONG_PTR)IntGetWndProc(wndPtr, !unicode); break; - } + } default: WARN("Unknown offset %d\n", offset ); SetLastError( ERROR_INVALID_INDEX ); @@ -1265,147 +1265,147 @@ static HICON CreateSmallIcon(HICON StdIcon) { - HICON SmallIcon = NULL; - ICONINFO StdInfo; - int SmallIconWidth; - int SmallIconHeight; - BITMAP StdBitmapInfo; - HDC hSourceDc = NULL; - HDC hDestDc = NULL; - ICONINFO SmallInfo; - HBITMAP OldSourceBitmap = NULL; - HBITMAP OldDestBitmap = NULL; - - SmallInfo.hbmColor = NULL; - SmallInfo.hbmMask = NULL; - - /* We need something to work with... */ - if (NULL == StdIcon) - { - goto cleanup; - } - - SmallIconWidth = GetSystemMetrics(SM_CXSMICON); - SmallIconHeight = GetSystemMetrics(SM_CYSMICON); - if (! GetIconInfo(StdIcon, &StdInfo)) - { - ERR("Failed to get icon info for icon 0x%x\n", StdIcon); - goto cleanup; - } + HICON SmallIcon = NULL; + ICONINFO StdInfo; + int SmallIconWidth; + int SmallIconHeight; + BITMAP StdBitmapInfo; + HDC hSourceDc = NULL; + HDC hDestDc = NULL; + ICONINFO SmallInfo; + HBITMAP OldSourceBitmap = NULL; + HBITMAP OldDestBitmap = NULL; + + SmallInfo.hbmColor = NULL; + SmallInfo.hbmMask = NULL; + + /* We need something to work with... */ + if (NULL == StdIcon) + { + goto cleanup; + } + + SmallIconWidth = GetSystemMetrics(SM_CXSMICON); + SmallIconHeight = GetSystemMetrics(SM_CYSMICON); + if (! GetIconInfo(StdIcon, &StdInfo)) + { + ERR("Failed to get icon info for icon 0x%x\n", StdIcon); + goto cleanup; + } if (! GetObjectW(StdInfo.hbmMask, sizeof(BITMAP), &StdBitmapInfo)) - { - ERR("Failed to get bitmap info for icon 0x%x bitmap 0x%x\n", - StdIcon, StdInfo.hbmColor); - goto cleanup; - } - if (StdBitmapInfo.bmWidth == SmallIconWidth && - StdBitmapInfo.bmHeight == SmallIconHeight) - { - /* Icon already has the correct dimensions */ - return StdIcon; - } - - hSourceDc = CreateCompatibleDC(NULL); - if (NULL == hSourceDc) - { - ERR("Failed to create source DC\n"); - goto cleanup; - } - hDestDc = CreateCompatibleDC(NULL); - if (NULL == hDestDc) - { - ERR("Failed to create dest DC\n"); - goto cleanup; - } - - OldSourceBitmap = SelectObject(hSourceDc, StdInfo.hbmColor); - if (NULL == OldSourceBitmap) - { - ERR("Failed to select source color bitmap\n"); - goto cleanup; - } - SmallInfo.hbmColor = CreateCompatibleBitmap(hSourceDc, SmallIconWidth, - SmallIconHeight); - if (NULL == SmallInfo.hbmColor) - { - ERR("Failed to create color bitmap\n"); - goto cleanup; - } - OldDestBitmap = SelectObject(hDestDc, SmallInfo.hbmColor); - if (NULL == OldDestBitmap) - { - ERR("Failed to select dest color bitmap\n"); - goto cleanup; - } - if (! StretchBlt(hDestDc, 0, 0, SmallIconWidth, SmallIconHeight, - hSourceDc, 0, 0, StdBitmapInfo.bmWidth, - StdBitmapInfo.bmHeight, SRCCOPY)) - { - ERR("Failed to stretch color bitmap\n"); - goto cleanup; - } - - if (NULL == SelectObject(hSourceDc, StdInfo.hbmMask)) - { - ERR("Failed to select source mask bitmap\n"); - goto cleanup; - } - SmallInfo.hbmMask = CreateCompatibleBitmap(hSourceDc, SmallIconWidth, SmallIconHeight); - if (NULL == SmallInfo.hbmMask) - { - ERR("Failed to create mask bitmap\n"); - goto cleanup; - } - if (NULL == SelectObject(hDestDc, SmallInfo.hbmMask)) - { - ERR("Failed to select dest mask bitmap\n"); - goto cleanup; - } - if (! StretchBlt(hDestDc, 0, 0, SmallIconWidth, SmallIconHeight, - hSourceDc, 0, 0, StdBitmapInfo.bmWidth, - StdBitmapInfo.bmHeight, SRCCOPY)) - { - ERR("Failed to stretch mask bitmap\n"); - goto cleanup; - } - - SmallInfo.fIcon = TRUE; - SmallInfo.xHotspot = SmallIconWidth / 2; - SmallInfo.yHotspot = SmallIconHeight / 2; - SmallIcon = CreateIconIndirect(&SmallInfo); - if (NULL == SmallIcon) - { - ERR("Failed to create icon\n"); - goto cleanup; - } + { + ERR("Failed to get bitmap info for icon 0x%x bitmap 0x%x\n", + StdIcon, StdInfo.hbmColor); + goto cleanup; + } + if (StdBitmapInfo.bmWidth == SmallIconWidth && + StdBitmapInfo.bmHeight == SmallIconHeight) + { + /* Icon already has the correct dimensions */ + return StdIcon; + } + + hSourceDc = CreateCompatibleDC(NULL); + if (NULL == hSourceDc) + { + ERR("Failed to create source DC\n"); + goto cleanup; + } + hDestDc = CreateCompatibleDC(NULL); + if (NULL == hDestDc) + { + ERR("Failed to create dest DC\n"); + goto cleanup; + } + + OldSourceBitmap = SelectObject(hSourceDc, StdInfo.hbmColor); + if (NULL == OldSourceBitmap) + { + ERR("Failed to select source color bitmap\n"); + goto cleanup; + } + SmallInfo.hbmColor = CreateCompatibleBitmap(hSourceDc, SmallIconWidth, + SmallIconHeight); + if (NULL == SmallInfo.hbmColor) + { + ERR("Failed to create color bitmap\n"); + goto cleanup; + } + OldDestBitmap = SelectObject(hDestDc, SmallInfo.hbmColor); + if (NULL == OldDestBitmap) + { + ERR("Failed to select dest color bitmap\n"); + goto cleanup; + } + if (! StretchBlt(hDestDc, 0, 0, SmallIconWidth, SmallIconHeight, + hSourceDc, 0, 0, StdBitmapInfo.bmWidth, + StdBitmapInfo.bmHeight, SRCCOPY)) + { + ERR("Failed to stretch color bitmap\n"); + goto cleanup; + } + + if (NULL == SelectObject(hSourceDc, StdInfo.hbmMask)) + { + ERR("Failed to select source mask bitmap\n"); + goto cleanup; + } + SmallInfo.hbmMask = CreateCompatibleBitmap(hSourceDc, SmallIconWidth, SmallIconHeight); + if (NULL == SmallInfo.hbmMask) + { + ERR("Failed to create mask bitmap\n"); + goto cleanup; + } + if (NULL == SelectObject(hDestDc, SmallInfo.hbmMask)) + { + ERR("Failed to select dest mask bitmap\n"); + goto cleanup; + } + if (! StretchBlt(hDestDc, 0, 0, SmallIconWidth, SmallIconHeight, + hSourceDc, 0, 0, StdBitmapInfo.bmWidth, + StdBitmapInfo.bmHeight, SRCCOPY)) + { + ERR("Failed to stretch mask bitmap\n"); + goto cleanup; + } + + SmallInfo.fIcon = TRUE; + SmallInfo.xHotspot = SmallIconWidth / 2; + SmallInfo.yHotspot = SmallIconHeight / 2; + SmallIcon = CreateIconIndirect(&SmallInfo); + if (NULL == SmallIcon) + { + ERR("Failed to create icon\n"); + goto cleanup; + } cleanup: - if (NULL != SmallInfo.hbmMask) - { - DeleteObject(SmallInfo.hbmMask); - } - if (NULL != OldDestBitmap) - { - SelectObject(hDestDc, OldDestBitmap); - } - if (NULL != SmallInfo.hbmColor) - { - DeleteObject(SmallInfo.hbmColor); - } - if (NULL != hDestDc) - { - DeleteDC(hDestDc); - } - if (NULL != OldSourceBitmap) - { - SelectObject(hSourceDc, OldSourceBitmap); - } - if (NULL != hSourceDc) - { - DeleteDC(hSourceDc); - } - - return SmallIcon; + if (NULL != SmallInfo.hbmMask) + { + DeleteObject(SmallInfo.hbmMask); + } + if (NULL != OldDestBitmap) + { + SelectObject(hDestDc, OldDestBitmap); + } + if (NULL != SmallInfo.hbmColor) + { + DeleteObject(SmallInfo.hbmColor); + } + if (NULL != hDestDc) + { + DeleteDC(hDestDc); + } + if (NULL != OldSourceBitmap) + { + SelectObject(hSourceDc, OldSourceBitmap); + } + if (NULL != hSourceDc) + { + DeleteDC(hSourceDc); + } + + return SmallIcon; } #endif @@ -1416,125 +1416,125 @@ DWORD dwFlags, BOOL ChkRegCls) { - ATOM Atom; - WNDCLASSEXW WndClass; - UNICODE_STRING ClassName; - UNICODE_STRING MenuName = {0}; - CLSMENUNAME clsMenuName; - ANSI_STRING AnsiMenuName; - HMODULE hLibModule = NULL; - DWORD save_error; - BOOL ClassFound = FALSE; - - if (lpwcx == NULL || lpwcx->cbSize != sizeof(WNDCLASSEXW) || - lpwcx->cbClsExtra < 0 || lpwcx->cbWndExtra < 0 || - lpwcx->lpszClassName == NULL) - { - TRACE("RegisterClassExWOWW Invalid Parameter Error!\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - - if (ChkRegCls) - { - if (!RegisterDefaultClasses) RegisterSystemControls(); - } - /* - * On real Windows this looks more like: - * if (lpwcx->hInstance == User32Instance && - * *(PULONG)((ULONG_PTR)NtCurrentTeb() + 0x6D4) & 0x400) - * But since I have no idea what the magic field in the - * TEB structure means, I rather decided to omit that. - * -- Filip Navara - - GetWin32ClientInfo()->dwExpWinVer & (WINVER == 0x400) - */ - if (lpwcx->hInstance == User32Instance) - { - TRACE("RegisterClassExWOWW User32Instance!\n"); - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - /* Yes, this is correct. We should modify the passed structure. */ - if (lpwcx->hInstance == NULL) - ((WNDCLASSEXW*)lpwcx)->hInstance = GetModuleHandleW(NULL); - - RtlCopyMemory(&WndClass, lpwcx, sizeof(WNDCLASSEXW)); -/* - if (NULL == WndClass.hIconSm) - { - WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon); - } + ATOM Atom; + WNDCLASSEXW WndClass; + UNICODE_STRING ClassName; + UNICODE_STRING MenuName = {0}; + CLSMENUNAME clsMenuName; + ANSI_STRING AnsiMenuName; + HMODULE hLibModule = NULL; + DWORD save_error; + BOOL ClassFound = FALSE; + + if (lpwcx == NULL || lpwcx->cbSize != sizeof(WNDCLASSEXW) || + lpwcx->cbClsExtra < 0 || lpwcx->cbWndExtra < 0 || + lpwcx->lpszClassName == NULL) + { + TRACE("RegisterClassExWOWW Invalid Parameter Error!\n"); + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + if (ChkRegCls) + { + if (!RegisterDefaultClasses) RegisterSystemControls(); + } + /* + * On real Windows this looks more like: + * if (lpwcx->hInstance == User32Instance && + * *(PULONG)((ULONG_PTR)NtCurrentTeb() + 0x6D4) & 0x400) + * But since I have no idea what the magic field in the + * TEB structure means, I rather decided to omit that. + * -- Filip Navara + + GetWin32ClientInfo()->dwExpWinVer & (WINVER == 0x400) + */ + if (lpwcx->hInstance == User32Instance) + { + TRACE("RegisterClassExWOWW User32Instance!\n"); + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + /* Yes, this is correct. We should modify the passed structure. */ + if (lpwcx->hInstance == NULL) + ((WNDCLASSEXW*)lpwcx)->hInstance = GetModuleHandleW(NULL); + + RtlCopyMemory(&WndClass, lpwcx, sizeof(WNDCLASSEXW)); +/* + if (NULL == WndClass.hIconSm) + { + WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon); + } */ - RtlInitEmptyAnsiString(&AnsiMenuName, NULL, 0); - if (WndClass.lpszMenuName != NULL) - { - if (!IS_INTRESOURCE(WndClass.lpszMenuName)) - { - if (WndClass.lpszMenuName[0]) - { - RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName); - RtlUnicodeStringToAnsiString( &AnsiMenuName, &MenuName, TRUE); - } - } - else - { - MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName; - AnsiMenuName.Buffer = (PCHAR)WndClass.lpszMenuName; - } - } - - if (IS_ATOM(WndClass.lpszClassName)) - { - ClassName.Length = - ClassName.MaximumLength = 0; - ClassName.Buffer = (LPWSTR)WndClass.lpszClassName; - } - else - { - RtlInitUnicodeString(&ClassName, WndClass.lpszClassName); - } - - clsMenuName.pszClientAnsiMenuName = AnsiMenuName.Buffer; - clsMenuName.pwszClientUnicodeMenuName = MenuName.Buffer; - clsMenuName.pusMenuName = &MenuName; - - for(;;) - { - Atom = NtUserRegisterClassExWOW( &WndClass, - &ClassName, - &ClassName, //PUNICODE_STRING ClsNVersion, - &clsMenuName, + RtlInitEmptyAnsiString(&AnsiMenuName, NULL, 0); + if (WndClass.lpszMenuName != NULL) + { + if (!IS_INTRESOURCE(WndClass.lpszMenuName)) + { + if (WndClass.lpszMenuName[0]) + { + RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName); + RtlUnicodeStringToAnsiString( &AnsiMenuName, &MenuName, TRUE); + } + } + else + { + MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName; + AnsiMenuName.Buffer = (PCHAR)WndClass.lpszMenuName; + } + } + + if (IS_ATOM(WndClass.lpszClassName)) + { + ClassName.Length = + ClassName.MaximumLength = 0; + ClassName.Buffer = (LPWSTR)WndClass.lpszClassName; + } + else + { + RtlInitUnicodeString(&ClassName, WndClass.lpszClassName); + } + + clsMenuName.pszClientAnsiMenuName = AnsiMenuName.Buffer; + clsMenuName.pwszClientUnicodeMenuName = MenuName.Buffer; + clsMenuName.pusMenuName = &MenuName; + + for(;;) + { + Atom = NtUserRegisterClassExWOW( &WndClass, + &ClassName, + &ClassName, //PUNICODE_STRING ClsNVersion, + &clsMenuName, fnID, dwFlags, pdwWowData); - if (Atom) break; - if (!ClassFound) - { - save_error = GetLastError(); - if ( save_error == ERROR_CANNOT_FIND_WND_CLASS || - save_error == ERROR_CLASS_DOES_NOT_EXIST ) - { - ClassFound = VersionRegisterClass(ClassName.Buffer, NULL, NULL, &hLibModule); - if (ClassFound) continue; - } - } - if (hLibModule) - { - save_error = GetLastError(); - FreeLibrary(hLibModule); - SetLastError(save_error); - hLibModule = 0; - } - break; - } - - TRACE("atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", - Atom, lpwcx->lpfnWndProc, lpwcx->hInstance, lpwcx->hbrBackground, - lpwcx->style, lpwcx->cbClsExtra, lpwcx->cbWndExtra, WndClass); - - return Atom; + if (Atom) break; + if (!ClassFound) + { + save_error = GetLastError(); + if ( save_error == ERROR_CANNOT_FIND_WND_CLASS || + save_error == ERROR_CLASS_DOES_NOT_EXIST ) + { + ClassFound = VersionRegisterClass(ClassName.Buffer, NULL, NULL, &hLibModule); + if (ClassFound) continue; + } + } + if (hLibModule) + { + save_error = GetLastError(); + FreeLibrary(hLibModule); + SetLastError(save_error); + hLibModule = 0; + } + break; + } + + TRACE("atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", + Atom, lpwcx->lpfnWndProc, lpwcx->hInstance, lpwcx->hbrBackground, + lpwcx->style, lpwcx->cbClsExtra, lpwcx->cbWndExtra, WndClass); + + return Atom; } /* @@ -1543,44 +1543,44 @@ ATOM WINAPI RegisterClassExA(CONST WNDCLASSEXA *lpwcx) { - RTL_ATOM Atom; - WNDCLASSEXW WndClass; - WCHAR mname[MAX_BUFFER_LEN]; - WCHAR cname[MAX_BUFFER_LEN]; - - RtlCopyMemory(&WndClass, lpwcx, sizeof(WNDCLASSEXA)); - - if (WndClass.lpszMenuName != NULL) - { - if (!IS_INTRESOURCE(WndClass.lpszMenuName)) - { - if (WndClass.lpszMenuName[0]) - { - if (!MultiByteToWideChar( CP_ACP, 0, lpwcx->lpszMenuName, -1, mname, MAX_ATOM_LEN + 1 )) return 0; - - WndClass.lpszMenuName = mname; - } - } - } - - if (!IS_ATOM(WndClass.lpszClassName)) - { - if (!MultiByteToWideChar( CP_ACP, 0, lpwcx->lpszClassName, -1, cname, MAX_ATOM_LEN + 1 )) return 0; - - WndClass.lpszClassName = cname; - } - - Atom = RegisterClassExWOWW( &WndClass, + RTL_ATOM Atom; + WNDCLASSEXW WndClass; + WCHAR mname[MAX_BUFFER_LEN]; + WCHAR cname[MAX_BUFFER_LEN]; + + RtlCopyMemory(&WndClass, lpwcx, sizeof(WNDCLASSEXA)); + + if (WndClass.lpszMenuName != NULL) + { + if (!IS_INTRESOURCE(WndClass.lpszMenuName)) + { + if (WndClass.lpszMenuName[0]) + { + if (!MultiByteToWideChar( CP_ACP, 0, lpwcx->lpszMenuName, -1, mname, MAX_ATOM_LEN + 1 )) return 0; + + WndClass.lpszMenuName = mname; + } + } + } + + if (!IS_ATOM(WndClass.lpszClassName)) + { + if (!MultiByteToWideChar( CP_ACP, 0, lpwcx->lpszClassName, -1, cname, MAX_ATOM_LEN + 1 )) return 0; + + WndClass.lpszClassName = cname; + } + + Atom = RegisterClassExWOWW( &WndClass, 0, 0, CSF_ANSIPROC, TRUE); - TRACE("A atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", - Atom, lpwcx->lpfnWndProc, lpwcx->hInstance, lpwcx->hbrBackground, - lpwcx->style, lpwcx->cbClsExtra, lpwcx->cbWndExtra, WndClass); - - return (ATOM)Atom; + TRACE("A atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", + Atom, lpwcx->lpfnWndProc, lpwcx->hInstance, lpwcx->hbrBackground, + lpwcx->style, lpwcx->cbClsExtra, lpwcx->cbWndExtra, WndClass); + + return (ATOM)Atom; } /* @@ -1589,15 +1589,15 @@ ATOM WINAPI RegisterClassExW(CONST WNDCLASSEXW *lpwcx) { - ATOM Atom; - - Atom = RegisterClassExWOWW( (WNDCLASSEXW *)lpwcx, 0, 0, 0, TRUE); - - TRACE("W atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d\n", + ATOM Atom; + + Atom = RegisterClassExWOWW( (WNDCLASSEXW *)lpwcx, 0, 0, 0, TRUE); + + TRACE("W atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d\n", Atom, lpwcx->lpfnWndProc, lpwcx->hInstance, lpwcx->hbrBackground, lpwcx->style, lpwcx->cbClsExtra, lpwcx->cbWndExtra); - return Atom; + return Atom; } /* @@ -1606,16 +1606,16 @@ ATOM WINAPI RegisterClassA(CONST WNDCLASSA *lpWndClass) { - WNDCLASSEXA Class; - - if (lpWndClass == NULL) - return 0; - - RtlCopyMemory(&Class.style, lpWndClass, sizeof(WNDCLASSA)); - Class.cbSize = sizeof(WNDCLASSEXA); - Class.hIconSm = NULL; - - return RegisterClassExA(&Class); + WNDCLASSEXA Class; + + if (lpWndClass == NULL) + return 0; + + RtlCopyMemory(&Class.style, lpWndClass, sizeof(WNDCLASSA)); + Class.cbSize = sizeof(WNDCLASSEXA); + Class.hIconSm = NULL; + + return RegisterClassExA(&Class); } /* @@ -1624,16 +1624,16 @@ ATOM WINAPI RegisterClassW(CONST WNDCLASSW *lpWndClass) { - WNDCLASSEXW Class; - - if (lpWndClass == NULL) - return 0; - - RtlCopyMemory(&Class.style, lpWndClass, sizeof(WNDCLASSW)); - Class.cbSize = sizeof(WNDCLASSEXW); - Class.hIconSm = NULL; - - return RegisterClassExW(&Class); + WNDCLASSEXW Class; + + if (lpWndClass == NULL) + return 0; + + RtlCopyMemory(&Class.style, lpWndClass, sizeof(WNDCLASSW)); + Class.cbSize = sizeof(WNDCLASSEXW); + Class.hIconSm = NULL; + + return RegisterClassExW(&Class); } /* @@ -1833,7 +1833,7 @@ int nIndex, LONG dwNewLong) { - return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, TRUE); + return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, TRUE); } /* @@ -1846,7 +1846,7 @@ int nIndex, LONG dwNewLong) { - return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); + return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); } #ifdef _WIN64 @@ -1859,7 +1859,7 @@ INT nIndex, LONG_PTR dwNewLong) { - return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); + return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); } /* @@ -1871,7 +1871,7 @@ INT nIndex, LONG_PTR dwNewLong) { - return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); + return NtUserSetWindowLong(hWnd, nIndex, dwNewLong, FALSE); } #endif
7 years, 10 months
1
0
0
0
[tfaber] 73772: [IP] - Print some debugging information when hitting 'p->tot_len == p->len' assertion in TCPSendDataCallback. CORE-10715
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Feb 11 11:46:38 2017 New Revision: 73772 URL:
http://svn.reactos.org/svn/reactos?rev=73772&view=rev
Log: [IP] - Print some debugging information when hitting 'p->tot_len == p->len' assertion in TCPSendDataCallback. CORE-10715 Modified: trunk/reactos/sdk/lib/drivers/ip/transport/tcp/if.c Modified: trunk/reactos/sdk/lib/drivers/ip/transport/tcp/if.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/drivers/ip/transpo…
============================================================================== --- trunk/reactos/sdk/lib/drivers/ip/transport/tcp/if.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/drivers/ip/transport/tcp/if.c [iso-8859-1] Sat Feb 11 11:46:38 2017 @@ -49,8 +49,15 @@ GetDataPtr(Packet.NdisPacket, 0, (PCHAR*)&Packet.Header, &Packet.TotalSize); Packet.MappedHeader = TRUE; - ASSERT(p->tot_len == p->len); - ASSERT(Packet.TotalSize == p->len); + if (p->tot_len != p->len || + Packet.TotalSize != p->len) + { + TI_DbgPrint(MIN_TRACE, + ("TCPSendDataCallback tot_len = %u, len = %u, TotalSize = %u\n", + p->tot_len, p->len, Packet.TotalSize)); + ASSERT(p->tot_len == p->len); + ASSERT(Packet.TotalSize == p->len); + } RtlCopyMemory(Packet.Header, p->payload, p->len);
7 years, 10 months
1
0
0
0
[tfaber] 73771: [IPHLPAPI][NETCFGX] - Don't check arrays against NULL. CID 513720, 513721, 1322048, 1322049
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Feb 11 10:54:09 2017 New Revision: 73771 URL:
http://svn.reactos.org/svn/reactos?rev=73771&view=rev
Log: [IPHLPAPI][NETCFGX] - Don't check arrays against NULL. CID 513720, 513721, 1322048, 1322049 Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c trunk/reactos/dll/win32/netcfgx/tcpipconf_notify.c Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/iphlpap…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c [iso-8859-1] Sat Feb 11 10:54:09 2017 @@ -2027,7 +2027,7 @@ { DWORD Status, Version = 0; - if (!AdapterInfo || !AdapterInfo->Name) + if (!AdapterInfo) return ERROR_INVALID_PARAMETER; /* Maybe we should do this in DllMain */ @@ -2061,7 +2061,7 @@ { DWORD Status, Version = 0; - if (!AdapterInfo || !AdapterInfo->Name) + if (!AdapterInfo) return ERROR_INVALID_PARAMETER; /* Maybe we should do this in DllMain */ Modified: trunk/reactos/dll/win32/netcfgx/tcpipconf_notify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netcfgx/tcpipcon…
============================================================================== --- trunk/reactos/dll/win32/netcfgx/tcpipconf_notify.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netcfgx/tcpipconf_notify.c [iso-8859-1] Sat Feb 11 10:54:09 2017 @@ -780,8 +780,7 @@ SendDlgItemMessageW(hwndDlg, IDC_OK, WM_SETTEXT, 0, (LPARAM)szBuffer); } - if (pGwSettings->szIP) - SendDlgItemMessageW(hwndDlg, IDC_IPADDR, IPM_SETADDRESS, 0, (LPARAM)GetIpAddressFromStringW(pGwSettings->szIP)); + SendDlgItemMessageW(hwndDlg, IDC_IPADDR, IPM_SETADDRESS, 0, (LPARAM)GetIpAddressFromStringW(pGwSettings->szIP)); if (pGwSettings->Metric) { @@ -941,11 +940,8 @@ SendDlgItemMessageW(hwndDlg, IDC_OK, WM_SETTEXT, 0, (LPARAM)szBuffer); } - if (pIpSettings->szIP) - SendDlgItemMessageW(hwndDlg, IDC_IPADDR, IPM_SETADDRESS, 0, (LPARAM)GetIpAddressFromStringW(pIpSettings->szIP)); - - if (pIpSettings->szMask) - SendDlgItemMessageW(hwndDlg, IDC_SUBNETMASK, IPM_SETADDRESS, 0, (LPARAM)GetIpAddressFromStringW(pIpSettings->szMask)); + SendDlgItemMessageW(hwndDlg, IDC_IPADDR, IPM_SETADDRESS, 0, (LPARAM)GetIpAddressFromStringW(pIpSettings->szIP)); + SendDlgItemMessageW(hwndDlg, IDC_SUBNETMASK, IPM_SETADDRESS, 0, (LPARAM)GetIpAddressFromStringW(pIpSettings->szMask)); } return TRUE; case WM_NOTIFY:
7 years, 10 months
1
0
0
0
[khornicek] 73770: [UMPNPMGR] - Fix a possible null pointer dereference. CID 515158
by khornicek@svn.reactos.org
Author: khornicek Date: Sat Feb 11 10:34:35 2017 New Revision: 73770 URL:
http://svn.reactos.org/svn/reactos?rev=73770&view=rev
Log: [UMPNPMGR] - Fix a possible null pointer dereference. CID 515158 Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/umpnpmgr/ump…
============================================================================== --- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] Sat Feb 11 10:34:35 2017 @@ -993,7 +993,9 @@ } done: - *pulTransferLen = (ret == CR_SUCCESS) ? *pulLength : 0; + + if(pulTransferLen) + *pulTransferLen = (ret == CR_SUCCESS) ? *pulLength : 0; if (hKey != NULL) RegCloseKey(hKey);
7 years, 10 months
1
0
0
0
[gadamopoulos] 73769: [USER32_APITEST] -Add more tests for versioned classes.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sat Feb 11 10:01:13 2017 New Revision: 73769 URL:
http://svn.reactos.org/svn/reactos?rev=73769&view=rev
Log: [USER32_APITEST] -Add more tests for versioned classes. Modified: trunk/rostests/apitests/user32/RegisterClassEx.c trunk/rostests/apitests/user32/verclasstest2.manifest Modified: trunk/rostests/apitests/user32/RegisterClassEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/RegisterC…
============================================================================== --- trunk/rostests/apitests/user32/RegisterClassEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/RegisterClassEx.c [iso-8859-1] Sat Feb 11 10:01:13 2017 @@ -9,6 +9,7 @@ #define WIN32_NO_STATUS #include <ndk/rtlfuncs.h> +#include <wchar.h> #include <wingdi.h> #include <winuser.h> #include "helper.h" @@ -25,14 +26,35 @@ static ATOM _GetClassAtom(LPCWSTR lpwszClassName, HINSTANCE hInstance) { WNDCLASSEXW wcex = {sizeof(WNDCLASSEXW)}; - return (ATOM)GetClassInfoEx(hInstance, lpwszClassName, &wcex); + return (ATOM)GetClassInfoExW(hInstance, lpwszClassName, &wcex); } static WNDPROC _GetWndproc(LPCWSTR lpwszClassName, HINSTANCE hInstance) { WNDCLASSEXW wcex = {sizeof(WNDCLASSEXW)}; - GetClassInfoEx(hInstance, lpwszClassName, &wcex); - return wcex.lpfnWndProc; + BOOL ret = GetClassInfoExW(hInstance, lpwszClassName, &wcex); + return ret ? wcex.lpfnWndProc : NULL; +} + +static ATOM _RegisterClassA(LPCSTR lpzClassName, HINSTANCE hInstance, UINT style, WNDPROC lpfnWndProc) +{ + WNDCLASSEXA wcex = {sizeof(WNDCLASSEX), style, lpfnWndProc}; + wcex.lpszClassName = lpzClassName; + wcex.hInstance = hInstance; + return RegisterClassExA(&wcex); +} + +static ATOM _GetClassAtomA(LPCSTR lpszClassName, HINSTANCE hInstance) +{ + WNDCLASSEXA wcex = {sizeof(WNDCLASSEX)}; + return (ATOM)GetClassInfoExA(hInstance, lpszClassName, &wcex); +} + +static WNDPROC _GetWndprocA(LPCSTR lpszClassName, HINSTANCE hInstance) +{ + WNDCLASSEXA wcex = {sizeof(WNDCLASSEX)}; + BOOL ret = GetClassInfoExA(hInstance, lpszClassName, &wcex); + return ret ? wcex.lpfnWndProc : NULL; } HANDLE _CreateActCtxFromFile(LPCWSTR FileName) @@ -146,9 +168,11 @@ { HMODULE hmod = GetModuleHandle(NULL); HANDLE h1, h2; - ULONG_PTR cookie1; - ATOM a,b,c; + ULONG_PTR cookie1, cookie2; + ATOM a,b,c,d; WNDPROC proc1,proc2,proc3, proc4, proc5; + WCHAR buffer[50]; + h1 = _CreateActCtxFromFile(L"verclasstest1.manifest"); h2 = _CreateActCtxFromFile(L"verclasstest2.manifest"); @@ -173,9 +197,9 @@ ok( c != 0, "\n"); ok( a == c, "\n"); ok (proc1 == DefWindowProcA, "\n"); - ok (proc2 == NULL, "\n"); - ok (proc3 == DefWindowProcW, "\n"); - ok (proc4 == DefWindowProcW, "\n"); + ok (proc2 == NULL, "Got 0x%p, expected NULL\n", proc2); + ok (proc3 == DefWindowProcW, "Got 0x%p, expected 0x%p\n", proc3, DefWindowProcW); + ok (proc4 == DefWindowProcW, "Got 0x%p, expected 0x%p\n", proc4, DefWindowProcW); ok (proc5 == DefWindowProcA, "\n"); a = _GetClassAtom(L"Button", hmod); @@ -184,25 +208,76 @@ ActivateActCtx(h2, &cookie1); c = _RegisterClass(L"Button", hmod, CS_GLOBALCLASS, DefWindowProcA); proc2 = _GetWndproc(L"Button", (HMODULE)0xdead); - ok( a != 0, "\n"); - ok( b == 0, "\n"); - ok( c != 0, "\n"); + d = _GetClassAtom(L"3.3.3.3!Button", (HMODULE)0xdead); + proc3 = _GetWndproc(L"3.3.3.3!Button", (HMODULE)0xdead); + ok( a != 0, "\n"); + ok( b == 0, "\n"); + ok( c != 0, "\n"); + ok( d != 0, "\n"); ok( a == c, "\n"); + ok( d == a, "\n"); ok( proc1 != NULL, "\n"); - ok( proc1 != proc2, "\n"); - ok( proc2 == DefWindowProcA, "\n"); + ok( proc1 != DefWindowProcA, "Got 0x%p, expected not 0x%p\n", proc1, DefWindowProcA); + ok( proc2 == DefWindowProcA, "Got 0x%p, expected 0x%p\n", proc2, DefWindowProcA); + ok( proc3 == DefWindowProcA, "Got 0x%p, expected 0x%p\n", proc3, DefWindowProcA); a = _RegisterClass(L"VersionTestClass2", hmod, CS_GLOBALCLASS, DefWindowProcW); proc1 = _GetWndproc(L"VersionTestClass2", (HMODULE)0xdead); b = _RegisterClass(L"VersionTestClass2", hmod, 0, DefWindowProcA); proc2 = _GetWndproc(L"VersionTestClass2", hmod); + proc3 = _GetWndproc(L"VersionTestClass2", (HMODULE)0xdead); ok (a != 0, "\n"); ok (b != 0, "\n"); ok (a == b, "\n"); + ok (proc1 == DefWindowProcW, "Got 0x%p, expected 0x%p\n", proc1, DefWindowProcW); + ok (proc2 == DefWindowProcA, "Got 0x%p, expected 0x%p\n", proc2, DefWindowProcA); + ok (proc3 == DefWindowProcW, "Got 0x%p, expected 0x%p\n", proc2, DefWindowProcA); + + a = _RegisterClass(L"VersionTestClass3", hmod, 0, DefWindowProcW); + swprintf(buffer, L"#%d", a); + proc1 = _GetWndproc((LPCWSTR)(DWORD_PTR)a, hmod); + proc2 = _GetWndproc(buffer, hmod); + ok (a != 0, "\n"); ok (proc1 == DefWindowProcW, "\n"); - ok (proc2 == DefWindowProcA, "\n"); - - + ok (proc2 == 0, "Got 0x%p for %S, expected 0\n", proc2, buffer); + DeactivateActCtx(0, cookie1); + + a = _RegisterClass(L"VersionTestClass3", hmod, 0, DefWindowProcW); + swprintf(buffer, L"#%d", a); + proc1 = _GetWndproc((LPCWSTR)(DWORD_PTR)a, hmod); + proc2 = _GetWndproc(buffer, hmod); + ok (a != 0, "\n"); + ok (proc1 == DefWindowProcW, "\n"); + ok (proc2 == 0, "Got 0x%p for %S, expected 0\n", proc2, buffer); + + ActivateActCtx(h2, &cookie1); + a = _RegisterClassA("VersionTestClass7", hmod, 0, DefWindowProcW); + b = _GetClassAtomA("VersionTestClass7", hmod); + proc1 = _GetWndprocA("VersionTestClass7", hmod); + proc2 = _GetWndprocA((LPCSTR)(DWORD_PTR)a, hmod); + ok(a != 0, "\n"); + ok(b != 0, "\n"); + ok(a == b, "\n"); + ok (proc1 == DefWindowProcW, "\n"); + ok (proc2 == DefWindowProcW, "\n"); + + DeactivateActCtx(0, cookie1); + + proc1 = _GetWndproc(L"Button", 0); + ActivateActCtx(h2, &cookie1); + ActivateActCtx(h1, &cookie2); + proc2 = _GetWndproc(L"Button", 0); + DeactivateActCtx(0, cookie2); + ActivateActCtx(0, &cookie2); + proc3 = _GetWndproc(L"Button", 0); + DeactivateActCtx(0, cookie2); + DeactivateActCtx(0, cookie1); + ok (proc1 != 0, "\n"); + ok (proc2 != 0, "\n"); + ok (proc4 != 0, "\n"); + ok (proc1 == proc2, "\n"); + ok (proc1 == proc3, "\n"); + } START_TEST(RegisterClassEx) Modified: trunk/rostests/apitests/user32/verclasstest2.manifest URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/verclasst…
============================================================================== --- trunk/rostests/apitests/user32/verclasstest2.manifest [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/verclasstest2.manifest [iso-8859-1] Sat Feb 11 10:01:13 2017 @@ -6,5 +6,8 @@ <windowClass>VersionTestClass2</windowClass> <windowClass>VersionTestClass3</windowClass> <windowClass>Button</windowClass> + <windowClass>VersionTestClass7</windowClass> + <windowClass>VersionTestClass8</windowClass> + <windowClass>VersionTestClass9</windowClass> </file> </assembly>
7 years, 10 months
1
0
0
0
[jimtabor] 73768: [User32] - Patch by Dmitry Timoshkov : Fix groupbox rectangle calculation in the button's WM_SETTEXT handler. BUTTON_CalcLabelRect should use the button font. Otherwise WM_SETTEXT...
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Feb 10 16:05:15 2017 New Revision: 73768 URL:
http://svn.reactos.org/svn/reactos?rev=73768&view=rev
Log: [User32] - Patch by Dmitry Timoshkov : Fix groupbox rectangle calculation in the button's WM_SETTEXT handler. BUTTON_CalcLabelRect should use the button font. Otherwise WM_SETTEXT handler gets wrong rectangle to erase an old text. - Fixes CORE-12464. Modified: trunk/reactos/win32ss/user/user32/controls/button.c Modified: trunk/reactos/win32ss/user/user32/controls/button.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/contro…
============================================================================== --- trunk/reactos/win32ss/user/user32/controls/button.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/controls/button.c [iso-8859-1] Fri Feb 10 16:05:15 2017 @@ -496,6 +496,9 @@ GetClientRect(hWnd, &client); rc = client; + /* FIXME: check other BS_* handlers */ + if (btn_type == BS_GROUPBOX) + InflateRect(&rc, -7, 1); /* GB_Paint does this */ BUTTON_CalcLabelRect(hWnd, hdc, &rc); /* Clip by client rect bounds */ if (rc.right > client.right) rc.right = client.right; @@ -759,19 +762,26 @@ switch (style & (BS_ICON|BS_BITMAP)) { case BS_TEXT: + { + HFONT hFont, hPrevFont = 0; + if (!(text = get_button_text( hwnd ))) goto empty_rect; if (!text[0]) { HeapFree( GetProcessHeap(), 0, text ); goto empty_rect; } + + if ((hFont = get_button_font( hwnd ))) hPrevFont = SelectObject( hdc, hFont ); DrawTextW(hdc, text, -1, &r, dtStyle | DT_CALCRECT); + if (hPrevFont) SelectObject( hdc, hPrevFont ); HeapFree( GetProcessHeap(), 0, text ); #ifdef __REACTOS__ if (get_ui_state(hwnd) & UISF_HIDEACCEL) dtStyle |= DT_HIDEPREFIX; #endif break; + } case BS_ICON: if (!GetIconInfo((HICON)GetWindowLongPtrW( hwnd, HIMAGE_GWL_OFFSET ), &iconInfo))
7 years, 10 months
1
0
0
0
[gadamopoulos] 73767: [KERNEL32_APITESTS]: Add more tests for FindActCtxSectionStringW.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Fri Feb 10 00:00:28 2017 New Revision: 73767 URL:
http://svn.reactos.org/svn/reactos?rev=73767&view=rev
Log: [KERNEL32_APITESTS]: Add more tests for FindActCtxSectionStringW. Added: trunk/rostests/apitests/kernel32/classtest2.manifest (with props) Modified: trunk/rostests/apitests/kernel32/CMakeLists.txt trunk/rostests/apitests/kernel32/FindActCtxSectionStringW.c Modified: trunk/rostests/apitests/kernel32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/CMakeLi…
============================================================================== --- trunk/rostests/apitests/kernel32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/kernel32/CMakeLists.txt [iso-8859-1] Fri Feb 10 00:00:28 2017 @@ -33,6 +33,7 @@ list(APPEND MANIFEST_FILES classtest.manifest + classtest2.manifest comctl32dep.manifest dep1.manifest deptest.manifest) Modified: trunk/rostests/apitests/kernel32/FindActCtxSectionStringW.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/FindAct…
============================================================================== --- trunk/rostests/apitests/kernel32/FindActCtxSectionStringW.c [iso-8859-1] (original) +++ trunk/rostests/apitests/kernel32/FindActCtxSectionStringW.c [iso-8859-1] Fri Feb 10 00:00:28 2017 @@ -269,8 +269,8 @@ START_TEST(FindActCtxSectionStringW) { - HANDLE h; - ULONG_PTR cookie; + HANDLE h, h2; + ULONG_PTR cookie, cookie2; /*First run the redirection tests without using our own actctx */ TestClassRedirection(NULL, L"Button", L"Button", L"comctl32.dll", 27); @@ -284,6 +284,9 @@ { _ActivateCtx(h, &cookie, __LINE__); TestClassRedirection(h, L"Button", L"2.2.2.2!Button", L"testlib.dll", 5); + _ActivateCtx(NULL, &cookie2, __LINE__); + TestClassRedirection(NULL, L"Button", L"Button", L"comctl32.dll", 27); + _DeactivateCtx(cookie2, __LINE__); _DeactivateCtx(cookie, __LINE__); } else @@ -291,6 +294,23 @@ skip("Failed to create context for classtest.manifest\n"); } + /* Class redirection tests with multiple contexts in the activation stack */ + h2 = _CreateActCtxFromFile(L"classtest2.manifest", __LINE__); + if (h != INVALID_HANDLE_VALUE && h2 != INVALID_HANDLE_VALUE) + { + _ActivateCtx(h, &cookie, __LINE__); + _ActivateCtx(h2, &cookie2, __LINE__); + TestClassRedirection(NULL, L"Button", L"Button", L"comctl32.dll", 27); + TestClassRedirection(h2, L"MyClass", L"1.1.1.1!MyClass", L"testlib.dll", 5); + _DeactivateCtx(cookie2, __LINE__); + TestClassRedirection(h, L"Button", L"2.2.2.2!Button", L"testlib.dll", 5); + _DeactivateCtx(cookie, __LINE__); + } + else + { + skip("Failed to create context for classtest.manifest\n"); + } + /* Dependency tests */ h = _CreateActCtxFromFile(L"deptest.manifest", __LINE__); if (h != INVALID_HANDLE_VALUE) Added: trunk/rostests/apitests/kernel32/classtest2.manifest URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/classte…
============================================================================== --- trunk/rostests/apitests/kernel32/classtest2.manifest (added) +++ trunk/rostests/apitests/kernel32/classtest2.manifest [iso-8859-1] Fri Feb 10 00:00:28 2017 @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity type="win32" name="ReactOS-TestLib" version="1.1.1.1" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df"/> + <file name="testlib.dll"> + <windowClass>ButtonListBox</windowClass> + <windowClass>ComboBoxEx32</windowClass> + <windowClass>ComboLBox</windowClass> + <windowClass>Combobox</windowClass> + <windowClass>MyClass</windowClass> + </file> +</assembly> Propchange: trunk/rostests/apitests/kernel32/classtest2.manifest ------------------------------------------------------------------------------ svn:eol-style = CRLF
7 years, 10 months
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
...
36
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
Results per page:
10
25
50
100
200