diff --git a/reactos/lib/user32/windows/class.c b/reactos/lib/user32/windows/class.c index cf2902ccf55..73a18c7410f 100644 --- a/reactos/lib/user32/windows/class.c +++ b/reactos/lib/user32/windows/class.c @@ -1,4 +1,4 @@ -/* $Id: class.c,v 1.30 2003/08/18 23:52:03 weiden Exp $ +/* $Id: class.c,v 1.31 2003/08/19 00:36:40 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -31,7 +31,10 @@ GetClassInfoExA( WNDCLASSEXW w; BOOL retval; NTSTATUS Status; - Status = HEAP_strdupAtoW (&str, lpszClass, NULL); + if(IS_ATOM(lpszClass)) + str = (LPWSTR)lpszClass; + else + Status = HEAP_strdupAtoW (&str, lpszClass, NULL); if ( !NT_SUCCESS (Status) ) { SetLastError (RtlNtStatusToDosError(Status)); @@ -47,10 +50,11 @@ GetClassInfoExA( SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY)); return 0; } - + w.lpszMenuName = (LPCWSTR)&str2; retval = (BOOL)NtUserGetClassInfo(hinst, str, &w, TRUE, 0); - HEAP_free(str); + if(!IS_ATOM(str)) + HEAP_free(str); RtlCopyMemory ( lpwcx, &w, sizeof(WNDCLASSEXW) ); if (!IS_INTRESOURCE(w.lpszMenuName)) @@ -76,8 +80,11 @@ GetClassInfoExW( UNICODE_STRING str2; WNDCLASSEXW w; WINBOOL retval; - str = HEAP_strdupW (lpszClass, wcslen(lpszClass) ); - + if(IS_ATOM(lpszClass)) + str = (LPWSTR)lpszClass; + else + str = HEAP_strdupW (lpszClass, wcslen(lpszClass) ); + str2.Length = 0; str2.MaximumLength = 255; str2.Buffer = (PWSTR)RtlAllocateHeap(RtlGetProcessHeap(), 0, @@ -90,13 +97,15 @@ GetClassInfoExW( w.lpszMenuName = (LPCWSTR)&str2; retval = (BOOL)NtUserGetClassInfo(hinst, str, &w, TRUE, 0); - HEAP_free(str); + if(!IS_ATOM(str)) + HEAP_free(str); RtlCopyMemory ( lpwcx, &w, sizeof(WNDCLASSEXW) ); if (!IS_INTRESOURCE(w.lpszMenuName) ) { lpwcx->lpszMenuName = heap_string_poolW (str2.Buffer, str2.Length); } + RtlFreeHeap(RtlGetProcessHeap(), 0, str2.Buffer); return retval; } diff --git a/reactos/lib/user32/windows/window.c b/reactos/lib/user32/windows/window.c index 35b805cf0d7..1b03ee844a3 100644 --- a/reactos/lib/user32/windows/window.c +++ b/reactos/lib/user32/windows/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.66 2003/08/18 23:52:03 weiden Exp $ +/* $Id: window.c,v 1.67 2003/08/19 00:36:40 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -722,7 +722,7 @@ CreateWindowExW(DWORD dwExStyle, } } } - + if(!hMenu) { wce.cbSize = sizeof(WNDCLASSEXW); diff --git a/reactos/subsys/win32k/ntuser/class.c b/reactos/subsys/win32k/ntuser/class.c index 836b8e6e2f6..1df6da48f8d 100644 --- a/reactos/subsys/win32k/ntuser/class.c +++ b/reactos/subsys/win32k/ntuser/class.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: class.c,v 1.31 2003/08/18 23:52:03 weiden Exp $ +/* $Id: class.c,v 1.32 2003/08/19 00:36:40 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -181,12 +181,12 @@ NtUserGetClassInfo(HINSTANCE hInst, wcex->hIcon = Class->hIcon; wcex->hCursor = Class->hCursor; wcex->hbrBackground = Class->hbrBackground; - //wcex->lpszMenuName = (LPCWSTR)Class->lpszMenuName; + if(Class->lpszMenuName) + RtlCopyUnicodeString((PUNICODE_STRING)wcex->lpszMenuName, Class->lpszMenuName); + else + wcex->lpszMenuName = (LPCWSTR)NULL; wcex->lpszClassName = (LPCWSTR)Class->lpszClassName; wcex->hIconSm = Class->hIconSm; - DbgPrint("Copying string...\n"); - RtlCopyUnicodeString((PUNICODE_STRING)wcex->lpszMenuName, Class->lpszMenuName); - DbgPrint("Copied string...\n"); return 1; }