mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
fixed some bugs in GetClassInfoExA/W()
svn path=/trunk/; revision=5660
This commit is contained in:
parent
1717987643
commit
37da5cd4d8
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -31,7 +31,10 @@ GetClassInfoExA(
|
||||||
WNDCLASSEXW w;
|
WNDCLASSEXW w;
|
||||||
BOOL retval;
|
BOOL retval;
|
||||||
NTSTATUS Status;
|
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) )
|
if ( !NT_SUCCESS (Status) )
|
||||||
{
|
{
|
||||||
SetLastError (RtlNtStatusToDosError(Status));
|
SetLastError (RtlNtStatusToDosError(Status));
|
||||||
|
@ -47,10 +50,11 @@ GetClassInfoExA(
|
||||||
SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
|
SetLastError (RtlNtStatusToDosError(STATUS_NO_MEMORY));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
w.lpszMenuName = (LPCWSTR)&str2;
|
w.lpszMenuName = (LPCWSTR)&str2;
|
||||||
retval = (BOOL)NtUserGetClassInfo(hinst, str, &w, TRUE, 0);
|
retval = (BOOL)NtUserGetClassInfo(hinst, str, &w, TRUE, 0);
|
||||||
HEAP_free(str);
|
if(!IS_ATOM(str))
|
||||||
|
HEAP_free(str);
|
||||||
RtlCopyMemory ( lpwcx, &w, sizeof(WNDCLASSEXW) );
|
RtlCopyMemory ( lpwcx, &w, sizeof(WNDCLASSEXW) );
|
||||||
|
|
||||||
if (!IS_INTRESOURCE(w.lpszMenuName))
|
if (!IS_INTRESOURCE(w.lpszMenuName))
|
||||||
|
@ -76,8 +80,11 @@ GetClassInfoExW(
|
||||||
UNICODE_STRING str2;
|
UNICODE_STRING str2;
|
||||||
WNDCLASSEXW w;
|
WNDCLASSEXW w;
|
||||||
WINBOOL retval;
|
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.Length = 0;
|
||||||
str2.MaximumLength = 255;
|
str2.MaximumLength = 255;
|
||||||
str2.Buffer = (PWSTR)RtlAllocateHeap(RtlGetProcessHeap(), 0,
|
str2.Buffer = (PWSTR)RtlAllocateHeap(RtlGetProcessHeap(), 0,
|
||||||
|
@ -90,13 +97,15 @@ GetClassInfoExW(
|
||||||
|
|
||||||
w.lpszMenuName = (LPCWSTR)&str2;
|
w.lpszMenuName = (LPCWSTR)&str2;
|
||||||
retval = (BOOL)NtUserGetClassInfo(hinst, str, &w, TRUE, 0);
|
retval = (BOOL)NtUserGetClassInfo(hinst, str, &w, TRUE, 0);
|
||||||
HEAP_free(str);
|
if(!IS_ATOM(str))
|
||||||
|
HEAP_free(str);
|
||||||
RtlCopyMemory ( lpwcx, &w, sizeof(WNDCLASSEXW) );
|
RtlCopyMemory ( lpwcx, &w, sizeof(WNDCLASSEXW) );
|
||||||
|
|
||||||
if (!IS_INTRESOURCE(w.lpszMenuName) )
|
if (!IS_INTRESOURCE(w.lpszMenuName) )
|
||||||
{
|
{
|
||||||
lpwcx->lpszMenuName = heap_string_poolW (str2.Buffer, str2.Length);
|
lpwcx->lpszMenuName = heap_string_poolW (str2.Buffer, str2.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, str2.Buffer);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, str2.Buffer);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -722,7 +722,7 @@ CreateWindowExW(DWORD dwExStyle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!hMenu)
|
if(!hMenu)
|
||||||
{
|
{
|
||||||
wce.cbSize = sizeof(WNDCLASSEXW);
|
wce.cbSize = sizeof(WNDCLASSEXW);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* 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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -181,12 +181,12 @@ NtUserGetClassInfo(HINSTANCE hInst,
|
||||||
wcex->hIcon = Class->hIcon;
|
wcex->hIcon = Class->hIcon;
|
||||||
wcex->hCursor = Class->hCursor;
|
wcex->hCursor = Class->hCursor;
|
||||||
wcex->hbrBackground = Class->hbrBackground;
|
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->lpszClassName = (LPCWSTR)Class->lpszClassName;
|
||||||
wcex->hIconSm = Class->hIconSm;
|
wcex->hIconSm = Class->hIconSm;
|
||||||
DbgPrint("Copying string...\n");
|
|
||||||
RtlCopyUnicodeString((PUNICODE_STRING)wcex->lpszMenuName, Class->lpszMenuName);
|
|
||||||
DbgPrint("Copied string...\n");
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue