2002-07-04 David Welch <welch@computer2.darkstar.org>

* subsys/win32k/include/callback.h: Fixed callback argument
	definitions.
	* subsys/win32k/ntuser/winpos.c: Implemented some more of the windows
	sizing/moving code.
	* subsys/win32k/ntuser/painting.c: Implemented some more of the
	window painting code.
	* subsys/win32k/objects/coord.c: Implemented LPtoDP and DPtoLP.
	* subsys/win32k/objects/region.c: Added stubs for some more
	region functions.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* ntoskrnl/ps/process.c (NtCreateProcess): Duplicate the
	process desktop handle as well.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* ntoskrnl/se/token.c: Don't call the ZwXXX variant of
	system calls when in system context.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* ntoskrnl/Makefile: Added file with MDA output code.
	* ntoskrnl/kd/kdebug.c: Recognize MDA as a destination for
	debug output.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* lib/user32/windows/defwnd.c: Implemented some more of the
	default window handler.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* lib/user32/misc/stubs.c: Removed some stubs to seperate files.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* lib/user32/user32.def: Export ScreenToClient otherwise we
	get problems when code in user32 tries to call it.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* include/win32k/region.h: Added prototypes for some missing
	region functions.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* include/win32k/ntuser.h: Added prototypes for some missing
	NtUserXXX functions.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* include/user32/wininternal.h: Added some constants for
	private GetDCEx styles that WINE needs.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* include/user32/callback.h: Fixed callbacks for messages with
	parameters.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* include/napi/win32.h (W32THREAD): Added pointer to the
	thread's desktop.
	* include/napi/win32.h (W32PROCESS): Removed handle table,
	added a pointer to the process's window station.
	* subsys/win32k/ntuser/guicheck.c (W32kGuiCheck): Reference
	a process's window station on the first win32k system call. Reference
	a thread's desktop on the first win32k system call.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* include/messages.h: Added some missing WM_XXX constants.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* drivers/dd/ide/makefile: Compiling with debugging messages
	needs libgcc to be linked in.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* iface/addsys/genw32k.c: Generate a variable with the
	number of system calls.
	* iface/native/genntdll.c: Generate a proper stack frame for
	the user system call stubs.
	* ntoskrnl/ke/i386/syscall.S: Generate a proper stack frame for
	the handler for system calls.

2002-07-04  David Welch  <welch@computer2.darkstar.org>

	* Makefile: Build the GUI startup application.
	* subsys/system/gstart/gstart.c: Application to start up
	the GUI.

svn path=/trunk/; revision=3179
This commit is contained in:
David Welch 2002-07-04 19:56:38 +00:00
parent 9033534bb4
commit 3c453d5dc1
50 changed files with 2121 additions and 662 deletions

View file

@ -1,3 +1,99 @@
2002-07-04 David Welch <welch@computer2.darkstar.org>
* subsys/win32k/include/callback.h: Fixed callback argument
definitions.
* subsys/win32k/ntuser/winpos.c: Implemented some more of the windows
sizing/moving code.
* subsys/win32k/ntuser/painting.c: Implemented some more of the
window painting code.
* subsys/win32k/objects/coord.c: Implemented LPtoDP and DPtoLP.
* subsys/win32k/objects/region.c: Added stubs for some more
region functions.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* ntoskrnl/ps/process.c (NtCreateProcess): Duplicate the
process desktop handle as well.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* ntoskrnl/se/token.c: Don't call the ZwXXX variant of
system calls when in system context.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* ntoskrnl/Makefile: Added file with MDA output code.
* ntoskrnl/kd/kdebug.c: Recognize MDA as a destination for
debug output.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* lib/user32/windows/defwnd.c: Implemented some more of the
default window handler.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* lib/user32/misc/stubs.c: Removed some stubs to seperate files.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* lib/user32/user32.def: Export ScreenToClient otherwise we
get problems when code in user32 tries to call it.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* include/win32k/region.h: Added prototypes for some missing
region functions.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* include/win32k/ntuser.h: Added prototypes for some missing
NtUserXXX functions.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* include/user32/wininternal.h: Added some constants for
private GetDCEx styles that WINE needs.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* include/user32/callback.h: Fixed callbacks for messages with
parameters.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* include/napi/win32.h (W32THREAD): Added pointer to the
thread's desktop.
* include/napi/win32.h (W32PROCESS): Removed handle table,
added a pointer to the process's window station.
* subsys/win32k/ntuser/guicheck.c (W32kGuiCheck): Reference
a process's window station on the first win32k system call. Reference
a thread's desktop on the first win32k system call.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* include/messages.h: Added some missing WM_XXX constants.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* drivers/dd/ide/makefile: Compiling with debugging messages
needs libgcc to be linked in.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* iface/addsys/genw32k.c: Generate a variable with the
number of system calls.
* iface/native/genntdll.c: Generate a proper stack frame for
the user system call stubs.
* ntoskrnl/ke/i386/syscall.S: Generate a proper stack frame for
the handler for system calls.
2002-07-04 David Welch <welch@computer2.darkstar.org>
* Makefile: Build the GUI startup application.
* subsys/system/gstart/gstart.c: Application to start up
the GUI.
2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk>
* tools/helper.mk: Make an import library a proper target * tools/helper.mk: Make an import library a proper target

View file

@ -74,7 +74,7 @@ STORAGE_DRIVERS = atapi cdrom class2 disk scsiport
# System applications # System applications
# autochk lsass services shell winlogon # autochk lsass services shell winlogon
SYS_APPS = autochk services shell winlogon SYS_APPS = autochk services shell winlogon gstart
# System services # System services
# rpcss eventlog # rpcss eventlog

View file

@ -41,7 +41,7 @@ int main (void)
printf("Entering GDITest..\n"); printf("Entering GDITest..\n");
GdiDllInitialize (NULL, DLL_PROCESS_ATTACH, NULL); GdiDllInitialize (NULL, DLL_PROCESS_ATTACH, NULL);
// Set up a DC called Desktop that accesses DISPLAY // Set up a DC called Desktop that accesses DISPLAY
Desktop = CreateDCA("DISPLAY", NULL, NULL, NULL); Desktop = CreateDCA("DISPLAY", NULL, NULL, NULL);

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.25 2001/08/21 20:13:11 chorns Exp $ # $Id: makefile,v 1.26 2002/07/04 19:56:32 dwelch Exp $
PATH_TO_TOP = ../../.. PATH_TO_TOP = ../../..
@ -10,6 +10,8 @@ TARGET_OBJECTS = ide.o
TARGET_HEADERS = *.h TARGET_HEADERS = *.h
TARGET_GCCLIBS = gcc
include $(PATH_TO_TOP)/rules.mak include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk include $(TOOLS_PATH)/helper.mk

View file

@ -1,4 +1,4 @@
/* $Id: genw32k.c,v 1.1 2000/02/21 22:34:26 ekohl Exp $ /* $Id: genw32k.c,v 1.2 2002/07/04 19:56:33 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS version of ntdll * PROJECT: ReactOS version of ntdll
@ -162,6 +162,7 @@ char *stmp;
fprintf(out, "\n\n#define MIN_SYSCALL_NUMBER 0\n"); fprintf(out, "\n\n#define MIN_SYSCALL_NUMBER 0\n");
fprintf(out, "#define MAX_SYSCALL_NUMBER %d\n", sys_call_idx-1); fprintf(out, "#define MAX_SYSCALL_NUMBER %d\n", sys_call_idx-1);
fprintf(out, "#define NUMBER_OF_SYSCALLS %d\n", sys_call_idx); fprintf(out, "#define NUMBER_OF_SYSCALLS %d\n", sys_call_idx);
fprintf(out, "ULONG Win32kNumberOfSysCalls = %d;\n", sys_call_idx);
return(0); return(0);
} }

View file

@ -1,4 +1,4 @@
/* $Id: genntdll.c,v 1.10 2000/02/21 22:35:12 ekohl Exp $ /* $Id: genntdll.c,v 1.11 2002/07/04 19:56:33 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS version of ntdll * PROJECT: ReactOS version of ntdll
@ -28,6 +28,45 @@
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
void write_syscall_stub(FILE* out, FILE* out3, char* name, char* name2,
unsigned int nr_args, unsigned int sys_call_idx)
{
#ifdef PARAMETERIZED_LIBS
fprintf(out,"__asm__(\"\\n\\t.global _%s@%s\\n\\t\"\n",name,nr_args);
fprintf(out,"\".global _%s@%s\\n\\t\"\n",name2,nr_args);
fprintf(out,"\"_%s@%s:\\n\\t\"\n",name,nr_args);
fprintf(out,"\"_%s@%s:\\n\\t\"\n",name2,nr_args);
#else
fprintf(out,"__asm__(\"\\n\\t.global _%s\\n\\t\"\n",name);
fprintf(out,"\".global _%s\\n\\t\"\n",name2);
fprintf(out,"\"_%s:\\n\\t\"\n",name);
fprintf(out,"\"_%s:\\n\\t\"\n",name2);
#endif
fprintf(out,"\t\"pushl\t%%ebp\\n\\t\"\n");
fprintf(out,"\t\"movl\t%%esp, %%ebp\\n\\t\"\n");
fprintf(out,"\t\"mov\t$%d,%%eax\\n\\t\"\n",sys_call_idx);
fprintf(out,"\t\"lea\t8(%%ebp),%%edx\\n\\t\"\n");
fprintf(out,"\t\"int\t$0x2E\\n\\t\"\n");
fprintf(out,"\t\"popl\t%%ebp\\n\\t\"\n");
fprintf(out,"\t\"ret\t$%s\\n\\t\");\n\n",nr_args);
/*
* Now write the NTOSKRNL stub for the
* current system call. ZwXXX does NOT
* alias the corresponding NtXXX call.
*/
fprintf(out3,"__asm__(\n");
fprintf(out3,"\".global _%s@%s\\n\\t\"\n",name2,nr_args);
fprintf(out3,"\"_%s@%s:\\n\\t\"\n",name2,nr_args);
fprintf(out3,"\t\"pushl\t%%ebp\\n\\t\"\n");
fprintf(out3,"\t\"movl\t%%esp, %%ebp\\n\\t\"\n");
fprintf(out3,"\t\"mov\t$%d,%%eax\\n\\t\"\n",sys_call_idx);
fprintf(out3,"\t\"lea\t8(%%ebp),%%edx\\n\\t\"\n");
fprintf(out3,"\t\"int\t$0x2E\\n\\t\"\n");
fprintf(out3,"\t\"popl\t%%ebp\\n\\t\"\n");
fprintf(out3,"\t\"ret\t$%s\\n\\t\");\n\n",nr_args);
}
int makeSystemServiceTable(FILE *in, FILE *out) int makeSystemServiceTable(FILE *in, FILE *out)
{ {
char line [INPUT_BUFFER_SIZE]; char line [INPUT_BUFFER_SIZE];
@ -257,34 +296,8 @@ process(
* system call: NtXXX and ZwXXX symbols * system call: NtXXX and ZwXXX symbols
* are aliases. * are aliases.
*/ */
#ifdef PARAMETERIZED_LIBS write_syscall_stub(out, out3, name, name2,
fprintf(out,"__asm__(\"\\n\\t.global _%s@%s\\n\\t\"\n",name,nr_args); nr_args, sys_call_idx);
fprintf(out,"\".global _%s@%s\\n\\t\"\n",name2,nr_args);
fprintf(out,"\"_%s@%s:\\n\\t\"\n",name,nr_args);
fprintf(out,"\"_%s@%s:\\n\\t\"\n",name2,nr_args);
#else
fprintf(out,"__asm__(\"\\n\\t.global _%s\\n\\t\"\n",name);
fprintf(out,"\".global _%s\\n\\t\"\n",name2);
fprintf(out,"\"_%s:\\n\\t\"\n",name);
fprintf(out,"\"_%s:\\n\\t\"\n",name2);
#endif
fprintf(out,"\t\"mov\t$%d,%%eax\\n\\t\"\n",sys_call_idx);
fprintf(out,"\t\"lea\t4(%%esp),%%edx\\n\\t\"\n");
fprintf(out,"\t\"int\t$0x2E\\n\\t\"\n");
fprintf(out,"\t\"ret\t$%s\\n\\t\");\n\n",nr_args);
/*
* Now write the NTOSKRNL stub for the
* current system call. ZwXXX does NOT
* alias the corresponding NtXXX call.
*/
fprintf(out3,"__asm__(\n");
fprintf(out3,"\".global _%s@%s\\n\\t\"\n",name2,nr_args);
fprintf(out3,"\"_%s@%s:\\n\\t\"\n",name2,nr_args);
fprintf(out3,"\t\"mov\t$%d,%%eax\\n\\t\"\n",sys_call_idx);
fprintf(out3,"\t\"lea\t4(%%esp),%%edx\\n\\t\"\n");
fprintf(out3,"\t\"int\t$0x2E\\n\\t\"\n");
fprintf(out3,"\t\"ret\t$%s\\n\\t\");\n\n",nr_args);
} }
} }

View file

@ -932,6 +932,7 @@ extern "C" {
#define WM_DRAWCLIPBOARD (776) #define WM_DRAWCLIPBOARD (776)
#define WM_DRAWITEM (43) #define WM_DRAWITEM (43)
#define WM_DROPFILES (563) #define WM_DROPFILES (563)
#define WM_DROPOBJECT (544)
#define WM_ENABLE (10) #define WM_ENABLE (10)
#define WM_ENDSESSION (22) #define WM_ENDSESSION (22)
#define WM_ENTERIDLE (289) #define WM_ENTERIDLE (289)
@ -995,6 +996,7 @@ extern "C" {
#define WM_MENUSELECT (287) #define WM_MENUSELECT (287)
#define WM_MOUSEACTIVATE (33) #define WM_MOUSEACTIVATE (33)
#define WM_MOUSEMOVE (512) #define WM_MOUSEMOVE (512)
#define WM_MOUSEWHEEL (522)
#define WM_MOVE (3) #define WM_MOVE (3)
#define WM_MOVING (534) #define WM_MOVING (534)
#define WM_NCACTIVATE (134) #define WM_NCACTIVATE (134)
@ -1038,6 +1040,7 @@ extern "C" {
#define WM_PSD_PAGESETUPDLG (1024) #define WM_PSD_PAGESETUPDLG (1024)
#define WM_PSD_YAFULLPAGERECT (1030) #define WM_PSD_YAFULLPAGERECT (1030)
#define WM_QUERYDRAGICON (55) #define WM_QUERYDRAGICON (55)
#define WM_QUERYDROPOBJECT (555)
#define WM_QUERYENDSESSION (17) #define WM_QUERYENDSESSION (17)
#define WM_QUERYNEWPALETTE (783) #define WM_QUERYNEWPALETTE (783)
#define WM_QUERYOPEN (19) #define WM_QUERYOPEN (19)
@ -1063,6 +1066,7 @@ extern "C" {
#define WM_SPOOLERSTATUS (42) #define WM_SPOOLERSTATUS (42)
#define WM_STYLECHANGED (125) #define WM_STYLECHANGED (125)
#define WM_STYLECHANGING (124) #define WM_STYLECHANGING (124)
#define WM_SYNCPAINT (136)
#define WM_SYSCHAR (262) #define WM_SYSCHAR (262)
#define WM_SYSCOLORCHANGE (21) #define WM_SYSCOLORCHANGE (21)
#define WM_SYSCOMMAND (274) #define WM_SYSCOMMAND (274)

View file

@ -4,15 +4,16 @@
typedef struct _W32THREAD typedef struct _W32THREAD
{ {
PVOID MessageQueue; PVOID MessageQueue;
FAST_MUTEX WindowListLock;
LIST_ENTRY WindowListHead;
struct _DESKTOP_OBJECT* Desktop;
} __attribute__((packed)) W32THREAD, *PW32THREAD; } __attribute__((packed)) W32THREAD, *PW32THREAD;
typedef struct _W32PROCESS typedef struct _W32PROCESS
{ {
FAST_MUTEX ClassListLock; FAST_MUTEX ClassListLock;
LIST_ENTRY ClassListHead; LIST_ENTRY ClassListHead;
FAST_MUTEX WindowListLock; struct _WINSTATION_OBJECT* WindowStation;
LIST_ENTRY WindowListHead;
struct _USER_HANDLE_TABLE* HandleTable;
} W32PROCESS, *PW32PROCESS; } W32PROCESS, *PW32PROCESS;
PW32THREAD STDCALL PW32THREAD STDCALL

View file

@ -6,7 +6,7 @@
#define USER32_CALLBACK_SENDNCCREATE (2) #define USER32_CALLBACK_SENDNCCREATE (2)
#define USER32_CALLBACK_SENDNCCALCSIZE (3) #define USER32_CALLBACK_SENDNCCALCSIZE (3)
#define USER32_CALLBACK_SENDCREATE (4) #define USER32_CALLBACK_SENDCREATE (4)
#define USER32_CALLBACK_MAXIMUM (4) #define USER32_CALLBACK_MAXIMUM (5)
typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS
{ {
@ -19,10 +19,10 @@ typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS
typedef struct _SENDASYNCPROC_CALLBACK_ARGUMENTS typedef struct _SENDASYNCPROC_CALLBACK_ARGUMENTS
{ {
SENDASYNCPROC Proc; SENDASYNCPROC Callback;
HWND Wnd; HWND Wnd;
UINT Msg; UINT Msg;
ULONG Data; ULONG_PTR Context;
LRESULT Result; LRESULT Result;
} SENDASYNCPROC_CALLBACK_ARGUMENTS, *PSENDASYNCPROC_CALLBACK_ARGUMENTS; } SENDASYNCPROC_CALLBACK_ARGUMENTS, *PSENDASYNCPROC_CALLBACK_ARGUMENTS;
@ -39,6 +39,23 @@ typedef struct _SENDCREATEMESSAGE_CALLBACK_ARGUMENTS
CREATESTRUCT CreateStruct; CREATESTRUCT CreateStruct;
} SENDCREATEMESSAGE_CALLBACK_ARGUMENTS, *PSENDCREATEMESSAGE_CALLBACK_ARGUMENTS; } SENDCREATEMESSAGE_CALLBACK_ARGUMENTS, *PSENDCREATEMESSAGE_CALLBACK_ARGUMENTS;
typedef struct _SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS
{
HWND Wnd;
BOOL Validate;
RECT Rect;
NCCALCSIZE_PARAMS Params;
} SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS,
*PSENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS;
typedef struct _SENDNCCALCSIZEMESSAGE_CALLBACK_RESULT
{
LRESULT Result;
RECT Rect;
NCCALCSIZE_PARAMS Params;
} SENDNCCALCSIZEMESSAGE_CALLBACK_RESULT,
*PSENDNCCALCSIZEMESSAGE_CALLBACK_RESULT;
NTSTATUS STDCALL NTSTATUS STDCALL
User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength); User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength);
NTSTATUS STDCALL NTSTATUS STDCALL

View file

@ -1,4 +1,5 @@
#define WIN_NCACTIVATED (0x0080) #define WIN_NCACTIVATED (0x0080)
#define DCX_KEEPCLIPRGN (0x40000) #define DCX_KEEPCLIPRGN (0x40000)
#define DCX_USESTYLE (0x10000) #define DCX_USESTYLE (0x10000)
#define DCX_WINDOWPAINT (0x20000)

View file

@ -1,8 +1,14 @@
#ifndef __WIN32K_NTUSER_H #ifndef __WIN32K_NTUSER_H
#define __WIN32K_NTUSER_H #define __WIN32K_NTUSER_H
ULONG STDCALL
NtUserGetSystemMetrics(ULONG Index);
DWORD STDCALL
NtUserGetClassLong(HWND hWnd, DWORD Offset);
DWORD STDCALL DWORD STDCALL
NtUserGetWindowLong(HWND hWnd, DWORD Index); NtUserGetWindowLong(HWND hWnd, DWORD Index);
INT STDCALL
NtUserReleaseDC(HWND hWnd, HDC hDc);
NTSTATUS NTSTATUS
STDCALL STDCALL
@ -29,11 +35,8 @@ NtUserAttachThreadInput(
DWORD Unknown1, DWORD Unknown1,
DWORD Unknown2); DWORD Unknown2);
DWORD HDC STDCALL
STDCALL NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* lPs);
NtUserBeginPaint(
DWORD Unknown0,
DWORD Unknown1);
DWORD DWORD
STDCALL STDCALL
@ -429,11 +432,8 @@ DWORD
STDCALL STDCALL
NtUserEndMenu(VOID); NtUserEndMenu(VOID);
DWORD BOOL STDCALL
STDCALL NtUserEndPaint(HWND hWnd, PAINTSTRUCT* lPs);
NtUserEndPaint(
DWORD Unknown0,
DWORD Unknown1);
DWORD DWORD
STDCALL STDCALL
@ -619,12 +619,8 @@ STDCALL
NtUserGetDC( NtUserGetDC(
DWORD Unknown0); DWORD Unknown0);
DWORD HDC STDCALL
STDCALL NtUserGetDCEx(HWND hWnd, HANDLE hRegion, ULONG Flags);
NtUserGetDCEx(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2);
DWORD DWORD
STDCALL STDCALL
@ -1181,6 +1177,12 @@ NtUserSendInput(
DWORD Unknown1, DWORD Unknown1,
DWORD Unknown2); DWORD Unknown2);
LRESULT STDCALL
NtUserSendMessage(HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam);
BOOL BOOL
STDCALL STDCALL
NtUserSendMessageCallback( NtUserSendMessageCallback(

View file

@ -2,6 +2,11 @@
#ifndef __WIN32K_REGION_H #ifndef __WIN32K_REGION_H
#define __WIN32K_REGION_H #define __WIN32K_REGION_H
INT STDCALL
W32kGetBoxRgn(HRGN hRgn, PRECT Rect);
HRGN STDCALL
W32kCropRgn(HRGN hDest, HRGN hSrc, const RECT* Rect, const POINT* Point);
INT INT
STDCALL STDCALL
W32kCombineRgn(HRGN hDest, W32kCombineRgn(HRGN hDest,

View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
/sbin/modprobe loop /sbin/modprobe loop
echo "Installing to disk." echo "Installing to disk."
mount -t vfat /mnt/hda3/bochs/10M.vga.dos /mnt/floppy -o loop,offset=8704,rw mount -t vfat /home/welch/devel/bochs/10M.vga.dos /mnt/floppy -o loop,offset=8704,rw
cp -rv reactos /mnt/floppy cp -rv reactos /mnt/floppy
umount /mnt/floppy umount /mnt/floppy

View file

@ -1,4 +1,4 @@
/* $Id: desktop.c,v 1.2 2001/06/29 19:31:59 ekohl Exp $ /* $Id: desktop.c,v 1.3 2002/07/04 19:56:34 dwelch 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
@ -21,49 +21,47 @@ CloseDesktop(
return NtUserCloseDesktop(hDesktop); return NtUserCloseDesktop(hDesktop);
} }
HDESK HDESK STDCALL
STDCALL CreateDesktopA(LPCSTR lpszDesktop,
CreateDesktopA( LPCSTR lpszDevice,
LPCSTR lpszDesktop, LPDEVMODEA pDevmode,
LPCSTR lpszDevice, DWORD dwFlags,
LPDEVMODEA pDevmode, ACCESS_MASK dwDesiredAccess,
DWORD dwFlags, LPSECURITY_ATTRIBUTES lpsa)
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
{ {
ANSI_STRING DesktopNameA; ANSI_STRING DesktopNameA;
UNICODE_STRING DesktopNameU; UNICODE_STRING DesktopNameU;
HDESK hDesktop; HDESK hDesktop;
if (lpszDesktop != NULL) { if (lpszDesktop != NULL)
RtlInitAnsiString(&DesktopNameA, (LPSTR)lpszDesktop); {
RtlAnsiStringToUnicodeString(&DesktopNameU, &DesktopNameA, TRUE); RtlInitAnsiString(&DesktopNameA, (LPSTR)lpszDesktop);
} else { RtlAnsiStringToUnicodeString(&DesktopNameU, &DesktopNameA, TRUE);
RtlInitUnicodeString(&DesktopNameU, NULL); }
} else
{
RtlInitUnicodeString(&DesktopNameU, NULL);
}
/* FIXME: Need to convert the DEVMODE parameter. */
hDesktop = CreateDesktopW( hDesktop = CreateDesktopW(DesktopNameU.Buffer,
DesktopNameU.Buffer, NULL,
NULL, pDevmode,
pDevmode, dwFlags,
dwFlags, dwDesiredAccess,
dwDesiredAccess, lpsa);
lpsa);
RtlFreeUnicodeString(&DesktopNameU); RtlFreeUnicodeString(&DesktopNameU);
return(hDesktop);
return hDesktop;
} }
HDESK HDESK STDCALL
STDCALL CreateDesktopW(LPCWSTR lpszDesktop,
CreateDesktopW( LPCWSTR lpszDevice,
LPCWSTR lpszDesktop, LPDEVMODEW pDevmode,
LPCWSTR lpszDevice, DWORD dwFlags,
LPDEVMODEW pDevmode, ACCESS_MASK dwDesiredAccess,
DWORD dwFlags, LPSECURITY_ATTRIBUTES lpsa)
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
{ {
UNICODE_STRING DesktopName; UNICODE_STRING DesktopName;
HWINSTA hWinSta; HWINSTA hWinSta;
@ -73,14 +71,13 @@ CreateDesktopW(
RtlInitUnicodeString(&DesktopName, lpszDesktop); RtlInitUnicodeString(&DesktopName, lpszDesktop);
hDesktop = NtUserCreateDesktop( hDesktop = NtUserCreateDesktop(&DesktopName,
&DesktopName, dwFlags,
dwFlags, dwDesiredAccess,
dwDesiredAccess, lpsa,
lpsa, hWinSta);
hWinSta);
return hDesktop; return(hDesktop);
} }
WINBOOL WINBOOL

View file

@ -32,7 +32,7 @@ User32ConvertString(PCSTR String)
{ {
ANSI_STRING InString; ANSI_STRING InString;
UNICODE_STRING OutString; UNICODE_STRING OutString;
RtlInitAnsiString(&InString, String); RtlInitAnsiString(&InString, String);
RtlAnsiStringToUnicodeString(&OutString, &InString, TRUE); RtlAnsiStringToUnicodeString(&OutString, &InString, TRUE);
return(OutString.Buffer); return(OutString.Buffer);
} }

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.8 2002/06/13 20:36:40 dwelch Exp $ /* $Id: stubs.c,v 1.9 2002/07/04 19:56:34 dwelch 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
@ -11,6 +11,11 @@
*/ */
#include <windows.h> #include <windows.h>
WINBOOL STDCALL
ScreenToClient(HWND hWnd, LPPOINT lpPoint)
{
}
WINBOOL WINBOOL
STDCALL STDCALL
AnyPopup(VOID) AnyPopup(VOID)

View file

@ -528,7 +528,7 @@ RemovePropW@8
ReplyMessage@4 ReplyMessage@4
;ResolveDesktopForWOW ;ResolveDesktopForWOW
ReuseDDElParam@20 ReuseDDElParam@20
;ScreenToClient ScreenToClient
;ScrollChildren ;ScrollChildren
ScrollDC@28 ScrollDC@28
ScrollWindow@20 ScrollWindow@20

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.6 2002/06/18 21:51:09 dwelch Exp $ /* $Id: window.c,v 1.7 2002/07/04 19:56:34 dwelch 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
@ -78,8 +78,8 @@ User32CallSendAsyncProcForKernel(PVOID Arguments, ULONG ArgumentLength)
{ {
return(STATUS_INFO_LENGTH_MISMATCH); return(STATUS_INFO_LENGTH_MISMATCH);
} }
CallbackArgs->Proc(CallbackArgs->Wnd, CallbackArgs->Msg, CallbackArgs->Callback(CallbackArgs->Wnd, CallbackArgs->Msg,
CallbackArgs->Data, CallbackArgs->Result); CallbackArgs->Context, CallbackArgs->Result);
return(STATUS_SUCCESS); return(STATUS_SUCCESS);
} }

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.71 2002/06/18 21:51:09 dwelch Exp $ # $Id: Makefile,v 1.72 2002/07/04 19:56:35 dwelch Exp $
# #
# ReactOS Operating System # ReactOS Operating System
# #
@ -328,7 +328,7 @@ OBJECTS_KD = \
kd/kdebug.o \ kd/kdebug.o \
kd/service.o \ kd/service.o \
kd/dlog.o \ kd/dlog.o \
kd/gdbstub.o kd/gdbstub.o kd/mda.o
DEP_OBJECTS := $(OBJECTS_NT) $(OBJECTS_MM) $(OBJECTS_ARCH) \ DEP_OBJECTS := $(OBJECTS_NT) $(OBJECTS_MM) $(OBJECTS_ARCH) \
$(OBJECTS_IO) $(OBJECTS_KE) $(OBJECTS_OB) \ $(OBJECTS_IO) $(OBJECTS_KE) $(OBJECTS_OB) \
@ -340,6 +340,7 @@ DEP_OBJECTS := $(OBJECTS_NT) $(OBJECTS_MM) $(OBJECTS_ARCH) \
# #
# Include automatic dependancy tracking # Include automatic dependancy tracking
# #
DEP_EXCLUDE_FILTER := ex/napi.% nt/zw.%
include $(PATH_TO_TOP)/tools/depend.mk include $(PATH_TO_TOP)/tools/depend.mk

View file

@ -25,11 +25,11 @@ typedef struct _DESKTOP_OBJECT
{ {
CSHORT Type; CSHORT Type;
CSHORT Size; CSHORT Size;
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
KSPIN_LOCK Lock; KSPIN_LOCK Lock;
UNICODE_STRING Name; UNICODE_STRING Name;
struct _WINSTATION_OBJECT *WindowStation; struct _WINSTATION_OBJECT *WindowStation;
LIST_ENTRY WindowListHead;
} DESKTOP_OBJECT, *PDESKTOP_OBJECT; } DESKTOP_OBJECT, *PDESKTOP_OBJECT;

View file

@ -1,4 +1,4 @@
/* $Id: kd.h,v 1.9 2002/05/16 06:39:30 ekohl Exp $ /* $Id: kd.h,v 1.10 2002/07/04 19:56:35 dwelch Exp $
* *
* kernel debugger prototypes * kernel debugger prototypes
*/ */
@ -15,6 +15,7 @@
#define KD_DEBUG_SERIAL 0x08 #define KD_DEBUG_SERIAL 0x08
#define KD_DEBUG_BOCHS 0x10 #define KD_DEBUG_BOCHS 0x10
#define KD_DEBUG_FILELOG 0x20 #define KD_DEBUG_FILELOG 0x20
#define KD_DEBUG_MDA 0x40
extern ULONG KdDebugState; extern ULONG KdDebugState;
@ -61,7 +62,9 @@ KdDebugPrint (LPSTR Message);
KD_CONTINUE_TYPE KD_CONTINUE_TYPE
KdEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, KdEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord,
PCONTEXT Context, PCONTEXT Context,
PKTRAP_FRAME TrapFrame); PKTRAP_FRAME TrapFrame);
VOID KdInitializeMda(VOID);
VOID KdPrintMda(PCH pch);
#endif /* __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H */ #endif /* __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H */

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: ps.h,v 1.34 2002/06/04 15:26:55 dwelch Exp $ /* $Id: ps.h,v 1.35 2002/07/04 19:56:35 dwelch Exp $
* *
* FILE: ntoskrnl/ke/kthread.c * FILE: ntoskrnl/ke/kthread.c
* PURPOSE: Process manager definitions * PURPOSE: Process manager definitions
@ -460,14 +460,15 @@ struct _EPROCESS
/* /*
* Added by David Welch (welch@mcmail.com) * Added by David Welch (welch@mcmail.com)
*/ */
MADDRESS_SPACE AddressSpace; HANDLE Win32Desktop;
HANDLE_TABLE HandleTable; MADDRESS_SPACE AddressSpace;
LIST_ENTRY ProcessListEntry; HANDLE_TABLE HandleTable;
LIST_ENTRY ProcessListEntry;
/* /*
* Added by Philip Susi for list of threads in process * Added by Philip Susi for list of threads in process
*/ */
LIST_ENTRY ThreadListHead; LIST_ENTRY ThreadListHead;
}; };
#define PROCESS_STATE_TERMINATED (1) #define PROCESS_STATE_TERMINATED (1)

View file

@ -1,4 +1,4 @@
/* $Id: kdebug.c,v 1.36 2002/05/08 17:05:32 chorns Exp $ /* $Id: kdebug.c,v 1.37 2002/07/04 19:56:35 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -140,6 +140,12 @@ KdInitSystem(ULONG Reserved,
KdDebuggerEnabled = TRUE; KdDebuggerEnabled = TRUE;
KdDebugState |= KD_DEBUG_FILELOG; KdDebugState |= KD_DEBUG_FILELOG;
} }
else if (!_strnicmp(p2, "MDA", 3))
{
p2 += 3;
KdDebuggerEnabled = TRUE;
KdDebugState |= KD_DEBUG_MDA;
}
} }
} }
else if (!_strnicmp(p2, "DEBUG", 5)) else if (!_strnicmp(p2, "DEBUG", 5))
@ -229,6 +235,8 @@ KdInitSystem(ULONG Reserved,
if (KdDebugState & KD_DEBUG_FILELOG) if (KdDebugState & KD_DEBUG_FILELOG)
PrintString("\n File log debugging enabled\n\n"); PrintString("\n File log debugging enabled\n\n");
if (KdDebugState & KD_DEBUG_MDA)
PrintString("\n MDA debugging enabled\n\n");
} }
/* Perform any initialization nescessary */ /* Perform any initialization nescessary */
@ -242,6 +250,9 @@ KdInitSystem(ULONG Reserved,
if (KdDebugState & KD_DEBUG_FILELOG) if (KdDebugState & KD_DEBUG_FILELOG)
DebugLogInit(); DebugLogInit();
if (KdDebugState & KD_DEBUG_MDA)
KdInitializeMda();
} }
} }
@ -320,6 +331,9 @@ KdpPrintString(PANSI_STRING String)
if (KdDebugState & KD_DEBUG_FILELOG) if (KdDebugState & KD_DEBUG_FILELOG)
DebugLogWrite(pch); DebugLogWrite(pch);
if (KdDebugState & KD_DEBUG_MDA)
KdPrintMda(pch);
return((ULONG)String->Length); return((ULONG)String->Length);
} }

151
reactos/ntoskrnl/kd/mda.c Normal file
View file

@ -0,0 +1,151 @@
/*
* ReactOS kernel
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: mda.c,v 1.1 2002/07/04 19:56:35 dwelch Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/kd/mda.c
* PURPOSE: Support for debugging using an MDA card.
* PROGRAMMER: David Welch <welch@cwcom.net>
*/
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <internal/ntoskrnl.h>
#include <internal/kd.h>
#include <internal/mm.h>
#include <roscfg.h>
#include "../dbg/kdb.h"
/* VARIABLES ***************************************************************/
STATIC ULONG MdaIndexPort;
STATIC ULONG MdaValuePort;
STATIC ULONG MdaStatusPort;
STATIC ULONG MdaGfxPort;
STATIC ULONG MdaModePort;
STATIC PUSHORT VideoBuffer;
#define MDA_COLUMNS (80)
#define MDA_LINES (25)
STATIC ULONG MdaCursorX, MdaCursorY;
/* PRIVATE FUNCTIONS ********************************************************/
#if 0
VOID STATIC
KdWriteByteMDA(ULONG Reg, ULONG Value)
{
WRITE_PORT_UCHAR((PUCHAR)MdaIndexPort, (CHAR)Reg);
WRITE_PORT_UCHAR((PUCHAR)MdaValuePort, (CHAR)Value);
}
VOID STATIC
KdWriteWordMDA(ULONG Reg, ULONG Value)
{
WRITE_PORT_UCHAR((PUCHAR)MdaIndexPort, (CHAR)Reg);
WRITE_PORT_UCHAR((PUCHAR)MdaValuePort, (CHAR)(Value >> 8));
WRITE_PORT_UCHAR((PUCHAR)MdaIndexPort, (CHAR)(Reg + 1));
WRITE_PORT_UCHAR((PUCHAR)MdaValuePort, (CHAR)(Value & 0xFF));
}
#endif
VOID
KdInitializeMda(VOID)
{
/* Setup the variables for the various port addresses. */
MdaIndexPort = 0x3b4;
MdaValuePort = 0x3b5;
MdaModePort = 0x3b8;
MdaStatusPort = 0x3ba;
MdaGfxPort = 0x3bf;
VideoBuffer = (PUSHORT)(0xd0000000 + 0xb0000);
MdaCursorX = MdaCursorY = 0;
}
VOID STATIC
KdScrollMda(VOID)
{
memmove(&VideoBuffer[(MDA_COLUMNS * 0) + 0],
&VideoBuffer[(MDA_COLUMNS * 1) + 0],
MDA_COLUMNS * (MDA_LINES - 1) * 2);
memset(&VideoBuffer[(MDA_COLUMNS * (MDA_LINES - 1)) + 0], 0,
MDA_COLUMNS * 2);
}
VOID STATIC
KdPutCharMda(CHAR Ch)
{
if (Ch == '\n')
{
if (MdaCursorY == (MDA_LINES - 1))
{
KdScrollMda();
}
else
{
MdaCursorY++;
}
MdaCursorX = 0;
return;
}
VideoBuffer[(MdaCursorY * MDA_COLUMNS) + MdaCursorX] = (Ch & 0xFF) | 0x0700;
MdaCursorX++;
if (MdaCursorX == (MDA_COLUMNS - 1))
{
if (MdaCursorY == (MDA_LINES - 1))
{
KdScrollMda();
}
else
{
MdaCursorY++;
}
MdaCursorX = 0;
}
}
VOID
KdPrintMda(PCH pch)
{
while((*pch) != 0)
{
if ((*pch) == '\t')
{
KdPutCharMda(' ');
KdPutCharMda(' ');
KdPutCharMda(' ');
KdPutCharMda(' ');
}
if ((*pch) == '\r')
{
/* Nothing. */
}
else
{
KdPutCharMda(*pch);
}
pch++;
}
}
/* EOF */

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: syscall.S,v 1.5 2002/06/11 22:09:02 dwelch Exp $ /* $Id: syscall.S,v 1.6 2002/07/04 19:56:36 dwelch Exp $
* *
* FILE: ntoskrnl/hal/x86/syscall.s * FILE: ntoskrnl/hal/x86/syscall.s
* PURPOSE: 2E trap handler * PURPOSE: 2E trap handler
@ -89,8 +89,9 @@ L3:
pushl $0 /* XXX: TempCS */ pushl $0 /* XXX: TempCS */
pushl $0 /* XXX: DebugPointer */ pushl $0 /* XXX: DebugPointer */
pushl $0 /* XXX: DebugArgMark */ pushl $0 /* XXX: DebugArgMark */
pushl $0 /* XXX: DebugEIP */ movl 0x60(%esp), %ebx
pushl $0 /* XXX: DebugEBP */ pushl %ebx /* DebugEIP */
pushl %ebp /* DebugEBP */
/* Load the segment registers */ /* Load the segment registers */
movl $KERNEL_DS, %ebx movl $KERNEL_DS, %ebx

View file

@ -1,4 +1,4 @@
/* $Id: process.c,v 1.83 2002/06/17 22:52:31 joeg Exp $ /* $Id: process.c,v 1.84 2002/07/04 19:56:36 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -259,6 +259,7 @@ PsInitProcessManagment(VOID)
PsInitialSystemProcess->UniqueProcessId = PsInitialSystemProcess->UniqueProcessId =
InterlockedIncrement(&PiNextProcessUniqueId); InterlockedIncrement(&PiNextProcessUniqueId);
PsInitialSystemProcess->Win32WindowStation = (HANDLE)0; PsInitialSystemProcess->Win32WindowStation = (HANDLE)0;
PsInitialSystemProcess->Win32Desktop = (HANDLE)0;
KeAcquireSpinLock(&PsProcessListLock, &oldIrql); KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
InsertHeadList(&PsProcessListHead, InsertHeadList(&PsProcessListHead,
@ -546,6 +547,26 @@ NtCreateProcess(OUT PHANDLE ProcessHandle,
{ {
Process->Win32WindowStation = (HANDLE)0; Process->Win32WindowStation = (HANDLE)0;
} }
if (ParentProcess->Win32Desktop != (HANDLE)0)
{
/* Always duplicate the process window station. */
Process->Win32Desktop = 0;
Status = ObDuplicateObject(ParentProcess,
Process,
ParentProcess->Win32Desktop,
&Process->Win32Desktop,
0,
FALSE,
DUPLICATE_SAME_ACCESS);
if (!NT_SUCCESS(Status))
{
KeBugCheck(0);
}
}
else
{
Process->Win32Desktop = (HANDLE)0;
}
KeAcquireSpinLock(&PsProcessListLock, &oldIrql); KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
for (i = 0; i < PiProcessNotifyRoutineCount; i++) for (i = 0; i < PiProcessNotifyRoutineCount; i++)

View file

@ -1,4 +1,4 @@
/* $Id: token.c,v 1.17 2002/06/17 22:52:32 joeg Exp $ /* $Id: token.c,v 1.18 2002/07/04 19:56:36 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -974,14 +974,14 @@ SepCreateSystemProcessToken(struct _EPROCESS* Process)
SepTokenObjectType, SepTokenObjectType,
(PVOID*)&AccessToken); (PVOID*)&AccessToken);
Status = ZwAllocateLocallyUniqueId(&AccessToken->TokenId); Status = NtAllocateLocallyUniqueId(&AccessToken->TokenId);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
ObDereferenceObject(AccessToken); ObDereferenceObject(AccessToken);
return(Status); return(Status);
} }
Status = ZwAllocateLocallyUniqueId(&AccessToken->ModifiedId); Status = NtAllocateLocallyUniqueId(&AccessToken->ModifiedId);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
ObDereferenceObject(AccessToken); ObDereferenceObject(AccessToken);

View file

@ -0,0 +1,21 @@
# $Id: Makefile,v 1.1 2002/07/04 19:56:36 dwelch Exp $
PATH_TO_TOP = ../../..
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = gstart
TARGET_INSTALLDIR = system32
TARGET_SDKLIBS = user32.a gdi32.a ntdll.a kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View file

@ -0,0 +1,89 @@
/* $Id: gstart.c,v 1.1 2002/07/04 19:56:36 dwelch Exp $
*
* PROJECT : ReactOS Operating System
* DESCRIPTION: ReactOS GUI Startup
* LICENSE : See top level directory
*
*/
#define NTOS_MODE_USER
#include <ntos.h>
#include <windows.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int ExecuteProcess(char* name, char* cmdline)
{
PROCESS_INFORMATION ProcessInformation;
STARTUPINFO StartupInfo;
BOOL ret;
CHAR fullname[260];
PCHAR p;
/* append '.exe' if needed */
strcpy (fullname, name);
p = strrchr (fullname, '.');
if ((p == NULL) || (_stricmp (p, ".exe") != 0))
{
strcat (fullname, ".exe");
}
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof (STARTUPINFO);
StartupInfo.lpTitle = name;
if( cmdline && *cmdline )
*(cmdline-1) = ' ';
ret = CreateProcessA(fullname,
name,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&StartupInfo,
&ProcessInformation);
if (ret)
{
WaitForSingleObject(ProcessInformation.hProcess, INFINITE);
CloseHandle(ProcessInformation.hProcess);
CloseHandle(ProcessInformation.hThread);
}
return(ret);
}
int main(int argc, char* argv[])
{
HDC Desktop;
HBRUSH Pen;
GdiDllInitialize (NULL, DLL_PROCESS_ATTACH, NULL);
/* Set up a DC called Desktop that accesses DISPLAY */
Desktop = CreateDCA("DISPLAY", NULL, NULL, NULL);
if (Desktop == NULL)
{
return 1;
}
Pen = CreatePen(PS_SOLID, 1, RGB(0, 0, 255));
SelectObject(Desktop, Pen);
Rectangle(Desktop, 0, 0, 640, 480);
if (argc > 1)
{
ExecuteProcess(argv[1], "");
}
else
{
Sleep(50);
}
DeleteDC(Desktop);
return(0);
}
/* EOF */

View file

@ -0,0 +1,38 @@
#include "../../../include/defines.h"
#include "../../../include/reactos/resource.h"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
VS_VERSION_INFO VERSIONINFO
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", RES_STR_COMPANY_NAME
VALUE "FileDescription", "ReactOS Simple Shell\0"
VALUE "FileVersion", RES_STR_FILE_VERSION
VALUE "InternalName", "shell\0"
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
VALUE "OriginalFilename", "shell.exe\0"
VALUE "ProductName", RES_STR_PRODUCT_NAME
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View file

@ -11,5 +11,14 @@ LRESULT STDCALL
W32kSendNCCREATEMessage(HWND Wnd, CREATESTRUCT* CreateStruct); W32kSendNCCREATEMessage(HWND Wnd, CREATESTRUCT* CreateStruct);
LRESULT STDCALL LRESULT STDCALL
W32kSendCREATEMessage(HWND Wnd, CREATESTRUCT* CreateStruct); W32kSendCREATEMessage(HWND Wnd, CREATESTRUCT* CreateStruct);
VOID STDCALL
W32kCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
HWND hWnd,
UINT Msg,
ULONG_PTR CompletionCallbackContext,
LRESULT Result);
LRESULT STDCALL
W32kSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, RECT Rect1,
RECT Rect2, RECT Rect3, PWINDOWPOS Pos);
#endif /* __SUBSYS_WIN32K_INCLUDE_CALLBACK_H */ #endif /* __SUBSYS_WIN32K_INCLUDE_CALLBACK_H */

View file

@ -34,16 +34,30 @@ typedef struct _USER_SENT_MESSAGE_NOTIFY
typedef struct _USER_MESSAGE_QUEUE typedef struct _USER_MESSAGE_QUEUE
{ {
/* Queue of messages sent to the queue. */
LIST_ENTRY SentMessagesListHead; LIST_ENTRY SentMessagesListHead;
/* Queue of messages posted to the queue. */
LIST_ENTRY PostedMessagesListHead; LIST_ENTRY PostedMessagesListHead;
/* Queue of hardware messages for the queue. */
LIST_ENTRY HardwareMessagesListHead; LIST_ENTRY HardwareMessagesListHead;
/* Queue of sent-message notifies for the queue. */
LIST_ENTRY NotifyMessagesListHead; LIST_ENTRY NotifyMessagesListHead;
/* Lock for the queue. */
FAST_MUTEX Lock; FAST_MUTEX Lock;
/* True if a WM_QUIT message is pending. */
BOOLEAN QuitPosted; BOOLEAN QuitPosted;
/* The quit exit code. */
ULONG QuitExitCode; ULONG QuitExitCode;
/* Set if there are new messages in any of the queues. */
KEVENT NewMessages; KEVENT NewMessages;
/* FIXME: Unknown. */
ULONG QueueStatus; ULONG QueueStatus;
/* Current window with focus for this queue. */
HWND FocusWindow; HWND FocusWindow;
/* True if a window needs painting. */
BOOLEAN PaintPosted;
/* Count of paints pending. */
ULONG PaintCount;
} USER_MESSAGE_QUEUE, *PUSER_MESSAGE_QUEUE; } USER_MESSAGE_QUEUE, *PUSER_MESSAGE_QUEUE;
VOID VOID
@ -82,6 +96,13 @@ NTSTATUS
MsqWaitForNewMessage(PUSER_MESSAGE_QUEUE MessageQueue); MsqWaitForNewMessage(PUSER_MESSAGE_QUEUE MessageQueue);
NTSTATUS NTSTATUS
MsqInitializeImpl(VOID); MsqInitializeImpl(VOID);
BOOLEAN
MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue);
NTSTATUS
MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue);
VOID
MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
PUSER_SENT_MESSAGE_NOTIFY NotifyMessage);
#define MAKE_LONG(x, y) ((((y) & 0xFFFF) << 16) | ((x) & 0xFFFF)) #define MAKE_LONG(x, y) ((((y) & 0xFFFF) << 16) | ((x) & 0xFFFF))

View file

@ -4,9 +4,20 @@
#include <windows.h> #include <windows.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <include/class.h> #include <include/class.h>
#include <include/msgqueue.h>
typedef struct _INTERNALPOS
{
RECT NormalRect;
POINT IconPos;
POINT MaxPos;
HWND IconTitle;
} INTERNALPOS, *PINTERNALPOS;
typedef struct _WINDOW_OBJECT typedef struct _WINDOW_OBJECT
{ {
/* Internal position. */
PINTERNALPOS InternalPos;
/* Pointer to the window class. */ /* Pointer to the window class. */
PWNDCLASS_OBJECT Class; PWNDCLASS_OBJECT Class;
/* Extended style. */ /* Extended style. */
@ -22,7 +33,6 @@ typedef struct _WINDOW_OBJECT
INT Height; INT Height;
/* Parent window handle. */ /* Parent window handle. */
HWND ParentHandle; HWND ParentHandle;
struct _WINDOW_OBJECT* Parent;
/* Window menu handle. */ /* Window menu handle. */
HMENU Menu; HMENU Menu;
/* Handle of the module that created the window. */ /* Handle of the module that created the window. */
@ -31,6 +41,8 @@ typedef struct _WINDOW_OBJECT
LPVOID Parameters; LPVOID Parameters;
/* Entry in the thread's list of windows. */ /* Entry in the thread's list of windows. */
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
/* Entry in the global list of windows. */
LIST_ENTRY DesktopListEntry;
/* Pointer to the extra data associated with the window. */ /* Pointer to the extra data associated with the window. */
PULONG ExtraData; PULONG ExtraData;
/* Size of the extra data associated with the window. */ /* Size of the extra data associated with the window. */
@ -43,16 +55,42 @@ typedef struct _WINDOW_OBJECT
HANDLE Self; HANDLE Self;
/* Window flags. */ /* Window flags. */
ULONG Flags; ULONG Flags;
/* FIXME: Don't know. */
UINT IDMenu; UINT IDMenu;
/* Handle of region of the window to be updated. */
HANDLE UpdateRegion;
/* Pointer to the message queue associated with the window. */
PUSER_MESSAGE_QUEUE MessageQueue;
/* Head of the list of child windows. */
LIST_ENTRY ChildrenListHead;
/* Lock for the list of child windows. */
FAST_MUTEX ChildrenListLock;
/* Entry in the parent's list of child windows. */
LIST_ENTRY SiblingListEntry;
/* Entry in the list of thread windows. */
LIST_ENTRY ThreadListEntry;
/* Pointer to the parent window. */
struct _WINDOW_OBJECT* Parent;
} WINDOW_OBJECT, *PWINDOW_OBJECT; } WINDOW_OBJECT, *PWINDOW_OBJECT;
/* Window flags. */
#define WINDOWOBJECT_NEED_SIZE (0x00000001) #define WINDOWOBJECT_NEED_SIZE (0x00000001)
#define WINDOWOBJECT_NEED_BEGINPAINT (0x00000002)
#define WINDOWOBJECT_NEED_ERASEBACKGRD (0x00000004)
#define WINDOWOBJECT_NEED_NCPAINT (0x00000008)
#define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000010)
#define WINDOWOBJECT_RESTOREMAX (0x00000020)
NTSTATUS NTSTATUS
InitWindowImpl(VOID); InitWindowImpl(VOID);
NTSTATUS NTSTATUS
CleanupWindowImpl(VOID); CleanupWindowImpl(VOID);
VOID
W32kGetClientRect(PWINDOW_OBJECT WindowObject, PRECT Rect);
PWINDOW_OBJECT
W32kGetWindowObject(HWND hWnd);
VOID
W32kReleaseWindowObject(PWINDOW_OBJECT Window);
#endif /* __WIN32K_WINDOW_H */ #endif /* __WIN32K_WINDOW_H */

View file

@ -1,9 +1,13 @@
/* Undocumented flags. */
#define SWP_NOCLIENTMOVE 0x0800
#define SWP_NOCLIENTSIZE 0x1000
LRESULT LRESULT
WinPosGetNonClientSize(HWND Wnd, RECT* WindowRect, RECT* ClientRect); WinPosGetNonClientSize(HWND Wnd, RECT* WindowRect, RECT* ClientRect);
VOID UINT
WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos, WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
POINT* MinTrack, POINT* MaxTrack); POINT* MinTrack, POINT* MaxTrack);
VOID UINT
WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos); WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos);
BOOLEAN BOOLEAN
WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,

View file

@ -20,18 +20,16 @@ NTSTATUS
CleanupWindowStationImpl(VOID); CleanupWindowStationImpl(VOID);
NTSTATUS NTSTATUS
ValidateWindowStationHandle( ValidateWindowStationHandle(HWINSTA WindowStation,
HWINSTA WindowStation, KPROCESSOR_MODE AccessMode,
KPROCESSOR_MODE AccessMode, ACCESS_MASK DesiredAccess,
ACCESS_MASK DesiredAccess, PWINSTATION_OBJECT *Object);
PWINSTATION_OBJECT *Object);
NTSTATUS NTSTATUS
ValidateDesktopHandle( ValidateDesktopHandle(HDESK Desktop,
HDESK Desktop, KPROCESSOR_MODE AccessMode,
KPROCESSOR_MODE AccessMode, ACCESS_MASK DesiredAccess,
ACCESS_MASK DesiredAccess, PDESKTOP_OBJECT *Object);
PDESKTOP_OBJECT *Object);
#endif /* __WIN32K_WINSTA_H */ #endif /* __WIN32K_WINSTA_H */

View file

@ -1,4 +1,4 @@
/* $Id: dllmain.c,v 1.25 2002/06/14 07:49:58 ekohl Exp $ /* $Id: dllmain.c,v 1.26 2002/07/04 19:56:37 dwelch Exp $
* *
* Entry Point for win32k.sys * Entry Point for win32k.sys
*/ */
@ -17,11 +17,9 @@
#include <include/class.h> #include <include/class.h>
#include <include/window.h> #include <include/window.h>
/* extern SSDT Win32kSSDT[];
* NOTE: the table is actually in the file ./svctab.c, extern SSPT Win32kSSPT[];
* generated by iface/addsys/mktab.c + w32ksvc.db extern ULONG Win32kNumberOfSysCalls;
*/
#include "svctab.c"
/* /*
* This definition doesn't work * This definition doesn't work
@ -40,7 +38,8 @@ DllMain (
* Register user mode call interface * Register user mode call interface
* (system service table index = 1) * (system service table index = 1)
*/ */
Result = KeAddSystemServiceTable (Win32kSSDT, NULL, NUMBER_OF_SYSCALLS, Win32kSSPT, 1); Result = KeAddSystemServiceTable (Win32kSSDT, NULL,
Win32kNumberOfSysCalls, Win32kSSPT, 1);
if (Result == FALSE) if (Result == FALSE)
{ {
DbgPrint("Adding system services failed!\n"); DbgPrint("Adding system services failed!\n");

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.45 2002/06/18 21:51:10 dwelch Exp $ # $Id: makefile,v 1.46 2002/07/04 19:56:36 dwelch Exp $
PATH_TO_TOP = ../.. PATH_TO_TOP = ../..
@ -23,14 +23,15 @@ TARGET_CFLAGS = $(CFLAGS_DBG) -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_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/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/palette.o eng/surface.o eng/xlate.o eng/transblt.o eng/mouse.o
MAIN_OBJECTS = main/dllmain.o MAIN_OBJECTS = main/dllmain.o main/svctabm.o
MISC_OBJECTS = misc/driver.o misc/error.o misc/math.o misc/object.o MISC_OBJECTS = misc/driver.o misc/error.o misc/math.o misc/object.o
LDR_OBJECTS = ldr/loader.o LDR_OBJECTS = ldr/loader.o
NTUSER_OBJECTS = ntuser/class.o ntuser/guicheck.o ntuser/hook.o \ NTUSER_OBJECTS = ntuser/class.o ntuser/guicheck.o ntuser/hook.o \
ntuser/message.o ntuser/msgqueue.o ntuser/stubs.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 ntuser/keyboard.o ntuser/callback.o \ ntuser/input.o ntuser/keyboard.o ntuser/callback.o \
ntuser/winpos.o ntuser/winpos.o ntuser/painting.o ntuser/metric.o \
ntuser/windc.o
OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \ OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \
objects/color.o objects/coord.o objects/dc.o \ objects/color.o objects/coord.o objects/dc.o \
objects/fillshap.o objects/gdiobj.o objects/icm.o \ objects/fillshap.o objects/gdiobj.o objects/icm.o \
@ -38,7 +39,7 @@ OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \
objects/path.o objects/pen.o objects/print.o \ objects/path.o objects/pen.o objects/print.o \
objects/region.o objects/text.o objects/wingl.o \ objects/region.o objects/text.o objects/wingl.o \
objects/bezier.o objects/objconv.o objects/dib.o \ objects/bezier.o objects/objconv.o objects/dib.o \
objects/palette.o objects/palette.o objects/rect.o
DIB_OBJECTS = dib/dib4bpp.o dib/dib24bpp.o DIB_OBJECTS = dib/dib4bpp.o dib/dib24bpp.o
FREETYPE_OBJECTS = freetype/ctype.o freetype/grfont.o \ FREETYPE_OBJECTS = freetype/ctype.o freetype/grfont.o \
freetype/src/base/ftsystem.o freetype/src/base/ftdebug.o \ freetype/src/base/ftsystem.o freetype/src/base/ftdebug.o \
@ -56,7 +57,7 @@ TARGET_OBJECTS = \
$(NTUSER_OBJECTS) $(OBJECTS_OBJECTS) $(STUBS_OBJECTS) \ $(NTUSER_OBJECTS) $(OBJECTS_OBJECTS) $(STUBS_OBJECTS) \
$(MATH_OBJECTS) $(FLOAT_OBJECTS) $(FREETYPE_OBJECTS) $(DIB_OBJECTS) $(MATH_OBJECTS) $(FLOAT_OBJECTS) $(FREETYPE_OBJECTS) $(DIB_OBJECTS)
TARGET_CLEAN = \ TARGET_CLEAN = $(TARGET_OBJECTS:.o=.d) \
dib/*.o \ dib/*.o \
eng/*.o \ eng/*.o \
freetype/*.o \ freetype/*.o \
@ -71,7 +72,12 @@ include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk include $(TOOLS_PATH)/helper.mk
main/dllmain.o: main/svctab.c # Automatic dependency tracking
DEP_OBJECTS := $(TARGET_OBJECTS)
DEP_EXCLUDE_FILTER := main/svctabm.d
include $(PATH_TO_TOP)/tools/depend.mk
misc/svctabm.o: misc/svctab.c
.dummy: .dummy:

View file

@ -1,4 +1,4 @@
/* $Id: callback.c,v 1.4 2002/06/21 04:14:07 ei Exp $ /* $Id: callback.c,v 1.5 2002/07/04 19:56:37 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -32,12 +32,66 @@ W32kCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
ULONG_PTR CompletionCallbackContext, ULONG_PTR CompletionCallbackContext,
LRESULT Result) LRESULT Result)
{ {
SENDASYNCPROC_CALLBACK_ARGUMENTS Arguments;
NTSTATUS Status;
Arguments.Callback = CompletionCallback;
Arguments.Wnd = hWnd;
Arguments.Msg = Msg;
Arguments.Context = CompletionCallbackContext;
Arguments.Result = Result;
Status = NtW32Call(USER32_CALLBACK_SENDASYNCPROC,
&Arguments,
sizeof(SENDASYNCPROC_CALLBACK_ARGUMENTS),
NULL,
NULL);
if (!NT_SUCCESS(Status))
{
return;
}
return;
} }
LRESULT STDCALL LRESULT STDCALL
W32kSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, RECT Rect1, W32kSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, PRECT Rect,
RECT Rect2, RECT Rect3, PWINDOWPOS Pos) NCCALCSIZE_PARAMS* Params)
{ {
SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS Arguments;
SENDNCCALCSIZEMESSAGE_CALLBACK_RESULT Result;
NTSTATUS Status;
PVOID ResultPointer;
ULONG ResultLength;
Arguments.Wnd = Wnd;
Arguments.Validate = Validate;
if (!Validate)
{
Arguments.Rect = *Rect;
}
else
{
Arguments.Params = *Params;
}
ResultPointer = &Result;
ResultLength = sizeof(SENDNCCALCSIZEMESSAGE_CALLBACK_RESULT);
Status = NtW32Call(USER32_CALLBACK_SENDNCCALCSIZE,
&Arguments,
sizeof(SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS),
&ResultPointer,
&ResultLength);
if (!NT_SUCCESS(Status))
{
return(0);
}
if (!Validate)
{
*Rect = Result.Rect;
}
else
{
*Params = Result.Params;
}
return(Result.Result);
} }
LRESULT STDCALL LRESULT STDCALL
@ -114,7 +168,7 @@ W32kCallWindowProc(WNDPROC Proc,
&Arguments, &Arguments,
sizeof(WINDOWPROC_CALLBACK_ARGUMENTS), sizeof(WINDOWPROC_CALLBACK_ARGUMENTS),
&ResultPointer, &ResultPointer,
&ResultLength); &ResultLength);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
return(0xFFFFFFFF); return(0xFFFFFFFF);

View file

@ -1,4 +1,4 @@
/* $Id: class.c,v 1.7 2002/06/14 20:56:17 jfilby Exp $ /* $Id: class.c,v 1.8 2002/07/04 19:56:37 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -17,6 +17,7 @@
#include <include/error.h> #include <include/error.h>
#include <include/winsta.h> #include <include/winsta.h>
#include <include/object.h> #include <include/object.h>
#include <include/guicheck.h>
//#define NDEBUG //#define NDEBUG
#include <debug.h> #include <debug.h>
@ -251,6 +252,11 @@ NtUserRegisterClassExWOW(LPWNDCLASSEX lpwcx,
return(Atom); return(Atom);
} }
DWORD STDCALL
NtUserGetClassLong(HWND hWnd, DWORD Offset)
{
}
DWORD STDCALL DWORD STDCALL
NtUserSetClassLong(DWORD Unknown0, NtUserSetClassLong(DWORD Unknown0,
DWORD Unknown1, DWORD Unknown1,

View file

@ -1,4 +1,4 @@
/* $Id: guicheck.c,v 1.4 2002/01/27 01:11:24 dwelch Exp $ /* $Id: guicheck.c,v 1.5 2002/07/04 19:56:37 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -22,6 +22,7 @@
#include <include/msgqueue.h> #include <include/msgqueue.h>
#include <include/object.h> #include <include/object.h>
#include <napi/win32.h> #include <napi/win32.h>
#include <include/winsta.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
@ -33,19 +34,46 @@ W32kGuiCheck(VOID)
{ {
if (PsGetWin32Process() == NULL) if (PsGetWin32Process() == NULL)
{ {
NTSTATUS Status;
PsCreateWin32Process(PsGetCurrentProcess()); PsCreateWin32Process(PsGetCurrentProcess());
InitializeListHead(&PsGetWin32Process()->ClassListHead); InitializeListHead(&PsGetWin32Process()->ClassListHead);
ExInitializeFastMutex(&PsGetWin32Process()->ClassListLock); ExInitializeFastMutex(&PsGetWin32Process()->ClassListLock);
InitializeListHead(&PsGetWin32Process()->WindowListHead);
ExInitializeFastMutex(&PsGetWin32Process()->WindowListLock); Status =
PsGetWin32Process()->HandleTable = ObmCreateHandleTable(); ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
UserMode,
GENERIC_ALL,
&PsGetWin32Process()->WindowStation);
if (!NT_SUCCESS(Status))
{
DbgPrint("W32K: Failed to reference a window station for "
"process.\n");
}
} }
if (PsGetWin32Thread() == NULL) if (PsGetWin32Thread() == NULL)
{ {
NTSTATUS Status;
PsCreateWin32Thread(PsGetCurrentThread()); PsCreateWin32Thread(PsGetCurrentThread());
PsGetWin32Thread()->MessageQueue = MsqCreateMessageQueue(); PsGetWin32Thread()->MessageQueue = MsqCreateMessageQueue();
InitializeListHead(&PsGetWin32Thread()->WindowListHead);
ExInitializeFastMutex(&PsGetWin32Thread()->WindowListLock);
/* By default threads get assigned their process's desktop. */
PsGetWin32Thread()->Desktop = NULL;
Status = ObReferenceObjectByHandle(PsGetCurrentProcess()->Win32Desktop,
GENERIC_ALL,
ExDesktopObjectType,
UserMode,
&PsGetWin32Thread()->Desktop,
NULL);
if (!NT_SUCCESS(Status))
{
DbgPrint("W32K: Failed to reference a desktop for thread.\n");
}
} }
} }

View file

@ -1,4 +1,4 @@
/* $Id: message.c,v 1.6 2002/06/06 17:50:16 jfilby Exp $ /* $Id: message.c,v 1.7 2002/07/04 19:56:37 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -21,8 +21,9 @@
#include <include/object.h> #include <include/object.h>
#include <include/winsta.h> #include <include/winsta.h>
#include <include/callback.h> #include <include/callback.h>
#include <include/painting.h>
#define NDEBUG //#define NDEBUG
#include <debug.h> #include <debug.h>
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
@ -44,6 +45,9 @@ LRESULT STDCALL
NtUserDispatchMessage(LPMSG lpMsg) NtUserDispatchMessage(LPMSG lpMsg)
{ {
LRESULT Result; LRESULT Result;
ULONG PaintingFlag;
PWINDOW_OBJECT WindowObject;
NTSTATUS Status;
/* Process timer messages. */ /* Process timer messages. */
if (lpMsg->message == WM_TIMER) if (lpMsg->message == WM_TIMER)
@ -62,20 +66,38 @@ NtUserDispatchMessage(LPMSG lpMsg)
} }
} }
/* /* Get the window object. */
* FIXME: Check for valid window handle, valid window and valid window Status =
* proc. ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
*/ lpMsg->hwnd,
otWindow,
(PVOID*)&WindowObject);
if (!NT_SUCCESS(Status))
{
return(0);
}
/* FIXME: Check for paint message. */ /* FIXME: Check for paint message. */
PaintingFlag = (lpMsg->message == WM_PAINT);
if (PaintingFlag)
{
WindowObject->Flags |= WINDOWOBJECT_NEED_BEGINPAINT;
}
/* FIXME: Call hook procedures. */
/* Call the window procedure. */
Result = W32kCallWindowProc(NULL /* WndProc */, Result = W32kCallWindowProc(NULL /* WndProc */,
lpMsg->hwnd, lpMsg->hwnd,
lpMsg->message, lpMsg->message,
lpMsg->wParam, lpMsg->wParam,
lpMsg->lParam); lpMsg->lParam);
/* FIXME: Check for paint message. */ if (PaintingFlag && WindowObject->Flags & WINDOWOBJECT_NEED_BEGINPAINT &&
WindowObject->UpdateRegion)
{
DbgBreakPoint();
}
return(Result); return(Result);
} }
@ -108,7 +130,8 @@ NtUserGetMessage(LPMSG lpMsg,
do do
{ {
/* FIXME: Dispatch sent messages here. */ /* Dispatch sent messages here. */
while (MsqDispatchOneSentMessage(ThreadQueue));
/* Now look for a quit message. */ /* Now look for a quit message. */
/* FIXME: WINE checks the message number filter here. */ /* FIXME: WINE checks the message number filter here. */
@ -152,9 +175,17 @@ NtUserGetMessage(LPMSG lpMsg,
return(TRUE); return(TRUE);
} }
/* FIXME: Check for sent messages again. */ /* Check for sent messages again. */
while (MsqDispatchOneSentMessage(ThreadQueue));
/* FIXME: Check for paint messages. */ /* Check for paint messages. */
if (ThreadQueue->PaintPosted)
{
lpMsg->hwnd = PaintingFindWinToRepaint(hWnd, PsGetWin32Thread());
lpMsg->message = WM_PAINT;
lpMsg->wParam = lpMsg->lParam = 0;
return(TRUE);
}
/* Nothing found so far. Wait for new messages. */ /* Nothing found so far. Wait for new messages. */
Status = MsqWaitForNewMessages(ThreadQueue); Status = MsqWaitForNewMessages(ThreadQueue);
@ -293,12 +324,71 @@ NtUserQuerySendMessage(DWORD Unknown0)
return 0; return 0;
} }
BOOL STDCALL LRESULT STDCALL
NtUserSendMessage(HWND hWnd, NtUserSendMessage(HWND hWnd,
UINT Msg, UINT Msg,
WPARAM Wparam, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
LRESULT Result;
NTSTATUS Status;
PWINDOW_OBJECT Window;
/* FIXME: Check for a broadcast or topmost destination. */
/* FIXME: Call hooks. */
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
hWnd,
otWindow,
(PVOID*)&Window);
if (!NT_SUCCESS(Status))
{
return(FALSE);
}
/* FIXME: Check for an exiting window. */
if (Window->MessageQueue == PsGetWin32Thread()->MessageQueue)
{
Result = W32kCallWindowProc(NULL, hWnd, Msg, wParam, lParam);
return(Result);
}
else
{
PUSER_SENT_MESSAGE Message;
PKEVENT CompletionEvent;
CompletionEvent = ExAllocatePool(NonPagedPool, sizeof(KEVENT));
KeInitializeEvent(CompletionEvent, NotificationEvent, FALSE);
Message = ExAllocatePool(NonPagedPool, sizeof(USER_SENT_MESSAGE));
Message->Msg.hwnd = hWnd;
Message->Msg.message = Msg;
Message->Msg.wParam = wParam;
Message->Msg.lParam = lParam;
Message->CompletionEvent = CompletionEvent;
Message->Result = &Result;
Message->CompletionQueue = NULL;
Message->CompletionCallback = NULL;
MsqSendMessage(Window->MessageQueue, Message);
ObmDereferenceObject(Window);
Status = KeWaitForSingleObject(CompletionEvent,
UserRequest,
UserMode,
FALSE,
NULL);
if (Status == STATUS_WAIT_0)
{
return(Result);
}
else
{
return(FALSE);
}
}
} }
BOOL STDCALL BOOL STDCALL
@ -309,9 +399,7 @@ NtUserSendMessageCallback(HWND hWnd,
SENDASYNCPROC lpCallBack, SENDASYNCPROC lpCallBack,
ULONG_PTR dwData) ULONG_PTR dwData)
{ {
UNIMPLEMENTED; return(0);
return 0;
} }
BOOL STDCALL BOOL STDCALL

View file

@ -1,4 +1,4 @@
/* $Id: msgqueue.c,v 1.3 2002/05/06 22:20:32 dwelch Exp $ /* $Id: msgqueue.c,v 1.4 2002/07/04 19:56:37 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -14,6 +14,7 @@
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <win32k/win32k.h> #include <win32k/win32k.h>
#include <include/msgqueue.h> #include <include/msgqueue.h>
#include <include/callback.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
@ -24,6 +25,28 @@ static PUSER_MESSAGE_QUEUE CurrentFocusMessageQueue;
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
VOID
MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue)
{
ExAcquireFastMutex(&Queue->Lock);
Queue->PaintCount++;
Queue->PaintPosted = TRUE;
ExReleaseFastMutex(&Queue->Lock);
}
VOID
MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue)
{
ExAcquireFastMutex(&Queue->Lock);
Queue->PaintCount--;
if (Queue->PaintCount == 0)
{
Queue->PaintPosted = FALSE;
}
ExReleaseFastMutex(&Queue->Lock);
}
NTSTATUS NTSTATUS
MsqInitializeImpl(VOID) MsqInitializeImpl(VOID)
{ {
@ -104,7 +127,7 @@ MsqPeekSentMessages(PUSER_MESSAGE_QUEUE MessageQueue)
return(!IsListEmpty(&MessageQueue->SentMessagesListHead)); return(!IsListEmpty(&MessageQueue->SentMessagesListHead));
} }
VOID BOOLEAN
MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue)
{ {
PUSER_SENT_MESSAGE Message; PUSER_SENT_MESSAGE Message;
@ -113,12 +136,16 @@ MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue)
PUSER_SENT_MESSAGE_NOTIFY NotifyMessage; PUSER_SENT_MESSAGE_NOTIFY NotifyMessage;
ExAcquireFastMutex(&MessageQueue->Lock); ExAcquireFastMutex(&MessageQueue->Lock);
if (IsListEmpty(&MessageQueue->SentMessagesListHead))
{
return(FALSE);
}
Entry = RemoveHeadList(&MessageQueue->SentMessagesListHead); Entry = RemoveHeadList(&MessageQueue->SentMessagesListHead);
Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry); Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry);
ExReleaseFastMutex(&MessageQueue->Lock); ExReleaseFastMutex(&MessageQueue->Lock);
/* Call the window procedure. */ /* Call the window procedure. */
Result = W32kCallWindowProc(W32kGetWindowProc(Message->Msg.hwnd), Result = W32kCallWindowProc(NULL,
Message->Msg.hwnd, Message->Msg.hwnd,
Message->Msg.message, Message->Msg.message,
Message->Msg.wParam, Message->Msg.wParam,
@ -148,10 +175,11 @@ MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue)
NotifyMessage->Result = Result; NotifyMessage->Result = Result;
NotifyMessage->hWnd = Message->Msg.hwnd; NotifyMessage->hWnd = Message->Msg.hwnd;
NotifyMessage->Msg = Message->Msg.message; NotifyMessage->Msg = Message->Msg.message;
MsqSendNotifyMessage(Message->CompletionQueue); MsqSendNotifyMessage(Message->CompletionQueue, NotifyMessage);
} }
ExFreePool(Message); ExFreePool(Message);
return(TRUE);
} }
VOID VOID

View file

@ -36,17 +36,6 @@ NtUserAttachThreadInput(
return 0; return 0;
} }
DWORD
STDCALL
NtUserBeginPaint(
DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL
NtUserBitBltSysBmp( NtUserBitBltSysBmp(
@ -578,17 +567,6 @@ NtUserEndMenu(VOID)
return 0; return 0;
} }
DWORD
STDCALL
NtUserEndPaint(
DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL
NtUserEnumDisplayDevices( NtUserEnumDisplayDevices(
@ -857,18 +835,6 @@ NtUserGetDC(
return 0; return 0;
} }
DWORD
STDCALL
NtUserGetDCEx(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL
NtUserGetDoubleClickTime(VOID) NtUserGetDoubleClickTime(VOID)

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.7 2002/06/18 21:51:11 dwelch Exp $ /* $Id: window.c,v 1.8 2002/07/04 19:56:37 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -27,14 +27,33 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
BOOL PWINDOW_OBJECT
W32kOffsetRect(LPRECT Rect, INT x, INT y) W32kGetWindowObject(HWND hWnd)
{
PWINDOW_OBJECT WindowObject;
NTSTATUS Status;
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->
HandleTable,
hWnd,
otWindow,
(PVOID*)&WindowObject);
if (!NT_SUCCESS(Status))
{
return(NULL);
}
return(WindowObject);
}
VOID
W32kReleaseWindowObject(PWINDOW_OBJECT Window)
{
ObmDereferenceObject(Window);
}
VOID
W32kGetClientRect(PWINDOW_OBJECT WindowObject, PRECT Rect)
{ {
Rect->left += x;
Rect->right += x;
Rect->top += y;
Rect->bottom += y;
return(TRUE);
} }
HWND HWND
@ -128,6 +147,8 @@ NtUserCreateWindowEx(DWORD dwExStyle,
} }
/* Check the window station. */ /* Check the window station. */
DPRINT("IoGetCurrentProcess() %X\n", IoGetCurrentProcess());
DPRINT("PROCESS_WINDOW_STATION %X\n", PROCESS_WINDOW_STATION());
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(), Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
KernelMode, KernelMode,
0, 0,
@ -143,8 +164,8 @@ NtUserCreateWindowEx(DWORD dwExStyle,
/* Create the window object. */ /* Create the window object. */
WindowObject = (PWINDOW_OBJECT) WindowObject = (PWINDOW_OBJECT)
ObmCreateObject(PsGetWin32Process()->HandleTable, &Handle, otWindow, ObmCreateObject(PsGetWin32Process()->WindowStation->HandleTable, &Handle,
sizeof(WINDOW_OBJECT)); otWindow, sizeof(WINDOW_OBJECT));
DPRINT("Created object with handle %X\n", Handle); DPRINT("Created object with handle %X\n", Handle);
if (!WindowObject) if (!WindowObject)
{ {
@ -171,6 +192,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
WindowObject->Instance = hInstance; WindowObject->Instance = hInstance;
WindowObject->Parameters = lpParam; WindowObject->Parameters = lpParam;
WindowObject->Self = Handle; WindowObject->Self = Handle;
WindowObject->MessageQueue = PsGetWin32Thread()->MessageQueue;
/* FIXME: Add the window parent. */ /* FIXME: Add the window parent. */
@ -202,10 +224,12 @@ NtUserCreateWindowEx(DWORD dwExStyle,
} }
/* Insert the window into the process's window list. */ /* Insert the window into the process's window list. */
ExAcquireFastMutexUnsafe (&PsGetWin32Process()->WindowListLock); ExAcquireFastMutexUnsafe (&PsGetWin32Thread()->WindowListLock);
InsertTailList (&PsGetWin32Process()->WindowListHead, InsertTailList (&PsGetWin32Thread()->WindowListHead,
&WindowObject->ListEntry); &WindowObject->ListEntry);
ExReleaseFastMutexUnsafe (&PsGetWin32Process()->WindowListLock); ExReleaseFastMutexUnsafe (&PsGetWin32Thread()->WindowListLock);
/* FIXME: Insert the window into the desktop window list. */
/* FIXME: Maybe allocate a DCE for this window. */ /* FIXME: Maybe allocate a DCE for this window. */
@ -296,7 +320,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
lParam = lParam =
MAKE_LONG(WindowObject->ClientRect.left, MAKE_LONG(WindowObject->ClientRect.left,
WindowObject->ClientRect.top); WindowObject->ClientRect.top);
DPRINT("NtUserCreateWindow(): About to send WM_SIZE\n"); DPRINT("NtUserCreateWindow(): About to send WM_MOVE\n");
W32kCallWindowProc(NULL, WindowObject->Self, WM_MOVE, 0, lParam); W32kCallWindowProc(NULL, WindowObject->Self, WM_MOVE, 0, lParam);
} }
@ -318,6 +342,8 @@ NtUserCreateWindowEx(DWORD dwExStyle,
NewPos.right, NewPos.bottom, SwFlag); NewPos.right, NewPos.bottom, SwFlag);
} }
/* FIXME: Need to set up parent window. */
#if 0
/* Notify the parent window of a new child. */ /* Notify the parent window of a new child. */
if ((WindowObject->Style & WS_CHILD) || if ((WindowObject->Style & WS_CHILD) ||
(!(WindowObject->ExStyle & WS_EX_NOPARENTNOTIFY))) (!(WindowObject->ExStyle & WS_EX_NOPARENTNOTIFY)))
@ -328,6 +354,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
MAKEWPARAM(WM_CREATE, WindowObject->IDMenu), MAKEWPARAM(WM_CREATE, WindowObject->IDMenu),
(LPARAM)WindowObject->Self); (LPARAM)WindowObject->Self);
} }
#endif
if (dwStyle & WS_VISIBLE) if (dwStyle & WS_VISIBLE)
{ {
@ -389,6 +416,7 @@ NtUserFindWindowEx(HWND hwndParent,
PUNICODE_STRING ucWindowName, PUNICODE_STRING ucWindowName,
DWORD Unknown4) DWORD Unknown4)
{ {
#if 0
NTSTATUS status; NTSTATUS status;
HWND windowHandle; HWND windowHandle;
PWINDOW_OBJECT windowObject; PWINDOW_OBJECT windowObject;
@ -429,6 +457,7 @@ NtUserFindWindowEx(HWND hwndParent,
ObmDereferenceObject (classObject); ObmDereferenceObject (classObject);
return (HWND)0; return (HWND)0;
#endif
} }
DWORD STDCALL DWORD STDCALL
@ -642,10 +671,11 @@ NtUserGetWindowLong(HWND hWnd, DWORD Index)
W32kGuiCheck(); W32kGuiCheck();
Status = ObmReferenceObjectByHandle(PsGetWin32Process()->HandleTable, Status =
hWnd, ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
otWindow, hWnd,
(PVOID*)&WindowObject); otWindow,
(PVOID*)&WindowObject);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("NtUserGetWindowLong(): Bad handle.\n"); DPRINT("NtUserGetWindowLong(): Bad handle.\n");
@ -743,21 +773,9 @@ BOOL STDCALL
NtUserShowWindow(HWND hWnd, NtUserShowWindow(HWND hWnd,
LONG nCmdShow) LONG nCmdShow)
{ {
PWINDOW_OBJECT WindowObject;
NTSTATUS Status;
W32kGuiCheck(); W32kGuiCheck();
Status = ObmReferenceObjectByHandle(PsGetWin32Process()->HandleTable, return(WinPosShowWindow(hWnd, nCmdShow));
hWnd,
otWindow,
(PVOID*)&WindowObject);
if (!NT_SUCCESS(Status))
{
return(FALSE);
}
return TRUE;
} }
DWORD STDCALL DWORD STDCALL

View file

@ -1,4 +1,4 @@
/* $Id: winpos.c,v 1.1 2002/05/06 22:20:32 dwelch Exp $ /* $Id: winpos.c,v 1.2 2002/07/04 19:56:37 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -19,6 +19,10 @@
#include <include/error.h> #include <include/error.h>
#include <include/winsta.h> #include <include/winsta.h>
#include <windows.h> #include <windows.h>
#include <include/winpos.h>
#include <include/rect.h>
#include <include/callback.h>
#include <include/painting.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
@ -27,34 +31,270 @@
#define MINMAX_NOSWP (0x00010000) #define MINMAX_NOSWP (0x00010000)
#define SWP_EX_PAINTSELF 0x0002
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
POINT STATIC
WinPosFindIconPos(HWND hWnd, POINT Pos)
{
}
HWND STATIC
WinPosCreateIconTitle(PWINDOW_OBJECT WindowObject)
{
return(NULL);
}
BOOL STATIC
WinPosShowIconTitle(PWINDOW_OBJECT WindowObject, BOOL Show)
{
PINTERNALPOS InternalPos = WindowObject->InternalPos;
PWINDOW_OBJECT IconWindow;
NTSTATUS Status;
if (InternalPos)
{
HWND hWnd = InternalPos->IconTitle;
if (hWnd == NULL)
{
hWnd = WinPosCreateIconTitle(WindowObject);
}
if (Show)
{
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->
HandleTable,
hWnd,
otWindow,
(PVOID*)&IconWindow);
if (NT_SUCCESS(Status))
{
if (!(IconWindow->Style & WS_VISIBLE))
{
NtUserSendMessage(hWnd, WM_SHOWWINDOW, TRUE, 0);
WinPosSetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE |
SWP_NOMOVE | SWP_NOACTIVATE |
SWP_NOZORDER | SWP_SHOWWINDOW);
}
ObmDereferenceObject(IconWindow);
}
}
else
{
WinPosShowWindow(hWnd, SW_HIDE);
}
}
return(FALSE);
}
PINTERNALPOS STATIC
WinPosInitInternalPos(PWINDOW_OBJECT WindowObject, POINT pt, PRECT RestoreRect)
{
if (WindowObject->InternalPos == NULL)
{
WindowObject->InternalPos =
ExAllocatePool(NonPagedPool, sizeof(INTERNALPOS));
WindowObject->InternalPos->IconTitle = 0;
WindowObject->InternalPos->NormalRect = WindowObject->WindowRect;
WindowObject->InternalPos->IconPos.x =
WindowObject->InternalPos->MaxPos.x = 0xFFFFFFFF;
WindowObject->InternalPos->IconPos.y =
WindowObject->InternalPos->MaxPos.y = 0xFFFFFFFF;
}
if (WindowObject->Style & WS_MINIMIZE)
{
WindowObject->InternalPos->IconPos = pt;
}
else if (WindowObject->Style & WS_MAXIMIZE)
{
WindowObject->InternalPos->MaxPos = pt;
}
else if (RestoreRect != NULL)
{
WindowObject->InternalPos->NormalRect = *RestoreRect;
}
return(WindowObject->InternalPos);
}
UINT UINT
WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos) WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos)
{ {
POINT Size;
PINTERNALPOS InternalPos;
UINT SwpFlags = 0;
Size.x = WindowObject->WindowRect.left;
Size.y = WindowObject->WindowRect.top;
InternalPos = WinPosInitInternalPos(WindowObject, Size,
&WindowObject->WindowRect);
if (InternalPos)
{
if (WindowObject->Style & WS_MINIMIZE)
{
if (!NtUserSendMessage(WindowObject->Self, WM_QUERYOPEN, 0, 0))
{
return(SWP_NOSIZE | SWP_NOMOVE);
}
SwpFlags |= SWP_NOCOPYBITS;
}
switch (ShowFlag)
{
case SW_MINIMIZE:
{
if (WindowObject->Style & WS_MAXIMIZE)
{
WindowObject->Flags |= WINDOWOBJECT_RESTOREMAX;
WindowObject->Style &= ~WS_MAXIMIZE;
}
else
{
WindowObject->Style &= ~WINDOWOBJECT_RESTOREMAX;
}
WindowObject->Style |= WS_MINIMIZE;
InternalPos->IconPos = WinPosFindIconPos(WindowObject,
InternalPos->IconPos);
W32kSetRect(NewPos, InternalPos->IconPos.x, InternalPos->IconPos.y,
NtUserGetSystemMetrics(SM_CXICON),
NtUserGetSystemMetrics(SM_CYICON));
SwpFlags |= SWP_NOCOPYBITS;
break;
}
case SW_MAXIMIZE:
{
WinPosGetMinMaxInfo(WindowObject, &Size, &InternalPos->MaxPos,
NULL, NULL);
if (WindowObject->Style & WS_MINIMIZE)
{
WinPosShowIconTitle(WindowObject, FALSE);
WindowObject->Style &= ~WS_MINIMIZE;
}
WindowObject->Style |= WS_MINIMIZE;
W32kSetRect(NewPos, InternalPos->MaxPos.x, InternalPos->MaxPos.y,
Size.x, Size.y);
break;
}
case SW_RESTORE:
{
if (WindowObject->Style & WS_MINIMIZE)
{
WindowObject->Style &= ~WS_MINIMIZE;
WinPosShowIconTitle(WindowObject, FALSE);
if (WindowObject->Flags & WINDOWOBJECT_RESTOREMAX)
{
WinPosGetMinMaxInfo(WindowObject, &Size,
&InternalPos->MaxPos, NULL, NULL);
WindowObject->Style |= WS_MAXIMIZE;
W32kSetRect(NewPos, InternalPos->MaxPos.x,
InternalPos->MaxPos.y, Size.x, Size.y);
break;
}
}
else
{
if (!(WindowObject->Style & WS_MAXIMIZE))
{
return(-1);
}
else
{
WindowObject->Style &= ~WS_MAXIMIZE;
}
*NewPos = InternalPos->NormalRect;
NewPos->right -= NewPos->left;
NewPos->bottom -= NewPos->top;
break;
}
}
}
}
else
{
SwpFlags |= SWP_NOSIZE | SWP_NOMOVE;
}
return(SwpFlags);
} }
UINT UINT
WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos, WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
POINT* MaxTrack) POINT* MinTrack, POINT* MaxTrack)
{ {
} }
BOOL STATIC
WinPosChangeActiveWindow(HWND Wnd, BOOL MouseMsg)
{
}
LONG STATIC
WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
RECT* WindowRect, RECT* ClientRect)
{
}
BOOL
WinPosDoWinPosChanging(PWINDOW_OBJECT WindowObject,
PWINDOWPOS WinPos,
PRECT WindowRect,
PRECT ClientRect)
{
if (!(WinPos->flags & SWP_NOSENDCHANGING))
{
NtUserSendMessage(WindowObject->Self, WM_WINDOWPOSCHANGING, 0,
(LPARAM)WinPos);
}
*WindowRect = WindowObject->WindowRect;
*ClientRect =
(WindowObject->Style & WS_MINIMIZE) ? WindowObject->WindowRect :
WindowObject->ClientRect;
if (!(WinPos->flags & SWP_NOSIZE))
{
WindowRect->right = WindowRect->left + WinPos->cx;
WindowRect->bottom = WindowRect->top + WinPos->cy;
}
if (!(WinPos->flags & SWP_NOMOVE))
{
WindowRect->left = WinPos->x;
WindowRect->top = WinPos->y;
WindowRect->right += WinPos->x - WindowObject->WindowRect.left;
WindowRect->bottom += WinPos->y - WindowObject->WindowRect.top;
W32kOffsetRect(ClientRect, WinPos->x - WindowObject->WindowRect.left,
WinPos->y - WindowObject->WindowRect.top);
}
WinPos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE;
return(TRUE);
}
BOOLEAN BOOLEAN
WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
INT cy, UINT flags) INT cy, UINT flags)
{ {
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
NTSTATUS Status; NTSTATUS Status;
WINDOWPOS WinPos;
RECT NewWindowRect;
RECT NewClientRect;
HRGN VisRgn = NULL;
ULONG WvrFlags = 0;
/* FIXME: Get current active window from active queue. */ /* FIXME: Get current active window from active queue. */
/* FIXME: Check if the window is for a desktop. */ /* FIXME: Check if the window is for a desktop. */
Status = ObmReferenceObjectByHandle(PsGetWin32Process()->HandleTable, Status =
Wnd, ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
otWindow, Wnd,
(PVOID*)&Window); otWindow,
(PVOID*)&Window);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
return(FALSE); return(FALSE);
@ -74,27 +314,140 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
flags &= ~SWP_HIDEWINDOW; flags &= ~SWP_HIDEWINDOW;
} }
if (cx < 0) cx = max(cx, 0);
cy = max(cy, 0);
if ((Window->WindowRect.right - Window->WindowRect.left) == cx &&
(Window->WindowRect.bottom - Window->WindowRect.top) == cy)
{ {
cx = 0; flags |= SWP_NOSIZE;
} }
if (cy < 0) if (Window->WindowRect.left == x && Window->WindowRect.top == y)
{ {
cy = 0; flags |= SWP_NOMOVE;
}
if (FALSE /* FIXME: Check if the window if already active. */)
{
flags |= SWP_NOACTIVATE;
}
else if ((Window->Style & (WS_POPUP | WS_CHILD)) != WS_CHILD)
{
if (!(flags & SWP_NOACTIVATE))
{
flags &= ~SWP_NOZORDER;
WndInsertAfter = HWND_TOP;
}
} }
if (WndInsertAfter == HWND_TOPMOST || WndInsertAfter == HWND_NOTOPMOST)
{
WndInsertAfter = HWND_TOP;
}
if (WndInsertAfter != HWND_TOP && WndInsertAfter != HWND_BOTTOM)
{
/* FIXME: Find the window to insert after. */
}
WinPos.hwnd = Wnd;
WinPos.hwndInsertAfter = WndInsertAfter;
WinPos.x = x;
WinPos.y = y;
WinPos.cx = cx;
WinPos.cy = cy;
WinPos.flags = flags;
WinPosDoWinPosChanging(Window, &WinPos, &NewWindowRect, &NewClientRect);
if ((WinPos.flags & (SWP_NOZORDER | SWP_HIDEWINDOW | SWP_SHOWWINDOW)) !=
SWP_NOZORDER)
{
/* FIXME: SWP_DoOwnedPopups. */
}
/* FIXME: Adjust flags based on WndInsertAfter */
if ((!(WinPos.flags & (SWP_NOREDRAW | SWP_SHOWWINDOW)) &&
WinPos.flags & (SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
SWP_HIDEWINDOW | SWP_FRAMECHANGED)) !=
(SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER))
{
if (Window->Style & WS_CLIPCHILDREN)
{
VisRgn = DceGetVisRgn(Wnd, DCX_WINDOW | DCX_CLIPSIBLINGS, 0, 0);
}
else
{
VisRgn = DceGetVisRgn(Wnd, DCX_WINDOW, 0, 0);
}
}
WvrFlags = WinPosDoNCCALCSize(Window, &WinPos, &NewWindowRect,
&NewClientRect);
/* FIXME: Relink windows. */
/* FIXME: Reset active DCEs */
/* FIXME: Check for redrawing the whole client rect. */
if (WinPos.flags & SWP_SHOWWINDOW)
{
Window->Style |= WS_VISIBLE;
flags |= SWP_EX_PAINTSELF;
VisRgn = 1;
}
else
{
/* FIXME: Move the window bits */
}
if (WinPos.flags & SWP_HIDEWINDOW)
{
Window->Style &= ~WS_VISIBLE;
}
/* FIXME: Hide or show the claret */
if (VisRgn)
{
if (!(WinPos.flags & SWP_NOREDRAW))
{
if (flags & SWP_EX_PAINTSELF)
{
PaintRedrawWindow(Window->Self, NULL,
(VisRgn == 1) ? 0 : VisRgn,
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |
RDW_ALLCHILDREN,
RDW_EX_XYWINDOW | RDW_EX_USEHRGN);
}
else
{
PaintRedrawWindow(Window->Self, NULL,
(VisRgn == 1) ? 0 : VisRgn,
RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN,
RDW_EX_USEHRGN);
}
/* FIXME: Redraw the window parent. */
}
/* FIXME: Delete VisRgn */
}
if (!(flags & SWP_NOACTIVATE))
{
WinPosChangeActiveWindow(WinPos.hwnd, FALSE);
}
/* FIXME: Check some conditions before doing this. */
NtUserSendMessage(WinPos.hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM)&WinPos);
ObmDereferenceObject(Window);
return(TRUE);
} }
LRESULT LRESULT
WinPosGetNonClientSize(HWND Wnd, RECT* WindowRect, RECT* ClientRect) WinPosGetNonClientSize(HWND Wnd, RECT* WindowRect, RECT* ClientRect)
{ {
LRESULT Result;
Result =
W32kSendNCCALCSIZEMessage(Wnd, FALSE, WindowRect, NULL,
NULL, NULL, ClientRect);
return(Result);
} }
BOOLEAN BOOLEAN
@ -107,10 +460,11 @@ WinPosShowWindow(HWND Wnd, INT Cmd)
RECT NewPos; RECT NewPos;
BOOLEAN ShowFlag; BOOLEAN ShowFlag;
Status = ObmReferenceObjectByHandle(PsGetWin32Process()->HandleTable, Status =
Wnd, ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
otWindow, Wnd,
(PVOID*)&Window); otWindow,
(PVOID*)&Window);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
return(FALSE); return(FALSE);

View file

@ -1,4 +1,4 @@
/* $Id: winsta.c,v 1.3 2002/06/11 22:09:03 dwelch Exp $ /* $Id: winsta.c,v 1.4 2002/07/04 19:56:37 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -172,15 +172,13 @@ NtUserCloseWindowStation(
* NtUserCloseWindowStation() * NtUserCloseWindowStation()
* Zero on failure * Zero on failure
*/ */
HWINSTA HWINSTA STDCALL
STDCALL NtUserCreateWindowStation(PUNICODE_STRING lpszWindowStationName,
NtUserCreateWindowStation( ACCESS_MASK dwDesiredAccess,
PUNICODE_STRING lpszWindowStationName, LPSECURITY_ATTRIBUTES lpSecurity,
ACCESS_MASK dwDesiredAccess, DWORD Unknown3,
LPSECURITY_ATTRIBUTES lpSecurity, DWORD Unknown4,
DWORD Unknown3, DWORD Unknown5)
DWORD Unknown4,
DWORD Unknown5)
{ {
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING WindowStationName; UNICODE_STRING WindowStationName;
@ -197,54 +195,51 @@ NtUserCreateWindowStation(
DPRINT("Trying to open window station (%wZ)\n", &WindowStationName); DPRINT("Trying to open window station (%wZ)\n", &WindowStationName);
/* Initialize ObjectAttributes for the window station object */ /* Initialize ObjectAttributes for the window station object */
InitializeObjectAttributes( InitializeObjectAttributes(&ObjectAttributes,
&ObjectAttributes, &WindowStationName,
&WindowStationName, 0,
0, NULL,
NULL, NULL);
NULL);
Status = ObOpenObjectByName( Status = ObOpenObjectByName(&ObjectAttributes,
&ObjectAttributes, ExWindowStationObjectType,
ExWindowStationObjectType, NULL,
NULL, UserMode,
UserMode, dwDesiredAccess,
dwDesiredAccess, NULL,
NULL, &WinSta);
&WinSta);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
DPRINT("Successfully opened window station (%wZ)\n", WindowStationName); DPRINT("Successfully opened window station (%wZ)\n", WindowStationName);
return (HWINSTA)WinSta; return((HWINSTA)WinSta);
} }
DPRINT("Creating window station (%wZ)\n", &WindowStationName); DPRINT("Creating window station (%wZ)\n", &WindowStationName);
Status = ObCreateObject( Status = ObCreateObject(&WinSta,
&WinSta, STANDARD_RIGHTS_REQUIRED,
STANDARD_RIGHTS_REQUIRED, &ObjectAttributes,
&ObjectAttributes, ExWindowStationObjectType,
ExWindowStationObjectType, (PVOID*)&WinStaObject);
(PVOID*)&WinStaObject);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("Failed creating window station (%wZ)\n", &WindowStationName); DPRINT("Failed creating window station (%wZ)\n", &WindowStationName);
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES); SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return (HWINSTA)0; return (HWINSTA)0;
} }
WinStaObject->HandleTable = ObmCreateHandleTable(); WinStaObject->HandleTable = ObmCreateHandleTable();
if (!WinStaObject->HandleTable) if (!WinStaObject->HandleTable)
{ {
DPRINT("Failed creating handle table\n"); DPRINT("Failed creating handle table\n");
ObDereferenceObject(WinStaObject); ObDereferenceObject(WinStaObject);
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES); SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return (HWINSTA)0; return((HWINSTA)0);
} }
DPRINT("Window station successfully created (%wZ)\n", &WindowStationName); DPRINT("Window station successfully created (%wZ)\n", &WindowStationName);
return (HWINSTA)WinSta; return((HWINSTA)WinSta);
} }
BOOL BOOL
@ -559,15 +554,12 @@ NtUserCreateDesktop(
return (HDESK)Desktop; return (HDESK)Desktop;
} }
HDESK HDESK STDCALL
STDCALL NtUserGetThreadDesktop(DWORD dwThreadId,
NtUserGetThreadDesktop( DWORD Unknown1)
DWORD dwThreadId,
DWORD Unknown1)
{ {
UNIMPLEMENTED UNIMPLEMENTED;
return((HDESK)0);
return (HDESK)0;
} }
/* /*
@ -731,14 +723,10 @@ NtUserResolveDesktopForWOW(
return 0; return 0;
} }
BOOL BOOL STDCALL
STDCALL NtUserSetThreadDesktop(HDESK hDesktop)
NtUserSetThreadDesktop(
HDESK hDesktop)
{ {
UNIMPLEMENTED return(FALSE);
return FALSE;
} }
/* /*

View file

@ -1,14 +1,24 @@
/* $Id: coord.c,v 1.7 2002/07/04 19:56:37 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Coordinate systems
* FILE: subsys/win32k/objects/coord.c
* PROGRAMER: Unknown
*/
/* INCLUDES ******************************************************************/
#undef WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <win32k/coord.h> #include <win32k/coord.h>
#include <win32k/dc.h> #include <win32k/dc.h>
// #define NDEBUG //#define NDEBUG
#include <win32k/debug1.h> #include <win32k/debug1.h>
/* FUNCTIONS *****************************************************************/
BOOL STDCALL W32kCombineTransform(LPXFORM XFormResult, BOOL STDCALL W32kCombineTransform(LPXFORM XFormResult,
CONST LPXFORM xform1, CONST LPXFORM xform1,
CONST LPXFORM xform2) CONST LPXFORM xform2)
@ -35,11 +45,37 @@ BOOL STDCALL W32kCombineTransform(LPXFORM XFormResult,
return TRUE; return TRUE;
} }
BOOL STDCALL W32kDPtoLP(HDC hDC, VOID STATIC
LPPOINT Points, CoordDPtoLP(PDC Dc, LPPOINT Point)
int Count)
{ {
UNIMPLEMENTED; FLOAT x, y;
x = (FLOAT)Point->x;
y = (FLOAT)Point->y;
Point->x = x * Dc->w.xformVport2World.eM11 +
y * Dc->w.xformVport2World.eM21 + Dc->w.xformVport2World.eDx;
Point->y = x * Dc->w.xformVport2World.eM12 +
y * Dc->w.xformVport2World.eM22 + Dc->w.xformVport2World.eDy;
}
BOOL STDCALL
W32kDPtoLP(HDC hDC,
LPPOINT Points,
int Count)
{
PDC Dc;
ULONG i;
Dc = DC_HandleToPtr (hDC);
if (Dc == NULL || !Dc->w.vport2WorldValid)
{
return(FALSE);
}
for (i = 0; i < Count; i++)
{
CoordDPtoLP(Dc, &Points[i]);
}
return(TRUE);
} }
int int
@ -81,13 +117,35 @@ W32kGetWorldTransform(HDC hDC,
return TRUE; return TRUE;
} }
BOOL VOID STATIC
STDCALL CoordLPtoDP(PDC Dc, LPPOINT Point)
W32kLPtoDP(HDC hDC,
LPPOINT Points,
int Count)
{ {
UNIMPLEMENTED; FLOAT x, y;
x = (FLOAT)Point->x;
y = (FLOAT)Point->y;
Point->x = x * Dc->w.xformWorld2Vport.eM11 +
y * Dc->w.xformWorld2Vport.eM21 + Dc->w.xformWorld2Vport.eDx;
Point->y = x * Dc->w.xformWorld2Vport.eM12 +
y * Dc->w.xformWorld2Vport.eM22 + Dc->w.xformWorld2Vport.eDy;
}
BOOL STDCALL
W32kLPtoDP(HDC hDC, LPPOINT Points, INT Count)
{
PDC Dc;
ULONG i;
Dc = DC_HandleToPtr (hDC);
if (Dc == NULL)
{
return(FALSE);
}
for (i = 0; i < Count; i++)
{
CoordLPtoDP(Dc, &Points[i]);
}
return(TRUE);
} }
BOOL BOOL

View file

@ -1,180 +1,190 @@
#undef WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <win32k/region.h> #include <win32k/region.h>
#include <win32k/gdiobj.h>
// #define NDEBUG //#define NDEBUG
#include <win32k/debug1.h> #include <win32k/debug1.h>
INT /* FUNCTIONS *****************************************************************/
STDCALL
INT STDCALL
W32kGetBoxRgn(HRGN hRgn, PRECT Rect)
{
}
HRGN STDCALL
W32kCropRgn(HRGN hDest, HRGN hSrc, const RECT* Rect, const POINT* Point)
{
}
INT STDCALL
W32kCombineRgn(HRGN hDest, W32kCombineRgn(HRGN hDest,
HRGN hSrc1, HRGN hSrc1,
HRGN hSrc2, HRGN hSrc2,
INT CombineMode) INT CombineMode)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
HRGN HRGN STDCALL
STDCALL
W32kCreateEllipticRgn(INT LeftRect, W32kCreateEllipticRgn(INT LeftRect,
INT TopRect, INT TopRect,
INT RightRect, INT RightRect,
INT BottomRect) INT BottomRect)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
HRGN HRGN STDCALL
STDCALL W32kCreateEllipticRgnIndirect(CONST PRECT rc)
W32kCreateEllipticRgnIndirect(CONST PRECT rc)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
HRGN HRGN STDCALL
STDCALL
W32kCreatePolygonRgn(CONST PPOINT pt, W32kCreatePolygonRgn(CONST PPOINT pt,
INT Count, INT Count,
INT PolyFillMode) INT PolyFillMode)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
HRGN HRGN STDCALL
STDCALL
W32kCreatePolyPolygonRgn(CONST PPOINT pt, W32kCreatePolyPolygonRgn(CONST PPOINT pt,
CONST PINT PolyCounts, CONST PINT PolyCounts,
INT Count, INT Count,
INT PolyFillMode) INT PolyFillMode)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
HRGN HRGN STDCALL
STDCALL
W32kCreateRectRgn(INT LeftRect, W32kCreateRectRgn(INT LeftRect,
INT TopRect, INT TopRect,
INT RightRect, INT RightRect,
INT BottomRect) INT BottomRect)
{ {
UNIMPLEMENTED; RGNDATA* Region;
PRECT Rect;
DPRINT("W32kCreateRectRgn(LeftRect %d, TopRect %d, RightRect %d, "
"BottomRect %d)\n", LeftRect, TopRect, RightRect, BottomRect);
Region = (RGNDATA*)GDIOBJ_AllocObject(sizeof(RGNDATA) + sizeof(RECT) - 1, 0);
Region->rdh.dwSize = sizeof(RGNDATA) + sizeof(RECT) - 1;
Region->rdh.iType = RDH_RECTANGLES;
Region->rdh.nCount = 0;
Rect = (PRECT)Region->Buffer;
Rect->left = LeftRect;
Rect->right = RightRect;
Rect->top = TopRect;
Rect->bottom = BottomRect;
Region->rdh.rcBound = *Rect;
return(GDIOBJ_PtrToHandle((PGDIOBJ)Region, 0));
} }
HRGN HRGN STDCALL
STDCALL W32kCreateRectRgnIndirect(CONST PRECT rc)
W32kCreateRectRgnIndirect(CONST PRECT rc)
{ {
UNIMPLEMENTED; return(W32kCreateRectRgn(rc->left, rc->top, rc->right, rc->bottom));
} }
HRGN HRGN STDCALL
STDCALL
W32kCreateRoundRectRgn(INT LeftRect, W32kCreateRoundRectRgn(INT LeftRect,
INT TopRect, INT TopRect,
INT RightRect, INT RightRect,
INT BottomRect, INT BottomRect,
INT WidthEllipse, INT WidthEllipse,
INT HeightEllipse) INT HeightEllipse)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOL BOOL STDCALL
STDCALL
W32kEqualRgn(HRGN hSrcRgn1, W32kEqualRgn(HRGN hSrcRgn1,
HRGN hSrcRgn2) HRGN hSrcRgn2)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
HRGN HRGN STDCALL
STDCALL
W32kExtCreateRegion(CONST PXFORM Xform, W32kExtCreateRegion(CONST PXFORM Xform,
DWORD Count, DWORD Count,
CONST PRGNDATA RgnData) CONST PRGNDATA RgnData)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOL BOOL STDCALL
STDCALL
W32kFillRgn(HDC hDC, W32kFillRgn(HDC hDC,
HRGN hRgn, HRGN hRgn,
HBRUSH hBrush) HBRUSH hBrush)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOL BOOL STDCALL
STDCALL
W32kFrameRgn(HDC hDC, W32kFrameRgn(HDC hDC,
HRGN hRgn, HRGN hRgn,
HBRUSH hBrush, HBRUSH hBrush,
INT Width, INT Width,
INT Height) INT Height)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
INT INT STDCALL
STDCALL
W32kGetRgnBox(HRGN hRgn, W32kGetRgnBox(HRGN hRgn,
LPRECT hRect) LPRECT hRect)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOL BOOL STDCALL
STDCALL
W32kInvertRgn(HDC hDC, W32kInvertRgn(HDC hDC,
HRGN hRgn) HRGN hRgn)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
INT INT STDCALL
STDCALL
W32kOffsetRgn(HRGN hRgn, W32kOffsetRgn(HRGN hRgn,
INT XOffset, INT XOffset,
INT YOffset) INT YOffset)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOL BOOL STDCALL
STDCALL
W32kPaintRgn(HDC hDC, W32kPaintRgn(HDC hDC,
HRGN hRgn) HRGN hRgn)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOL BOOL STDCALL
STDCALL
W32kPtInRegion(HRGN hRgn, W32kPtInRegion(HRGN hRgn,
INT X, INT X,
INT Y) INT Y)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOL BOOL STDCALL
STDCALL
W32kRectInRegion(HRGN hRgn, W32kRectInRegion(HRGN hRgn,
CONST LPRECT rc) CONST LPRECT rc)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOL BOOL STDCALL
STDCALL
W32kSetRectRgn(HRGN hRgn, W32kSetRectRgn(HRGN hRgn,
INT LeftRect, INT LeftRect,
INT TopRect, INT TopRect,
INT RightRect, INT RightRect,
INT BottomRect) INT BottomRect)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }

View file

@ -2,7 +2,7 @@
# Define $DEP_OBJECTS before this file is included # Define $DEP_OBJECTS before this file is included
# $DEP_OBJECTS contain a list of object files that are checked for dependancies # $DEP_OBJECTS contain a list of object files that are checked for dependancies
DEP_FILTERED := $(filter-out ex/napi.% nt/zw.%, $(DEP_OBJECTS:.o=.d)) DEP_FILTERED := $(filter-out $(DEP_EXCLUDE_FILTER), $(DEP_OBJECTS:.o=.d))
DEP_FILES := $(join $(dir $(DEP_FILTERED)), $(addprefix ., $(notdir $(DEP_FILTERED)))) DEP_FILES := $(join $(dir $(DEP_FILTERED)), $(addprefix ., $(notdir $(DEP_FILTERED))))