Began work on message queue and default window procedure

svn path=/trunk/; revision=2504
This commit is contained in:
David Welch 2002-01-13 22:52:08 +00:00
parent a600e78a7a
commit 43b2190795
27 changed files with 956 additions and 924 deletions

View file

@ -2,7 +2,7 @@
#include <string.h>
#include <windows.h>
#define SIZE (128*1024*1024)
#define SIZE (65*1024*1024)
ULONG x[SIZE / 4096];

View file

@ -531,3 +531,5 @@ NtUserWaitMessage 0
NtUserWin32PoolAllocationStats 6
NtUserWindowFromPoint 2
NtUserYieldTask 0
# ReactOS only system calls
NtUserAcquireOrReleaseInputOwnership 1

View file

@ -318,8 +318,10 @@ typedef enum _SID_NAME_USE {
#define HIBYTE(w) ((BYTE) (((WORD) (w) >> 8) & 0xFF))
#define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF))
#define SHIWORD(l) ((INT16) (((DWORD) (l) >> 16) & 0xFFFF))
#define LOBYTE(w) ((BYTE) (w))
#define LOWORD(l) ((WORD) (l))
#define SLOWORD(l) ((INT16) (l))
#define MAKELONG(a, b) ((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16))
#define MAKEWORD(a, b) ((WORD) (((BYTE) (a)) | ((WORD) ((BYTE) (b))) << 8))

View file

@ -154,12 +154,14 @@ typedef struct _GDI_TEB_BATCH
ULONG Buffer[0x136];
} GDI_TEB_BATCH, *PGDI_TEB_BATCH;
// FIXME: Redundant definition of W32THREAD also in ntoskrnl\include\internal\ps.h
typedef struct _W32THREAD
{
PVOID MessageQueue;
} __attribute__((packed)) W32THREAD, *PW32THREAD;
PW32THREAD STDCALL
PsGetWin32Thread(VOID);
typedef struct _TEB
{
NT_TIB Tib; // 00h

View file

@ -1,4 +1,4 @@
# $Id: makefile_rex,v 1.20 2001/08/21 20:13:07 chorns Exp $
# $Id: makefile_rex,v 1.21 2002/01/13 22:52:07 dwelch Exp $
PATH_TO_TOP = ../..
@ -32,7 +32,8 @@ MISC_OBJECTS = \
WINDOWS_OBJECTS = \
windows/class.o \
windows/message.o \
windows/window.o
windows/window.o \
windows/defwnd.o
OBJECTS = \
$(MISC_OBJECTS) \

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.2 2001/07/06 00:05:05 rex Exp $
/* $Id: window.c,v 1.3 2002/01/13 22:52:07 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -8,79 +8,67 @@
* UPDATE HISTORY:
* 06-06-2001 CSH Created
*/
/* INCLUDES ******************************************************************/
#include <windows.h>
#include <user32.h>
#include <window.h>
#include <debug.h>
/* FUNCTIONS *****************************************************************/
WINBOOL
STDCALL
AdjustWindowRect(
LPRECT lpRect,
WINBOOL STDCALL
AdjustWindowRect(LPRECT lpRect,
DWORD dwStyle,
WINBOOL bMenu)
{
return FALSE;
return(AdjustWindowRectEx(lpRect, dwStyle, bMenu, 0));
}
WINBOOL
STDCALL
AdjustWindowRectEx(
LPRECT lpRect,
WINBOOL STDCALL
AdjustWindowRectEx(LPRECT lpRect,
DWORD dwStyle,
WINBOOL bMenu,
DWORD dwExStyle)
{
return FALSE;
return(FALSE);
}
WINBOOL
STDCALL
AllowSetForegroundWindow(
DWORD dwProcessId)
WINBOOL STDCALL
AllowSetForegroundWindow(DWORD dwProcessId)
{
return FALSE;
return(FALSE);
}
WINBOOL
STDCALL
AnimateWindow(
HWND hwnd,
WINBOOL STDCALL
AnimateWindow(HWND hwnd,
DWORD dwTime,
DWORD dwFlags)
{
return FALSE;
}
UINT
STDCALL
ArrangeIconicWindows(
HWND hWnd)
UINT STDCALL
ArrangeIconicWindows(HWND hWnd)
{
return 0;
}
HDWP
STDCALL
BeginDeferWindowPos(
int nNumWindows)
HDWP STDCALL
BeginDeferWindowPos(int nNumWindows)
{
return (HDWP)0;
}
WINBOOL
STDCALL
BringWindowToTop(
HWND hWnd)
WINBOOL STDCALL
BringWindowToTop(HWND hWnd)
{
return FALSE;
}
WORD
STDCALL
CascadeWindows(
HWND hwndParent,
WORD STDCALL
CascadeWindows(HWND hwndParent,
UINT wHow,
CONST RECT *lpRect,
UINT cKids,
@ -89,37 +77,29 @@ CascadeWindows(
return 0;
}
HWND
STDCALL
ChildWindowFromPoint(
HWND hWndParent,
HWND STDCALL
ChildWindowFromPoint(HWND hWndParent,
POINT Point)
{
return (HWND)0;
}
HWND
STDCALL
ChildWindowFromPointEx(
HWND hwndParent,
HWND STDCALL
ChildWindowFromPointEx(HWND hwndParent,
POINT pt,
UINT uFlags)
{
return (HWND)0;
}
WINBOOL
STDCALL
CloseWindow(
HWND hWnd)
WINBOOL STDCALL
CloseWindow(HWND hWnd)
{
return FALSE;
}
HWND
STDCALL
CreateWindowExA(
DWORD dwExStyle,
HWND STDCALL
CreateWindowExA(DWORD dwExStyle,
LPCSTR lpClassName,
LPCSTR lpWindowName,
DWORD dwStyle,
@ -136,26 +116,31 @@ CreateWindowExA(
UNICODE_STRING ClassName;
HWND Handle;
if (IS_ATOM(lpClassName)) {
if (IS_ATOM(lpClassName))
{
RtlInitUnicodeString(&ClassName, NULL);
ClassName.Buffer = (LPWSTR)lpClassName;
} else {
if (!RtlCreateUnicodeStringFromAsciiz(&(ClassName), (PCSZ)lpClassName)) {
}
else
{
if (!RtlCreateUnicodeStringFromAsciiz(&(ClassName), (PCSZ)lpClassName))
{
SetLastError(ERROR_OUTOFMEMORY);
return (HWND)0;
}
}
if (!RtlCreateUnicodeStringFromAsciiz(&WindowName, (PCSZ)lpWindowName)) {
if (!IS_ATOM(lpClassName)) {
if (!RtlCreateUnicodeStringFromAsciiz(&WindowName, (PCSZ)lpWindowName))
{
if (!IS_ATOM(lpClassName))
{
RtlFreeUnicodeString(&ClassName);
}
SetLastError(ERROR_OUTOFMEMORY);
return (HWND)0;
}
Handle = NtUserCreateWindowEx(
dwExStyle,
Handle = NtUserCreateWindowEx(dwExStyle,
&ClassName,
&WindowName,
dwStyle,
@ -171,17 +156,16 @@ CreateWindowExA(
RtlFreeUnicodeString(&WindowName);
if (!IS_ATOM(lpClassName)) {
if (!IS_ATOM(lpClassName))
{
RtlFreeUnicodeString(&ClassName);
}
return Handle;
}
HWND
STDCALL
CreateWindowExW(
DWORD dwExStyle,
HWND STDCALL
CreateWindowExW(DWORD dwExStyle,
LPCWSTR lpClassName,
LPCWSTR lpWindowName,
DWORD dwStyle,
@ -198,17 +182,19 @@ CreateWindowExW(
UNICODE_STRING ClassName;
HANDLE Handle;
if (IS_ATOM(lpClassName)) {
if (IS_ATOM(lpClassName))
{
RtlInitUnicodeString(&ClassName, NULL);
ClassName.Buffer = (LPWSTR)lpClassName;
} else {
}
else
{
RtlInitUnicodeString(&ClassName, lpClassName);
}
RtlInitUnicodeString(&WindowName, lpWindowName);
Handle = NtUserCreateWindowEx(
dwExStyle,
Handle = NtUserCreateWindowEx(dwExStyle,
&ClassName,
&WindowName,
dwStyle,
@ -225,10 +211,8 @@ CreateWindowExW(
return (HWND)Handle;
}
HDWP
STDCALL
DeferWindowPos(
HDWP hWinPosInfo,
HDWP STDCALL
DeferWindowPos(HDWP hWinPosInfo,
HWND hWnd,
HWND hWndInsertAfter,
int x,
@ -240,87 +224,42 @@ DeferWindowPos(
return (HDWP)0;
}
LRESULT
STDCALL
DefWindowProcA(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
{
switch (Msg)
{
case WM_CREATE:
return 0;
case WM_DESTROY:
return 0;
default:
return 0;
}
return 0;
}
LRESULT
STDCALL
DefWindowProcW(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
{
return (LRESULT)0;
}
WINBOOL
STDCALL
DestroyWindow(
HWND hWnd)
WINBOOL STDCALL
DestroyWindow(HWND hWnd)
{
return FALSE;
}
WINBOOL
STDCALL
EndDeferWindowPos(
HDWP hWinPosInfo)
WINBOOL STDCALL
EndDeferWindowPos(HDWP hWinPosInfo)
{
return FALSE;
}
WINBOOL
STDCALL
EnumChildWindows(
HWND hWndParent,
WINBOOL STDCALL
EnumChildWindows(HWND hWndParent,
ENUMWINDOWSPROC lpEnumFunc,
LPARAM lParam)
{
return FALSE;
}
WINBOOL
STDCALL
EnumThreadWindows(
DWORD dwThreadId,
WINBOOL STDCALL
EnumThreadWindows(DWORD dwThreadId,
ENUMWINDOWSPROC lpfn,
LPARAM lParam)
{
return FALSE;
}
WINBOOL
STDCALL
EnumWindows(
ENUMWINDOWSPROC lpEnumFunc,
WINBOOL STDCALL
EnumWindows(ENUMWINDOWSPROC lpEnumFunc,
LPARAM lParam)
{
return FALSE;
}
HWND
STDCALL
HWND STDCALL
FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName)
{
//FIXME: FindWindow does not search children, but FindWindowEx does.
@ -328,10 +267,8 @@ FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName)
return FindWindowExA (NULL, NULL, lpClassName, lpWindowName);
}
HWND
STDCALL
FindWindowExA(
HWND hwndParent,
HWND STDCALL
FindWindowExA(HWND hwndParent,
HWND hwndChildAfter,
LPCSTR lpszClass,
LPCSTR lpszWindow)
@ -339,8 +276,7 @@ FindWindowExA(
return (HWND)0;
}
HWND
STDCALL
HWND STDCALL
FindWindowW(LPCWSTR lpClassName, LPCWSTR lpWindowName)
{
//FIXME: FindWindow does not search children, but FindWindowEx does.
@ -348,10 +284,8 @@ FindWindowW(LPCWSTR lpClassName, LPCWSTR lpWindowName)
return FindWindowExW (NULL, NULL, lpClassName, lpWindowName);
}
HWND
STDCALL
FindWindowExW(
HWND hwndParent,
HWND STDCALL
FindWindowExW(HWND hwndParent,
HWND hwndChildAfter,
LPCWSTR lpszClass,
LPCWSTR lpszWindow)
@ -359,10 +293,8 @@ FindWindowExW(
return (HWND)0;
}
WINBOOL
STDCALL
GetAltTabInfo(
HWND hwnd,
WINBOOL STDCALL
GetAltTabInfo(HWND hwnd,
int iItem,
PALTTABINFO pati,
LPTSTR pszItemText,
@ -371,10 +303,8 @@ GetAltTabInfo(
return FALSE;
}
WINBOOL
STDCALL
GetAltTabInfoA(
HWND hwnd,
WINBOOL STDCALL
GetAltTabInfoA(HWND hwnd,
int iItem,
PALTTABINFO pati,
LPSTR pszItemText,
@ -383,10 +313,8 @@ GetAltTabInfoA(
return FALSE;
}
WINBOOL
STDCALL
GetAltTabInfoW(
HWND hwnd,
WINBOOL STDCALL
GetAltTabInfoW(HWND hwnd,
int iItem,
PALTTABINFO pati,
LPWSTR pszItemText,
@ -395,260 +323,202 @@ GetAltTabInfoW(
return FALSE;
}
HWND
STDCALL
GetAncestor(
HWND hwnd,
HWND STDCALL
GetAncestor(HWND hwnd,
UINT gaFlags)
{
return (HWND)0;
}
WINBOOL
STDCALL
GetClientRect(
HWND hWnd,
WINBOOL STDCALL
GetClientRect(HWND hWnd,
LPRECT lpRect)
{
return FALSE;
}
HWND
STDCALL
HWND STDCALL
GetDesktopWindow(VOID)
{
return (HWND)0;
}
HWND
STDCALL
HWND STDCALL
GetForegroundWindow(VOID)
{
return (HWND)0;
}
WINBOOL
STDCALL
GetGUIThreadInfo(
DWORD idThread,
WINBOOL STDCALL
GetGUIThreadInfo(DWORD idThread,
LPGUITHREADINFO lpgui)
{
return FALSE;
}
HWND
STDCALL
GetLastActivePopup(
HWND hWnd)
HWND STDCALL
GetLastActivePopup(HWND hWnd)
{
return (HWND)0;
}
HWND
STDCALL
GetParent(
HWND hWnd)
HWND STDCALL
GetParent(HWND hWnd)
{
return (HWND)0;
}
WINBOOL
STDCALL
GetProcessDefaultLayout(
DWORD *pdwDefaultLayout)
WINBOOL STDCALL
GetProcessDefaultLayout(DWORD *pdwDefaultLayout)
{
return FALSE;
}
WINBOOL
STDCALL
GetTitleBarInfo(
HWND hwnd,
WINBOOL STDCALL
GetTitleBarInfo(HWND hwnd,
PTITLEBARINFO pti)
{
return FALSE;
}
HWND
STDCALL
GetTopWindow(
HWND hWnd)
HWND STDCALL
GetTopWindow(HWND hWnd)
{
return (HWND)0;
}
HWND
STDCALL
GetWindow(
HWND hWnd,
HWND STDCALL
GetWindow(HWND hWnd,
UINT uCmd)
{
return (HWND)0;
}
WINBOOL
STDCALL
GetWindowInfo(
HWND hwnd,
WINBOOL STDCALL
GetWindowInfo(HWND hwnd,
PWINDOWINFO pwi)
{
return FALSE;
}
UINT
STDCALL
GetWindowModuleFileName(
HWND hwnd,
UINT STDCALL
GetWindowModuleFileName(HWND hwnd,
LPSTR lpszFileName,
UINT cchFileNameMax)
{
return 0;
}
UINT
STDCALL
GetWindowModuleFileNameA(
HWND hwnd,
UINT STDCALL
GetWindowModuleFileNameA(HWND hwnd,
LPSTR lpszFileName,
UINT cchFileNameMax)
{
return 0;
}
UINT
STDCALL
GetWindowModuleFileNameW(
HWND hwnd,
UINT STDCALL
GetWindowModuleFileNameW(HWND hwnd,
LPWSTR lpszFileName,
UINT cchFileNameMax)
{
return 0;
}
WINBOOL
STDCALL
GetWindowPlacement(
HWND hWnd,
WINBOOL STDCALL
GetWindowPlacement(HWND hWnd,
WINDOWPLACEMENT *lpwndpl)
{
return FALSE;
}
WINBOOL
STDCALL
GetWindowRect(
HWND hWnd,
WINBOOL STDCALL
GetWindowRect(HWND hWnd,
LPRECT lpRect)
{
return FALSE;
}
int
STDCALL
GetWindowTextA(
HWND hWnd,
int STDCALL
GetWindowTextA(HWND hWnd,
LPSTR lpString,
int nMaxCount)
{
return 0;
}
int
STDCALL
GetWindowTextLengthA(
HWND hWnd)
int STDCALL
GetWindowTextLengthA(HWND hWnd)
{
return 0;
}
int
STDCALL
GetWindowTextLengthW(
HWND hWnd)
int STDCALL
GetWindowTextLengthW(HWND hWnd)
{
return 0;
}
int
STDCALL
GetWindowTextW(
HWND hWnd,
int STDCALL
GetWindowTextW(HWND hWnd,
LPWSTR lpString,
int nMaxCount)
{
return 0;
}
DWORD
STDCALL
GetWindowThreadProcessId(
HWND hWnd,
DWORD STDCALL
GetWindowThreadProcessId(HWND hWnd,
LPDWORD lpdwProcessId)
{
return 0;
}
WINBOOL
STDCALL
IsChild(
HWND hWndParent,
WINBOOL STDCALL
IsChild(HWND hWndParent,
HWND hWnd)
{
return FALSE;
}
WINBOOL
STDCALL
IsIconic(
HWND hWnd)
WINBOOL STDCALL
IsIconic(HWND hWnd)
{
return FALSE;
}
WINBOOL
STDCALL
IsWindow(
HWND hWnd)
WINBOOL STDCALL
IsWindow(HWND hWnd)
{
return FALSE;
}
WINBOOL
STDCALL
IsWindowUnicode(
HWND hWnd)
WINBOOL STDCALL
IsWindowUnicode(HWND hWnd)
{
return FALSE;
}
WINBOOL
STDCALL
IsWindowVisible(
HWND hWnd)
WINBOOL STDCALL
IsWindowVisible(HWND hWnd)
{
return FALSE;
}
WINBOOL
STDCALL
IsZoomed(
HWND hWnd)
WINBOOL STDCALL
IsZoomed(HWND hWnd)
{
return FALSE;
}
WINBOOL
STDCALL
LockSetForegroundWindow(
UINT uLockCode)
WINBOOL STDCALL
LockSetForegroundWindow(UINT uLockCode)
{
return FALSE;
}
WINBOOL
STDCALL
MoveWindow(
HWND hWnd,
WINBOOL STDCALL
MoveWindow(HWND hWnd,
int X,
int Y,
int nWidth,
@ -658,44 +528,35 @@ MoveWindow(
return FALSE;
}
WINBOOL
STDCALL
OpenIcon(
HWND hWnd)
WINBOOL STDCALL
OpenIcon(HWND hWnd)
{
return FALSE;
}
HWND
STDCALL
RealChildWindowFromPoint(
HWND hwndParent,
HWND STDCALL
RealChildWindowFromPoint(HWND hwndParent,
POINT ptParentClientCoords)
{
return (HWND)0;
}
UINT
RealGetWindowClass(
HWND hwnd,
RealGetWindowClass(HWND hwnd,
LPTSTR pszType,
UINT cchType)
{
return 0;
}
WINBOOL
STDCALL
SetForegroundWindow(
HWND hWnd)
WINBOOL STDCALL
SetForegroundWindow(HWND hWnd)
{
return FALSE;
}
WINBOOL
STDCALL
SetLayeredWindowAttributes(
HWND hwnd,
WINBOOL STDCALL
SetLayeredWindowAttributes(HWND hwnd,
COLORREF crKey,
BYTE bAlpha,
DWORD dwFlags)
@ -703,36 +564,28 @@ SetLayeredWindowAttributes(
return FALSE;
}
HWND
STDCALL
SetParent(
HWND hWndChild,
HWND STDCALL
SetParent(HWND hWndChild,
HWND hWndNewParent)
{
return (HWND)0;
}
WINBOOL
STDCALL
SetProcessDefaultLayout(
DWORD dwDefaultLayout)
WINBOOL STDCALL
SetProcessDefaultLayout(DWORD dwDefaultLayout)
{
return FALSE;
}
WINBOOL
STDCALL
SetWindowPlacement(
HWND hWnd,
WINBOOL STDCALL
SetWindowPlacement(HWND hWnd,
CONST WINDOWPLACEMENT *lpwndpl)
{
return FALSE;
}
WINBOOL
STDCALL
SetWindowPos(
HWND hWnd,
WINBOOL STDCALL
SetWindowPos(HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
@ -743,55 +596,43 @@ SetWindowPos(
return FALSE;
}
WINBOOL
STDCALL
SetWindowTextA(
HWND hWnd,
WINBOOL STDCALL
SetWindowTextA(HWND hWnd,
LPCSTR lpString)
{
return FALSE;
}
WINBOOL
STDCALL
SetWindowTextW(
HWND hWnd,
WINBOOL STDCALL
SetWindowTextW(HWND hWnd,
LPCWSTR lpString)
{
return FALSE;
}
WINBOOL
STDCALL
ShowOwnedPopups(
HWND hWnd,
WINBOOL STDCALL
ShowOwnedPopups(HWND hWnd,
WINBOOL fShow)
{
return FALSE;
}
WINBOOL
STDCALL
ShowWindow(
HWND hWnd,
WINBOOL STDCALL
ShowWindow(HWND hWnd,
int nCmdShow)
{
return NtUserShowWindow(hWnd, nCmdShow);
}
WINBOOL
STDCALL
ShowWindowAsync(
HWND hWnd,
WINBOOL STDCALL
ShowWindowAsync(HWND hWnd,
int nCmdShow)
{
return FALSE;
}
WORD
STDCALL
TileWindows(
HWND hwndParent,
WORD STDCALL
TileWindows(HWND hwndParent,
UINT wHow,
CONST RECT *lpRect,
UINT cKids,
@ -800,10 +641,8 @@ TileWindows(
return 0;
}
WINBOOL
STDCALL
UpdateLayeredWindow(
HWND hwnd,
WINBOOL STDCALL
UpdateLayeredWindow(HWND hwnd,
HDC hdcDst,
POINT *pptDst,
SIZE *psize,
@ -816,10 +655,8 @@ UpdateLayeredWindow(
return FALSE;
}
HWND
STDCALL
WindowFromPoint(
POINT Point)
HWND STDCALL
WindowFromPoint(POINT Point)
{
return (HWND)0;
}

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.124 2002/01/13 22:02:30 ea Exp $
; $Id: ntoskrnl.def,v 1.125 2002/01/13 22:52:07 dwelch Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -503,6 +503,7 @@ NlsMbOemCodePageTag DATA
NlsOemLeadByteInfo DATA
NtAddAtom@8
NtAdjustPrivilegesToken@24
NtAlertThread@4
NtAllocateLocallyUniqueId@4
NtAllocateUuids@12
NtAllocateVirtualMemory@24
@ -593,7 +594,7 @@ PsAssignImpersonationToken@8
PsCreateSystemProcess@12
PsCreateSystemThread@28
PsCreateWin32Process@4
PsDispatchThread@4
PsGetWin32Thread@0
PsEstablishWin32Callouts@24
PsGetCurrentProcessId@0
PsGetCurrentThreadId@0

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.110 2002/01/13 22:02:30 ea Exp $
; $Id: ntoskrnl.edf,v 1.111 2002/01/13 22:52:07 dwelch Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -503,6 +503,7 @@ NlsMbOemCodePageTag DATA
NlsOemLeadByteInfo DATA
NtAddAtom=NtAddAtom@8
NtAdjustPrivilegesToken=NtAdjustPrivilegesToken@24
NtAlertThread=NtAlertThread@4
NtAllocateLocallyUniqueId=NtAllocateLocallyUniqueId@4
NtAllocateUuids=NtAllocateUuids@12
NtAllocateVirtualMemory=NtAllocateVirtualMemory@24
@ -593,7 +594,7 @@ PsAssignImpersonationToken=PsAssignImpersonationToken@8
PsCreateSystemProcess=PsCreateSystemProcess@12
PsCreateSystemThread=PsCreateSystemThread@28
PsCreateWin32Process=PsCreateWin32Process@4
PsDispatchThread=PsDispatchThread@4
PsGetWin32Thread=PsGetWin32Thread@0
PsEstablishWin32Callouts=PsEstablishWin32Callouts@24
PsGetCurrentProcessId=PsGetCurrentProcessId@0
PsGetCurrentThreadId=PsGetCurrentThreadId@0

View file

@ -1,4 +1,4 @@
/* $Id: thread.c,v 1.83 2002/01/08 00:49:01 dwelch Exp $
/* $Id: thread.c,v 1.84 2002/01/13 22:52:07 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -462,7 +462,6 @@ NtAlertResumeThread(IN HANDLE ThreadHandle,
NTSTATUS STDCALL NtAlertThread (IN HANDLE ThreadHandle)
{
#if 0
PETHREAD Thread;
NTSTATUS Status;
NTSTATUS ThreadStatus;
@ -483,8 +482,6 @@ NTSTATUS STDCALL NtAlertThread (IN HANDLE ThreadHandle)
ObDereferenceObject(Thread);
return(STATUS_SUCCESS);
#endif
UNIMPLEMENTED;
}
NTSTATUS STDCALL

View file

@ -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: win32.c,v 1.1 2002/01/04 13:09:11 ekohl Exp $
/* $Id: win32.c,v 1.2 2002/01/13 22:52:07 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -38,9 +38,14 @@
static ULONG PspWin32ProcessSize = 0;
/* FUNCTIONS ***************************************************************/
PW32THREAD STDCALL
PsGetWin32Thread(VOID)
{
return(PsGetCurrentThread()->Win32Thread);
}
NTSTATUS STDCALL
PsCreateWin32Process(PEPROCESS Process)
{

View file

@ -10,8 +10,17 @@ PFN_DIB_PutPixel DIB_4BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c);
PFN_DIB_GetPixel DIB_4BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y);
PFN_DIB_HLine DIB_4BPP_HLine(PSURFOBJ SurfObj, LONG x1, LONG x2, LONG y, ULONG c);
PFN_DIB_VLine DIB_4BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c);
BOOLEAN DIB_To_4BPP_Bitblt( SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
SURFGDI *DestGDI, SURFGDI *SourceGDI,
PRECTL DestRect, POINTL *SourcePoint,
ULONG Delta, XLATEOBJ *ColorTranslation);
PFN_DIB_PutPixel DIB_24BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c);
PFN_DIB_GetPixel DIB_24BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y);
PFN_DIB_HLine DIB_24BPP_HLine(PSURFOBJ SurfObj, LONG x1, LONG x2, LONG y, ULONG c);
PFN_DIB_VLine DIB_24BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c);
PFN_DIB_VLine DIB_24BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG
c);
BOOLEAN DIB_To_24BPP_Bitblt( SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
SURFGDI *DestGDI, SURFGDI *SourceGDI,
PRECTL DestRect, POINTL *SourcePoint,
ULONG Delta, XLATEOBJ *ColorTranslation);

View file

@ -14,6 +14,11 @@
#include "brush.h"
#include "enum.h"
#include "objects.h"
#include <include/mouse.h>
#include <include/object.h>
#include <include/dib.h>
#include <include/surface.h>
#include <include/copybits.h>
BOOL EngIntersectRect(PRECTL prcDst, PRECTL prcSrc1, PRECTL prcSrc2)
{
@ -96,7 +101,7 @@ BOOL EngBitBlt(SURFOBJ *Dest, SURFOBJ *Source,
hTemp = EngCreateBitmap(TempSize,
DIB_GetDIBWidthBytes(DestRect->right - DestRect->left, BitsPerFormat(Dest->iBitmapFormat)),
Dest->iBitmapFormat, 0, NULL);
TempSurf = (PSURFOBJ)AccessUserObject(hTemp);
TempSurf = (PSURFOBJ)AccessUserObject((ULONG)hTemp);
// FIXME: Skip creating a TempSurf if we have the same BPP and palette
EngBitBlt(TempSurf, Source, NULL, NULL, ColorTranslation, &TempRect, SourcePoint, NULL, NULL, NULL, 0);

View file

@ -12,6 +12,7 @@
#include <ddk/ntddk.h>
#include "objects.h"
#include "clip.h"
#include <include/object.h>
// FIXME: Complex clipping doesn't work

View file

@ -12,6 +12,9 @@
#include "objects.h"
#include "enum.h"
#include "../dib/dib.h"
#include <include/mouse.h>
#include <include/object.h>
#include <include/eng.h>
BOOLEAN CopyBitsCopy(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
SURFGDI *DestGDI, SURFGDI *SourceGDI,
@ -108,7 +111,7 @@ BOOL EngCopyBits(SURFOBJ *Dest, SURFOBJ *Source,
// If CopyBits wasn't hooked, BitBlt must be
ret = EngBitBlt(Dest, Source,
NULL, Clip, ColorTranslation, DestRect, SourcePoint,
NULL, NULL, NULL, NULL);
NULL, NULL, NULL, 0);
MouseSafetyOnDrawEnd(Source, SourceGDI);
MouseSafetyOnDrawEnd(Dest, DestGDI);

View file

@ -15,7 +15,8 @@
BOOL FillSolid(SURFOBJ *Surface, PRECTL Dimensions, ULONG iColor)
{
ULONG x, y, LineWidth, leftOfBitmap;
LONG y;
ULONG x, LineWidth, leftOfBitmap;
SURFGDI *SurfaceGDI;
SurfaceGDI = (SURFGDI*)AccessInternalObjectFromUserObject(Surface);

View file

@ -38,7 +38,7 @@ HPALETTE EngCreatePalette(ULONG Mode,
if(Mode==PAL_INDEXED)
{
PalGDI->NumColors = NumColors;
PalGDI->IndexedColors = Colors;
PalGDI->IndexedColors = (PULONG)Colors;
} else
if(Mode==PAL_BITFIELDS)
{

View file

@ -177,7 +177,7 @@ BOOL EngAssociateSurface(HSURF Surface, HDEV Dev, ULONG Hooks)
// Hook up specified functions
if(Hooks & HOOK_BITBLT) SurfGDI->BitBlt = Dc->DriverFunctions.BitBlt;
if(Hooks & HOOK_TRANSPARENTBLT) SurfGDI->TransparentBlt = Dc->DriverFunctions.TransparentBlt;
if(Hooks & HOOK_STRETCHBLT) SurfGDI->StretchBlt = Dc->DriverFunctions.StretchBlt;
if(Hooks & HOOK_STRETCHBLT) SurfGDI->StretchBlt = (PFN_StretchBlt)Dc->DriverFunctions.StretchBlt;
if(Hooks & HOOK_TEXTOUT) SurfGDI->TextOut = Dc->DriverFunctions.TextOut;
if(Hooks & HOOK_PAINT) SurfGDI->Paint = Dc->DriverFunctions.Paint;
if(Hooks & HOOK_STROKEPATH) SurfGDI->StrokePath = Dc->DriverFunctions.StrokePath;
@ -191,7 +191,7 @@ BOOL EngAssociateSurface(HSURF Surface, HDEV Dev, ULONG Hooks)
SurfGDI->CreateDeviceBitmap = Dc->DriverFunctions.CreateDeviceBitmap;
SurfGDI->SetPalette = Dc->DriverFunctions.SetPalette;
SurfGDI->MovePointer = Dc->DriverFunctions.MovePointer;
SurfGDI->SetPointerShape = Dc->DriverFunctions.SetPointerShape;
SurfGDI->SetPointerShape = (PFN_SetPointerShape)Dc->DriverFunctions.SetPointerShape;
return TRUE;
}

View file

@ -5,7 +5,7 @@
#include <ddk/ntddk.h>
VOID
GuiCheck(VOID);
W32kGuiCheck(VOID);
#endif /* __WIN32K_GUICHECK_H */

View file

@ -11,48 +11,51 @@ typedef struct _USER_MESSAGE
typedef struct _USER_MESSAGE_QUEUE
{
LIST_ENTRY ListHead;
PFAST_MUTEX ListLock;
LIST_ENTRY SentMessagesListHead;
LIST_ENTRY PostedMessagesListHead;
LIST_ENTRY HardwareMessagesListHead;
FAST_MUTEX Lock;
BOOLEAN QuitPosted;
ULONG QuitExitCode;
KEVENT NewMessages;
ULONG QueueStatus;
HWND FocusWindow;
} USER_MESSAGE_QUEUE, *PUSER_MESSAGE_QUEUE;
VOID
MsqInitializeMessage(
PUSER_MESSAGE Message,
MsqInitializeMessage(PUSER_MESSAGE Message,
LPMSG Msg);
PUSER_MESSAGE
MsqCreateMessage(
LPMSG Msg);
MsqCreateMessage(LPMSG Msg);
VOID
MsqDestroyMessage(
PUSER_MESSAGE Message);
MsqDestroyMessage(PUSER_MESSAGE Message);
VOID
MsqPostMessage(
PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_MESSAGE Message);
BOOL
MsqRetrieveMessage(
PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_MESSAGE *Message);
MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_MESSAGE Message,
BOOLEAN Hardware);
BOOLEAN
MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
IN BOOLEAN Hardware,
IN BOOLEAN Remove,
IN HWND Wnd,
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message);
VOID
MsqInitializeMessageQueue(
PUSER_MESSAGE_QUEUE MessageQueue);
MsqInitializeMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue);
VOID
MsqFreeMessageQueue(
PUSER_MESSAGE_QUEUE MessageQueue);
MsqFreeMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue);
PUSER_MESSAGE_QUEUE
MsqCreateMessageQueue(VOID);
VOID
MsqDestroyMessageQueue(
PUSER_MESSAGE_QUEUE MessageQueue);
MsqDestroyMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue);
PUSER_MESSAGE_QUEUE
MsqGetHardwareMessageQueue(VOID);
NTSTATUS
MsqWaitForNewMessage(PUSER_MESSAGE_QUEUE MessageQueue);
NTSTATUS
MsqInitializeImpl(VOID);
#endif /* __WIN32K_MSGQUEUE_H */

View file

@ -102,6 +102,13 @@ VOID
ObmDestroyHandleTable(
PUSER_HANDLE_TABLE HandleTable);
PVOID AccessInternalObjectFromUserObject(PVOID UserObject);
PVOID AccessUserObject(ULONG Handle);
ULONG CreateGDIHandle(PVOID InternalObject, PVOID UserObject);
VOID FreeGDIHandle(ULONG Handle);
ULONG AccessHandleFromUserObject(PVOID UserObject);
PVOID AccessInternalObject(ULONG Handle);
#endif /* __WIN32K_OBJECT_H */
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: dllmain.c,v 1.21 2001/11/02 06:10:11 rex Exp $
/* $Id: dllmain.c,v 1.22 2002/01/13 22:52:08 dwelch Exp $
*
* Entry Point for win32k.sys
*/
@ -71,6 +71,20 @@ DllMain (
return STATUS_UNSUCCESSFUL;
}
Status = InitInputImpl();
if (!NT_SUCCESS(Status))
{
DbgPrint("Failed to initialize input implementation.\n");
return(Status);
}
Status = MsqInitializeImpl();
if (!NT_SUCCESS(Status))
{
DbgPrint("Failed to initialize message queue implementation.\n");
return(Status);
}
return STATUS_SUCCESS;
}

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.40 2001/09/08 12:12:41 jfilby Exp $
# $Id: makefile,v 1.41 2002/01/13 22:52:08 dwelch Exp $
PATH_TO_TOP = ../..
@ -13,24 +13,26 @@ TARGET_ENTRY = _DllMain@8
# from atheos appserver makefile
COPTS = -pipe -O3 -I./freetype/include -c -Wall
TARGET_CFLAGS = -I$(PATH_TO_TOP)/ntoskrnl/include -DUNICODE
TARGET_CFLAGS = -I$(PATH_TO_TOP)/ntoskrnl/include -DUNICODE -Wall
ENG_OBJECTS= eng/debug.o eng/mem.o eng/brush.o eng/bitblt.o eng/clip.o eng/copybits.o \
eng/device.o eng/handle.o eng/lineto.o eng/paint.o eng/palette.o \
eng/surface.o eng/xlate.o eng/transblt.o eng/mouse.o
ENG_OBJECTS= eng/debug.o eng/mem.o eng/brush.o eng/bitblt.o eng/clip.o \
eng/copybits.o eng/device.o eng/handle.o eng/lineto.o eng/paint.o \
eng/palette.o eng/surface.o eng/xlate.o eng/transblt.o eng/mouse.o
MAIN_OBJECTS = main/dllmain.o
MISC_OBJECTS = misc/driver.o misc/error.o misc/math.o misc/object.o
LDR_OBJECTS = ldr/loader.o
NTUSER_OBJECTS = ntuser/class.o ntuser/guicheck.o ntuser/hook.o \
ntuser/message.o ntuser/msgqueue.o ntuser/stubs.o \
ntuser/userobj.o ntuser/window.o ntuser/winsta.o
ntuser/userobj.o ntuser/window.o ntuser/winsta.o \
ntuser/input.o
OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \
objects/color.o objects/coord.o objects/dc.o \
objects/fillshap.o objects/gdiobj.o objects/icm.o \
objects/line.o objects/metafile.o objects/paint.o \
objects/path.o objects/pen.o objects/print.o \
objects/region.o objects/text.o objects/wingl.o \
objects/bezier.o objects/objconv.o objects/dib.o objects/palette.o
objects/bezier.o objects/objconv.o objects/dib.o \
objects/palette.o
DIB_OBJECTS = dib/dib4bpp.o dib/dib24bpp.o
FREETYPE_OBJECTS = freetype/ctype.o freetype/grfont.o \
freetype/src/base/ftsystem.o freetype/src/base/ftdebug.o \

View file

@ -1,4 +1,4 @@
/* $Id: class.c,v 1.2 2001/07/06 00:05:05 rex Exp $
/* $Id: class.c,v 1.3 2002/01/13 22:52:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -8,6 +8,8 @@
* REVISION HISTORY:
* 06-06-2001 CSH Created
*/
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <win32k/win32k.h>
#include <win32k/userobj.h>
@ -18,29 +20,32 @@
#define NDEBUG
#include <debug.h>
/* GLOBALS *******************************************************************/
/* List of system classes */
static LIST_ENTRY SystemClassListHead;
static FAST_MUTEX SystemClassListLock;
/* FUNCTIONS *****************************************************************/
NTSTATUS
InitClassImpl(VOID)
{
ExInitializeFastMutex(&SystemClassListLock);
InitializeListHead(&SystemClassListHead);
return STATUS_SUCCESS;
return(STATUS_SUCCESS);
}
NTSTATUS
CleanupClassImpl(VOID)
{
return STATUS_SUCCESS;
return(STATUS_SUCCESS);
}
DWORD
CliFindClassByName(
PWNDCLASS_OBJECT *Class,
CliFindClassByName(PWNDCLASS_OBJECT* Class,
LPWSTR ClassName,
PLIST_ENTRY ListHead)
{
@ -57,23 +62,22 @@ CliFindClassByName(
{
*Class = Current;
ExReleaseFastMutexUnsafe (&SystemClassListLock);
return STATUS_SUCCESS;
return(STATUS_SUCCESS);
}
CurrentEntry = CurrentEntry->Flink;
}
ExReleaseFastMutexUnsafe (&SystemClassListLock);
return STATUS_NOT_FOUND;
return(STATUS_NOT_FOUND);
}
NTSTATUS
CliReferenceClassByNameWinSta(
PWINSTATION_OBJECT WinStaObject,
CliReferenceClassByNameWinSta(PWINSTATION_OBJECT WinStaObject,
PWNDCLASS_OBJECT *Class,
LPWSTR ClassName)
{
/*
/*
if (NT_SUCCESS(CliFindClassByName(Class, ClassName, &LocalClassListHead)))
{
return STATUS_SUCCESS;
@ -83,13 +87,12 @@ CliReferenceClassByNameWinSta(
{
return STATUS_SUCCESS;
}
*/
return CliFindClassByName(Class, ClassName, &SystemClassListHead);
*/
return(CliFindClassByName(Class, ClassName, &SystemClassListHead));
}
NTSTATUS
ClassReferenceClassByName(
PWNDCLASS_OBJECT *Class,
ClassReferenceClassByName(PWNDCLASS_OBJECT *Class,
LPWSTR ClassName)
{
PWINSTATION_OBJECT WinStaObject;
@ -97,11 +100,10 @@ ClassReferenceClassByName(
if (!ClassName)
{
return STATUS_INVALID_PARAMETER;
return(STATUS_INVALID_PARAMETER);
}
Status = ValidateWindowStationHandle(
PROCESS_WINDOW_STATION(),
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
KernelMode,
0,
&WinStaObject);
@ -109,11 +111,10 @@ ClassReferenceClassByName(
{
DPRINT("Validation of window station handle (0x%X) failed\n",
PROCESS_WINDOW_STATION());
return STATUS_UNSUCCESSFUL;
return(STATUS_UNSUCCESSFUL);
}
Status = CliReferenceClassByNameWinSta(
WinStaObject,
Status = CliReferenceClassByNameWinSta(WinStaObject,
Class,
ClassName);
@ -123,8 +124,7 @@ ClassReferenceClassByName(
}
NTSTATUS
ClassReferenceClassByAtom(
PWNDCLASS_OBJECT *Class,
ClassReferenceClassByAtom(PWNDCLASS_OBJECT *Class,
RTL_ATOM ClassAtom)
{
PWINSTATION_OBJECT WinStaObject;
@ -134,11 +134,10 @@ ClassReferenceClassByAtom(
if (!ClassAtom)
{
return STATUS_INVALID_PARAMETER;
return(STATUS_INVALID_PARAMETER);
}
Status = ValidateWindowStationHandle(
PROCESS_WINDOW_STATION(),
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
KernelMode,
0,
&WinStaObject);
@ -146,38 +145,36 @@ ClassReferenceClassByAtom(
{
DPRINT("Validation of window station handle (0x%X) failed\n",
PROCESS_WINDOW_STATION());
return STATUS_UNSUCCESSFUL;
return(STATUS_UNSUCCESSFUL);
}
ClassNameLength = sizeof(ClassName);
Status = RtlQueryAtomInAtomTable(
WinStaObject->AtomTable,
Status = RtlQueryAtomInAtomTable(WinStaObject->AtomTable,
ClassAtom,
NULL,
NULL,
&ClassName[0],
&ClassNameLength);
Status = CliReferenceClassByNameWinSta(
WinStaObject,
Status = CliReferenceClassByNameWinSta(WinStaObject,
Class,
&ClassName[0]);
ObDereferenceObject(WinStaObject);
return Status;
return(Status);
}
NTSTATUS
ClassReferenceClassByNameOrAtom(
PWNDCLASS_OBJECT *Class,
ClassReferenceClassByNameOrAtom(PWNDCLASS_OBJECT *Class,
LPWSTR ClassNameOrAtom)
{
NTSTATUS Status;
if (IS_ATOM(ClassNameOrAtom))
{
Status = ClassReferenceClassByAtom(Class, (RTL_ATOM)((ULONG_PTR)ClassNameOrAtom));
Status = ClassReferenceClassByAtom(Class,
(RTL_ATOM)((ULONG_PTR)ClassNameOrAtom));
}
else
{
@ -189,45 +186,38 @@ ClassReferenceClassByNameOrAtom(
SetLastNtError(Status);
}
return Status;
return(Status);
}
DWORD
STDCALL
NtUserGetClassInfo(
DWORD Unknown0,
DWORD STDCALL
NtUserGetClassInfo(DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
return(0);
}
DWORD
STDCALL
NtUserGetClassName(
DWORD Unknown0,
DWORD STDCALL
NtUserGetClassName(DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
return(0);
}
DWORD
STDCALL
NtUserGetWOWClass(
DWORD Unknown0,
DWORD STDCALL
NtUserGetWOWClass(DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
return(0);
}
/*
@ -240,10 +230,8 @@ NtUserGetWOWClass(
* RETURNS:
* Atom identifying the new class
*/
RTL_ATOM
STDCALL
NtUserRegisterClassExWOW(
LPWNDCLASSEX lpwcx,
RTL_ATOM STDCALL
NtUserRegisterClassExWOW(LPWNDCLASSEX lpwcx,
BOOL bUnicodeClass,
DWORD Unknown2,
DWORD Unknown3,
@ -257,10 +245,10 @@ NtUserRegisterClassExWOW(
WORD objectSize;
LPTSTR namePtr;
DPRINT("About to open window station handle (0x%X)\n", PROCESS_WINDOW_STATION());
DPRINT("About to open window station handle (0x%X)\n",
PROCESS_WINDOW_STATION());
Status = ValidateWindowStationHandle(
PROCESS_WINDOW_STATION(),
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
KernelMode,
0,
&WinStaObject);
@ -268,11 +256,10 @@ NtUserRegisterClassExWOW(
{
DPRINT("Validation of window station handle (0x%X) failed\n",
PROCESS_WINDOW_STATION());
return (RTL_ATOM)0;
return((RTL_ATOM)0);
}
Status = RtlAddAtomToAtomTable(
WinStaObject->AtomTable,
Status = RtlAddAtomToAtomTable(WinStaObject->AtomTable,
(LPWSTR)lpwcx->lpszClassName,
&Atom);
if (!NT_SUCCESS(Status))
@ -282,7 +269,7 @@ NtUserRegisterClassExWOW(
lpwcx->lpszClassName);
SetLastNtError(Status);
return (RTL_ATOM) 0;
return((RTL_ATOM)0);
}
objectSize = sizeof(WNDCLASS_OBJECT) +
@ -296,7 +283,7 @@ NtUserRegisterClassExWOW(
DPRINT("Failed creating window class object\n");
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return (RTL_ATOM) 0;
return((RTL_ATOM)0);
}
ClassObject->Class = *lpwcx;
@ -323,44 +310,38 @@ NtUserRegisterClassExWOW(
ObDereferenceObject(WinStaObject);
return Atom;
return(Atom);
}
DWORD
STDCALL
NtUserSetClassLong(
DWORD Unknown0,
DWORD STDCALL
NtUserSetClassLong(DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
return(0);
}
DWORD
STDCALL
NtUserSetClassWord(
DWORD Unknown0,
DWORD STDCALL
NtUserSetClassWord(DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
return(0);
}
DWORD
STDCALL
NtUserUnregisterClass(
DWORD Unknown0,
DWORD STDCALL
NtUserUnregisterClass(DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
return(0);
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: guicheck.c,v 1.2 2001/07/04 20:40:24 chorns Exp $
/* $Id: guicheck.c,v 1.3 2002/01/13 22:52:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -12,7 +12,11 @@
* REVISION HISTORY:
* 06-06-2001 CSH Created
*/
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <napi/teb.h>
#include <win32k/win32k.h>
#include <include/guicheck.h>
#include <include/msgqueue.h>
@ -20,14 +24,15 @@
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
VOID
GuiCheck(VOID)
W32kGuiCheck(VOID)
{
/* if (NtCurrentTeb()->MessageQueue)
if (PsGetWin32Thread()->MessageQueue != NULL)
return;
NtCurrentTeb()->MessageQueue = MsqCreateMessageQueue();*/
PsGetWin32Thread()->MessageQueue = MsqCreateMessageQueue();
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: message.c,v 1.2 2001/12/20 03:56:10 dwelch Exp $
/* $Id: message.c,v 1.3 2002/01/13 22:52:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -8,8 +8,13 @@
* REVISION HISTORY:
* 06-06-2001 CSH Created
*/
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <win32k/win32k.h>
#include <include/guicheck.h>
#include <include/msgqueue.h>
#include <include/window.h>
#include <include/class.h>
#include <include/error.h>
@ -19,26 +24,25 @@
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
NTSTATUS
InitMessageImpl(VOID)
W32kInitMessageImpl(VOID)
{
return STATUS_SUCCESS;
return(STATUS_SUCCESS);
}
NTSTATUS
CleanupMessageImpl(VOID)
W32kCleanupMessageImpl(VOID)
{
return STATUS_SUCCESS;
return(STATUS_SUCCESS);
}
LRESULT
STDCALL
NtUserDispatchMessage(
LPMSG lpmsg)
LRESULT STDCALL
NtUserDispatchMessage(LPMSG lpmsg)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}
@ -48,8 +52,81 @@ NtUserGetMessage(LPMSG lpMsg,
HWND hWnd,
UINT wMsgFilterMin,
UINT wMsgFilterMax)
/*
* FUNCTION: Get a message from the calling thread's message queue.
* ARGUMENTS:
* lpMsg - Pointer to the structure which receives the returned message.
* hWnd - Window whose messages are to be retrieved.
* wMsgFilterMin - Integer value of the lowest message value to be
* retrieved.
* wMsgFilterMax - Integer value of the highest message value to be
* retrieved.
*/
{
return FALSE;
PUSER_MESSAGE_QUEUE ThreadQueue;
BOOLEAN Present;
PUSER_MESSAGE Message;
NTSTATUS Status;
W32kGuiCheck();
ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue;
do
{
/* FIXME: Dispatch sent messages here. */
/* Now look for a quit message. */
/* FIXME: WINE checks the message number filter here. */
if (ThreadQueue->QuitPosted)
{
lpMsg->hwnd = hWnd;
lpMsg->message = WM_QUIT;
lpMsg->wParam = ThreadQueue->QuitExitCode;
lpMsg->lParam = 0;
ThreadQueue->QuitPosted = FALSE;
return(FALSE);
}
/* Now check for normal messages. */
Present = MsqFindMessage(ThreadQueue,
FALSE,
TRUE,
hWnd,
wMsgFilterMin,
wMsgFilterMax,
&Message);
if (Present)
{
RtlCopyMemory(lpMsg, &Message->Msg, sizeof(MSG));
ExFreePool(Message);
return(TRUE);
}
/* Check for hardware events. */
Present = MsqFindMessage(ThreadQueue,
TRUE,
TRUE,
hWnd,
wMsgFilterMin,
wMsgFilterMax,
&Message);
if (Present)
{
RtlCopyMemory(lpMsg, &Message->Msg, sizeof(MSG));
ExFreePool(Message);
return(TRUE);
}
/* FIXME: Check for sent messages again. */
/* FIXME: Check for paint messages. */
/* Nothing found so far. Wait for new messages. */
Status = MsqWaitForNewMessages(ThreadQueue);
}
while (Status == STATUS_WAIT_0);
return((BOOLEAN)(-1));
}
DWORD
@ -68,100 +145,85 @@ NtUserMessageCall(
return 0;
}
BOOL
STDCALL
NtUserPeekMessage(
LPMSG lpMsg,
BOOL STDCALL
NtUserPeekMessage(LPMSG lpMsg,
HWND hWnd,
UINT wMsgFilterMin,
UINT wMsgFilterMax,
UINT wRemoveMsg)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}
BOOL
STDCALL
NtUserPostMessage(
HWND hWnd,
BOOL STDCALL
NtUserPostMessage(HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}
BOOL
STDCALL
NtUserPostThreadMessage(
DWORD idThread,
BOOL STDCALL
NtUserPostThreadMessage(DWORD idThread,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}
DWORD
STDCALL
NtUserQuerySendMessage(
DWORD Unknown0)
DWORD STDCALL
NtUserQuerySendMessage(DWORD Unknown0)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}
BOOL
STDCALL
NtUserSendMessageCallback(
HWND hWnd,
BOOL STDCALL
NtUserSendMessageCallback(HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam,
SENDASYNCPROC lpCallBack,
ULONG_PTR dwData)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}
BOOL
STDCALL
NtUserSendNotifyMessage(
HWND hWnd,
BOOL STDCALL
NtUserSendNotifyMessage(HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}
BOOL
STDCALL
NtUserTranslateMessage(
LPMSG lpMsg,
BOOL STDCALL
NtUserTranslateMessage(LPMSG lpMsg,
DWORD Unknown1)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}
BOOL
STDCALL
BOOL STDCALL
NtUserWaitMessage(VOID)
{
UNIMPLEMENTED
UNIMPLEMENTED;
return 0;
}

View file

@ -1,4 +1,4 @@
/* $Id: msgqueue.c,v 1.1 2001/06/12 17:50:29 chorns Exp $
/* $Id: msgqueue.c,v 1.2 2002/01/13 22:52:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -8,6 +8,9 @@
* REVISION HISTORY:
* 06-06-2001 CSH Created
*/
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <win32k/win32k.h>
#include <include/msgqueue.h>
@ -15,23 +18,48 @@
#define NDEBUG
#include <debug.h>
/* GLOBALS *******************************************************************/
static PUSER_MESSAGE_QUEUE CurrentFocusMessageQueue;
/* FUNCTIONS *****************************************************************/
NTSTATUS
MsqInitializeImpl(VOID)
{
CurrentFocusMessageQueue = NULL;
return(STATUS_SUCCESS);
}
VOID
MsqInitializeMessage(
PUSER_MESSAGE Message,
MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
MSG Msg;
PUSER_MESSAGE Message;
Msg.hwnd = CurrentFocusMessageQueue->FocusWindow;
Msg.message = uMsg;
Msg.wParam = wParam;
Msg.lParam = lParam;
/* FIXME: Initialize time and point. */
Message = MsqCreateMessage(&Msg);
MsqPostMessage(CurrentFocusMessageQueue, Message, TRUE);
}
VOID
MsqInitializeMessage(PUSER_MESSAGE Message,
LPMSG Msg)
{
RtlMoveMemory(&Message->Msg, Msg, sizeof(MSG));
}
PUSER_MESSAGE
MsqCreateMessage(
LPMSG Msg)
MsqCreateMessage(LPMSG Msg)
{
PUSER_MESSAGE Message;
Message = (PUSER_MESSAGE)ExAllocatePool(
PagedPool, sizeof(USER_MESSAGE));
Message = (PUSER_MESSAGE)ExAllocatePool(PagedPool, sizeof(USER_MESSAGE));
if (!Message)
{
return NULL;
@ -43,60 +71,124 @@ MsqCreateMessage(
}
VOID
MsqDestroyMessage(
PUSER_MESSAGE Message)
MsqDestroyMessage(PUSER_MESSAGE Message)
{
ExFreePool(Message);
}
VOID
MsqPostMessage(
PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_MESSAGE Message)
MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_MESSAGE Message,
BOOLEAN Hardware)
{
// FIXME: Grab lock
InsertTailList(&MessageQueue->ListHead, &Message->ListEntry);
}
BOOL
MsqRetrieveMessage(
PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_MESSAGE *Message)
{
PLIST_ENTRY CurrentEntry;
// FIXME: Grab lock
if (!IsListEmpty(&MessageQueue->ListHead))
ExAcquireFastMutex(&MessageQueue->Lock);
if (Hardware)
{
CurrentEntry = RemoveHeadList(&MessageQueue->ListHead);
*Message = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry);
return TRUE;
InsertTailList(&MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
}
else
{
return FALSE;
InsertTailList(&MessageQueue->PostedMessagesListHead,
&Message->ListEntry);
}
KeSetEvent(&MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
ExReleaseFastMutex(&MessageQueue->Lock);
}
VOID
MsqInitializeMessageQueue(
PUSER_MESSAGE_QUEUE MessageQueue)
BOOLEAN
MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
IN BOOLEAN Hardware,
IN BOOLEAN Remove,
IN HWND Wnd,
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message)
{
InitializeListHead(&MessageQueue->ListHead);
ExInitializeFastMutex(MessageQueue->ListLock);
}
PLIST_ENTRY CurrentEntry;
PUSER_MESSAGE CurrentMessage;
PLIST_ENTRY ListHead;
VOID
MsqFreeMessageQueue(
PUSER_MESSAGE_QUEUE MessageQueue)
{
PUSER_MESSAGE Message;
// FIXME: Grab lock
while (MsqRetrieveMessage(MessageQueue, &Message))
ExAcquireFastMutex(&MessageQueue->Lock);
if (Hardware)
{
ExFreePool(Message);
CurrentEntry = MessageQueue->HardwareMessagesListHead.Flink;
ListHead = &MessageQueue->HardwareMessagesListHead;
}
else
{
CurrentEntry = MessageQueue->PostedMessagesListHead.Flink;
ListHead = &MessageQueue->PostedMessagesListHead;
}
while (CurrentEntry != ListHead)
{
CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
ListEntry);
if ((Wnd == 0 || Wnd == CurrentMessage->Msg.hwnd) &&
((MsgFilterLow == 0 && MsgFilterHigh == 0) ||
(MsgFilterLow <= CurrentMessage->Msg.message &&
MsgFilterHigh >= CurrentMessage->Msg.message)))
{
if (Remove)
{
RemoveEntryList(&CurrentMessage->ListEntry);
}
ExReleaseFastMutex(&MessageQueue->Lock);
*Message = CurrentMessage;
return(TRUE);
}
CurrentEntry = CurrentEntry->Flink;
}
ExReleaseFastMutex(&MessageQueue->Lock);
return(FALSE);
}
NTSTATUS
MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue)
{
return(KeWaitForSingleObject(&MessageQueue->NewMessages,
0,
UserMode,
TRUE,
NULL));
}
VOID
MsqInitializeMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue)
{
InitializeListHead(&MessageQueue->PostedMessagesListHead);
InitializeListHead(&MessageQueue->HardwareMessagesListHead);
InitializeListHead(&MessageQueue->SentMessagesListHead);
ExInitializeFastMutex(&MessageQueue->Lock);
MessageQueue->QuitPosted = FALSE;
MessageQueue->QuitExitCode = 0;
KeInitializeEvent(&MessageQueue->NewMessages, NotificationEvent, FALSE);
MessageQueue->QueueStatus = 0;
MessageQueue->FocusWindow = NULL;
}
VOID
MsqFreeMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue)
{
PLIST_ENTRY CurrentEntry;
PUSER_MESSAGE CurrentMessage;
CurrentEntry = MessageQueue->PostedMessagesListHead.Flink;
while (CurrentEntry != &MessageQueue->PostedMessagesListHead)
{
CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
ListEntry);
CurrentEntry = CurrentEntry->Flink;
ExFreePool(CurrentMessage);
}
CurrentEntry = MessageQueue->HardwareMessagesListHead.Flink;
while (CurrentEntry != &MessageQueue->HardwareMessagesListHead)
{
CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
ListEntry);
CurrentEntry = CurrentEntry->Flink;
ExFreePool(CurrentMessage);
}
}
@ -105,8 +197,8 @@ MsqCreateMessageQueue(VOID)
{
PUSER_MESSAGE_QUEUE MessageQueue;
MessageQueue = (PUSER_MESSAGE_QUEUE)ExAllocatePool(
PagedPool, sizeof(USER_MESSAGE_QUEUE));
MessageQueue = (PUSER_MESSAGE_QUEUE)ExAllocatePool(PagedPool,
sizeof(USER_MESSAGE_QUEUE));
if (!MessageQueue)
{
return NULL;
@ -118,8 +210,7 @@ MsqCreateMessageQueue(VOID)
}
VOID
MsqDestroyMessageQueue(
PUSER_MESSAGE_QUEUE MessageQueue)
MsqDestroyMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue)
{
MsqFreeMessageQueue(MessageQueue);
ExFreePool(MessageQueue);

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.3 2001/08/28 18:16:32 jfilby Exp $
/* $Id: window.c,v 1.4 2002/01/13 22:52:08 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -93,7 +93,7 @@ NtUserCreateWindowEx(
NTSTATUS Status;
HANDLE Handle;
GuiCheck();
W32kGuiCheck();
Status = ClassReferenceClassByNameOrAtom(&ClassObject, lpClassName->Buffer);
if (!NT_SUCCESS(Status))
@ -222,7 +222,7 @@ NtUserFindWindowEx(
PLIST_ENTRY currentEntry;
PWNDCLASS_OBJECT classObject;
GuiCheck();
W32kGuiCheck();
status = ClassReferenceClassByNameOrAtom(&classObject, ucClassName->Buffer);
if (!NT_SUCCESS(status))
@ -567,7 +567,7 @@ NtUserShowWindow(
{
PWINDOW_OBJECT WindowObject;
GuiCheck();
W32kGuiCheck();
WindowObject = USEROBJ_HandleToPtr (hWnd, UO_WINDOW_MAGIC);