minor fixes

svn path=/trunk/; revision=5662
This commit is contained in:
Thomas Bluemel 2003-08-19 01:03:41 +00:00
parent 01533e4a5d
commit 6569fdad17
2 changed files with 34 additions and 11 deletions

View file

@ -1,4 +1,4 @@
/* $Id: class.c,v 1.32 2003/08/19 00:49:42 weiden Exp $ /* $Id: class.c,v 1.33 2003/08/19 01:03:41 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
@ -137,6 +137,13 @@ GetClassInfoA(
{ {
WNDCLASSEXA w; WNDCLASSEXA w;
WINBOOL retval; WINBOOL retval;
if(!lpClassName || !lpWndClass)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
retval = GetClassInfoExA(hInstance,lpClassName,&w); retval = GetClassInfoExA(hInstance,lpClassName,&w);
RtlCopyMemory (lpWndClass,&w.style,sizeof(WNDCLASSA)); RtlCopyMemory (lpWndClass,&w.style,sizeof(WNDCLASSA));
return retval; return retval;
@ -154,6 +161,13 @@ GetClassInfoW(
{ {
WNDCLASSEXW w; WNDCLASSEXW w;
WINBOOL retval; WINBOOL retval;
if(!lpClassName || !lpWndClass)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
retval = GetClassInfoExW(hInstance,lpClassName,&w); retval = GetClassInfoExW(hInstance,lpClassName,&w);
RtlCopyMemory (lpWndClass,&w.style,sizeof(WNDCLASSW)); RtlCopyMemory (lpWndClass,&w.style,sizeof(WNDCLASSW));
return retval; return retval;
@ -221,6 +235,9 @@ GetClassNameA(
int result; int result;
LPWSTR ClassNameW; LPWSTR ClassNameW;
NTSTATUS Status; NTSTATUS Status;
if(!lpClassName)
return 0;
ClassNameW = HEAP_alloc ( (nMaxCount+1)*sizeof(WCHAR) ); ClassNameW = HEAP_alloc ( (nMaxCount+1)*sizeof(WCHAR) );
@ -249,6 +266,9 @@ GetClassNameW(
{ {
int result; int result;
LPWSTR ClassNameW; LPWSTR ClassNameW;
if(!lpClassName)
return 0;
ClassNameW = HEAP_alloc ( (nMaxCount+1) * sizeof(WCHAR) ); ClassNameW = HEAP_alloc ( (nMaxCount+1) * sizeof(WCHAR) );

View file

@ -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.32 2003/08/19 00:36:40 weiden Exp $ /* $Id: class.c,v 1.33 2003/08/19 01:03:41 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -257,9 +257,10 @@ NtUserGetClassName (
WindowObject = W32kGetWindowObject(hWnd); WindowObject = W32kGetWindowObject(hWnd);
if (WindowObject == NULL) if (WindowObject == NULL)
{ {
return(0); SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
} return 0;
}
Ret = W32kGetClassName(WindowObject, lpClassName, nMaxCount); Ret = W32kGetClassName(WindowObject, lpClassName, nMaxCount);
W32kReleaseWindowObject(WindowObject); W32kReleaseWindowObject(WindowObject);
return(Ret); return(Ret);
@ -450,9 +451,10 @@ NtUserGetClassLong(HWND hWnd, DWORD Offset, BOOL Ansi)
WindowObject = W32kGetWindowObject(hWnd); WindowObject = W32kGetWindowObject(hWnd);
if (WindowObject == NULL) if (WindowObject == NULL)
{ {
return(0); SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
} return 0;
}
Ret = W32kGetClassLong(WindowObject, Offset, Ansi); Ret = W32kGetClassLong(WindowObject, Offset, Ansi);
W32kReleaseWindowObject(WindowObject); W32kReleaseWindowObject(WindowObject);
return(Ret); return(Ret);
@ -528,9 +530,10 @@ NtUserSetClassLong(HWND hWnd,
WindowObject = W32kGetWindowObject(hWnd); WindowObject = W32kGetWindowObject(hWnd);
if (WindowObject == NULL) if (WindowObject == NULL)
{ {
return(0); SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
} return 0;
}
Ret = W32kGetClassLong(WindowObject, Offset, Ansi); Ret = W32kGetClassLong(WindowObject, Offset, Ansi);
W32kSetClassLong(WindowObject, Offset, dwNewLong, Ansi); W32kSetClassLong(WindowObject, Offset, dwNewLong, Ansi);
W32kReleaseWindowObject(WindowObject); W32kReleaseWindowObject(WindowObject);