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>
* tools/helper.mk: Make an import library a proper target
@ -369,4 +465,4 @@

View file

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

View file

@ -41,7 +41,7 @@ int main (void)
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
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 = ../../..
@ -10,6 +10,8 @@ TARGET_OBJECTS = ide.o
TARGET_HEADERS = *.h
TARGET_GCCLIBS = gcc
include $(PATH_TO_TOP)/rules.mak
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
* PROJECT: ReactOS version of ntdll
@ -162,6 +162,7 @@ char *stmp;
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 NUMBER_OF_SYSCALLS %d\n", sys_call_idx);
fprintf(out, "ULONG Win32kNumberOfSysCalls = %d;\n", sys_call_idx);
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
* PROJECT: ReactOS version of ntdll
@ -28,6 +28,45 @@
/* 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)
{
char line [INPUT_BUFFER_SIZE];
@ -257,34 +296,8 @@ process(
* system call: NtXXX and ZwXXX symbols
* are aliases.
*/
#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\"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);
write_syscall_stub(out, out3, name, name2,
nr_args, sys_call_idx);
}
}

View file

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

View file

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

View file

@ -6,7 +6,7 @@
#define USER32_CALLBACK_SENDNCCREATE (2)
#define USER32_CALLBACK_SENDNCCALCSIZE (3)
#define USER32_CALLBACK_SENDCREATE (4)
#define USER32_CALLBACK_MAXIMUM (4)
#define USER32_CALLBACK_MAXIMUM (5)
typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS
{
@ -19,10 +19,10 @@ typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS
typedef struct _SENDASYNCPROC_CALLBACK_ARGUMENTS
{
SENDASYNCPROC Proc;
SENDASYNCPROC Callback;
HWND Wnd;
UINT Msg;
ULONG Data;
ULONG_PTR Context;
LRESULT Result;
} SENDASYNCPROC_CALLBACK_ARGUMENTS, *PSENDASYNCPROC_CALLBACK_ARGUMENTS;
@ -39,6 +39,23 @@ typedef struct _SENDCREATEMESSAGE_CALLBACK_ARGUMENTS
CREATESTRUCT CreateStruct;
} 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
User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength);
NTSTATUS STDCALL

View file

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

View file

@ -2,6 +2,11 @@
#ifndef __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
STDCALL
W32kCombineRgn(HRGN hDest,

View file

@ -1,7 +1,7 @@
#!/bin/sh
/sbin/modprobe loop
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
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
* PROJECT: ReactOS user32.dll
@ -21,49 +21,47 @@ CloseDesktop(
return NtUserCloseDesktop(hDesktop);
}
HDESK
STDCALL
CreateDesktopA(
LPCSTR lpszDesktop,
LPCSTR lpszDevice,
LPDEVMODEA pDevmode,
DWORD dwFlags,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
HDESK STDCALL
CreateDesktopA(LPCSTR lpszDesktop,
LPCSTR lpszDevice,
LPDEVMODEA pDevmode,
DWORD dwFlags,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
{
ANSI_STRING DesktopNameA;
UNICODE_STRING DesktopNameU;
HDESK hDesktop;
if (lpszDesktop != NULL) {
RtlInitAnsiString(&DesktopNameA, (LPSTR)lpszDesktop);
RtlAnsiStringToUnicodeString(&DesktopNameU, &DesktopNameA, TRUE);
} else {
RtlInitUnicodeString(&DesktopNameU, NULL);
}
hDesktop = CreateDesktopW(
DesktopNameU.Buffer,
NULL,
pDevmode,
dwFlags,
dwDesiredAccess,
lpsa);
RtlFreeUnicodeString(&DesktopNameU);
return hDesktop;
if (lpszDesktop != NULL)
{
RtlInitAnsiString(&DesktopNameA, (LPSTR)lpszDesktop);
RtlAnsiStringToUnicodeString(&DesktopNameU, &DesktopNameA, TRUE);
}
else
{
RtlInitUnicodeString(&DesktopNameU, NULL);
}
/* FIXME: Need to convert the DEVMODE parameter. */
hDesktop = CreateDesktopW(DesktopNameU.Buffer,
NULL,
pDevmode,
dwFlags,
dwDesiredAccess,
lpsa);
RtlFreeUnicodeString(&DesktopNameU);
return(hDesktop);
}
HDESK
STDCALL
CreateDesktopW(
LPCWSTR lpszDesktop,
LPCWSTR lpszDevice,
LPDEVMODEW pDevmode,
DWORD dwFlags,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
HDESK STDCALL
CreateDesktopW(LPCWSTR lpszDesktop,
LPCWSTR lpszDevice,
LPDEVMODEW pDevmode,
DWORD dwFlags,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
{
UNICODE_STRING DesktopName;
HWINSTA hWinSta;
@ -73,14 +71,13 @@ CreateDesktopW(
RtlInitUnicodeString(&DesktopName, lpszDesktop);
hDesktop = NtUserCreateDesktop(
&DesktopName,
dwFlags,
dwDesiredAccess,
lpsa,
hWinSta);
hDesktop = NtUserCreateDesktop(&DesktopName,
dwFlags,
dwDesiredAccess,
lpsa,
hWinSta);
return hDesktop;
return(hDesktop);
}
WINBOOL

View file

@ -32,7 +32,7 @@ User32ConvertString(PCSTR String)
{
ANSI_STRING InString;
UNICODE_STRING OutString;
RtlInitAnsiString(&InString, String);
RtlInitAnsiString(&InString, String);
RtlAnsiStringToUnicodeString(&OutString, &InString, TRUE);
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
* PROJECT: ReactOS user32.dll
@ -11,6 +11,11 @@
*/
#include <windows.h>
WINBOOL STDCALL
ScreenToClient(HWND hWnd, LPPOINT lpPoint)
{
}
WINBOOL
STDCALL
AnyPopup(VOID)

View file

@ -528,7 +528,7 @@ RemovePropW@8
ReplyMessage@4
;ResolveDesktopForWOW
ReuseDDElParam@20
;ScreenToClient
ScreenToClient
;ScrollChildren
ScrollDC@28
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
* PROJECT: ReactOS user32.dll
@ -78,8 +78,8 @@ User32CallSendAsyncProcForKernel(PVOID Arguments, ULONG ArgumentLength)
{
return(STATUS_INFO_LENGTH_MISMATCH);
}
CallbackArgs->Proc(CallbackArgs->Wnd, CallbackArgs->Msg,
CallbackArgs->Data, CallbackArgs->Result);
CallbackArgs->Callback(CallbackArgs->Wnd, CallbackArgs->Msg,
CallbackArgs->Context, CallbackArgs->Result);
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
#
@ -328,7 +328,7 @@ OBJECTS_KD = \
kd/kdebug.o \
kd/service.o \
kd/dlog.o \
kd/gdbstub.o
kd/gdbstub.o kd/mda.o
DEP_OBJECTS := $(OBJECTS_NT) $(OBJECTS_MM) $(OBJECTS_ARCH) \
$(OBJECTS_IO) $(OBJECTS_KE) $(OBJECTS_OB) \
@ -340,6 +340,7 @@ DEP_OBJECTS := $(OBJECTS_NT) $(OBJECTS_MM) $(OBJECTS_ARCH) \
#
# Include automatic dependancy tracking
#
DEP_EXCLUDE_FILTER := ex/napi.% nt/zw.%
include $(PATH_TO_TOP)/tools/depend.mk

View file

@ -25,11 +25,11 @@ typedef struct _DESKTOP_OBJECT
{
CSHORT Type;
CSHORT Size;
LIST_ENTRY ListEntry;
KSPIN_LOCK Lock;
UNICODE_STRING Name;
struct _WINSTATION_OBJECT *WindowStation;
LIST_ENTRY WindowListHead;
} 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
*/
@ -15,6 +15,7 @@
#define KD_DEBUG_SERIAL 0x08
#define KD_DEBUG_BOCHS 0x10
#define KD_DEBUG_FILELOG 0x20
#define KD_DEBUG_MDA 0x40
extern ULONG KdDebugState;
@ -61,7 +62,9 @@ KdDebugPrint (LPSTR Message);
KD_CONTINUE_TYPE
KdEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord,
PCONTEXT Context,
PKTRAP_FRAME TrapFrame);
PCONTEXT Context,
PKTRAP_FRAME TrapFrame);
VOID KdInitializeMda(VOID);
VOID KdPrintMda(PCH pch);
#endif /* __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H */

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: 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
* PURPOSE: Process manager definitions
@ -460,14 +460,15 @@ struct _EPROCESS
/*
* Added by David Welch (welch@mcmail.com)
*/
MADDRESS_SPACE AddressSpace;
HANDLE_TABLE HandleTable;
LIST_ENTRY ProcessListEntry;
HANDLE Win32Desktop;
MADDRESS_SPACE AddressSpace;
HANDLE_TABLE HandleTable;
LIST_ENTRY ProcessListEntry;
/*
* Added by Philip Susi for list of threads in process
*/
LIST_ENTRY ThreadListHead;
LIST_ENTRY ThreadListHead;
};
#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
* PROJECT: ReactOS kernel
@ -140,6 +140,12 @@ KdInitSystem(ULONG Reserved,
KdDebuggerEnabled = TRUE;
KdDebugState |= KD_DEBUG_FILELOG;
}
else if (!_strnicmp(p2, "MDA", 3))
{
p2 += 3;
KdDebuggerEnabled = TRUE;
KdDebugState |= KD_DEBUG_MDA;
}
}
}
else if (!_strnicmp(p2, "DEBUG", 5))
@ -229,6 +235,8 @@ KdInitSystem(ULONG Reserved,
if (KdDebugState & KD_DEBUG_FILELOG)
PrintString("\n File log debugging enabled\n\n");
if (KdDebugState & KD_DEBUG_MDA)
PrintString("\n MDA debugging enabled\n\n");
}
/* Perform any initialization nescessary */
@ -242,6 +250,9 @@ KdInitSystem(ULONG Reserved,
if (KdDebugState & KD_DEBUG_FILELOG)
DebugLogInit();
if (KdDebugState & KD_DEBUG_MDA)
KdInitializeMda();
}
}
@ -320,6 +331,9 @@ KdpPrintString(PANSI_STRING String)
if (KdDebugState & KD_DEBUG_FILELOG)
DebugLogWrite(pch);
if (KdDebugState & KD_DEBUG_MDA)
KdPrintMda(pch);
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
* 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
* PURPOSE: 2E trap handler
@ -89,8 +89,9 @@ L3:
pushl $0 /* XXX: TempCS */
pushl $0 /* XXX: DebugPointer */
pushl $0 /* XXX: DebugArgMark */
pushl $0 /* XXX: DebugEIP */
pushl $0 /* XXX: DebugEBP */
movl 0x60(%esp), %ebx
pushl %ebx /* DebugEIP */
pushl %ebp /* DebugEBP */
/* Load the segment registers */
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
* PROJECT: ReactOS kernel
@ -259,6 +259,7 @@ PsInitProcessManagment(VOID)
PsInitialSystemProcess->UniqueProcessId =
InterlockedIncrement(&PiNextProcessUniqueId);
PsInitialSystemProcess->Win32WindowStation = (HANDLE)0;
PsInitialSystemProcess->Win32Desktop = (HANDLE)0;
KeAcquireSpinLock(&PsProcessListLock, &oldIrql);
InsertHeadList(&PsProcessListHead,
@ -546,7 +547,27 @@ NtCreateProcess(OUT PHANDLE ProcessHandle,
{
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);
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
* PROJECT: ReactOS kernel
@ -974,14 +974,14 @@ SepCreateSystemProcessToken(struct _EPROCESS* Process)
SepTokenObjectType,
(PVOID*)&AccessToken);
Status = ZwAllocateLocallyUniqueId(&AccessToken->TokenId);
Status = NtAllocateLocallyUniqueId(&AccessToken->TokenId);
if (!NT_SUCCESS(Status))
{
ObDereferenceObject(AccessToken);
return(Status);
}
Status = ZwAllocateLocallyUniqueId(&AccessToken->ModifiedId);
Status = NtAllocateLocallyUniqueId(&AccessToken->ModifiedId);
if (!NT_SUCCESS(Status))
{
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);
LRESULT STDCALL
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 */

View file

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

View file

@ -4,9 +4,20 @@
#include <windows.h>
#include <ddk/ntddk.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
{
/* Internal position. */
PINTERNALPOS InternalPos;
/* Pointer to the window class. */
PWNDCLASS_OBJECT Class;
/* Extended style. */
@ -22,7 +33,6 @@ typedef struct _WINDOW_OBJECT
INT Height;
/* Parent window handle. */
HWND ParentHandle;
struct _WINDOW_OBJECT* Parent;
/* Window menu handle. */
HMENU Menu;
/* Handle of the module that created the window. */
@ -31,6 +41,8 @@ typedef struct _WINDOW_OBJECT
LPVOID Parameters;
/* Entry in the thread's list of windows. */
LIST_ENTRY ListEntry;
/* Entry in the global list of windows. */
LIST_ENTRY DesktopListEntry;
/* Pointer to the extra data associated with the window. */
PULONG ExtraData;
/* Size of the extra data associated with the window. */
@ -43,16 +55,42 @@ typedef struct _WINDOW_OBJECT
HANDLE Self;
/* Window flags. */
ULONG Flags;
/* FIXME: Don't know. */
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 flags. */
#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
InitWindowImpl(VOID);
NTSTATUS
CleanupWindowImpl(VOID);
VOID
W32kGetClientRect(PWINDOW_OBJECT WindowObject, PRECT Rect);
PWINDOW_OBJECT
W32kGetWindowObject(HWND hWnd);
VOID
W32kReleaseWindowObject(PWINDOW_OBJECT Window);
#endif /* __WIN32K_WINDOW_H */

View file

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

View file

@ -20,18 +20,16 @@ NTSTATUS
CleanupWindowStationImpl(VOID);
NTSTATUS
ValidateWindowStationHandle(
HWINSTA WindowStation,
KPROCESSOR_MODE AccessMode,
ACCESS_MASK DesiredAccess,
PWINSTATION_OBJECT *Object);
ValidateWindowStationHandle(HWINSTA WindowStation,
KPROCESSOR_MODE AccessMode,
ACCESS_MASK DesiredAccess,
PWINSTATION_OBJECT *Object);
NTSTATUS
ValidateDesktopHandle(
HDESK Desktop,
KPROCESSOR_MODE AccessMode,
ACCESS_MASK DesiredAccess,
PDESKTOP_OBJECT *Object);
ValidateDesktopHandle(HDESK Desktop,
KPROCESSOR_MODE AccessMode,
ACCESS_MASK DesiredAccess,
PDESKTOP_OBJECT *Object);
#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
*/
@ -17,11 +17,9 @@
#include <include/class.h>
#include <include/window.h>
/*
* NOTE: the table is actually in the file ./svctab.c,
* generated by iface/addsys/mktab.c + w32ksvc.db
*/
#include "svctab.c"
extern SSDT Win32kSSDT[];
extern SSPT Win32kSSPT[];
extern ULONG Win32kNumberOfSysCalls;
/*
* This definition doesn't work
@ -40,7 +38,8 @@ DllMain (
* Register user mode call interface
* (system service table index = 1)
*/
Result = KeAddSystemServiceTable (Win32kSSDT, NULL, NUMBER_OF_SYSCALLS, Win32kSSPT, 1);
Result = KeAddSystemServiceTable (Win32kSSDT, NULL,
Win32kNumberOfSysCalls, Win32kSSPT, 1);
if (Result == FALSE)
{
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 = ../..
@ -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/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
MAIN_OBJECTS = main/dllmain.o main/svctabm.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/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/color.o objects/coord.o objects/dc.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/region.o objects/text.o objects/wingl.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
FREETYPE_OBJECTS = freetype/ctype.o freetype/grfont.o \
freetype/src/base/ftsystem.o freetype/src/base/ftdebug.o \
@ -56,7 +57,7 @@ TARGET_OBJECTS = \
$(NTUSER_OBJECTS) $(OBJECTS_OBJECTS) $(STUBS_OBJECTS) \
$(MATH_OBJECTS) $(FLOAT_OBJECTS) $(FREETYPE_OBJECTS) $(DIB_OBJECTS)
TARGET_CLEAN = \
TARGET_CLEAN = $(TARGET_OBJECTS:.o=.d) \
dib/*.o \
eng/*.o \
freetype/*.o \
@ -71,7 +72,12 @@ include $(PATH_TO_TOP)/rules.mak
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:

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
* PROJECT: ReactOS kernel
@ -32,12 +32,66 @@ W32kCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
ULONG_PTR CompletionCallbackContext,
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
W32kSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, RECT Rect1,
RECT Rect2, RECT Rect3, PWINDOWPOS Pos)
W32kSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, PRECT Rect,
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
@ -114,7 +168,7 @@ W32kCallWindowProc(WNDPROC Proc,
&Arguments,
sizeof(WINDOWPROC_CALLBACK_ARGUMENTS),
&ResultPointer,
&ResultLength);
&ResultLength);
if (!NT_SUCCESS(Status))
{
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
* PROJECT: ReactOS kernel
@ -17,6 +17,7 @@
#include <include/error.h>
#include <include/winsta.h>
#include <include/object.h>
#include <include/guicheck.h>
//#define NDEBUG
#include <debug.h>
@ -251,6 +252,11 @@ NtUserRegisterClassExWOW(LPWNDCLASSEX lpwcx,
return(Atom);
}
DWORD STDCALL
NtUserGetClassLong(HWND hWnd, DWORD Offset)
{
}
DWORD STDCALL
NtUserSetClassLong(DWORD Unknown0,
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
* PROJECT: ReactOS kernel
@ -22,6 +22,7 @@
#include <include/msgqueue.h>
#include <include/object.h>
#include <napi/win32.h>
#include <include/winsta.h>
#define NDEBUG
#include <debug.h>
@ -33,19 +34,46 @@ W32kGuiCheck(VOID)
{
if (PsGetWin32Process() == NULL)
{
NTSTATUS Status;
PsCreateWin32Process(PsGetCurrentProcess());
InitializeListHead(&PsGetWin32Process()->ClassListHead);
ExInitializeFastMutex(&PsGetWin32Process()->ClassListLock);
InitializeListHead(&PsGetWin32Process()->WindowListHead);
ExInitializeFastMutex(&PsGetWin32Process()->WindowListLock);
PsGetWin32Process()->HandleTable = ObmCreateHandleTable();
ExInitializeFastMutex(&PsGetWin32Process()->ClassListLock);
Status =
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)
{
NTSTATUS Status;
PsCreateWin32Thread(PsGetCurrentThread());
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
* PROJECT: ReactOS kernel
@ -21,8 +21,9 @@
#include <include/object.h>
#include <include/winsta.h>
#include <include/callback.h>
#include <include/painting.h>
#define NDEBUG
//#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
@ -44,6 +45,9 @@ LRESULT STDCALL
NtUserDispatchMessage(LPMSG lpMsg)
{
LRESULT Result;
ULONG PaintingFlag;
PWINDOW_OBJECT WindowObject;
NTSTATUS Status;
/* Process timer messages. */
if (lpMsg->message == WM_TIMER)
@ -62,20 +66,38 @@ NtUserDispatchMessage(LPMSG lpMsg)
}
}
/*
* FIXME: Check for valid window handle, valid window and valid window
* proc.
*/
/* Get the window object. */
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
lpMsg->hwnd,
otWindow,
(PVOID*)&WindowObject);
if (!NT_SUCCESS(Status))
{
return(0);
}
/* 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 */,
lpMsg->hwnd,
lpMsg->message,
lpMsg->wParam,
lpMsg->lParam);
/* FIXME: Check for paint message. */
if (PaintingFlag && WindowObject->Flags & WINDOWOBJECT_NEED_BEGINPAINT &&
WindowObject->UpdateRegion)
{
DbgBreakPoint();
}
return(Result);
}
@ -108,7 +130,8 @@ NtUserGetMessage(LPMSG lpMsg,
do
{
/* FIXME: Dispatch sent messages here. */
/* Dispatch sent messages here. */
while (MsqDispatchOneSentMessage(ThreadQueue));
/* Now look for a quit message. */
/* FIXME: WINE checks the message number filter here. */
@ -152,9 +175,17 @@ NtUserGetMessage(LPMSG lpMsg,
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. */
Status = MsqWaitForNewMessages(ThreadQueue);
@ -293,12 +324,71 @@ NtUserQuerySendMessage(DWORD Unknown0)
return 0;
}
BOOL STDCALL
LRESULT STDCALL
NtUserSendMessage(HWND hWnd,
UINT Msg,
WPARAM Wparam,
WPARAM wParam,
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
@ -309,9 +399,7 @@ NtUserSendMessageCallback(HWND hWnd,
SENDASYNCPROC lpCallBack,
ULONG_PTR dwData)
{
UNIMPLEMENTED;
return 0;
return(0);
}
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
* PROJECT: ReactOS kernel
@ -14,6 +14,7 @@
#include <ddk/ntddk.h>
#include <win32k/win32k.h>
#include <include/msgqueue.h>
#include <include/callback.h>
#define NDEBUG
#include <debug.h>
@ -24,6 +25,28 @@ static PUSER_MESSAGE_QUEUE CurrentFocusMessageQueue;
/* 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
MsqInitializeImpl(VOID)
{
@ -104,7 +127,7 @@ MsqPeekSentMessages(PUSER_MESSAGE_QUEUE MessageQueue)
return(!IsListEmpty(&MessageQueue->SentMessagesListHead));
}
VOID
BOOLEAN
MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue)
{
PUSER_SENT_MESSAGE Message;
@ -113,12 +136,16 @@ MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue)
PUSER_SENT_MESSAGE_NOTIFY NotifyMessage;
ExAcquireFastMutex(&MessageQueue->Lock);
if (IsListEmpty(&MessageQueue->SentMessagesListHead))
{
return(FALSE);
}
Entry = RemoveHeadList(&MessageQueue->SentMessagesListHead);
Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry);
ExReleaseFastMutex(&MessageQueue->Lock);
/* Call the window procedure. */
Result = W32kCallWindowProc(W32kGetWindowProc(Message->Msg.hwnd),
Result = W32kCallWindowProc(NULL,
Message->Msg.hwnd,
Message->Msg.message,
Message->Msg.wParam,
@ -148,10 +175,11 @@ MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue)
NotifyMessage->Result = Result;
NotifyMessage->hWnd = Message->Msg.hwnd;
NotifyMessage->Msg = Message->Msg.message;
MsqSendNotifyMessage(Message->CompletionQueue);
MsqSendNotifyMessage(Message->CompletionQueue, NotifyMessage);
}
ExFreePool(Message);
return(TRUE);
}
VOID

View file

@ -36,17 +36,6 @@ NtUserAttachThreadInput(
return 0;
}
DWORD
STDCALL
NtUserBeginPaint(
DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
NtUserBitBltSysBmp(
@ -578,17 +567,6 @@ NtUserEndMenu(VOID)
return 0;
}
DWORD
STDCALL
NtUserEndPaint(
DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
NtUserEnumDisplayDevices(
@ -857,18 +835,6 @@ NtUserGetDC(
return 0;
}
DWORD
STDCALL
NtUserGetDCEx(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
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
* PROJECT: ReactOS kernel
@ -27,14 +27,33 @@
/* FUNCTIONS *****************************************************************/
BOOL
W32kOffsetRect(LPRECT Rect, INT x, INT y)
PWINDOW_OBJECT
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
@ -128,6 +147,8 @@ NtUserCreateWindowEx(DWORD dwExStyle,
}
/* Check the window station. */
DPRINT("IoGetCurrentProcess() %X\n", IoGetCurrentProcess());
DPRINT("PROCESS_WINDOW_STATION %X\n", PROCESS_WINDOW_STATION());
Status = ValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
KernelMode,
0,
@ -143,8 +164,8 @@ NtUserCreateWindowEx(DWORD dwExStyle,
/* Create the window object. */
WindowObject = (PWINDOW_OBJECT)
ObmCreateObject(PsGetWin32Process()->HandleTable, &Handle, otWindow,
sizeof(WINDOW_OBJECT));
ObmCreateObject(PsGetWin32Process()->WindowStation->HandleTable, &Handle,
otWindow, sizeof(WINDOW_OBJECT));
DPRINT("Created object with handle %X\n", Handle);
if (!WindowObject)
{
@ -171,6 +192,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
WindowObject->Instance = hInstance;
WindowObject->Parameters = lpParam;
WindowObject->Self = Handle;
WindowObject->MessageQueue = PsGetWin32Thread()->MessageQueue;
/* FIXME: Add the window parent. */
@ -202,10 +224,12 @@ NtUserCreateWindowEx(DWORD dwExStyle,
}
/* Insert the window into the process's window list. */
ExAcquireFastMutexUnsafe (&PsGetWin32Process()->WindowListLock);
InsertTailList (&PsGetWin32Process()->WindowListHead,
ExAcquireFastMutexUnsafe (&PsGetWin32Thread()->WindowListLock);
InsertTailList (&PsGetWin32Thread()->WindowListHead,
&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. */
@ -296,7 +320,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
lParam =
MAKE_LONG(WindowObject->ClientRect.left,
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);
}
@ -318,6 +342,8 @@ NtUserCreateWindowEx(DWORD dwExStyle,
NewPos.right, NewPos.bottom, SwFlag);
}
/* FIXME: Need to set up parent window. */
#if 0
/* Notify the parent window of a new child. */
if ((WindowObject->Style & WS_CHILD) ||
(!(WindowObject->ExStyle & WS_EX_NOPARENTNOTIFY)))
@ -328,6 +354,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
MAKEWPARAM(WM_CREATE, WindowObject->IDMenu),
(LPARAM)WindowObject->Self);
}
#endif
if (dwStyle & WS_VISIBLE)
{
@ -389,6 +416,7 @@ NtUserFindWindowEx(HWND hwndParent,
PUNICODE_STRING ucWindowName,
DWORD Unknown4)
{
#if 0
NTSTATUS status;
HWND windowHandle;
PWINDOW_OBJECT windowObject;
@ -429,6 +457,7 @@ NtUserFindWindowEx(HWND hwndParent,
ObmDereferenceObject (classObject);
return (HWND)0;
#endif
}
DWORD STDCALL
@ -642,10 +671,11 @@ NtUserGetWindowLong(HWND hWnd, DWORD Index)
W32kGuiCheck();
Status = ObmReferenceObjectByHandle(PsGetWin32Process()->HandleTable,
hWnd,
otWindow,
(PVOID*)&WindowObject);
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
hWnd,
otWindow,
(PVOID*)&WindowObject);
if (!NT_SUCCESS(Status))
{
DPRINT("NtUserGetWindowLong(): Bad handle.\n");
@ -743,21 +773,9 @@ BOOL STDCALL
NtUserShowWindow(HWND hWnd,
LONG nCmdShow)
{
PWINDOW_OBJECT WindowObject;
NTSTATUS Status;
W32kGuiCheck();
Status = ObmReferenceObjectByHandle(PsGetWin32Process()->HandleTable,
hWnd,
otWindow,
(PVOID*)&WindowObject);
if (!NT_SUCCESS(Status))
{
return(FALSE);
}
return TRUE;
return(WinPosShowWindow(hWnd, nCmdShow));
}
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
* PROJECT: ReactOS kernel
@ -19,6 +19,10 @@
#include <include/error.h>
#include <include/winsta.h>
#include <windows.h>
#include <include/winpos.h>
#include <include/rect.h>
#include <include/callback.h>
#include <include/painting.h>
#define NDEBUG
#include <debug.h>
@ -27,34 +31,270 @@
#define MINMAX_NOSWP (0x00010000)
#define SWP_EX_PAINTSELF 0x0002
/* 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
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
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
WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
INT cy, UINT flags)
{
PWINDOW_OBJECT Window;
NTSTATUS Status;
WINDOWPOS WinPos;
RECT NewWindowRect;
RECT NewClientRect;
HRGN VisRgn = NULL;
ULONG WvrFlags = 0;
/* FIXME: Get current active window from active queue. */
/* FIXME: Check if the window is for a desktop. */
Status = ObmReferenceObjectByHandle(PsGetWin32Process()->HandleTable,
Wnd,
otWindow,
(PVOID*)&Window);
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
Wnd,
otWindow,
(PVOID*)&Window);
if (!NT_SUCCESS(Status))
{
return(FALSE);
@ -74,27 +314,140 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
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
WinPosGetNonClientSize(HWND Wnd, RECT* WindowRect, RECT* ClientRect)
{
LRESULT Result;
Result =
W32kSendNCCALCSIZEMessage(Wnd, FALSE, WindowRect, NULL,
NULL, NULL, ClientRect);
return(Result);
}
BOOLEAN
@ -107,10 +460,11 @@ WinPosShowWindow(HWND Wnd, INT Cmd)
RECT NewPos;
BOOLEAN ShowFlag;
Status = ObmReferenceObjectByHandle(PsGetWin32Process()->HandleTable,
Wnd,
otWindow,
(PVOID*)&Window);
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
Wnd,
otWindow,
(PVOID*)&Window);
if (!NT_SUCCESS(Status))
{
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
* PROJECT: ReactOS kernel
@ -172,15 +172,13 @@ NtUserCloseWindowStation(
* NtUserCloseWindowStation()
* Zero on failure
*/
HWINSTA
STDCALL
NtUserCreateWindowStation(
PUNICODE_STRING lpszWindowStationName,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpSecurity,
DWORD Unknown3,
DWORD Unknown4,
DWORD Unknown5)
HWINSTA STDCALL
NtUserCreateWindowStation(PUNICODE_STRING lpszWindowStationName,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpSecurity,
DWORD Unknown3,
DWORD Unknown4,
DWORD Unknown5)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING WindowStationName;
@ -197,54 +195,51 @@ NtUserCreateWindowStation(
DPRINT("Trying to open window station (%wZ)\n", &WindowStationName);
/* Initialize ObjectAttributes for the window station object */
InitializeObjectAttributes(
&ObjectAttributes,
&WindowStationName,
0,
NULL,
NULL);
Status = ObOpenObjectByName(
&ObjectAttributes,
ExWindowStationObjectType,
NULL,
UserMode,
dwDesiredAccess,
NULL,
&WinSta);
InitializeObjectAttributes(&ObjectAttributes,
&WindowStationName,
0,
NULL,
NULL);
Status = ObOpenObjectByName(&ObjectAttributes,
ExWindowStationObjectType,
NULL,
UserMode,
dwDesiredAccess,
NULL,
&WinSta);
if (NT_SUCCESS(Status))
{
DPRINT("Successfully opened window station (%wZ)\n", WindowStationName);
return (HWINSTA)WinSta;
}
{
DPRINT("Successfully opened window station (%wZ)\n", WindowStationName);
return((HWINSTA)WinSta);
}
DPRINT("Creating window station (%wZ)\n", &WindowStationName);
Status = ObCreateObject(
&WinSta,
STANDARD_RIGHTS_REQUIRED,
&ObjectAttributes,
ExWindowStationObjectType,
(PVOID*)&WinStaObject);
Status = ObCreateObject(&WinSta,
STANDARD_RIGHTS_REQUIRED,
&ObjectAttributes,
ExWindowStationObjectType,
(PVOID*)&WinStaObject);
if (!NT_SUCCESS(Status))
{
DPRINT("Failed creating window station (%wZ)\n", &WindowStationName);
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return (HWINSTA)0;
}
{
DPRINT("Failed creating window station (%wZ)\n", &WindowStationName);
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return (HWINSTA)0;
}
WinStaObject->HandleTable = ObmCreateHandleTable();
if (!WinStaObject->HandleTable)
{
DPRINT("Failed creating handle table\n");
ObDereferenceObject(WinStaObject);
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return (HWINSTA)0;
}
{
DPRINT("Failed creating handle table\n");
ObDereferenceObject(WinStaObject);
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return((HWINSTA)0);
}
DPRINT("Window station successfully created (%wZ)\n", &WindowStationName);
return (HWINSTA)WinSta;
return((HWINSTA)WinSta);
}
BOOL
@ -559,15 +554,12 @@ NtUserCreateDesktop(
return (HDESK)Desktop;
}
HDESK
STDCALL
NtUserGetThreadDesktop(
DWORD dwThreadId,
DWORD Unknown1)
HDESK STDCALL
NtUserGetThreadDesktop(DWORD dwThreadId,
DWORD Unknown1)
{
UNIMPLEMENTED
return (HDESK)0;
UNIMPLEMENTED;
return((HDESK)0);
}
/*
@ -731,14 +723,10 @@ NtUserResolveDesktopForWOW(
return 0;
}
BOOL
STDCALL
NtUserSetThreadDesktop(
HDESK hDesktop)
BOOL STDCALL
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 <ddk/ntddk.h>
#include <win32k/coord.h>
#include <win32k/dc.h>
// #define NDEBUG
//#define NDEBUG
#include <win32k/debug1.h>
/* FUNCTIONS *****************************************************************/
BOOL STDCALL W32kCombineTransform(LPXFORM XFormResult,
CONST LPXFORM xform1,
CONST LPXFORM xform2)
@ -35,11 +45,37 @@ BOOL STDCALL W32kCombineTransform(LPXFORM XFormResult,
return TRUE;
}
BOOL STDCALL W32kDPtoLP(HDC hDC,
LPPOINT Points,
int Count)
VOID STATIC
CoordDPtoLP(PDC Dc, LPPOINT Point)
{
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)
{
UNIMPLEMENTED;
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
@ -81,13 +117,35 @@ W32kGetWorldTransform(HDC hDC,
return TRUE;
}
BOOL
STDCALL
W32kLPtoDP(HDC hDC,
LPPOINT Points,
int Count)
VOID STATIC
CoordLPtoDP(PDC Dc, LPPOINT Point)
{
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

View file

@ -1,180 +1,190 @@
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ddk/ntddk.h>
#include <win32k/region.h>
#include <win32k/gdiobj.h>
// #define NDEBUG
//#define NDEBUG
#include <win32k/debug1.h>
INT
STDCALL
/* FUNCTIONS *****************************************************************/
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,
HRGN hSrc1,
HRGN hSrc2,
INT CombineMode)
HRGN hSrc1,
HRGN hSrc2,
INT CombineMode)
{
UNIMPLEMENTED;
}
HRGN
STDCALL
HRGN STDCALL
W32kCreateEllipticRgn(INT LeftRect,
INT TopRect,
INT RightRect,
INT BottomRect)
INT TopRect,
INT RightRect,
INT BottomRect)
{
UNIMPLEMENTED;
}
HRGN
STDCALL
W32kCreateEllipticRgnIndirect(CONST PRECT rc)
HRGN STDCALL
W32kCreateEllipticRgnIndirect(CONST PRECT rc)
{
UNIMPLEMENTED;
}
HRGN
STDCALL
HRGN STDCALL
W32kCreatePolygonRgn(CONST PPOINT pt,
INT Count,
INT PolyFillMode)
INT Count,
INT PolyFillMode)
{
UNIMPLEMENTED;
}
HRGN
STDCALL
HRGN STDCALL
W32kCreatePolyPolygonRgn(CONST PPOINT pt,
CONST PINT PolyCounts,
INT Count,
INT PolyFillMode)
CONST PINT PolyCounts,
INT Count,
INT PolyFillMode)
{
UNIMPLEMENTED;
}
HRGN
STDCALL
HRGN STDCALL
W32kCreateRectRgn(INT LeftRect,
INT TopRect,
INT RightRect,
INT BottomRect)
INT TopRect,
INT RightRect,
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
STDCALL
W32kCreateRectRgnIndirect(CONST PRECT rc)
HRGN STDCALL
W32kCreateRectRgnIndirect(CONST PRECT rc)
{
UNIMPLEMENTED;
return(W32kCreateRectRgn(rc->left, rc->top, rc->right, rc->bottom));
}
HRGN
STDCALL
HRGN STDCALL
W32kCreateRoundRectRgn(INT LeftRect,
INT TopRect,
INT RightRect,
INT BottomRect,
INT WidthEllipse,
INT HeightEllipse)
INT TopRect,
INT RightRect,
INT BottomRect,
INT WidthEllipse,
INT HeightEllipse)
{
UNIMPLEMENTED;
}
BOOL
STDCALL
BOOL STDCALL
W32kEqualRgn(HRGN hSrcRgn1,
HRGN hSrcRgn2)
HRGN hSrcRgn2)
{
UNIMPLEMENTED;
}
HRGN
STDCALL
HRGN STDCALL
W32kExtCreateRegion(CONST PXFORM Xform,
DWORD Count,
CONST PRGNDATA RgnData)
DWORD Count,
CONST PRGNDATA RgnData)
{
UNIMPLEMENTED;
}
BOOL
STDCALL
BOOL STDCALL
W32kFillRgn(HDC hDC,
HRGN hRgn,
HBRUSH hBrush)
HRGN hRgn,
HBRUSH hBrush)
{
UNIMPLEMENTED;
}
BOOL
STDCALL
BOOL STDCALL
W32kFrameRgn(HDC hDC,
HRGN hRgn,
HBRUSH hBrush,
INT Width,
INT Height)
HRGN hRgn,
HBRUSH hBrush,
INT Width,
INT Height)
{
UNIMPLEMENTED;
}
INT
STDCALL
INT STDCALL
W32kGetRgnBox(HRGN hRgn,
LPRECT hRect)
LPRECT hRect)
{
UNIMPLEMENTED;
}
BOOL
STDCALL
BOOL STDCALL
W32kInvertRgn(HDC hDC,
HRGN hRgn)
HRGN hRgn)
{
UNIMPLEMENTED;
}
INT
STDCALL
INT STDCALL
W32kOffsetRgn(HRGN hRgn,
INT XOffset,
INT YOffset)
INT XOffset,
INT YOffset)
{
UNIMPLEMENTED;
}
BOOL
STDCALL
BOOL STDCALL
W32kPaintRgn(HDC hDC,
HRGN hRgn)
HRGN hRgn)
{
UNIMPLEMENTED;
}
BOOL
STDCALL
BOOL STDCALL
W32kPtInRegion(HRGN hRgn,
INT X,
INT Y)
INT X,
INT Y)
{
UNIMPLEMENTED;
}
BOOL
STDCALL
BOOL STDCALL
W32kRectInRegion(HRGN hRgn,
CONST LPRECT rc)
CONST LPRECT rc)
{
UNIMPLEMENTED;
}
BOOL
STDCALL
BOOL STDCALL
W32kSetRectRgn(HRGN hRgn,
INT LeftRect,
INT TopRect,
INT RightRect,
INT BottomRect)
INT LeftRect,
INT TopRect,
INT RightRect,
INT BottomRect)
{
UNIMPLEMENTED;
}

View file

@ -2,7 +2,7 @@
# Define $DEP_OBJECTS before this file is included
# $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))))