-/* $Id: class.c,v 1.25 2003/08/06 16:47:35 weiden Exp $
+/* $Id: class.c,v 1.26 2003/08/07 04:03:24 royce Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
#include <string.h>
#include <stdlib.h>
#include <debug.h>
+#include <window.h> /* for IS_ATOM */
/* copied from menu.c */
NTSTATUS
/*
- * @implemented
+ * @unimplemented
*/
DWORD STDCALL
GetClassLongA(HWND hWnd, int nIndex)
{
+ /*
+ * FIXME - for GCL_MENUNAME, we need to allocate a buffer
+ * in thread-local storage and convert the results back
+ * to that. Subsequent calls should be sure and clean that
+ * up
+ */
return(NtUserGetClassLong(hWnd, nIndex, TRUE));
}
RegisterClassA(CONST WNDCLASSA *lpWndClass)
{
WNDCLASSEXA Class;
-
- if(!lpWndClass) return (ATOM)0;
- RtlMoveMemory ( &Class.style, lpWndClass, sizeof(WNDCLASSA));
+ if ( !lpWndClass ) return (ATOM)0;
+
+ RtlMoveMemory ( &Class.style, lpWndClass, sizeof(WNDCLASSA) );
+
Class.cbSize = sizeof(WNDCLASSEXA);
Class.hIconSm = INVALID_HANDLE_VALUE;
- return RegisterClassExA(&Class);
+
+ return RegisterClassExA ( &Class );
}
/*
NTSTATUS Status;
LPWSTR ClassName = NULL;
LPWSTR MenuName = NULL;
-
+
if(!lpwcx || (lpwcx->cbSize != sizeof(WNDCLASSEXA)))
return (ATOM)0;
-
+
if(!lpwcx->lpszClassName) return (ATOM)0;
-
+
hHeap = RtlGetProcessHeap();
RtlMoveMemory(&wndclass, lpwcx, sizeof(WNDCLASSEXW));
-
- if(HIWORD(lpwcx->lpszClassName))
+
+ if ( !IS_ATOM(lpwcx->lpszClassName) )
{
Status = HEAP_strdupA2W (hHeap, &ClassName, (LPCSTR)lpwcx->lpszClassName, NULL);
if (!NT_SUCCESS (Status))
}
wndclass.lpszClassName = ClassName;
}
-
- if(HIWORD(lpwcx->lpszMenuName))
+
+ if ( !IS_ATOM(lpwcx->lpszMenuName) )
{
Status = HEAP_strdupA2W (hHeap, &MenuName, (LPCSTR)lpwcx->lpszMenuName, NULL);
if (!NT_SUCCESS (Status))
wndclass.lpszMenuName = MenuName;
}
- Atom = NtUserRegisterClassExWOW(&wndclass,
- FALSE,
- 0,
- 0,
- 0);
+ Atom = NtUserRegisterClassExWOW (
+ &wndclass,
+ FALSE,
+ 0,
+ 0,
+ 0);
/* free strings if neccessary */
if(MenuName) RtlFreeHeap (hHeap, 0, MenuName);
LPWSTR ClassName = NULL;
LPWSTR MenuName = NULL;
ULONG len;
-
+
if(!lpwcx || (lpwcx->cbSize != sizeof(WNDCLASSEXA)))
return (ATOM)0;
-
+
if(!lpwcx->lpszClassName) return (ATOM)0;
-
+
hHeap = RtlGetProcessHeap();
RtlMoveMemory(&wndclass, lpwcx, sizeof(WNDCLASSEXW));
-
+
/* copy strings if needed */
-
- if(HIWORD(lpwcx->lpszClassName))
+
+ if ( !IS_ATOM(lpwcx->lpszClassName) )
{
len = lstrlenW(lpwcx->lpszClassName);
ClassName = RtlAllocateHeap (hHeap, 0, (len + 1) * sizeof(WCHAR));
SetLastError(RtlNtStatusToDosError(STATUS_NO_MEMORY));
return 0;
}
- memcpy(&ClassName, &lpwcx->lpszClassName, len);
-
+ RtlMoveMemory(&ClassName, &lpwcx->lpszClassName, len);
+
wndclass.lpszClassName = ClassName;
}
-
- if(HIWORD(lpwcx->lpszMenuName))
+
+ if ( !IS_ATOM(lpwcx->lpszMenuName) )
{
len = lstrlenW(lpwcx->lpszMenuName);
MenuName = RtlAllocateHeap (hHeap, 0, (len + 1) * sizeof(WCHAR));
SetLastError(RtlNtStatusToDosError(STATUS_NO_MEMORY));
return 0;
}
- memcpy(&MenuName, &lpwcx->lpszMenuName, len);
-
+ RtlMoveMemory(&MenuName, &lpwcx->lpszMenuName, len);
+
wndclass.lpszMenuName = MenuName;
}
- Atom = NtUserRegisterClassExWOW(&wndclass,
- TRUE,
- 0,
- 0,
- 0);
+ Atom = NtUserRegisterClassExWOW (
+ &wndclass,
+ TRUE,
+ 0,
+ 0,
+ 0);
/* free strings if neccessary */
if(MenuName) RtlFreeHeap (hHeap, 0, MenuName);
RegisterClassW(CONST WNDCLASSW *lpWndClass)
{
WNDCLASSEXW Class;
-
- if(!lpWndClass) return (ATOM)0;
- RtlMoveMemory(&Class.style, lpWndClass, sizeof(WNDCLASSW));
+ if ( !lpWndClass ) return (ATOM)0;
+
+ RtlMoveMemory ( &Class.style, lpWndClass, sizeof(WNDCLASSW) );
Class.cbSize = sizeof(WNDCLASSEXW);
Class.hIconSm = INVALID_HANDLE_VALUE;
- return RegisterClassExW(&Class);
+ return RegisterClassExW ( &Class );
}
/*
- * @mplemented
+ * @unimplemented
*/
DWORD
STDCALL
int nIndex,
LONG dwNewLong)
{
+ /* FIXME - handle GCL_MENUNAME special case */
return(NtUserSetClassLong(hWnd, nIndex, dwNewLong, TRUE));
}
/*
- * @implemented
+ * @unimplemented
*/
DWORD
STDCALL
int nIndex,
LONG dwNewLong)
{
+ /* FIXME - handle GCL_MENUNAME special case */
return(NtUserSetClassLong(hWnd, nIndex, dwNewLong, FALSE));
}