Author: hbelusca Date: Wed Mar 1 19:23:27 2017 New Revision: 74017
URL: http://svn.reactos.org/svn/reactos?rev=74017&view=rev Log: [USER32]: Fix formatting in User32CreateWindowEx, no code changes.
Modified: trunk/reactos/win32ss/user/user32/windows/window.c
Modified: trunk/reactos/win32ss/user/user32/windows/window.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/windows... ============================================================================== --- trunk/reactos/win32ss/user/user32/windows/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/window.c [iso-8859-1] Wed Mar 1 19:23:27 2017 @@ -172,7 +172,7 @@ WNDCLASSEXA wceA; WNDCLASSEXW wceW; HMODULE hLibModule = NULL; - DWORD save_error; + DWORD dwLastError; BOOL Unicode, ClassFound = FALSE; HWND Handle = NULL; LPCWSTR lpszClsVersion; @@ -185,8 +185,8 @@
if (!RegisterDefaultClasses) { - TRACE("RegisterSystemControls\n"); - RegisterSystemControls(); + TRACE("RegisterSystemControls\n"); + RegisterSystemControls(); }
Unicode = !(dwFlags & NUCWE_ANSI); @@ -197,14 +197,16 @@ } else { - if(Unicode) + if (Unicode) + { RtlInitUnicodeString(&ClassName, (PCWSTR)lpClassName); + } else { if (!RtlCreateUnicodeStringFromAsciiz(&ClassName, (PCSZ)lpClassName)) { SetLastError(ERROR_OUTOFMEMORY); - return (HWND)0; + return NULL; } }
@@ -247,20 +249,20 @@ } }
- if(!hMenu && (dwStyle & (WS_OVERLAPPEDWINDOW | WS_POPUP))) - { - if(Unicode) - { - wceW.cbSize = sizeof(WNDCLASSEXW); - if(GetClassInfoExW(hInstance, (LPCWSTR)lpClassName, &wceW) && wceW.lpszMenuName) + if (!hMenu && (dwStyle & (WS_OVERLAPPEDWINDOW | WS_POPUP))) + { + if (Unicode) + { + wceW.cbSize = sizeof(wceW); + if (GetClassInfoExW(hInstance, (LPCWSTR)lpClassName, &wceW) && wceW.lpszMenuName) { hMenu = LoadMenuW(hInstance, wceW.lpszMenuName); } } else { - wceA.cbSize = sizeof(WNDCLASSEXA); - if(GetClassInfoExA(hInstance, lpClassName, &wceA) && wceA.lpszMenuName) + wceA.cbSize = sizeof(wceA); + if (GetClassInfoExA(hInstance, lpClassName, &wceA) && wceA.lpszMenuName) { hMenu = LoadMenuA(hInstance, wceA.lpszMenuName); } @@ -283,54 +285,53 @@ plstrClassVersion = &lstrClassVersion; }
- for(;;) - { - Handle = NtUserCreateWindowEx(dwExStyle, - plstrClassName, - plstrClassVersion, - &WindowName, - dwStyle, - x, - y, - nWidth, - nHeight, - hWndParent, - hMenu, - hInstance, - lpParam, - dwFlags, - NULL); - if (Handle) break; - if (!lpLibFileName) break; - if (!ClassFound) - { - save_error = GetLastError(); - if ( save_error == ERROR_CANNOT_FIND_WND_CLASS ) - { - ClassFound = VersionRegisterClass(ClassName.Buffer, lpLibFileName, pCtx, &hLibModule); - if (ClassFound) continue; - } - } - if (hLibModule) - { - save_error = GetLastError(); - FreeLibrary(hLibModule); - SetLastError(save_error); - hLibModule = 0; - } - break; + for (;;) + { + Handle = NtUserCreateWindowEx(dwExStyle, + plstrClassName, + plstrClassVersion, + &WindowName, + dwStyle, + x, + y, + nWidth, + nHeight, + hWndParent, + hMenu, + hInstance, + lpParam, + dwFlags, + NULL); + if (Handle) break; + if (!lpLibFileName) break; + if (!ClassFound) + { + dwLastError = GetLastError(); + if (dwLastError == ERROR_CANNOT_FIND_WND_CLASS) + { + ClassFound = VersionRegisterClass(ClassName.Buffer, lpLibFileName, pCtx, &hLibModule); + if (ClassFound) continue; + } + } + if (hLibModule) + { + dwLastError = GetLastError(); + FreeLibrary(hLibModule); + SetLastError(dwLastError); + hLibModule = NULL; + } + break; }
#if 0 DbgPrint("[window] NtUserCreateWindowEx() == %d\n", Handle); #endif + cleanup: - if(!Unicode) + if (!Unicode) { if (!IS_ATOM(lpClassName)) - { RtlFreeUnicodeString(&ClassName); - }
RtlFreeLargeString(&WindowName); } @@ -573,8 +574,8 @@ }
hwnd = User32CreateWindowEx(dwExStyle, - (LPCSTR) lpClassName, - (LPCSTR) lpWindowName, + (LPCSTR)lpClassName, + (LPCSTR)lpWindowName, dwStyle, x, y,