From cc95f734212da745ab5af72a2ea7c40fcadb577d Mon Sep 17 00:00:00 2001 From: David Welch Date: Thu, 29 Jun 2000 23:35:53 +0000 Subject: [PATCH] Made header file usage more consistent Tried to reduce dependancies between layers by moving ntoskrnl's private header files inside its directory Removed the need to include windows.h for ddk code Removed obsolete testing code svn path=/trunk/; revision=1213 --- reactos/apps/tests/apc/apc.c | 3 +- reactos/apps/tests/args/args.c | 2 +- reactos/apps/tests/lpc/lpcclt.c | 3 +- reactos/apps/tests/lpc/lpcsrv.c | 3 +- reactos/apps/tests/shm/shmclt.c | 1 + reactos/apps/tests/shm/shmsrv.c | 3 +- reactos/apps/utils/buildno/Makefile | 6 +- reactos/apps/utils/buildno/buildno.c | 4 +- reactos/drivers/dd/blue/blue.c | 10 +- reactos/drivers/dd/ide/ide.c | 7 +- reactos/drivers/dd/ide/makefile | 4 +- reactos/drivers/dd/keyboard/keyboard.c | 9 +- reactos/drivers/dd/keyboard/makefile | 4 +- reactos/drivers/dd/parallel/makefile | 4 +- reactos/drivers/dd/parallel/parallel.c | 6 +- reactos/drivers/dd/serial/makefile | 4 +- reactos/drivers/dd/serial/serial.c | 8 +- reactos/drivers/fs/minix/block.c | 2 +- reactos/drivers/fs/minix/blockdev.c | 3 +- reactos/drivers/fs/minix/cache.c | 2 +- reactos/drivers/fs/minix/dir.c | 2 +- reactos/drivers/fs/minix/inode.c | 5 +- reactos/drivers/fs/minix/minix.c | 3 +- reactos/drivers/fs/minix/mount.c | 2 +- reactos/drivers/fs/minix/rw.c | 3 +- reactos/drivers/fs/vfat/blockdev.c | 2 +- reactos/drivers/fs/vfat/create.c | 6 +- reactos/drivers/fs/vfat/dir.c | 3 +- reactos/drivers/fs/vfat/dirwr.c | 6 +- reactos/drivers/fs/vfat/fat.c | 5 +- reactos/drivers/fs/vfat/finfo.c | 7 +- reactos/drivers/fs/vfat/iface.c | 5 +- reactos/drivers/fs/vfat/makefile | 4 +- reactos/drivers/fs/vfat/rw.c | 6 +- reactos/drivers/fs/vfat/string.c | 5 +- reactos/drivers/fs/vfat/volume.c | 5 +- reactos/include/base.h | 93 +--- reactos/include/csrss/csrss.h | 1 + reactos/include/ddk/defines.h | 4 +- .../{internal/hal/ddk.h => ddk/halddk.h} | 11 +- .../{internal/hal/irq.h => ddk/i386/irql.h} | 0 reactos/include/ddk/i386/pagesize.h | 6 + .../{internal/hal/hal.h => ddk/i386/tss.h} | 34 +- reactos/include/ddk/iotypes.h | 5 +- reactos/include/ddk/mmfuncs.h | 4 +- reactos/include/ddk/mmtypes.h | 4 +- reactos/include/ddk/ntddblue.h | 1 + reactos/include/ddk/ntddk.h | 12 +- reactos/include/ddk/pstypes.h | 7 +- reactos/include/ddk/rtl.h | 5 +- reactos/include/ddk/sefuncs.h | 12 +- reactos/include/{internal => ddk}/service.h | 0 reactos/include/ddk/setypes.h | 4 +- reactos/include/ddk/structs.h | 1 - reactos/include/ddk/types.h | 93 +--- reactos/include/ddk/zw.h | 11 +- reactos/include/ddk/zwtypes.h | 2 +- reactos/include/debug.h | 98 ++++ reactos/include/defines.h | 362 +------------- reactos/include/internal/asm.inc | 25 - reactos/include/internal/i386/hal.h | 91 ---- reactos/include/internal/i386/segment.inc | 6 - reactos/include/internal/linkage.h | 5 - reactos/include/internal/pool.h | 22 - .../include/{internal => napi}/i386/segment.h | 0 reactos/include/napi/lpc.h | 2 +- reactos/include/{internal => napi}/teb.h | 2 + reactos/include/napi/types.h | 102 ++++ reactos/include/ntdll/ntdll.h | 2 + reactos/include/ntdll/rtl.h | 27 +- reactos/include/ntos.h | 6 +- reactos/include/ntos/atom.h | 17 + reactos/include/ntos/console.h | 41 ++ reactos/include/ntos/disk.h | 56 +++ reactos/include/ntos/file.h | 108 ++++ reactos/include/ntos/heap.h | 24 + reactos/include/ntos/keyboard.h | 213 ++++++++ reactos/include/ntos/minmax.h | 7 + reactos/include/ntos/mm.h | 62 +++ reactos/include/ntos/ntdef.h | 25 + reactos/include/ntos/ps.h | 63 +++ reactos/include/{ => ntos}/security.h | 47 ++ reactos/include/ntos/synch.h | 24 + reactos/include/ntos/time.h | 38 ++ reactos/include/ntos/types.h | 303 +++++++++++ reactos/include/structs.h | 373 +------------- reactos/include/win32k/debug1.h | 98 ++++ reactos/include/windows.h | 2 +- reactos/lib/kernel32/file/delete.c | 4 +- reactos/lib/kernel32/file/dir.c | 4 +- reactos/lib/kernel32/file/move.c | 3 +- reactos/lib/kernel32/file/volume.c | 3 +- reactos/lib/kernel32/mem/section.c | 3 +- reactos/lib/kernel32/misc/time.c | 1 - reactos/lib/kernel32/process/cmdline.c | 4 +- reactos/lib/kernel32/process/create.c | 6 +- reactos/lib/kernel32/process/lib.c | 6 +- reactos/lib/kernel32/process/proc.c | 6 +- reactos/lib/kernel32/thread/thread.c | 4 +- reactos/lib/ntdll/csr/api.c | 11 +- reactos/lib/ntdll/ldr/utils.c | 4 +- reactos/lib/ntdll/main/dllmain.c | 4 +- reactos/lib/ntdll/rtl/acl.c | 4 +- reactos/lib/ntdll/rtl/apc.c | 4 +- reactos/lib/ntdll/rtl/callback.c | 5 +- reactos/lib/ntdll/rtl/critical.c | 4 +- reactos/lib/ntdll/rtl/env.c | 4 +- reactos/lib/ntdll/rtl/error.c | 3 +- reactos/lib/ntdll/rtl/heap.c | 22 +- reactos/lib/ntdll/rtl/luid.c | 4 +- reactos/lib/ntdll/rtl/mem.c | 6 +- reactos/lib/ntdll/rtl/ppb.c | 4 +- reactos/lib/ntdll/rtl/process.c | 8 +- reactos/lib/ntdll/rtl/sd.c | 12 +- reactos/lib/ntdll/rtl/thread.c | 4 +- reactos/lib/ntdll/rtl/time.c | 4 +- reactos/lib/ntdll/rtl/unicode.c | 7 +- reactos/ntoskrnl/cm/registry.c | 4 +- reactos/ntoskrnl/ex/napi.c | 2 +- reactos/ntoskrnl/hal/x86/bios32.c | 1 + reactos/ntoskrnl/hal/x86/irq.c | 37 +- reactos/ntoskrnl/hal/x86/pci.c | 1 + .../{ => ntoskrnl}/include/internal/bitops.h | 0 reactos/{ => ntoskrnl}/include/internal/cc.h | 2 +- .../{ => ntoskrnl}/include/internal/ctype.h | 0 reactos/{ => ntoskrnl}/include/internal/dbg.h | 0 .../{ => ntoskrnl}/include/internal/debug.h | 0 reactos/{ => ntoskrnl}/include/internal/dma.h | 2 +- reactos/{ => ntoskrnl}/include/internal/ex.h | 10 +- reactos/{ => ntoskrnl}/include/internal/hal.h | 0 .../{ => ntoskrnl}/include/internal/hal/io.h | 0 reactos/ntoskrnl/include/internal/hal/irq.h | 7 + .../include/internal/hal/page.h | 0 .../include/internal/hal/segment.h | 0 .../{ => ntoskrnl}/include/internal/halio.h | 0 reactos/ntoskrnl/include/internal/i386/hal.h | 48 ++ .../{ => ntoskrnl}/include/internal/i386/io.h | 0 .../include/internal/i386/mmhal.h | 0 .../ntoskrnl/include/internal/i386/segment.h | 353 +++++++++++++ .../include/internal/i386/string.h | 0 reactos/{ => ntoskrnl}/include/internal/id.h | 0 reactos/{ => ntoskrnl}/include/internal/ifs.h | 2 +- reactos/{ => ntoskrnl}/include/internal/io.h | 2 +- reactos/{ => ntoskrnl}/include/internal/kd.h | 2 +- reactos/{ => ntoskrnl}/include/internal/ke.h | 2 - reactos/{ => ntoskrnl}/include/internal/ldr.h | 0 reactos/{ => ntoskrnl}/include/internal/mm.h | 12 +- .../{ => ntoskrnl}/include/internal/mmhal.h | 0 .../{ => ntoskrnl}/include/internal/module.h | 0 reactos/{ => ntoskrnl}/include/internal/nt.h | 0 .../include/internal/ntoskrnl.h | 3 - reactos/{ => ntoskrnl}/include/internal/ob.h | 0 reactos/ntoskrnl/include/internal/pool.h | 13 + .../{ => ntoskrnl}/include/internal/port.h | 0 reactos/{ => ntoskrnl}/include/internal/ps.h | 6 +- .../{ => ntoskrnl}/include/internal/psmgr.h | 0 .../{ => ntoskrnl}/include/internal/stddef.h | 0 .../{ => ntoskrnl}/include/internal/string.h | 0 .../{ => ntoskrnl}/include/internal/types.h | 0 .../{ => ntoskrnl}/include/internal/wait.h | 0 reactos/ntoskrnl/io/device.c | 3 +- reactos/ntoskrnl/io/iomgr.c | 3 +- reactos/ntoskrnl/io/symlink.c | 3 +- reactos/ntoskrnl/ke/dpc.c | 30 +- reactos/ntoskrnl/ke/event.c | 1 + reactos/ntoskrnl/ke/i386/exp.c | 12 +- reactos/ntoskrnl/ke/i386/usercall.c | 4 +- reactos/ntoskrnl/ke/main.c | 4 +- reactos/ntoskrnl/ke/mutex.c | 3 +- reactos/ntoskrnl/ke/sem.c | 31 +- reactos/ntoskrnl/ke/timer.c | 3 +- reactos/ntoskrnl/ke/wait.c | 1 + reactos/ntoskrnl/ldr/init.c | 4 +- reactos/ntoskrnl/ldr/loader.c | 11 +- reactos/ntoskrnl/ldr/rtl.c | 78 ++- reactos/ntoskrnl/ldr/sysdll.c | 3 - reactos/ntoskrnl/ldr/userldr.c | 4 +- reactos/ntoskrnl/lpc/port.c | 4 +- reactos/ntoskrnl/lpc/send.c | 71 +-- reactos/ntoskrnl/makefile_rex | 7 +- reactos/ntoskrnl/mm/section.c | 11 +- reactos/ntoskrnl/nt/ntevent.c | 2 + reactos/ntoskrnl/nt/ntsem.c | 2 + reactos/ntoskrnl/ob/namespc.c | 1 + reactos/ntoskrnl/ps/create.c | 3 +- reactos/ntoskrnl/ps/process.c | 5 +- reactos/ntoskrnl/rtl/unicode.c | 3 +- reactos/ntoskrnl/se/token.c | 3 +- reactos/ntoskrnl/tst/test.c | 470 ------------------ reactos/rules.mak | 4 +- reactos/subsys/csrss/api.h | 4 +- reactos/subsys/smss/init.c | 4 +- reactos/subsys/win32k/eng/bitblt.c | 1 + reactos/subsys/win32k/eng/device.c | 2 +- reactos/subsys/win32k/main/dllmain.c | 4 +- reactos/subsys/win32k/makefile | 4 +- reactos/subsys/win32k/misc/driver.c | 6 +- reactos/subsys/win32k/objects/bitmaps.c | 2 +- reactos/subsys/win32k/objects/brush.c | 4 +- reactos/subsys/win32k/objects/cliprgn.c | 2 +- reactos/subsys/win32k/objects/color.c | 2 +- reactos/subsys/win32k/objects/coord.c | 2 +- reactos/subsys/win32k/objects/dc.c | 4 +- reactos/subsys/win32k/objects/fillshap.c | 2 +- reactos/subsys/win32k/objects/icm.c | 2 +- reactos/subsys/win32k/objects/line.c | 2 +- reactos/subsys/win32k/objects/metafile.c | 2 +- reactos/subsys/win32k/objects/paint.c | 2 +- reactos/subsys/win32k/objects/path.c | 2 +- reactos/subsys/win32k/objects/pen.c | 2 +- reactos/subsys/win32k/objects/print.c | 2 +- reactos/subsys/win32k/objects/region.c | 2 +- reactos/subsys/win32k/objects/text.c | 2 +- reactos/subsys/win32k/objects/wingl.c | 2 +- 214 files changed, 2260 insertions(+), 1972 deletions(-) rename reactos/include/{internal/hal/ddk.h => ddk/halddk.h} (97%) rename reactos/include/{internal/hal/irq.h => ddk/i386/irql.h} (100%) create mode 100644 reactos/include/ddk/i386/pagesize.h rename reactos/include/{internal/hal/hal.h => ddk/i386/tss.h} (66%) rename reactos/include/{internal => ddk}/service.h (100%) create mode 100644 reactos/include/debug.h delete mode 100644 reactos/include/internal/asm.inc delete mode 100644 reactos/include/internal/i386/hal.h delete mode 100644 reactos/include/internal/i386/segment.inc delete mode 100644 reactos/include/internal/linkage.h delete mode 100644 reactos/include/internal/pool.h rename reactos/include/{internal => napi}/i386/segment.h (100%) rename reactos/include/{internal => napi}/teb.h (99%) create mode 100644 reactos/include/napi/types.h create mode 100644 reactos/include/ntos/atom.h create mode 100644 reactos/include/ntos/console.h create mode 100644 reactos/include/ntos/disk.h create mode 100644 reactos/include/ntos/file.h create mode 100644 reactos/include/ntos/heap.h create mode 100644 reactos/include/ntos/keyboard.h create mode 100644 reactos/include/ntos/minmax.h create mode 100644 reactos/include/ntos/mm.h create mode 100644 reactos/include/ntos/ntdef.h create mode 100644 reactos/include/ntos/ps.h rename reactos/include/{ => ntos}/security.h (76%) create mode 100644 reactos/include/ntos/synch.h create mode 100644 reactos/include/ntos/time.h create mode 100644 reactos/include/ntos/types.h create mode 100644 reactos/include/win32k/debug1.h rename reactos/{ => ntoskrnl}/include/internal/bitops.h (100%) rename reactos/{ => ntoskrnl}/include/internal/cc.h (74%) rename reactos/{ => ntoskrnl}/include/internal/ctype.h (100%) rename reactos/{ => ntoskrnl}/include/internal/dbg.h (100%) rename reactos/{ => ntoskrnl}/include/internal/debug.h (100%) rename reactos/{ => ntoskrnl}/include/internal/dma.h (99%) rename reactos/{ => ntoskrnl}/include/internal/ex.h (74%) rename reactos/{ => ntoskrnl}/include/internal/hal.h (100%) rename reactos/{ => ntoskrnl}/include/internal/hal/io.h (100%) create mode 100644 reactos/ntoskrnl/include/internal/hal/irq.h rename reactos/{ => ntoskrnl}/include/internal/hal/page.h (100%) rename reactos/{ => ntoskrnl}/include/internal/hal/segment.h (100%) rename reactos/{ => ntoskrnl}/include/internal/halio.h (100%) create mode 100644 reactos/ntoskrnl/include/internal/i386/hal.h rename reactos/{ => ntoskrnl}/include/internal/i386/io.h (100%) rename reactos/{ => ntoskrnl}/include/internal/i386/mmhal.h (100%) create mode 100644 reactos/ntoskrnl/include/internal/i386/segment.h rename reactos/{ => ntoskrnl}/include/internal/i386/string.h (100%) rename reactos/{ => ntoskrnl}/include/internal/id.h (100%) rename reactos/{ => ntoskrnl}/include/internal/ifs.h (71%) rename reactos/{ => ntoskrnl}/include/internal/io.h (97%) rename reactos/{ => ntoskrnl}/include/internal/kd.h (81%) rename reactos/{ => ntoskrnl}/include/internal/ke.h (96%) rename reactos/{ => ntoskrnl}/include/internal/ldr.h (100%) rename reactos/{ => ntoskrnl}/include/internal/mm.h (95%) rename reactos/{ => ntoskrnl}/include/internal/mmhal.h (100%) rename reactos/{ => ntoskrnl}/include/internal/module.h (100%) rename reactos/{ => ntoskrnl}/include/internal/nt.h (100%) rename reactos/{ => ntoskrnl}/include/internal/ntoskrnl.h (97%) rename reactos/{ => ntoskrnl}/include/internal/ob.h (100%) create mode 100644 reactos/ntoskrnl/include/internal/pool.h rename reactos/{ => ntoskrnl}/include/internal/port.h (100%) rename reactos/{ => ntoskrnl}/include/internal/ps.h (96%) rename reactos/{ => ntoskrnl}/include/internal/psmgr.h (100%) rename reactos/{ => ntoskrnl}/include/internal/stddef.h (100%) rename reactos/{ => ntoskrnl}/include/internal/string.h (100%) rename reactos/{ => ntoskrnl}/include/internal/types.h (100%) rename reactos/{ => ntoskrnl}/include/internal/wait.h (100%) delete mode 100644 reactos/ntoskrnl/tst/test.c diff --git a/reactos/apps/tests/apc/apc.c b/reactos/apps/tests/apc/apc.c index c30ced1aaf9..b9297ac9978 100644 --- a/reactos/apps/tests/apc/apc.c +++ b/reactos/apps/tests/apc/apc.c @@ -1,7 +1,8 @@ -#include #include #include #include +#include +#include HANDLE OutputHandle; HANDLE InputHandle; diff --git a/reactos/apps/tests/args/args.c b/reactos/apps/tests/args/args.c index dcd4be15dd8..91b0d0eb406 100644 --- a/reactos/apps/tests/args/args.c +++ b/reactos/apps/tests/args/args.c @@ -1,7 +1,7 @@ -#include #include #include #include +#include HANDLE OutputHandle; HANDLE InputHandle; diff --git a/reactos/apps/tests/lpc/lpcclt.c b/reactos/apps/tests/lpc/lpcclt.c index 834de34c57a..4958efb3924 100644 --- a/reactos/apps/tests/lpc/lpcclt.c +++ b/reactos/apps/tests/lpc/lpcclt.c @@ -1,9 +1,10 @@ -/* $Id: lpcclt.c,v 1.6 2000/04/03 21:54:33 dwelch Exp $ +/* $Id: lpcclt.c,v 1.7 2000/06/29 23:35:09 dwelch Exp $ * * DESCRIPTION: Simple LPC Client * PROGRAMMER: David Welch */ #include +#include #include #include #include diff --git a/reactos/apps/tests/lpc/lpcsrv.c b/reactos/apps/tests/lpc/lpcsrv.c index ea9818863ae..2bac4c6e07a 100644 --- a/reactos/apps/tests/lpc/lpcsrv.c +++ b/reactos/apps/tests/lpc/lpcsrv.c @@ -1,9 +1,10 @@ -/* $Id: lpcsrv.c,v 1.6 2000/04/03 21:54:33 dwelch Exp $ +/* $Id: lpcsrv.c,v 1.7 2000/06/29 23:35:10 dwelch Exp $ * * DESCRIPTION: Simple LPC Server * PROGRAMMER: David Welch */ #include +#include #include #include #include diff --git a/reactos/apps/tests/shm/shmclt.c b/reactos/apps/tests/shm/shmclt.c index 39a614f114e..4b1f5da3997 100644 --- a/reactos/apps/tests/shm/shmclt.c +++ b/reactos/apps/tests/shm/shmclt.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/reactos/apps/tests/shm/shmsrv.c b/reactos/apps/tests/shm/shmsrv.c index 04dbfe7f83d..4877e96c77b 100644 --- a/reactos/apps/tests/shm/shmsrv.c +++ b/reactos/apps/tests/shm/shmsrv.c @@ -1,9 +1,10 @@ -/* $Id: shmsrv.c,v 1.4 2000/05/13 13:50:54 dwelch Exp $ +/* $Id: shmsrv.c,v 1.5 2000/06/29 23:35:10 dwelch Exp $ * * FILE : reactos/apps/shm/shmsrv.c * AUTHOR: David Welch */ #include +#include #include #include #include diff --git a/reactos/apps/utils/buildno/Makefile b/reactos/apps/utils/buildno/Makefile index 794739f2b39..7b85ce5e51b 100644 --- a/reactos/apps/utils/buildno/Makefile +++ b/reactos/apps/utils/buildno/Makefile @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.5 2000/01/29 20:32:12 phreak Exp $ +# $Id: Makefile,v 1.6 2000/06/29 23:35:09 dwelch Exp $ # -BASE_CFLAGS = -I../../include +BASE_CFLAGS = TARGETNAME=buildno CLEAN_FILES= $(TARGETNAME).o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).sym @@ -10,7 +10,7 @@ all: $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME)$(EXE_POSTFIX): $(TARGETNAME).c ../../include/reactos/version.h - $(NATIVE_CC) -I../../include -o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).c + $(NATIVE_CC) -o $(TARGETNAME)$(EXE_POSTFIX) $(TARGETNAME).c diff --git a/reactos/apps/utils/buildno/buildno.c b/reactos/apps/utils/buildno/buildno.c index 5eaa481dc0c..11ad3b3b715 100644 --- a/reactos/apps/utils/buildno/buildno.c +++ b/reactos/apps/utils/buildno/buildno.c @@ -1,4 +1,4 @@ -/* $Id: buildno.c,v 1.3 2000/01/22 14:25:48 ea Exp $ +/* $Id: buildno.c,v 1.4 2000/06/29 23:35:09 dwelch Exp $ * * buildno - Generate the build number for ReactOS * @@ -33,7 +33,7 @@ #include #include #include -#include +#include "../../include/reactos/version.h" #define FALSE 0 #define TRUE 1 diff --git a/reactos/drivers/dd/blue/blue.c b/reactos/drivers/dd/blue/blue.c index 25f99f64b3f..d6495096b76 100644 --- a/reactos/drivers/dd/blue/blue.c +++ b/reactos/drivers/dd/blue/blue.c @@ -1,4 +1,4 @@ -/* $Id: blue.c,v 1.23 2000/05/26 05:43:33 phreak Exp $ +/* $Id: blue.c,v 1.24 2000/06/29 23:35:47 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -17,7 +17,7 @@ #include #define NDEBUG -#include +#include /* DEFINITIONS ***************************************************************/ @@ -434,7 +434,7 @@ ScrIoControl (PDEVICE_OBJECT DeviceObject, PIRP Irp) case IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE: { POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer; - LPWORD pAttr = (LPWORD)MmGetSystemAddressForMdl(Irp->MdlAddress); + PWORD pAttr = (PWORD)MmGetSystemAddressForMdl(Irp->MdlAddress); char *vidmem; int offset; DWORD dwCount; @@ -458,7 +458,7 @@ ScrIoControl (PDEVICE_OBJECT DeviceObject, PIRP Irp) case IOCTL_CONSOLE_WRITE_OUTPUT_ATTRIBUTE: { POUTPUT_ATTRIBUTE Buf = (POUTPUT_ATTRIBUTE)Irp->AssociatedIrp.SystemBuffer; - LPWORD pAttr = (LPWORD)MmGetSystemAddressForMdl(Irp->MdlAddress); + PWORD pAttr = (PWORD)MmGetSystemAddressForMdl(Irp->MdlAddress); char *vidmem; int offset; DWORD dwCount; @@ -480,7 +480,7 @@ ScrIoControl (PDEVICE_OBJECT DeviceObject, PIRP Irp) break; case IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE: - DeviceExtension->CharAttribute = (WORD)*(LPWORD)Irp->AssociatedIrp.SystemBuffer; + DeviceExtension->CharAttribute = (WORD)*(PWORD)Irp->AssociatedIrp.SystemBuffer; Irp->IoStatus.Information = 0; Status = STATUS_SUCCESS; break; diff --git a/reactos/drivers/dd/ide/ide.c b/reactos/drivers/dd/ide/ide.c index 654ace4b634..f1a7b6fef4e 100644 --- a/reactos/drivers/dd/ide/ide.c +++ b/reactos/drivers/dd/ide/ide.c @@ -1,4 +1,4 @@ -/* $Id: ide.c,v 1.28 2000/06/19 22:15:50 ekohl Exp $ +/* $Id: ide.c,v 1.29 2000/06/29 23:35:48 dwelch Exp $ * * IDE.C - IDE Disk driver * written by Rex Jolliff @@ -72,12 +72,11 @@ typedef DISK_GEOMETRY *PDISK_GEOMETRY; // ------------------------------------------------------------------------- -#include +#include "../../../ntoskrnl/include/internal/i386/io.h" #include -#include #define NDEBUG -#include +#include #include "ide.h" #include "idep.h" diff --git a/reactos/drivers/dd/ide/makefile b/reactos/drivers/dd/ide/makefile index f2156e6d31a..c7eaa073c7d 100644 --- a/reactos/drivers/dd/ide/makefile +++ b/reactos/drivers/dd/ide/makefile @@ -1,11 +1,11 @@ -# $Id: makefile,v 1.10 1999/12/18 10:17:41 ea Exp $ +# $Id: makefile,v 1.11 2000/06/29 23:35:48 dwelch Exp $ # # TARGET=ide OBJECTS = $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a -BASE_CFLAGS = -I../../../include +BASE_CFLAGS = -I. -I../../../include all: $(TARGET).sys diff --git a/reactos/drivers/dd/keyboard/keyboard.c b/reactos/drivers/dd/keyboard/keyboard.c index fedddc97dcd..490b7443eab 100644 --- a/reactos/drivers/dd/keyboard/keyboard.c +++ b/reactos/drivers/dd/keyboard/keyboard.c @@ -10,14 +10,13 @@ /* INCLUDES ****************************************************************/ #include -#include -#include #include -#include -#include +#include +#include "../../../ntoskrnl/include/internal/i386/io.h" +#include #define NDEBUG -#include +#include #include "keyboard.h" diff --git a/reactos/drivers/dd/keyboard/makefile b/reactos/drivers/dd/keyboard/makefile index f0b75a0e8b3..17d504365aa 100644 --- a/reactos/drivers/dd/keyboard/makefile +++ b/reactos/drivers/dd/keyboard/makefile @@ -1,11 +1,11 @@ -# $Id: makefile,v 1.8 1999/12/18 10:17:42 ea Exp $ +# $Id: makefile,v 1.9 2000/06/29 23:35:48 dwelch Exp $ # # TARGET=keyboard OBJECTS = $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a -BASE_CFLAGS = -I../../../include +BASE_CFLAGS = -I. -I../../../include all: $(TARGET).sys diff --git a/reactos/drivers/dd/parallel/makefile b/reactos/drivers/dd/parallel/makefile index 5be68ff8f2d..130389aae8b 100644 --- a/reactos/drivers/dd/parallel/makefile +++ b/reactos/drivers/dd/parallel/makefile @@ -1,10 +1,10 @@ -# $Id: makefile,v 1.7 1999/12/04 20:58:40 ea Exp $ +# $Id: makefile,v 1.8 2000/06/29 23:35:49 dwelch Exp $ # # TARGET=parallel OBJECTS= $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a -BASE_CFLAGS = -I../../../include +BASE_CFLAGS = -I. -I../../../include all: $(TARGET).sys diff --git a/reactos/drivers/dd/parallel/parallel.c b/reactos/drivers/dd/parallel/parallel.c index 6a38031a9fc..14889f328c0 100644 --- a/reactos/drivers/dd/parallel/parallel.c +++ b/reactos/drivers/dd/parallel/parallel.c @@ -1,4 +1,4 @@ -/* $Id: parallel.c,v 1.4 1999/12/04 20:58:40 ea Exp $ +/* $Id: parallel.c,v 1.5 2000/06/29 23:35:49 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,12 +13,12 @@ /* FUNCTIONS **************************************************************/ #include -#include +#include "../../../ntoskrnl/include/internal/i386/io.h" #include "parallel.h" #define NDEBUG -#include +#include #define LP_B (0x378) diff --git a/reactos/drivers/dd/serial/makefile b/reactos/drivers/dd/serial/makefile index a284cc98a2c..ae0761379fa 100644 --- a/reactos/drivers/dd/serial/makefile +++ b/reactos/drivers/dd/serial/makefile @@ -1,10 +1,10 @@ -# $Id: makefile,v 1.7 1999/12/04 20:58:40 ea Exp $ +# $Id: makefile,v 1.8 2000/06/29 23:35:49 dwelch Exp $ # # TARGET= serial OBJECTS= $(TARGET).o $(TARGET).coff ../../../ntoskrnl/ntoskrnl.a -BASE_CFLAGS = -I../../../include +BASE_CFLAGS = -I. -I../../../include all: $(TARGET).sys diff --git a/reactos/drivers/dd/serial/serial.c b/reactos/drivers/dd/serial/serial.c index c9c1f293ad8..3ff0088fb5d 100644 --- a/reactos/drivers/dd/serial/serial.c +++ b/reactos/drivers/dd/serial/serial.c @@ -1,4 +1,4 @@ -/* $Id: serial.c,v 1.7 1999/12/04 20:58:41 ea Exp $ +/* $Id: serial.c,v 1.8 2000/06/29 23:35:49 dwelch Exp $ * * Serial driver * Written by Jason Filby (jasonfilby@yahoo.com) @@ -7,11 +7,11 @@ */ #include -#include -#include +//#include +#include "../../../ntoskrnl/include/internal/i386/io.h" #define NDEBUG -#include +#include #define COM1 0x3F8 diff --git a/reactos/drivers/fs/minix/block.c b/reactos/drivers/fs/minix/block.c index b47af0dfddb..07b9dfb4c54 100644 --- a/reactos/drivers/fs/minix/block.c +++ b/reactos/drivers/fs/minix/block.c @@ -12,7 +12,7 @@ #include //#define NDEBUG -#include +#include #include "minix.h" diff --git a/reactos/drivers/fs/minix/blockdev.c b/reactos/drivers/fs/minix/blockdev.c index fe60b86b3f2..c0610ee2b16 100644 --- a/reactos/drivers/fs/minix/blockdev.c +++ b/reactos/drivers/fs/minix/blockdev.c @@ -11,10 +11,9 @@ #include #include -#include #define NDEBUG -#include +#include #include "minix.h" diff --git a/reactos/drivers/fs/minix/cache.c b/reactos/drivers/fs/minix/cache.c index 2580b0b6ab6..cb825bd9c56 100644 --- a/reactos/drivers/fs/minix/cache.c +++ b/reactos/drivers/fs/minix/cache.c @@ -13,7 +13,7 @@ #include //#define NDEBUG -#include +#include #include "minix.h" diff --git a/reactos/drivers/fs/minix/dir.c b/reactos/drivers/fs/minix/dir.c index 8be6436a552..289a32b4994 100644 --- a/reactos/drivers/fs/minix/dir.c +++ b/reactos/drivers/fs/minix/dir.c @@ -13,7 +13,7 @@ #include //#define NDEBUG -#include +#include #include "minix.h" diff --git a/reactos/drivers/fs/minix/inode.c b/reactos/drivers/fs/minix/inode.c index 88472e7d899..37fce616160 100644 --- a/reactos/drivers/fs/minix/inode.c +++ b/reactos/drivers/fs/minix/inode.c @@ -11,12 +11,11 @@ #include #include -#include -#include +#include "../../../ntoskrnl/include/internal/bitops.h" #include #define NDEBUG -#include +#include #include "minix.h" diff --git a/reactos/drivers/fs/minix/minix.c b/reactos/drivers/fs/minix/minix.c index 62f247966d1..e9beb324d0f 100644 --- a/reactos/drivers/fs/minix/minix.c +++ b/reactos/drivers/fs/minix/minix.c @@ -10,11 +10,10 @@ /* INCLUDES *****************************************************************/ #include -#include #include //#define NDEBUG -#include +#include #include "minix_fs.h" diff --git a/reactos/drivers/fs/minix/mount.c b/reactos/drivers/fs/minix/mount.c index faae6facfe7..fa7f4951790 100644 --- a/reactos/drivers/fs/minix/mount.c +++ b/reactos/drivers/fs/minix/mount.c @@ -13,7 +13,7 @@ #include //#define NDEBUG -#include +#include #include "minix.h" diff --git a/reactos/drivers/fs/minix/rw.c b/reactos/drivers/fs/minix/rw.c index dae256ea0f8..48065689346 100644 --- a/reactos/drivers/fs/minix/rw.c +++ b/reactos/drivers/fs/minix/rw.c @@ -11,9 +11,10 @@ #include #include +#include #define NDEBUG -#include +#include #include "minix.h" diff --git a/reactos/drivers/fs/vfat/blockdev.c b/reactos/drivers/fs/vfat/blockdev.c index 3e2038d8a2c..aaa7aba4af2 100644 --- a/reactos/drivers/fs/vfat/blockdev.c +++ b/reactos/drivers/fs/vfat/blockdev.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/drivers/fs/vfat/create.c b/reactos/drivers/fs/vfat/create.c index 5b65300b009..4acf8707416 100644 --- a/reactos/drivers/fs/vfat/create.c +++ b/reactos/drivers/fs/vfat/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.4 2000/06/17 22:00:46 phreak Exp $ +/* $Id: create.c,v 1.5 2000/06/29 23:35:50 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,10 +13,10 @@ #include #include #include -#include +#include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/drivers/fs/vfat/dir.c b/reactos/drivers/fs/vfat/dir.c index 2e87eba8e6d..9d26b05a8d5 100644 --- a/reactos/drivers/fs/vfat/dir.c +++ b/reactos/drivers/fs/vfat/dir.c @@ -10,10 +10,9 @@ #include #include -#include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/drivers/fs/vfat/dirwr.c b/reactos/drivers/fs/vfat/dirwr.c index 5e49ffd3728..c6a4f3ae575 100644 --- a/reactos/drivers/fs/vfat/dirwr.c +++ b/reactos/drivers/fs/vfat/dirwr.c @@ -1,4 +1,4 @@ -/* $Id: dirwr.c,v 1.12 2000/06/17 22:02:09 phreak Exp $ +/* $Id: dirwr.c,v 1.13 2000/06/29 23:35:50 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,10 +12,10 @@ #include #include #include -#include +#include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/drivers/fs/vfat/fat.c b/reactos/drivers/fs/vfat/fat.c index 23bb3490706..1418f4c8778 100644 --- a/reactos/drivers/fs/vfat/fat.c +++ b/reactos/drivers/fs/vfat/fat.c @@ -1,5 +1,5 @@ /* - * $Id: fat.c,v 1.5 2000/06/17 22:03:23 phreak Exp $ + * $Id: fat.c,v 1.6 2000/06/29 23:35:50 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,11 +13,10 @@ #include #include -#include #include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/drivers/fs/vfat/finfo.c b/reactos/drivers/fs/vfat/finfo.c index e8226d4b38d..f7a2ce551c8 100644 --- a/reactos/drivers/fs/vfat/finfo.c +++ b/reactos/drivers/fs/vfat/finfo.c @@ -1,4 +1,4 @@ -/* $Id: finfo.c,v 1.2 2000/02/22 02:02:08 ekohl Exp $ +/* $Id: finfo.c,v 1.3 2000/06/29 23:35:50 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,11 +12,10 @@ #include #include -#include #include #define NDEBUG -#include +#include #include "vfat.h" @@ -117,7 +116,7 @@ NTSTATUS FsdSetDispositionInformation(PFILE_OBJECT FileObject, { DPRINT("FsdSetDispositionInformation()\n"); - FileObject->DeletePending = DispositionInfo->DeleteFile; + FileObject->DeletePending = DispositionInfo->DoDeleteFile; return(STATUS_SUCCESS); } diff --git a/reactos/drivers/fs/vfat/iface.c b/reactos/drivers/fs/vfat/iface.c index 0a929f1cc5c..013d8fd935c 100644 --- a/reactos/drivers/fs/vfat/iface.c +++ b/reactos/drivers/fs/vfat/iface.c @@ -1,4 +1,4 @@ -/* $Id: iface.c,v 1.41 2000/02/21 22:42:15 ekohl Exp $ +/* $Id: iface.c,v 1.42 2000/06/29 23:35:50 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -24,10 +24,9 @@ #include #include -#include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/drivers/fs/vfat/makefile b/reactos/drivers/fs/vfat/makefile index 6ab9bc4fa60..801172191d0 100644 --- a/reactos/drivers/fs/vfat/makefile +++ b/reactos/drivers/fs/vfat/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.15 2000/06/04 17:15:47 ekohl Exp $ +# $Id: makefile,v 1.16 2000/06/29 23:35:51 dwelch Exp $ # # TARGET=vfatfs @@ -6,7 +6,7 @@ TARGET=vfatfs OBJECTS = blockdev.o dir.o dirwr.o iface.o string.o fat.o rw.o finfo.o volume.o create.o $(TARGET).coff LIBS = ../../../ntoskrnl/ntoskrnl.a -BASE_CFLAGS = -I../../../include +BASE_CFLAGS = -I. -I../../../include all: $(TARGET).sys diff --git a/reactos/drivers/fs/vfat/rw.c b/reactos/drivers/fs/vfat/rw.c index c9418eb6654..6b1eb3a4b0c 100644 --- a/reactos/drivers/fs/vfat/rw.c +++ b/reactos/drivers/fs/vfat/rw.c @@ -1,4 +1,4 @@ -/* $Id: rw.c,v 1.6 2000/06/17 22:04:08 phreak Exp $ +/* $Id: rw.c,v 1.7 2000/06/29 23:35:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,11 +12,11 @@ #include #include -#include #include +#include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/drivers/fs/vfat/string.c b/reactos/drivers/fs/vfat/string.c index ce76d58724d..23853448d0e 100644 --- a/reactos/drivers/fs/vfat/string.c +++ b/reactos/drivers/fs/vfat/string.c @@ -1,4 +1,4 @@ -/* $Id: string.c,v 1.2 2000/02/22 02:02:08 ekohl Exp $ +/* $Id: string.c,v 1.3 2000/06/29 23:35:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,11 +12,10 @@ #include #include -#include #include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/drivers/fs/vfat/volume.c b/reactos/drivers/fs/vfat/volume.c index 73980e72c41..6e5c4ee3960 100644 --- a/reactos/drivers/fs/vfat/volume.c +++ b/reactos/drivers/fs/vfat/volume.c @@ -1,4 +1,4 @@ -/* $Id: volume.c,v 1.2 2000/02/22 02:02:08 ekohl Exp $ +/* $Id: volume.c,v 1.3 2000/06/29 23:35:51 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,11 +11,10 @@ #include #include -#include #include #define NDEBUG -#include +#include #include "vfat.h" diff --git a/reactos/include/base.h b/reactos/include/base.h index 0bced22aa69..b4ffb1d11bf 100644 --- a/reactos/include/base.h +++ b/reactos/include/base.h @@ -43,37 +43,7 @@ extern "C" { #endif #endif /* !NULL */ -/* - * Definitions needed for the ddk includes (we miss out win32 only stuff to - * cut down on the compile time) - */ -typedef unsigned char UCHAR; -typedef unsigned int UINT; -typedef unsigned long ULONG; -typedef unsigned short USHORT; -typedef unsigned short WCHAR; -typedef unsigned short WORD; -typedef int WINBOOL; -typedef unsigned char BOOLEAN; -typedef unsigned int DWORD; /* was unsigned long */ -typedef unsigned short *LPWSTR; -typedef unsigned short *PWSTR; -typedef unsigned char *PUCHAR; -typedef unsigned int *PUINT; -typedef unsigned long *PULONG; -typedef unsigned short *PUSHORT; -typedef void *PVOID; -typedef unsigned char BYTE; -typedef void *LPVOID; -typedef DWORD *PDWORD; -typedef float *PFLOAT; -typedef unsigned short *PWCH; -typedef unsigned short *PWORD; - -typedef long long LONGLONG; -typedef unsigned long long ULONGLONG; -typedef long long *PLONGLONG; -typedef unsigned long long *PULONGLONG; +#include /* Check VOID before defining CHAR, SHORT, and LONG */ #ifndef VOID @@ -83,19 +53,7 @@ typedef short SHORT; typedef long LONG; #endif -typedef CHAR *PCHAR; -typedef CHAR *PCH; -typedef void *HANDLE; -typedef char CCHAR; - -#define FALSE 0 -#define TRUE 1 - -typedef const unsigned short *PCWSTR; - -typedef char* PCSZ; - #define CONST const #ifdef i386 @@ -113,13 +71,7 @@ typedef char* PCSZ; #define APIENTRY STDCALL #define WINGDIAPI -typedef BYTE *PBOOLEAN; -typedef HANDLE *PHANDLE; -typedef DWORD CALLBACK (*PTHREAD_START_ROUTINE) (LPVOID); -typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; - -typedef unsigned short ATOM; #ifdef UNICODE typedef unsigned short *LPTCH; @@ -129,36 +81,6 @@ typedef char *LPTCH; typedef char *LPTSTR; #endif /* UNICODE */ -typedef long *PLONG; -typedef unsigned short *PWCHAR; -typedef char *LPSTR; - -typedef enum _MEDIA_TYPE { - Unknown, - F5_1Pt2_512, - F3_1Pt44_512, - F3_2Pt88_512, - F3_20Pt8_512, - F3_720_512, - F5_360_512, - F5_320_512, - F5_320_1024, - F5_180_512, - F5_160_512, - RemovableMedia, - FixedMedia -} MEDIA_TYPE; - -#ifndef max -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef min -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif - - - #ifndef RC_INVOKED /* typedef ACMDRIVERENUMCB; @@ -232,17 +154,16 @@ typedef HANDLE HWINSTA; typedef HANDLE HWND; typedef int INT; typedef unsigned short LANGID; -typedef DWORD LCID; +//typedef DWORD LCID; typedef DWORD LCTYPE; /* typedef LOCALHANDLE */ typedef unsigned short *LP; typedef long LPARAM; +typedef int WINBOOL; typedef WINBOOL *LPBOOL; -typedef BYTE *LPBYTE; typedef CONST CHAR *LPCCH; typedef CHAR *LPCH; typedef COLORREF *LPCOLORREF; -typedef const char *LPCSTR; #ifdef UNICODE typedef const unsigned short *LPCTSTR; @@ -251,7 +172,6 @@ typedef const char *LPCTSTR; #endif /* UNICODE */ typedef const unsigned short *LPCWCH; -typedef const unsigned short *LPCWSTR; typedef DWORD *LPDWORD; /* typedef LPFRHOOKPROC; */ typedef HANDLE *LPHANDLE; @@ -260,13 +180,11 @@ typedef int *LPINT; typedef long *LPLONG; typedef long LRESULT; -typedef const void *LPCVOID; typedef unsigned short *LPWCH; typedef unsigned short *LPWORD; /* typedef NPSTR; */ typedef unsigned short *NWPSTR; typedef WINBOOL *PWINBOOL; -typedef BYTE *PBYTE; typedef const CHAR *PCCH; typedef const char *PCSTR; typedef const unsigned short *PCWCH; @@ -330,10 +248,6 @@ typedef unsigned int WPARAM; /* Enumerations */ -typedef enum _ACL_INFORMATION_CLASS { - AclRevisionInformation = 1, - AclSizeInformation -} ACL_INFORMATION_CLASS; #define RASCS_DONE 0x2000 @@ -559,7 +473,6 @@ typedef WINBOOL CALLBACK (*PFNPROCESSPOLICIES) (HWND, LPCTSTR, LPCTSTR, LPCTSTR, typedef void (*CALLB) (void); typedef CALLB PFNCALLBACK; -typedef WINBOOL SECURITY_CONTEXT_TRACKING_MODE; /* End of stuff from ddeml.h in old Cygnus headers */ /* ----------------------------------------------- */ diff --git a/reactos/include/csrss/csrss.h b/reactos/include/csrss/csrss.h index 0d6345f45c4..7b88e14d5ba 100644 --- a/reactos/include/csrss/csrss.h +++ b/reactos/include/csrss/csrss.h @@ -3,6 +3,7 @@ #include #include +#include #define CSR_PRIORITY_CLASS_NORMAL (0x10) #define CSR_PRIORITY_CLASS_IDLE (0x20) diff --git a/reactos/include/ddk/defines.h b/reactos/include/ddk/defines.h index 5b10ca521ff..7492d65acf6 100644 --- a/reactos/include/ddk/defines.h +++ b/reactos/include/ddk/defines.h @@ -5,8 +5,6 @@ #define _WIN32_WINNT 0x0400 -#include - #include #include @@ -234,6 +232,8 @@ enum #define MAXIMUM_VOLUME_LABEL_LENGTH (32) +#include + /* * IRQ levels */ diff --git a/reactos/include/internal/hal/ddk.h b/reactos/include/ddk/halddk.h similarity index 97% rename from reactos/include/internal/hal/ddk.h rename to reactos/include/ddk/halddk.h index 040127adb4b..e0425975aaa 100644 --- a/reactos/include/internal/hal/ddk.h +++ b/reactos/include/ddk/halddk.h @@ -1,4 +1,4 @@ -/* $Id: ddk.h,v 1.15 2000/06/12 14:52:05 ekohl Exp $ +/* $Id: halddk.h,v 1.1 2000/06/29 23:35:11 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,8 +13,6 @@ #ifndef __INCLUDE_INTERNAL_HAL_DDK_H #define __INCLUDE_INTERNAL_HAL_DDK_H -#include - /* HalReturnToFirmware */ #define FIRMWARE_HALT 1 #define FIRMWARE_REBOOT 3 @@ -246,13 +244,6 @@ HalInitializeProcessor ( ULONG ProcessorNumber ); -BOOLEAN -STDCALL -HalInitSystem ( - ULONG Phase, - boot_param *bp - ); - BOOLEAN STDCALL HalMakeBeep ( diff --git a/reactos/include/internal/hal/irq.h b/reactos/include/ddk/i386/irql.h similarity index 100% rename from reactos/include/internal/hal/irq.h rename to reactos/include/ddk/i386/irql.h diff --git a/reactos/include/ddk/i386/pagesize.h b/reactos/include/ddk/i386/pagesize.h new file mode 100644 index 00000000000..6979b12617c --- /dev/null +++ b/reactos/include/ddk/i386/pagesize.h @@ -0,0 +1,6 @@ +#ifndef __INCLUDE_DDK_I386_PAGESIZE_H +#define __INCLUDE_DDK_I386_PAGESIZE_H + +#define PAGESIZE (4096) + +#endif /* __INCLUDE_DDK_I386_PAGESIZE_H */ diff --git a/reactos/include/internal/hal/hal.h b/reactos/include/ddk/i386/tss.h similarity index 66% rename from reactos/include/internal/hal/hal.h rename to reactos/include/ddk/i386/tss.h index 2407febcb7f..c6cd5b0cb63 100644 --- a/reactos/include/internal/hal/hal.h +++ b/reactos/include/ddk/i386/tss.h @@ -2,9 +2,8 @@ * */ -#ifndef __INTERNAL_HAL_HAL_H -#define __INTERNAL_HAL_HAL_H - +#ifndef __INCLUDE_DDK_I386_TSS_H +#define __INCLUDE_DDK_I386_TSS_H typedef struct { @@ -46,33 +45,14 @@ typedef struct unsigned short reserved11; unsigned short trap; unsigned short iomap_base; - + unsigned short nr; + PVOID KernelStackBase; + PVOID SavedKernelEsp; + PVOID SavedKernelStackBase; unsigned char io_bitmap[1]; } hal_thread_state; -/* - * FUNCTION: Probes for a PCI bus - * RETURNS: True if found - */ -BOOL HalPciProbe(void); -/* - * FUNCTION: Probes for a BIOS32 extension - */ -VOID Hal_bios32_probe(VOID); - -/* - * FUNCTION: Determines if a a bios32 service is present - */ -BOOLEAN Hal_bios32_is_service_present(ULONG service); - - -/* - * FUNCTION: Initializes the text mode display (blue screen) - */ -VOID HalInitializeDisplay (boot_param *bp); -VOID HalResetDisplay (VOID) - -#endif /* __INTERNAL_HAL_HAL_H */ +#endif /* __INCLUDE_DDK_I386_TSS_H */ diff --git a/reactos/include/ddk/iotypes.h b/reactos/include/ddk/iotypes.h index 2b4db09f688..8b3f6dd8688 100644 --- a/reactos/include/ddk/iotypes.h +++ b/reactos/include/ddk/iotypes.h @@ -1,10 +1,13 @@ -/* $Id: iotypes.h,v 1.17 2000/05/13 13:50:55 dwelch Exp $ +/* $Id: iotypes.h,v 1.18 2000/06/29 23:35:11 dwelch Exp $ * */ #ifndef __INCLUDE_DDK_IOTYPES_H #define __INCLUDE_DDK_IOTYPES_H +#include +#include + #ifdef __NTOSKRNL__ extern POBJECT_TYPE EXPORTED IoAdapterObjectType; extern POBJECT_TYPE EXPORTED IoDeviceHandlerObjectType; diff --git a/reactos/include/ddk/mmfuncs.h b/reactos/include/ddk/mmfuncs.h index eb21cf2ed03..22ba8a774f5 100644 --- a/reactos/include/ddk/mmfuncs.h +++ b/reactos/include/ddk/mmfuncs.h @@ -1,9 +1,9 @@ #ifndef _INCLUDE_DDK_MMFUNCS_H #define _INCLUDE_DDK_MMFUNCS_H -/* $Id: mmfuncs.h,v 1.5 2000/04/02 13:32:38 ea Exp $ */ +/* $Id: mmfuncs.h,v 1.6 2000/06/29 23:35:12 dwelch Exp $ */ /* MEMORY MANAGMENT ******************************************************/ -#include +#include #define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGESIZE) ? ((((ULONG)x)&(~0xfff))+0x1000) : ((ULONG)x) ) #define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~0xfff)) diff --git a/reactos/include/ddk/mmtypes.h b/reactos/include/ddk/mmtypes.h index e3b244d1150..15efa60307f 100644 --- a/reactos/include/ddk/mmtypes.h +++ b/reactos/include/ddk/mmtypes.h @@ -1,8 +1,10 @@ -/* $Id: mmtypes.h,v 1.6 2000/05/09 16:12:47 ekohl Exp $ */ +/* $Id: mmtypes.h,v 1.7 2000/06/29 23:35:12 dwelch Exp $ */ #ifndef _INCLUDE_DDK_MMTYPES_H #define _INCLUDE_DDK_MMTYPES_H +#include + #ifdef __NTOSKRNL__ extern POBJECT_TYPE EXPORTED MmSectionObjectType; #else diff --git a/reactos/include/ddk/ntddblue.h b/reactos/include/ddk/ntddblue.h index 670e51abd1e..ed294276f71 100644 --- a/reactos/include/ddk/ntddblue.h +++ b/reactos/include/ddk/ntddblue.h @@ -1,6 +1,7 @@ #ifndef _NTDDBLUE_H_INCLUDED_ #define _NTDDBLUE_H_INCLUDED_ +#include #define IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO CTL_CODE(FILE_DEVICE_SCREEN, 0x801, METHOD_BUFFERED, FILE_READ_ACCESS) #define IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO CTL_CODE(FILE_DEVICE_SCREEN, 0x802, METHOD_BUFFERED, FILE_WRITE_ACCESS) diff --git a/reactos/include/ddk/ntddk.h b/reactos/include/ddk/ntddk.h index 1e0fcfadf31..336d320410c 100644 --- a/reactos/include/ddk/ntddk.h +++ b/reactos/include/ddk/ntddk.h @@ -1,4 +1,4 @@ -/* $Id: ntddk.h,v 1.13 2000/03/01 22:52:25 ea Exp $ +/* $Id: ntddk.h,v 1.14 2000/06/29 23:35:12 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -19,15 +19,14 @@ extern "C" /* INCLUDES ***************************************************************/ -#define WIN32_NO_STATUS -#include - /* GCC can not handle __fastcall */ #ifndef FASTCALL #define FASTCALL STDCALL #endif -#include +#include +#include + #include #include #include @@ -35,6 +34,7 @@ extern "C" // #include #include #include +#include #include #include #include @@ -44,7 +44,7 @@ extern "C" #include #include #include -#include +#include #include #include diff --git a/reactos/include/ddk/pstypes.h b/reactos/include/ddk/pstypes.h index 6e98ea69010..f0a5209146a 100644 --- a/reactos/include/ddk/pstypes.h +++ b/reactos/include/ddk/pstypes.h @@ -1,9 +1,10 @@ #ifndef __INCLUDE_DDK_PSTYPES_H #define __INCLUDE_DDK_PSTYPES_H -#include -#include -#include +#include + +#include +#include #ifndef TLS_MINIMUM_AVAILABLE #define TLS_MINIMUM_AVAILABLE (64) diff --git a/reactos/include/ddk/rtl.h b/reactos/include/ddk/rtl.h index 648a0540aeb..eb0c3064deb 100644 --- a/reactos/include/ddk/rtl.h +++ b/reactos/include/ddk/rtl.h @@ -1,4 +1,4 @@ -/* $Id: rtl.h,v 1.35 2000/06/18 15:20:10 ekohl Exp $ +/* $Id: rtl.h,v 1.36 2000/06/29 23:35:12 dwelch Exp $ * */ @@ -6,6 +6,9 @@ #define __DDK_RTL_H #include +#include + +#include typedef struct _CONTROLLER_OBJECT { diff --git a/reactos/include/ddk/sefuncs.h b/reactos/include/ddk/sefuncs.h index aed677852d1..5f3f536f828 100644 --- a/reactos/include/ddk/sefuncs.h +++ b/reactos/include/ddk/sefuncs.h @@ -1,6 +1,6 @@ #ifndef _INCLUDE_DDK_SEFUNCS_H #define _INCLUDE_DDK_SEFUNCS_H -/* $Id: sefuncs.h,v 1.11 2000/05/09 21:29:44 ekohl Exp $ */ +/* $Id: sefuncs.h,v 1.12 2000/06/29 23:35:12 dwelch Exp $ */ NTSTATUS STDCALL RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision); NTSTATUS STDCALL RtlQueryInformationAcl (PACL Acl, PVOID Information, ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass); NTSTATUS STDCALL RtlSetInformationAcl (PACL Acl, PVOID Information, ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass); @@ -30,15 +30,15 @@ NTSTATUS STDCALL RtlSetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDesc NTSTATUS STDCALL RtlGetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PBOOLEAN SaclPresent, PACL* Sacl, PBOOLEAN SaclDefauted); NTSTATUS STDCALL RtlSelfRelativeToAbsoluteSD (PSECURITY_DESCRIPTOR RelSD, PSECURITY_DESCRIPTOR AbsSD, - LPDWORD AbsSDSize, + PDWORD AbsSDSize, PACL Dacl, - LPDWORD DaclSize, + PDWORD DaclSize, PACL Sacl, - LPDWORD SaclSize, + PDWORD SaclSize, PSID Owner, - LPDWORD OwnerSize, + PDWORD OwnerSize, PSID Group, - LPDWORD GroupSize); + PDWORD GroupSize); NTSTATUS STDCALL RtlAllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, UCHAR SubAuthorityCount, diff --git a/reactos/include/internal/service.h b/reactos/include/ddk/service.h similarity index 100% rename from reactos/include/internal/service.h rename to reactos/include/ddk/service.h diff --git a/reactos/include/ddk/setypes.h b/reactos/include/ddk/setypes.h index 152a15fafc1..93a2dcb550d 100644 --- a/reactos/include/ddk/setypes.h +++ b/reactos/include/ddk/setypes.h @@ -1,4 +1,4 @@ -/* $Id: setypes.h,v 1.4 2000/01/05 21:56:58 dwelch Exp $ +/* $Id: setypes.h,v 1.5 2000/06/29 23:35:12 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory for details * PROJECT: ReactOS kernel @@ -12,7 +12,7 @@ #ifndef __INCLUDE_DDK_SETYPES_H #define __INCLUDE_DDK_SETYPES_H -#include +#include /* SID */ #define SECURITY_NULL_RID (0L) diff --git a/reactos/include/ddk/structs.h b/reactos/include/ddk/structs.h index 694bb21d930..bad9af706eb 100644 --- a/reactos/include/ddk/structs.h +++ b/reactos/include/ddk/structs.h @@ -1,6 +1,5 @@ /* SYSTEM STRUCTURES ******************************************************/ -#include #include #include #include diff --git a/reactos/include/ddk/types.h b/reactos/include/ddk/types.h index f9b43a78cf4..94efe87b7c9 100644 --- a/reactos/include/ddk/types.h +++ b/reactos/include/ddk/types.h @@ -1,47 +1,16 @@ -#ifndef __DDK_TYPES_H -#define __DDK_TYPES_H +#ifndef __INCLUDE_DDK_TYPES_H +#define __INCLUDE_DDK_TYPES_H // these should be moved to a file like ntdef.h -typedef const int CINT; typedef ULONG KAFFINITY, *PKAFFINITY; -typedef LONG NTSTATUS, *PNTSTATUS; - -typedef ULONG DEVICE_TYPE; - -enum -{ - DIRECTORY_QUERY, - DIRECTORY_TRAVERSE, - DIRECTORY_CREATE_OBJECT, - DIRECTORY_CREATE_SUBDIRECTORY, - DIRECTORY_ALL_ACCESS, -}; - -/* - * General type for status information - */ -//typedef LONG NTSTATUS; - -typedef struct _UNICODE_STRING -{ - USHORT Length; - USHORT MaximumLength; - PWSTR Buffer; -} UNICODE_STRING, *PUNICODE_STRING; - -typedef enum _SECTION_INHERIT { - ViewShare = 1, - ViewUnmap = 2 -} SECTION_INHERIT; - /* * Various other types (all quite pointless) */ @@ -54,66 +23,10 @@ typedef ULONG TIMER_TYPE; typedef ULONG MM_SYSTEM_SIZE; typedef ULONG LOCK_OPERATION; -/* File information for IRP_MJ_QUERY_INFORMATION (and SET) */ -typedef enum _FILE_INFORMATION_CLASS -{ - FileDirectoryInformation = 1, - FileFullDirectoryInformation, - FileBothDirectoryInformation, - FileBasicInformation, - FileStandardInformation, - FileInternalInformation, - FileEaInformation, - FileAccessInformation, - FileNameInformation, - FileRenameInformation, - FileLinkInformation, - FileNamesInformation, - FileDispositionInformation, - FilePositionInformation, - FileFullEaInformation, - FileModeInformation, - FileAlignmentInformation, - FileAllInformation, - FileAllocationInformation, - FileEndOfFileInformation, - FileAlternateNameInformation, - FileStreamInformation, - FilePipeInformation, - FilePipeLocalInformation, - FilePipeRemoteInformation, - FileMailslotQueryInformation, - FileMailslotSetInformation, - FileCompressionInformation, - FileCopyOnWriteInformation, - FileCompletionInformation, - FileMoveClusterInformation, - FileOleClassIdInformation, - FileOleStateBitsInformation, - FileNetworkOpenInformation, - FileObjectIdInformation, - FileOleAllInformation, - FileOleDirectoryInformation, - FileContentIndexInformation, - FileInheritContentIndexInformation, - FileOleInformation, - FileMaximumInformation, -} FILE_INFORMATION_CLASS; - typedef LARGE_INTEGER PHYSICAL_ADDRESS; typedef PHYSICAL_ADDRESS* PPHYSICAL_ADDRESS; -typedef ULONG WAIT_TYPE; -//typedef ULONG KINTERRUPT_MODE; -typedef USHORT CSHORT; -#if 0 -typedef struct _TIME { - DWORD LowPart; - LONG HighPart; -} TIME, *PTIME; -#endif -typedef ULARGE_INTEGER TIME, *PTIME; -#endif +#endif /* __INCLUDE_DDK_TYPES_H */ diff --git a/reactos/include/ddk/zw.h b/reactos/include/ddk/zw.h index fcf1bbea6d0..10c08a4f36e 100644 --- a/reactos/include/ddk/zw.h +++ b/reactos/include/ddk/zw.h @@ -1,5 +1,5 @@ -/* $Id: zw.h,v 1.31 2000/06/27 19:20:42 dwelch Exp $ +/* $Id: zw.h,v 1.32 2000/06/29 23:35:12 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -17,10 +17,11 @@ #ifndef __DDK_ZW_H #define __DDK_ZW_H -#include +#include +#include #include -#define LCID ULONG +//#define LCID ULONG //#define SECURITY_INFORMATION ULONG //typedef ULONG SECURITY_INFORMATION; @@ -3053,7 +3054,7 @@ NTSTATUS STDCALL NtQueryMultipleValueKey( HANDLE KeyHandle, - PVALENT ListOfValuesToQuery, + PWVALENT ListOfValuesToQuery, ULONG NumberOfItems, PVOID MultipleValueInformation, ULONG Length, @@ -3064,7 +3065,7 @@ NTSTATUS STDCALL ZwQueryMultipleValueKey( HANDLE KeyHandle, - PVALENT ListOfValuesToQuery, + PWVALENT ListOfValuesToQuery, ULONG NumberOfItems, PVOID MultipleValueInformation, ULONG Length, diff --git a/reactos/include/ddk/zwtypes.h b/reactos/include/ddk/zwtypes.h index 665305441b0..af0c82a809e 100644 --- a/reactos/include/ddk/zwtypes.h +++ b/reactos/include/ddk/zwtypes.h @@ -874,7 +874,7 @@ typedef struct _FILE_ALIGNMENT_INFORMATION typedef struct _FILE_DISPOSITION_INFORMATION { - BOOLEAN DeleteFile; + BOOLEAN DoDeleteFile; } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION; typedef struct _FILE_END_OF_FILE_INFORMATION diff --git a/reactos/include/debug.h b/reactos/include/debug.h new file mode 100644 index 00000000000..f1131e288a4 --- /dev/null +++ b/reactos/include/debug.h @@ -0,0 +1,98 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/internal/debug.h + * PURPOSE: Useful debugging macros + * PROGRAMMER: David Welch (welch@mcmail.com) + * UPDATE HISTORY: + * 28/05/98: Created + */ + +/* + * NOTE: Define NDEBUG before including this header to disable debugging + * macros + */ + +#ifndef __INTERNAL_DEBUG +#define __INTERNAL_DEBUG + +#define UNIMPLEMENTED do {DbgPrint("%s at %s:%d is unimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;); } while(0); + +/* FIXME: should probably remove this later */ +#if !defined(CHECKED) && !defined(NDEBUG) +#define CHECKED +#endif + +#ifndef NASSERT +#define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); KeBugCheck(0); } +#else +#define assert(x) +#endif + +#define DPRINT1(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); ExAllocatePool(NonPagedPool,0); } while(0); +#define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); ExAllocatePool(NonPagedPool,0); } while(0); + +extern unsigned int old_idt[256][2]; +//extern unsigned int idt; +extern unsigned int old_idt_valid; + +#ifdef __NTOSKRNL__ +//#define DPRINT_CHECKS ExAllocatePool(NonPagedPool,0); assert(old_idt_valid || (!memcmp(old_idt,KiIdt,256*2))); +//#define DPRINT_CHECKS ExAllocatePool(NonPagedPool,0); +#define DPRINT_CHECKS +#else +#define DPRINT_CHECKS +#endif + +#ifndef NDEBUG +#define OLD_DPRINT(fmt,args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(fmt,args); } while(0); +#define DPRINT(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); DPRINT_CHECKS } while(0); +#define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); ExAllocatePool(NonPagedPool,0); } while(0); +#else +//#define DPRINT(args...) do { DPRINT_CHECKS } while (0); +#define DPRINT(args...) +#define OLD_DPRINT(args...) +#define CHECKPOINT +#endif /* NDEBUG */ + +/* + * FUNCTION: Assert a maximum value for the current irql + * ARGUMENTS: + * x = Maximum irql + */ +#define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x)) +#define assert_irql(x) assert(KeGetCurrentIrql()<=(x)) + +#define HBP_EXECUTE (0) +#define HBP_WRITE (1) +#define HBP_READWRITE (3) + +#define HBP_BYTE (0) +#define HBP_WORD (1) +#define HBP_DWORD (3) + +/* + * FUNCTION: Sets a hardware breakpoint + * ARGUMENTS: + * i = breakpoint to set (0 to 3) + * addr = linear address to break on + * type = Type of access to break on + * len = length of the variable to watch + * NOTES: + * The variable to watch must be aligned to its length (i.e. a dword + * breakpoint must be aligned to a dword boundary) + * + * A fatal exception will be generated on the access to the variable. + * It is (at the moment) only really useful for catching undefined + * pointers if you know the variable effected but not the buggy + * routine. + * + * FIXME: Extend to call out to kernel debugger on breakpoint + * Add support for I/O breakpoints + * REFERENCES: See the i386 programmer manual for more details + */ +void set_breakpoint(unsigned int i, unsigned int addr, unsigned int type, + unsigned int len); + + +#endif /* __INTERNAL_DEBUG */ diff --git a/reactos/include/defines.h b/reactos/include/defines.h index 78c4c3a4670..780bcc3e0ee 100644 --- a/reactos/include/defines.h +++ b/reactos/include/defines.h @@ -34,62 +34,17 @@ #define WINBASEAPI -#define EXCEPTION_MAXIMUM_PARAMETERS (15) -#define ANYSIZE_ARRAY (1) - #ifndef WIN32_NO_STATUS -#define STATUS_WAIT_0 (0x00000000L) -#define STATUS_ABANDONED_WAIT_0 (0x00000080L) -#define STATUS_USER_APC (0x000000C0L) -#define STATUS_TIMEOUT (0x00000102L) -#define STATUS_PENDING (0x00000103L) +//#define STATUS_WAIT_0 (0x00000000L) +//#define STATUS_ABANDONED_WAIT_0 (0x00000080L) +//#define STATUS_USER_APC (0x000000C0L) +//#define STATUS_TIMEOUT (0x00000102L) +//#define STATUS_PENDING (0x00000103L) #endif /* WIN32_NO_STATUS */ -#define SEC_COMMIT (134217728) -#define SEC_IMAGE (16777216) -#define SEC_NOCACHE (268435456) -#define SEC_RESERVE (67108864) -#define PAGE_READONLY (2) -#define PAGE_READWRITE (4) -#define PAGE_WRITECOPY (8) -#define PAGE_EXECUTE (16) -#define PAGE_EXECUTE_READ (32) -#define PAGE_EXECUTE_READWRITE (64) -#define PAGE_EXECUTE_WRITECOPY (128) -#define PAGE_GUARD (256) -#define PAGE_NOACCESS (1) -#define PAGE_NOCACHE (512) -#define MEM_COMMIT (4096) -#define MEM_FREE (65536) -#define MEM_RESERVE (8192) -#define MEM_IMAGE (16777216) -#define MEM_MAPPED (262144) -#define MEM_PRIVATE (131072) -#define MEM_DECOMMIT (16384) -#define MEM_RELEASE (32768) -#define MEM_TOP_DOWN (1048576) -#define EXCEPTION_GUARD_PAGE (0x80000001L) -#define SECTION_EXTEND_SIZE (0x10) -#define SECTION_MAP_READ (0x4) -#define SECTION_MAP_WRITE (0x2) -#define SECTION_QUERY (0x1) -#define SECTION_ALL_ACCESS (0xf001fL) /* DuplicateHandle, MapViewOfFile */ -#define DUPLICATE_CLOSE_SOURCE (1) -#define DUPLICATE_SAME_ACCESS (2) -#define FILE_MAP_ALL_ACCESS (0xf001fL) -#define FILE_MAP_READ (4) -#define FILE_MAP_WRITE (2) -#define FILE_MAP_COPY (1) -#define MUTEX_ALL_ACCESS (0x1f0001L) -#define MUTEX_MODIFY_STATE (1) -#define SYNCHRONIZE (0x100000L) -#define SEMAPHORE_ALL_ACCESS (0x1f0003L) -#define SEMAPHORE_MODIFY_STATE (2) -#define EVENT_ALL_ACCESS (0x1f0003L) -#define EVENT_MODIFY_STATE (2) #define KEY_ALL_ACCESS (0xf003fL) #define KEY_CREATE_LINK (32) #define KEY_CREATE_SUB_KEY (4) @@ -100,121 +55,10 @@ #define KEY_READ (0x20019L) #define KEY_SET_VALUE (2) #define KEY_WRITE (0x20006L) -#define PROCESS_ALL_ACCESS (0x1f0fffL) -#define PROCESS_CREATE_PROCESS (128) -#define PROCESS_CREATE_THREAD (2) -#define PROCESS_DUP_HANDLE (64) -#define PROCESS_QUERY_INFORMATION (1024) -#define PROCESS_SET_INFORMATION (512) -#define PROCESS_TERMINATE (1) -#define PROCESS_VM_OPERATION (8) -#define PROCESS_VM_READ (16) -#define PROCESS_VM_WRITE (32) -#define THREAD_ALL_ACCESS (0x1f03ffL) -#define THREAD_DIRECT_IMPERSONATION (512) -#define THREAD_GET_CONTEXT (8) -#define THREAD_IMPERSONATE (256) -#define THREAD_QUERY_INFORMATION (64) -#define THREAD_SET_CONTEXT (16) -#define THREAD_SET_INFORMATION (32) -#define THREAD_SET_THREAD_TOKEN (128) -#define THREAD_SUSPEND_RESUME (2) -#define THREAD_TERMINATE (1) -#define PACKED __attribute__((packed)) - -#define THREAD_PRIORITY_ABOVE_NORMAL (1) -#define THREAD_PRIORITY_BELOW_NORMAL (-1) -#define THREAD_PRIORITY_HIGHEST (2) -#define THREAD_PRIORITY_IDLE (-15) -#define THREAD_PRIORITY_LOWEST (-2) -#define THREAD_PRIORITY_NORMAL (0) -#define THREAD_PRIORITY_TIME_CRITICAL (15) -#define THREAD_PRIORITY_ERROR_RETURN (2147483647) /* CreateFile, GetFileAttributes, SetFileAttributes */ -#define GENERIC_READ (0x80000000L) -#define GENERIC_WRITE (0x40000000L) -#define FILE_READ_DATA ( 0x0001 ) /* file & pipe */ -#define FILE_LIST_DIRECTORY ( 0x0001 ) /* directory */ -#define FILE_WRITE_DATA ( 0x0002 ) /* file & pipe */ -#define FILE_ADD_FILE ( 0x0002 ) /* directory */ - -#define FILE_APPEND_DATA ( 0x0004 ) /* file */ -#define FILE_ADD_SUBDIRECTORY ( 0x0004 ) /* directory */ -#define FILE_CREATE_PIPE_INSTANCE ( 0x0004 ) /* named pipe */ - -#define FILE_READ_EA ( 0x0008 ) /* file & directory */ -#define FILE_READ_PROPERTIES FILE_READ_EA - -#define FILE_WRITE_EA ( 0x0010 ) /* file & directory */ -#define FILE_WRITE_PROPERTIES FILE_WRITE_EA - -#define FILE_EXECUTE ( 0x0020 ) /* file */ -#define FILE_TRAVERSE ( 0x0020 ) /* directory */ - -#define FILE_DELETE_CHILD ( 0x0040 ) /* directory */ - -#define FILE_READ_ATTRIBUTES ( 0x0080 ) /* all */ - -#define FILE_WRITE_ATTRIBUTES ( 0x0100 ) /* all */ - -#define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) - -#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ |\ - FILE_READ_DATA |\ - FILE_READ_ATTRIBUTES |\ - FILE_READ_EA |\ - SYNCHRONIZE) - - -#define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ - FILE_WRITE_DATA |\ - FILE_WRITE_ATTRIBUTES |\ - FILE_WRITE_EA |\ - FILE_APPEND_DATA |\ - SYNCHRONIZE) - - -#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - FILE_READ_ATTRIBUTES |\ - FILE_EXECUTE |\ - SYNCHRONIZE) - -#define FILE_SHARE_DELETE (4) -#define FILE_SHARE_READ (1) -#define FILE_SHARE_WRITE (2) -#define CONSOLE_TEXTMODE_BUFFER (1) -#define CREATE_NEW (1) -#define CREATE_ALWAYS (2) -#define OPEN_EXISTING (3) -#define OPEN_ALWAYS (4) -#define TRUNCATE_EXISTING (5) -#define FILE_ATTRIBUTE_ARCHIVE (32) -#define FILE_ATTRIBUTE_COMPRESSED (2048) -#define FILE_ATTRIBUTE_DEVICE (64) -#define FILE_ATTRIBUTE_NORMAL (128) -#define FILE_ATTRIBUTE_DIRECTORY (16) -#define FILE_ATTRIBUTE_ENCRYPTED (16384) -#define FILE_ATTRIBUTE_HIDDEN (2) -#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED (8192) -#define FILE_ATTRIBUTE_OFFLINE (4096) -#define FILE_ATTRIBUTE_READONLY (1) -#define FILE_ATTRIBUTE_REPARSE_POINT (1024) -#define FILE_ATTRIBUTE_SPARSE_FILE (512) -#define FILE_ATTRIBUTE_SYSTEM (4) -#define FILE_ATTRIBUTE_TEMPORARY (256) -#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7 -#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7 -#define FILE_FLAG_WRITE_THROUGH (2147483648) -#define FILE_FLAG_OVERLAPPED (1073741824) -#define FILE_FLAG_NO_BUFFERING (536870912) -#define FILE_FLAG_RANDOM_ACCESS (268435456) -#define FILE_FLAG_SEQUENTIAL_SCAN (134217728) -#define FILE_FLAG_DELETE_ON_CLOSE (67108864) -#define FILE_FLAG_BACKUP_SEMANTICS (33554432) -#define FILE_FLAG_POSIX_SEMANTICS (16777216) #define SECURITY_ANONYMOUS (0) #define SECURITY_IDENTIFICATION (65536) #define SECURITY_IMPERSONATION (131072) @@ -223,18 +67,7 @@ #define SECURITY_EFFECTIVE_ONLY (524288) #define SECURITY_SQOS_PRESENT (1048576) -/* Standard rights */ -#define STANDARD_RIGHTS_REQUIRED (0xf0000L) -#define STANDARD_RIGHTS_WRITE (0x20000L) -#define STANDARD_RIGHTS_READ (0x20000L) -#define STANDARD_RIGHTS_EXECUTE (0x20000L) -#define STANDARD_RIGHTS_ALL (0x1f0000L) -#define SPECIFIC_RIGHTS_ALL (0xffffL) -/* ACCESS_MASK */ -#define MAXIMUM_ALLOWED (0x2000000L) -#define GENERIC_ALL (0x10000000L) -#define GENERIC_EXECUTE (0x20000000L) #ifndef WIN32_LEAN_AND_MEAN @@ -248,8 +81,6 @@ extern "C" { #define LF_FACESIZE (32) #define LF_FULLFACESIZE (64) #define ELF_VENDOR_SIZE (4) -#define SECURITY_STATIC_TRACKING (0) -#define SECURITY_DYNAMIC_TRACKING (1) #define MAX_DEFAULTCHAR (2) #define MAX_LEADBYTES (12) #define CCHDEVICENAME (32) @@ -706,20 +537,6 @@ extern "C" { #define ALTERNATE (1) #define WINDING (2) -/* CreateProcess */ -#define CREATE_DEFAULT_ERROR_MODE (67108864) -#define CREATE_NEW_CONSOLE (16) -#define CREATE_NEW_PROCESS_GROUP (512) -#define CREATE_SEPARATE_WOW_VDM (2048) -#define CREATE_SUSPENDED (4) -#define CREATE_UNICODE_ENVIRONMENT (1024) -#define DEBUG_PROCESS (1) -#define DEBUG_ONLY_THIS_PROCESS (2) -#define DETACHED_PROCESS (8) -#define HIGH_PRIORITY_CLASS (128) -#define IDLE_PRIORITY_CLASS (64) -#define NORMAL_PRIORITY_CLASS (32) -#define REALTIME_PRIORITY_CLASS (256) /* CreateService */ #define SERVICE_ALL_ACCESS (0xf01ffL) @@ -1460,14 +1277,6 @@ extern "C" { /* GetComputerName */ #define MAX_COMPUTERNAME_LENGTH (15) -/* GetConsoleMode */ -#define ENABLE_LINE_INPUT (2) -#define ENABLE_ECHO_INPUT (4) -#define ENABLE_PROCESSED_INPUT (1) -#define ENABLE_WINDOW_INPUT (8) -#define ENABLE_MOUSE_INPUT (16) -#define ENABLE_PROCESSED_OUTPUT (1) -#define ENABLE_WRAP_AT_EOL_OUTPUT (2) /* GetCPInfo */ #define CP_ACP (0) @@ -1740,7 +1549,6 @@ extern "C" { #define STD_INPUT_HANDLE (DWORD)(-10) #define STD_OUTPUT_HANDLE (DWORD)(-11) #define STD_ERROR_HANDLE (DWORD)(-12) -#define INVALID_HANDLE_VALUE ((HANDLE)-1) /* GetStockObject */ #define BLACK_BRUSH (4) @@ -1969,14 +1777,6 @@ extern "C" { #define UOI_NAME (2) #define UOI_TYPE (3) -/* GetVolumeInformation */ -#define FS_CASE_IS_PRESERVED (2) -#define FS_CASE_SENSITIVE (1) -#define FS_UNICODE_STORED_ON_DISK (4) -#define FS_PERSISTENT_ACLS (8) -#define FS_FILE_COMPRESSION (16) -#define FS_VOL_IS_COMPRESSED (32768) - /* GetWindowLong */ #define GWL_EXSTYLE (-20) #define GWL_STYLE (-16) @@ -2006,13 +1806,6 @@ extern "C" { #define GMEM_DISCARDED (16384) #define GMEM_INVALID_HANDLE (32768) #define GMEM_LOCKCOUNT (255) - -/* HeapAlloc, HeapReAlloc */ -#define HEAP_GENERATE_EXCEPTIONS (4) -#define HEAP_NO_SERIALIZE (1) -#define HEAP_ZERO_MEMORY (8) -#define HEAP_REALLOC_IN_PLACE_ONLY (16) -#define HEAP_GROWABLE (32) /* ImageList_Create */ #define ILC_COLOR (0) @@ -4354,124 +4147,6 @@ extern "C" { #define SW_PARENTCLOSING (1) #define SW_PARENTOPENING (3) -/* Virtual Key codes */ -#define VK_LBUTTON (1) -#define VK_RBUTTON (2) -#define VK_CANCEL (3) -#define VK_MBUTTON (4) -#define VK_BACK (8) -#define VK_TAB (9) -#define VK_CLEAR (12) -#define VK_RETURN (13) -#define VK_SHIFT (16) -#define VK_CONTROL (17) -#define VK_MENU (18) -#define VK_PAUSE (19) -#define VK_CAPITAL (20) -#define VK_ESCAPE (27) -#define VK_SPACE (32) -#define VK_PRIOR (33) -#define VK_NEXT (34) -#define VK_END (35) -#define VK_HOME (36) -#define VK_LEFT (37) -#define VK_UP (38) -#define VK_RIGHT (39) -#define VK_DOWN (40) -#define VK_SELECT (41) -#define VK_PRINT (42) -#define VK_EXECUTE (43) -#define VK_SNAPSHOT (44) -#define VK_INSERT (45) -#define VK_DELETE (46) -#define VK_HELP (47) -#define VK_0 (48) -#define VK_1 (49) -#define VK_2 (50) -#define VK_3 (51) -#define VK_4 (52) -#define VK_5 (53) -#define VK_6 (54) -#define VK_7 (55) -#define VK_8 (56) -#define VK_9 (57) -#define VK_A (65) -#define VK_B (66) -#define VK_C (67) -#define VK_D (68) -#define VK_E (69) -#define VK_F (70) -#define VK_G (71) -#define VK_H (72) -#define VK_I (73) -#define VK_J (74) -#define VK_K (75) -#define VK_L (76) -#define VK_M (77) -#define VK_N (78) -#define VK_O (79) -#define VK_P (80) -#define VK_Q (81) -#define VK_R (82) -#define VK_S (83) -#define VK_T (84) -#define VK_U (85) -#define VK_V (86) -#define VK_W (87) -#define VK_X (88) -#define VK_Y (89) -#define VK_Z (90) -#define VK_NUMPAD0 (96) -#define VK_NUMPAD1 (97) -#define VK_NUMPAD2 (98) -#define VK_NUMPAD3 (99) -#define VK_NUMPAD4 (100) -#define VK_NUMPAD5 (101) -#define VK_NUMPAD6 (102) -#define VK_NUMPAD7 (103) -#define VK_NUMPAD8 (104) -#define VK_NUMPAD9 (105) -#define VK_MULTIPLY (106) -#define VK_ADD (107) -#define VK_SEPARATOR (108) -#define VK_SUBTRACT (109) -#define VK_DECIMAL (110) -#define VK_DIVIDE (111) -#define VK_F1 (112) -#define VK_F2 (113) -#define VK_F3 (114) -#define VK_F4 (115) -#define VK_F5 (116) -#define VK_F6 (117) -#define VK_F7 (118) -#define VK_F8 (119) -#define VK_F9 (120) -#define VK_F10 (121) -#define VK_F11 (122) -#define VK_F12 (123) -#define VK_F13 (124) -#define VK_F14 (125) -#define VK_F15 (126) -#define VK_F16 (127) -#define VK_F17 (128) -#define VK_F18 (129) -#define VK_F19 (130) -#define VK_F20 (131) -#define VK_F21 (132) -#define VK_F22 (133) -#define VK_F23 (134) -#define VK_F24 (135) - -/* GetAsyncKeyState */ -#define VK_NUMLOCK (144) -#define VK_SCROLL (145) -#define VK_LSHIFT (160) -#define VK_LCONTROL (162) -#define VK_LMENU (164) -#define VK_RSHIFT (161) -#define VK_RCONTROL (163) -#define VK_RMENU (165) - /* ImmGetVirtualKey */ #define VK_PROCESSKEY (229) @@ -4790,33 +4465,6 @@ extern "C" { #define RESOURCEDISPLAYTYPE_SERVER (2) #define RESOURCEDISPLAYTYPE_SHARE (3) -/* KEY_EVENT_RECORD structure */ -#define CAPSLOCK_ON (128) -#define ENHANCED_KEY (256) -#define LEFT_ALT_PRESSED (2) -#define LEFT_CTRL_PRESSED (8) -#define NUMLOCK_ON (32) -#define RIGHT_ALT_PRESSED (1) -#define RIGHT_CTRL_PRESSED (4) -#define SCROLLLOCK_ON (64) -#define SHIFT_PRESSED (16) - -/* MOUSE_EVENT_RECORD structure */ -#define FROM_LEFT_1ST_BUTTON_PRESSED (1) -#define RIGHTMOST_BUTTON_PRESSED (2) -#define FROM_LEFT_2ND_BUTTON_PRESSED (4) -#define FROM_LEFT_3RD_BUTTON_PRESSED (8) -#define FROM_LEFT_4TH_BUTTON_PRESSED (16) -#define DOUBLE_CLICK (2) -#define MOUSE_MOVED (1) - -/* INPUT_RECORD structure */ -#define KEY_EVENT (1) -#define MOUSE_EVENT (2) -#define WINDOW_BUFFER_SIZE_EVENT (4) -#define MENU_EVENT (8) -#define FOCUS_EVENT (16) - /* BITMAPINFOHEADER structure */ #define BI_RGB (0L) #define BI_RLE8 (1L) diff --git a/reactos/include/internal/asm.inc b/reactos/include/internal/asm.inc deleted file mode 100644 index 477a241fc7a..00000000000 --- a/reactos/include/internal/asm.inc +++ /dev/null @@ -1,25 +0,0 @@ -%macro DECLARE_EXTERNAL_SYMBOL 1 -%ifdef coff -extern _%1 -%elifdef win32 -extern _%1 -%elifdef elf -extern %1 -_%1: - call %1 - ret -%endif -%endmacro - -%macro DECLARE_GLOBAL_SYMBOL 1 -%ifdef coff -global _%1 -_%1: -%elifdef win32 -global _%1 -_%1: -%elifdef elf -global %1 -%1: -%endif -%endmacro diff --git a/reactos/include/internal/i386/hal.h b/reactos/include/internal/i386/hal.h deleted file mode 100644 index 6cf1424848b..00000000000 --- a/reactos/include/internal/i386/hal.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - */ - -#ifndef __INTERNAL_HAL_HAL_H -#define __INTERNAL_HAL_HAL_H - -#include -#include - -typedef struct -{ - unsigned short previous_task; - unsigned short reserved1; - unsigned long esp0; - unsigned short ss0; - unsigned short reserved2; - unsigned long esp1; - unsigned short ss1; - unsigned short reserved3; - unsigned long esp2; - unsigned short ss2; - unsigned short reserved4; - unsigned long cr3; - unsigned long eip; - unsigned long eflags; - unsigned long eax; - unsigned long ecx; - unsigned long edx; - unsigned long ebx; - unsigned long esp; - unsigned long ebp; - unsigned long esi; - unsigned long edi; - unsigned short es; - unsigned short reserved5; - unsigned short cs; - unsigned short reserved6; - unsigned short ss; - unsigned short reserved7; - unsigned short ds; - unsigned short reserved8; - unsigned short fs; - unsigned short reserved9; - unsigned short gs; - unsigned short reserved10; - unsigned short ldt; - unsigned short reserved11; - unsigned short trap; - unsigned short iomap_base; - - unsigned short nr; - PVOID KernelStackBase; - PVOID SavedKernelEsp; - PVOID SavedKernelStackBase; - - unsigned char io_bitmap[1]; -} hal_thread_state; - - -/* - * FUNCTION: Probes for a PCI bus - * RETURNS: True if found - */ -BOOL HalPciProbe(void); - -/* - * FUNCTION: Probes for a BIOS32 extension - */ -VOID Hal_bios32_probe(VOID); - -/* - * FUNCTION: Determines if a a bios32 service is present - */ -BOOLEAN Hal_bios32_is_service_present(ULONG service); - -VOID HalInitializeDisplay (boot_param *bp); -VOID HalResetDisplay (VOID); - -VOID -HalpInitBusHandlers (VOID); - -/* udelay.c */ -VOID HalpCalibrateStallExecution(VOID); - -/* irq.c */ -VOID HalpDispatchInterrupt (ULONG irq); -VOID HalpInitIRQs (VOID); - - -#endif /* __INTERNAL_HAL_HAL_H */ diff --git a/reactos/include/internal/i386/segment.inc b/reactos/include/internal/i386/segment.inc deleted file mode 100644 index a39c1e6997a..00000000000 --- a/reactos/include/internal/i386/segment.inc +++ /dev/null @@ -1,6 +0,0 @@ -; -; Useful prototypes and definitions -; - -%define KERNEL_DS 028h -%define KERNEL_CS 020h diff --git a/reactos/include/internal/linkage.h b/reactos/include/internal/linkage.h deleted file mode 100644 index f4adc6155b3..00000000000 --- a/reactos/include/internal/linkage.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __cplusplus -#define asmlinkage extern "C" -#else -#define asmlinkage -#endif diff --git a/reactos/include/internal/pool.h b/reactos/include/internal/pool.h deleted file mode 100644 index e3b7da588e8..00000000000 --- a/reactos/include/internal/pool.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __INTERNAL_POOL_H -#define __INTERNAL_POOL_H - -#include - -PVOID -__stdcall -ExAllocateNonPagedPoolWithTag ( - POOL_TYPE type, - ULONG size, - ULONG Tag, - PVOID Caller - ); -PVOID -__stdcall -ExAllocatePagedPoolWithTag ( - POOL_TYPE Type, - ULONG size, - ULONG Tag - ); - -#endif /* __INTERNAL_POOL_H */ diff --git a/reactos/include/internal/i386/segment.h b/reactos/include/napi/i386/segment.h similarity index 100% rename from reactos/include/internal/i386/segment.h rename to reactos/include/napi/i386/segment.h diff --git a/reactos/include/napi/lpc.h b/reactos/include/napi/lpc.h index 50027551e1b..60cd977ad39 100644 --- a/reactos/include/napi/lpc.h +++ b/reactos/include/napi/lpc.h @@ -1,7 +1,7 @@ #ifndef __INCLUDE_NAPI_LPC_H #define __INCLUDE_NAPI_LPC_H -#include +#include #define MAX_MESSAGE_DATA (0x130) diff --git a/reactos/include/internal/teb.h b/reactos/include/napi/teb.h similarity index 99% rename from reactos/include/internal/teb.h rename to reactos/include/napi/teb.h index 9a51e3ce83e..c547667101b 100644 --- a/reactos/include/internal/teb.h +++ b/reactos/include/napi/teb.h @@ -2,6 +2,8 @@ #ifndef __INCLUDE_INTERNAL_TEB #define __INCLUDE_INTERNAL_TEB +#include + typedef struct _CLIENT_ID { HANDLE UniqueProcess; diff --git a/reactos/include/napi/types.h b/reactos/include/napi/types.h new file mode 100644 index 00000000000..aa4d58e76d1 --- /dev/null +++ b/reactos/include/napi/types.h @@ -0,0 +1,102 @@ +#ifndef __INCLUDE_NAPI_TYPES_H +#define __INCLUDE_NAPI_TYPES_H + +// these should be moved to a file like ntdef.h + +typedef const int CINT; + +typedef LONG NTSTATUS, *PNTSTATUS; + +typedef ULONG DEVICE_TYPE; + + + + + +enum +{ + DIRECTORY_QUERY, + DIRECTORY_TRAVERSE, + DIRECTORY_CREATE_OBJECT, + DIRECTORY_CREATE_SUBDIRECTORY, + DIRECTORY_ALL_ACCESS, +}; + +/* + * General type for status information + */ +//typedef LONG NTSTATUS; + +typedef struct _UNICODE_STRING +{ + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; +} UNICODE_STRING, *PUNICODE_STRING; + +typedef enum _SECTION_INHERIT { + ViewShare = 1, + ViewUnmap = 2 +} SECTION_INHERIT; + + +/* File information for IRP_MJ_QUERY_INFORMATION (and SET) */ +typedef enum _FILE_INFORMATION_CLASS +{ + FileDirectoryInformation = 1, + FileFullDirectoryInformation, + FileBothDirectoryInformation, + FileBasicInformation, + FileStandardInformation, + FileInternalInformation, + FileEaInformation, + FileAccessInformation, + FileNameInformation, + FileRenameInformation, + FileLinkInformation, + FileNamesInformation, + FileDispositionInformation, + FilePositionInformation, + FileFullEaInformation, + FileModeInformation, + FileAlignmentInformation, + FileAllInformation, + FileAllocationInformation, + FileEndOfFileInformation, + FileAlternateNameInformation, + FileStreamInformation, + FilePipeInformation, + FilePipeLocalInformation, + FilePipeRemoteInformation, + FileMailslotQueryInformation, + FileMailslotSetInformation, + FileCompressionInformation, + FileCopyOnWriteInformation, + FileCompletionInformation, + FileMoveClusterInformation, + FileOleClassIdInformation, + FileOleStateBitsInformation, + FileNetworkOpenInformation, + FileObjectIdInformation, + FileOleAllInformation, + FileOleDirectoryInformation, + FileContentIndexInformation, + FileInheritContentIndexInformation, + FileOleInformation, + FileMaximumInformation, +} FILE_INFORMATION_CLASS; + +typedef ULONG WAIT_TYPE; +typedef USHORT CSHORT; + + +#if 0 +typedef struct _TIME { + DWORD LowPart; + LONG HighPart; +} TIME, *PTIME; +#endif + +typedef ULARGE_INTEGER TIME, *PTIME; + +#endif /* __INCLUDE_NAPI_TYPES_H */ diff --git a/reactos/include/ntdll/ntdll.h b/reactos/include/ntdll/ntdll.h index e2cca70a810..7f5c456cfec 100644 --- a/reactos/include/ntdll/ntdll.h +++ b/reactos/include/ntdll/ntdll.h @@ -1,4 +1,6 @@ +#include + #define UNIMPLEMENTED DbgPrint("%s in %s:%d is unimplemented\n",__FUNCTION__,__FILE__,__LINE__); #ifdef NDEBUG diff --git a/reactos/include/ntdll/rtl.h b/reactos/include/ntdll/rtl.h index 59b4065d7c5..8d01cce8620 100644 --- a/reactos/include/ntdll/rtl.h +++ b/reactos/include/ntdll/rtl.h @@ -1,10 +1,33 @@ -/* $Id: rtl.h,v 1.16 2000/05/25 15:50:22 ekohl Exp $ +/* $Id: rtl.h,v 1.17 2000/06/29 23:35:22 dwelch Exp $ * */ #ifndef __INCLUDE_NTDLL_RTL_H #define __INCLUDE_NTDLL_RTL_H +#include + +typedef struct _CRITICAL_SECTION_DEBUG { + WORD Type; + WORD CreatorBackTraceIndex; + struct _CRITICAL_SECTION *CriticalSection; + LIST_ENTRY ProcessLocksList; + DWORD EntryCount; + DWORD ContentionCount; + DWORD Depth; + PVOID OwnerBackTrace[ 5 ]; +} CRITICAL_SECTION_DEBUG, *PCRITICAL_SECTION_DEBUG; + +typedef struct _CRITICAL_SECTION { + PCRITICAL_SECTION_DEBUG DebugInfo; + LONG LockCount; + LONG RecursionCount; + HANDLE OwningThread; + HANDLE LockSemaphore; + DWORD Reserved; +} CRITICAL_SECTION, *PCRITICAL_SECTION, *LPCRITICAL_SECTION; + + /* * Preliminary data type!! * @@ -256,7 +279,7 @@ RtlCreateUserProcess ( PRTL_USER_PROCESS_PARAMETERS ProcessParameters, // verified PSECURITY_DESCRIPTOR ProcessSd, PSECURITY_DESCRIPTOR ThreadSd, - WINBOOL bInheritHandles, + BOOL bInheritHandles, DWORD dwCreationFlags, ULONG Unknown8, ULONG Unknown9, diff --git a/reactos/include/ntos.h b/reactos/include/ntos.h index 292196da534..8e097d8965f 100644 --- a/reactos/include/ntos.h +++ b/reactos/include/ntos.h @@ -1,7 +1,11 @@ #ifndef _NTOS_H #define _NTOS_H -/* $Id: ntos.h,v 1.1 1999/08/29 07:02:52 ea Exp $ */ +/* $Id: ntos.h,v 1.2 2000/06/29 23:35:11 dwelch Exp $ */ #include +#include +#include +#include +#include #endif /* ndef _NTOS_H */ diff --git a/reactos/include/ntos/atom.h b/reactos/include/ntos/atom.h new file mode 100644 index 00000000000..8c577e0bb60 --- /dev/null +++ b/reactos/include/ntos/atom.h @@ -0,0 +1,17 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/atom.h + * PURPOSE: Atom declarations used by all the parts of the system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_ATOM_H +#define __INCLUDE_ATOM_H + +typedef unsigned short ATOM; + +#endif /* __INCLUDE_ATOM_H */ diff --git a/reactos/include/ntos/console.h b/reactos/include/ntos/console.h new file mode 100644 index 00000000000..d1443ac561d --- /dev/null +++ b/reactos/include/ntos/console.h @@ -0,0 +1,41 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/console.h + * PURPOSE: Console declarations used by all the parts of the + * system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_CONSOLE_H +#define __INCLUDE_CONSOLE_H + +/* GetConsoleMode */ +#define ENABLE_LINE_INPUT (2) +#define ENABLE_ECHO_INPUT (4) +#define ENABLE_PROCESSED_INPUT (1) +#define ENABLE_WINDOW_INPUT (8) +#define ENABLE_MOUSE_INPUT (16) +#define ENABLE_PROCESSED_OUTPUT (1) +#define ENABLE_WRAP_AT_EOL_OUTPUT (2) + +typedef struct _CONSOLE_SCREEN_BUFFER_INFO { + COORD dwSize; + COORD dwCursorPosition; + WORD wAttributes; + SMALL_RECT srWindow; + COORD dwMaximumWindowSize; +} CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO ; + +typedef struct _CONSOLE_CURSOR_INFO { + DWORD dwSize; + BOOL bVisible; +} CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO; + +#endif /* __INCLUDE_CONSOLE_H */ + + + diff --git a/reactos/include/ntos/disk.h b/reactos/include/ntos/disk.h new file mode 100644 index 00000000000..cad52d427ea --- /dev/null +++ b/reactos/include/ntos/disk.h @@ -0,0 +1,56 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/disk.h + * PURPOSE: Disk related definitions used by all the parts of the system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_DISK_H +#define __INCLUDE_DISK_H + +typedef enum _MEDIA_TYPE { + Unknown, + F5_1Pt2_512, + F3_1Pt44_512, + F3_2Pt88_512, + F3_20Pt8_512, + F3_720_512, + F5_360_512, + F5_320_512, + F5_320_1024, + F5_180_512, + F5_160_512, + RemovableMedia, + FixedMedia +} MEDIA_TYPE; + +typedef struct _PARTITION_INFORMATION { + BYTE PartitionType; + BOOLEAN BootIndicator; + BOOLEAN RecognizedPartition; + BOOLEAN RewritePartition; + LARGE_INTEGER StartingOffset; + LARGE_INTEGER PartitionLength; + LARGE_INTEGER HiddenSectors; +} PARTITION_INFORMATION; + +typedef struct _DRIVE_LAYOUT_INFORMATION { + DWORD PartitionCount; + DWORD Signature; + PARTITION_INFORMATION PartitionEntry[1]; +} DRIVE_LAYOUT_INFORMATION; + +typedef struct _DISK_GEOMETRY { + LARGE_INTEGER Cylinders; + MEDIA_TYPE MediaType; + DWORD TracksPerCylinder; + DWORD SectorsPerTrack; + DWORD BytesPerSector; +} DISK_GEOMETRY ; + + +#endif /* __INCLUDE_DISK_H */ diff --git a/reactos/include/ntos/file.h b/reactos/include/ntos/file.h new file mode 100644 index 00000000000..49d651622dd --- /dev/null +++ b/reactos/include/ntos/file.h @@ -0,0 +1,108 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/ps.h + * PURPOSE: Filesystem declarations used by all the parts of the + * system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_FILE_H +#define __INCLUDE_FILE_H + +#define GENERIC_READ (0x80000000L) +#define GENERIC_WRITE (0x40000000L) +#define FILE_READ_DATA ( 0x0001 ) /* file & pipe */ +#define FILE_LIST_DIRECTORY ( 0x0001 ) /* directory */ + +#define FILE_WRITE_DATA ( 0x0002 ) /* file & pipe */ +#define FILE_ADD_FILE ( 0x0002 ) /* directory */ + +#define FILE_APPEND_DATA ( 0x0004 ) /* file */ +#define FILE_ADD_SUBDIRECTORY ( 0x0004 ) /* directory */ +#define FILE_CREATE_PIPE_INSTANCE ( 0x0004 ) /* named pipe */ + +#define FILE_READ_EA ( 0x0008 ) /* file & directory */ +#define FILE_READ_PROPERTIES FILE_READ_EA + +#define FILE_WRITE_EA ( 0x0010 ) /* file & directory */ +#define FILE_WRITE_PROPERTIES FILE_WRITE_EA + +#define FILE_EXECUTE ( 0x0020 ) /* file */ +#define FILE_TRAVERSE ( 0x0020 ) /* directory */ + +#define FILE_DELETE_CHILD ( 0x0040 ) /* directory */ + +#define FILE_READ_ATTRIBUTES ( 0x0080 ) /* all */ + +#define FILE_WRITE_ATTRIBUTES ( 0x0100 ) /* all */ + +#define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) + +#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ |\ + FILE_READ_DATA |\ + FILE_READ_ATTRIBUTES |\ + FILE_READ_EA |\ + SYNCHRONIZE) + + +#define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ + FILE_WRITE_DATA |\ + FILE_WRITE_ATTRIBUTES |\ + FILE_WRITE_EA |\ + FILE_APPEND_DATA |\ + SYNCHRONIZE) + + +#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ + FILE_READ_ATTRIBUTES |\ + FILE_EXECUTE |\ + SYNCHRONIZE) + +#define FILE_SHARE_DELETE (4) +#define FILE_SHARE_READ (1) +#define FILE_SHARE_WRITE (2) +#define CONSOLE_TEXTMODE_BUFFER (1) +#define CREATE_NEW (1) +#define CREATE_ALWAYS (2) +#define OPEN_EXISTING (3) +#define OPEN_ALWAYS (4) +#define TRUNCATE_EXISTING (5) +#define FILE_ATTRIBUTE_ARCHIVE (32) +#define FILE_ATTRIBUTE_COMPRESSED (2048) +#define FILE_ATTRIBUTE_DEVICE (64) +#define FILE_ATTRIBUTE_NORMAL (128) +#define FILE_ATTRIBUTE_DIRECTORY (16) +#define FILE_ATTRIBUTE_ENCRYPTED (16384) +#define FILE_ATTRIBUTE_HIDDEN (2) +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED (8192) +#define FILE_ATTRIBUTE_OFFLINE (4096) +#define FILE_ATTRIBUTE_READONLY (1) +#define FILE_ATTRIBUTE_REPARSE_POINT (1024) +#define FILE_ATTRIBUTE_SPARSE_FILE (512) +#define FILE_ATTRIBUTE_SYSTEM (4) +#define FILE_ATTRIBUTE_TEMPORARY (256) +#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7 +#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7 +#define FILE_FLAG_WRITE_THROUGH (2147483648) +#define FILE_FLAG_OVERLAPPED (1073741824) +#define FILE_FLAG_NO_BUFFERING (536870912) +#define FILE_FLAG_RANDOM_ACCESS (268435456) +#define FILE_FLAG_SEQUENTIAL_SCAN (134217728) +#define FILE_FLAG_DELETE_ON_CLOSE (67108864) +#define FILE_FLAG_BACKUP_SEMANTICS (33554432) +#define FILE_FLAG_POSIX_SEMANTICS (16777216) + +/* GetVolumeInformation */ +#define FS_CASE_IS_PRESERVED (2) +#define FS_CASE_SENSITIVE (1) +#define FS_UNICODE_STORED_ON_DISK (4) +#define FS_PERSISTENT_ACLS (8) +#define FS_FILE_COMPRESSION (16) +#define FS_VOL_IS_COMPRESSED (32768) + + +#endif /* __INCLUDE_FILE_H */ diff --git a/reactos/include/ntos/heap.h b/reactos/include/ntos/heap.h new file mode 100644 index 00000000000..7e6b685d029 --- /dev/null +++ b/reactos/include/ntos/heap.h @@ -0,0 +1,24 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/heap.h + * PURPOSE: Heap declarations used by all the parts of the + * system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_HEAP_H +#define __INCLUDE_HEAP_H + +/* HeapAlloc, HeapReAlloc */ +#define HEAP_GENERATE_EXCEPTIONS (4) +#define HEAP_NO_SERIALIZE (1) +#define HEAP_ZERO_MEMORY (8) +#define HEAP_REALLOC_IN_PLACE_ONLY (16) +#define HEAP_GROWABLE (32) + + +#endif /* __INCLUDE_HEAP_H */ diff --git a/reactos/include/ntos/keyboard.h b/reactos/include/ntos/keyboard.h new file mode 100644 index 00000000000..2945a737ad1 --- /dev/null +++ b/reactos/include/ntos/keyboard.h @@ -0,0 +1,213 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/keyboard.h + * PURPOSE: Keyboard declarations used by all the parts of the + * system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_KEYBOARD_H +#define __INCLUDE_KEYBOARD_H + +#include + +/* KEY_EVENT_RECORD structure */ +#define CAPSLOCK_ON (128) +#define ENHANCED_KEY (256) +#define LEFT_ALT_PRESSED (2) +#define LEFT_CTRL_PRESSED (8) +#define NUMLOCK_ON (32) +#define RIGHT_ALT_PRESSED (1) +#define RIGHT_CTRL_PRESSED (4) +#define SCROLLLOCK_ON (64) +#define SHIFT_PRESSED (16) + +/* MOUSE_EVENT_RECORD structure */ +#define FROM_LEFT_1ST_BUTTON_PRESSED (1) +#define RIGHTMOST_BUTTON_PRESSED (2) +#define FROM_LEFT_2ND_BUTTON_PRESSED (4) +#define FROM_LEFT_3RD_BUTTON_PRESSED (8) +#define FROM_LEFT_4TH_BUTTON_PRESSED (16) +#define DOUBLE_CLICK (2) +#define MOUSE_MOVED (1) + +/* INPUT_RECORD structure */ +#define KEY_EVENT (1) +#define MOUSE_EVENT (2) +#define WINDOW_BUFFER_SIZE_EVENT (4) +#define MENU_EVENT (8) +#define FOCUS_EVENT (16) + + +typedef struct _KEY_EVENT_RECORD { + BOOL bKeyDown; + WORD wRepeatCount; + WORD wVirtualKeyCode; + WORD wVirtualScanCode; + union { + WCHAR UnicodeChar; + CHAR AsciiChar; + } uChar; + DWORD dwControlKeyState; +} KEY_EVENT_RECORD PACKED; + +typedef struct _MOUSE_EVENT_RECORD { + COORD dwMousePosition; + DWORD dwButtonState; + DWORD dwControlKeyState; + DWORD dwEventFlags; +} MOUSE_EVENT_RECORD; + +typedef struct _WINDOW_BUFFER_SIZE_RECORD { + COORD dwSize; +} WINDOW_BUFFER_SIZE_RECORD; + +typedef struct _MENU_EVENT_RECORD { + UINT dwCommandId; +} MENU_EVENT_RECORD, *PMENU_EVENT_RECORD; + +typedef struct _FOCUS_EVENT_RECORD { + BOOL bSetFocus; +} FOCUS_EVENT_RECORD; + +typedef struct _INPUT_RECORD { + WORD EventType; + union { +#ifndef __cplus_plus + /* this will be the wrong size in c++ */ + KEY_EVENT_RECORD KeyEvent; +#endif + MOUSE_EVENT_RECORD MouseEvent; + WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent; + MENU_EVENT_RECORD MenuEvent; + FOCUS_EVENT_RECORD FocusEvent; + } Event; +} INPUT_RECORD, *PINPUT_RECORD; + +/* Virtual Key codes */ +#define VK_LBUTTON (1) +#define VK_RBUTTON (2) +#define VK_CANCEL (3) +#define VK_MBUTTON (4) +#define VK_BACK (8) +#define VK_TAB (9) +#define VK_CLEAR (12) +#define VK_RETURN (13) +#define VK_SHIFT (16) +#define VK_CONTROL (17) +#define VK_MENU (18) +#define VK_PAUSE (19) +#define VK_CAPITAL (20) +#define VK_ESCAPE (27) +#define VK_SPACE (32) +#define VK_PRIOR (33) +#define VK_NEXT (34) +#define VK_END (35) +#define VK_HOME (36) +#define VK_LEFT (37) +#define VK_UP (38) +#define VK_RIGHT (39) +#define VK_DOWN (40) +#define VK_SELECT (41) +#define VK_PRINT (42) +#define VK_EXECUTE (43) +#define VK_SNAPSHOT (44) +#define VK_INSERT (45) +#define VK_DELETE (46) +#define VK_HELP (47) +#define VK_0 (48) +#define VK_1 (49) +#define VK_2 (50) +#define VK_3 (51) +#define VK_4 (52) +#define VK_5 (53) +#define VK_6 (54) +#define VK_7 (55) +#define VK_8 (56) +#define VK_9 (57) +#define VK_A (65) +#define VK_B (66) +#define VK_C (67) +#define VK_D (68) +#define VK_E (69) +#define VK_F (70) +#define VK_G (71) +#define VK_H (72) +#define VK_I (73) +#define VK_J (74) +#define VK_K (75) +#define VK_L (76) +#define VK_M (77) +#define VK_N (78) +#define VK_O (79) +#define VK_P (80) +#define VK_Q (81) +#define VK_R (82) +#define VK_S (83) +#define VK_T (84) +#define VK_U (85) +#define VK_V (86) +#define VK_W (87) +#define VK_X (88) +#define VK_Y (89) +#define VK_Z (90) +#define VK_NUMPAD0 (96) +#define VK_NUMPAD1 (97) +#define VK_NUMPAD2 (98) +#define VK_NUMPAD3 (99) +#define VK_NUMPAD4 (100) +#define VK_NUMPAD5 (101) +#define VK_NUMPAD6 (102) +#define VK_NUMPAD7 (103) +#define VK_NUMPAD8 (104) +#define VK_NUMPAD9 (105) +#define VK_MULTIPLY (106) +#define VK_ADD (107) +#define VK_SEPARATOR (108) +#define VK_SUBTRACT (109) +#define VK_DECIMAL (110) +#define VK_DIVIDE (111) +#define VK_F1 (112) +#define VK_F2 (113) +#define VK_F3 (114) +#define VK_F4 (115) +#define VK_F5 (116) +#define VK_F6 (117) +#define VK_F7 (118) +#define VK_F8 (119) +#define VK_F9 (120) +#define VK_F10 (121) +#define VK_F11 (122) +#define VK_F12 (123) +#define VK_F13 (124) +#define VK_F14 (125) +#define VK_F15 (126) +#define VK_F16 (127) +#define VK_F17 (128) +#define VK_F18 (129) +#define VK_F19 (130) +#define VK_F20 (131) +#define VK_F21 (132) +#define VK_F22 (133) +#define VK_F23 (134) +#define VK_F24 (135) + +/* GetAsyncKeyState */ +#define VK_NUMLOCK (144) +#define VK_SCROLL (145) +#define VK_LSHIFT (160) +#define VK_LCONTROL (162) +#define VK_LMENU (164) +#define VK_RSHIFT (161) +#define VK_RCONTROL (163) +#define VK_RMENU (165) + + +#endif /* __INCLUDE_KEYBOARD_H */ + + + diff --git a/reactos/include/ntos/minmax.h b/reactos/include/ntos/minmax.h new file mode 100644 index 00000000000..37d9ff3fcaf --- /dev/null +++ b/reactos/include/ntos/minmax.h @@ -0,0 +1,7 @@ +#ifndef max +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef min +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif diff --git a/reactos/include/ntos/mm.h b/reactos/include/ntos/mm.h new file mode 100644 index 00000000000..72eef72ced2 --- /dev/null +++ b/reactos/include/ntos/mm.h @@ -0,0 +1,62 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/mm.h + * PURPOSE: Memory managment declarations used by all the parts of the + * system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_MM_H +#define __INCLUDE_MM_H + +#define SEC_COMMIT (134217728) +#define SEC_IMAGE (16777216) +#define SEC_NOCACHE (268435456) +#define SEC_RESERVE (67108864) +#define PAGE_READONLY (2) +#define PAGE_READWRITE (4) +#define PAGE_WRITECOPY (8) +#define PAGE_EXECUTE (16) +#define PAGE_EXECUTE_READ (32) +#define PAGE_EXECUTE_READWRITE (64) +#define PAGE_EXECUTE_WRITECOPY (128) +#define PAGE_GUARD (256) +#define PAGE_NOACCESS (1) +#define PAGE_NOCACHE (512) +#define MEM_COMMIT (4096) +#define MEM_FREE (65536) +#define MEM_RESERVE (8192) +#define MEM_IMAGE (16777216) +#define MEM_MAPPED (262144) +#define MEM_PRIVATE (131072) +#define MEM_DECOMMIT (16384) +#define MEM_RELEASE (32768) +#define MEM_TOP_DOWN (1048576) +#define EXCEPTION_GUARD_PAGE (0x80000001L) +#define SECTION_EXTEND_SIZE (0x10) +#define SECTION_MAP_READ (0x4) +#define SECTION_MAP_WRITE (0x2) +#define SECTION_QUERY (0x1) +#define SECTION_ALL_ACCESS (0xf001fL) + +typedef struct _MEMORY_BASIC_INFORMATION { + PVOID BaseAddress; + PVOID AllocationBase; + DWORD AllocationProtect; + DWORD RegionSize; + DWORD State; + DWORD Protect; + DWORD Type; +} MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION; + +#define FILE_MAP_ALL_ACCESS (0xf001fL) +#define FILE_MAP_READ (4) +#define FILE_MAP_WRITE (2) +#define FILE_MAP_COPY (1) + + +#endif /* __INCLUDE_MM_H */ diff --git a/reactos/include/ntos/ntdef.h b/reactos/include/ntos/ntdef.h new file mode 100644 index 00000000000..9dcb80af570 --- /dev/null +++ b/reactos/include/ntos/ntdef.h @@ -0,0 +1,25 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/ntdef.h + * PURPOSE: Defines used by all the parts of the system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + +#ifndef __INCLUDE_NTDEF_H +#define __INCLUDE_NTDEF_H + +#define ANYSIZE_ARRAY (1) + +#define SYNCHRONIZE (0x100000L) + +#define DUPLICATE_CLOSE_SOURCE (1) +#define DUPLICATE_SAME_ACCESS (2) + +#define PACKED __attribute__((packed)) + +#define INVALID_HANDLE_VALUE ((HANDLE)-1) + +#endif /* __INCLUDE_NTDEF_H */ diff --git a/reactos/include/ntos/ps.h b/reactos/include/ntos/ps.h new file mode 100644 index 00000000000..4561869d4c8 --- /dev/null +++ b/reactos/include/ntos/ps.h @@ -0,0 +1,63 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/ps.h + * PURPOSE: Process/thread declarations used by all the parts of the + * system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_PS_H +#define __INCLUDE_PS_H + +#define THREAD_ALL_ACCESS (0x1f03ffL) +#define THREAD_DIRECT_IMPERSONATION (512) +#define THREAD_GET_CONTEXT (8) +#define THREAD_IMPERSONATE (256) +#define THREAD_QUERY_INFORMATION (64) +#define THREAD_SET_CONTEXT (16) +#define THREAD_SET_INFORMATION (32) +#define THREAD_SET_THREAD_TOKEN (128) +#define THREAD_SUSPEND_RESUME (2) +#define THREAD_TERMINATE (1) + +#define PROCESS_ALL_ACCESS (0x1f0fffL) +#define PROCESS_CREATE_PROCESS (128) +#define PROCESS_CREATE_THREAD (2) +#define PROCESS_DUP_HANDLE (64) +#define PROCESS_QUERY_INFORMATION (1024) +#define PROCESS_SET_INFORMATION (512) +#define PROCESS_TERMINATE (1) +#define PROCESS_VM_OPERATION (8) +#define PROCESS_VM_READ (16) +#define PROCESS_VM_WRITE (32) + +#define THREAD_PRIORITY_ABOVE_NORMAL (1) +#define THREAD_PRIORITY_BELOW_NORMAL (-1) +#define THREAD_PRIORITY_HIGHEST (2) +#define THREAD_PRIORITY_IDLE (-15) +#define THREAD_PRIORITY_LOWEST (-2) +#define THREAD_PRIORITY_NORMAL (0) +#define THREAD_PRIORITY_TIME_CRITICAL (15) +#define THREAD_PRIORITY_ERROR_RETURN (2147483647) + +/* CreateProcess */ +#define CREATE_DEFAULT_ERROR_MODE (67108864) +#define CREATE_NEW_CONSOLE (16) +#define CREATE_NEW_PROCESS_GROUP (512) +#define CREATE_SEPARATE_WOW_VDM (2048) +#define CREATE_SUSPENDED (4) +#define CREATE_UNICODE_ENVIRONMENT (1024) +#define DEBUG_PROCESS (1) +#define DEBUG_ONLY_THIS_PROCESS (2) +#define DETACHED_PROCESS (8) +#define HIGH_PRIORITY_CLASS (128) +#define IDLE_PRIORITY_CLASS (64) +#define NORMAL_PRIORITY_CLASS (32) +#define REALTIME_PRIORITY_CLASS (256) + + +#endif /* __INCLUDE_PS_H */ diff --git a/reactos/include/security.h b/reactos/include/ntos/security.h similarity index 76% rename from reactos/include/security.h rename to reactos/include/ntos/security.h index 3d41f6c84e9..05e12ea1c0f 100644 --- a/reactos/include/security.h +++ b/reactos/include/ntos/security.h @@ -1,6 +1,28 @@ #ifndef __INCLUDE_SECURITY_H #define __INCLUDE_SECURITY_H +#include +#include + +/* ACCESS_MASK */ +#define MAXIMUM_ALLOWED (0x2000000L) +#define GENERIC_ALL (0x10000000L) +#define GENERIC_EXECUTE (0x20000000L) + +#define SECURITY_STATIC_TRACKING (0) +#define SECURITY_DYNAMIC_TRACKING (1) + +/* Standard rights */ +#define STANDARD_RIGHTS_REQUIRED (0xf0000L) +#define STANDARD_RIGHTS_WRITE (0x20000L) +#define STANDARD_RIGHTS_READ (0x20000L) +#define STANDARD_RIGHTS_EXECUTE (0x20000L) +#define STANDARD_RIGHTS_ALL (0x1f0000L) +#define SPECIFIC_RIGHTS_ALL (0xffffL) + + +typedef BOOL SECURITY_CONTEXT_TRACKING_MODE; + typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION; typedef enum _TOKEN_INFORMATION_CLASS { @@ -157,4 +179,29 @@ typedef struct _TOKEN_STATISTICS { LUID ModifiedId; } TOKEN_STATISTICS, *PTOKEN_STATISTICS; +typedef struct _GENERIC_MAPPING { + ACCESS_MASK GenericRead; + ACCESS_MASK GenericWrite; + ACCESS_MASK GenericExecute; + ACCESS_MASK GenericAll; +} GENERIC_MAPPING, *PGENERIC_MAPPING; + +typedef struct _PRIVILEGE_SET { + DWORD PrivilegeCount; + DWORD Control; + LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY]; +} PRIVILEGE_SET, *PPRIVILEGE_SET, *LPPRIVILEGE_SET; + +typedef enum _ACL_INFORMATION_CLASS { + AclRevisionInformation = 1, + AclSizeInformation +} ACL_INFORMATION_CLASS; + +typedef struct _SECURITY_ATTRIBUTES { + DWORD nLength; + LPVOID lpSecurityDescriptor; + BOOL bInheritHandle; +} SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; + + #endif /* __INCLUDE_SECURITY_H */ diff --git a/reactos/include/ntos/synch.h b/reactos/include/ntos/synch.h new file mode 100644 index 00000000000..6a4927db521 --- /dev/null +++ b/reactos/include/ntos/synch.h @@ -0,0 +1,24 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/synch.h + * PURPOSE: Synchronization declarations used by all the parts of the + * system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_SYNCH_H +#define __INCLUDE_SYNCH_H + +#define MUTEX_ALL_ACCESS (0x1f0001L) +#define MUTEX_MODIFY_STATE (1) +#define SEMAPHORE_ALL_ACCESS (0x1f0003L) +#define SEMAPHORE_MODIFY_STATE (2) +#define EVENT_ALL_ACCESS (0x1f0003L) +#define EVENT_MODIFY_STATE (2) + + +#endif /* __INCLUDE_PS_H */ diff --git a/reactos/include/ntos/time.h b/reactos/include/ntos/time.h new file mode 100644 index 00000000000..435a927e931 --- /dev/null +++ b/reactos/include/ntos/time.h @@ -0,0 +1,38 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/time.h + * PURPOSE: Time declarations used by all the parts of the system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + + +#ifndef __INCLUDE_TIME_H +#define __INCLUDE_TIME_H + +#include + +typedef struct _SYSTEMTIME { + WORD wYear; + WORD wMonth; + WORD wDayOfWeek; + WORD wDay; + WORD wHour; + WORD wMinute; + WORD wSecond; + WORD wMilliseconds; +} SYSTEMTIME, *LPSYSTEMTIME; + +typedef struct _TIME_ZONE_INFORMATION { + LONG Bias; + WCHAR StandardName[ 32 ]; + SYSTEMTIME StandardDate; + LONG StandardBias; + WCHAR DaylightName[ 32 ]; + SYSTEMTIME DaylightDate; + LONG DaylightBias; +} TIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION; + +#endif /* __INCLUDE_TIME_H */ diff --git a/reactos/include/ntos/types.h b/reactos/include/ntos/types.h new file mode 100644 index 00000000000..e80482d8f5b --- /dev/null +++ b/reactos/include/ntos/types.h @@ -0,0 +1,303 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/types.h + * PURPOSE: Types used by all the parts of the system + * PROGRAMMER: David Welch + * UPDATE HISTORY: + * 27/06/00: Created + */ + +#ifndef __INCLUDE_TYPES_H +#define __INCLUDE_TYPES_H + +typedef unsigned char UCHAR; +typedef unsigned int UINT; +typedef unsigned long ULONG; +typedef unsigned short USHORT; +typedef unsigned short WCHAR; +typedef unsigned short WORD; +typedef int BOOL; +typedef unsigned char BOOLEAN; +typedef BOOLEAN* PBOOLEAN; +typedef unsigned int DWORD; /* was unsigned long */ +typedef unsigned short *LPWSTR; +typedef unsigned short *PWSTR; +typedef unsigned char *PUCHAR; +typedef unsigned int *PUINT; +typedef unsigned long *PULONG; +typedef unsigned short *PUSHORT; +typedef void *PVOID; +typedef unsigned char BYTE; +typedef void *LPVOID; +typedef DWORD *PDWORD; +typedef float *PFLOAT; +typedef unsigned short *PWCH; +typedef unsigned short *PWORD; + +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef long long *PLONGLONG; +typedef unsigned long long *PULONGLONG; + +/* Check VOID before defining CHAR, SHORT, and LONG */ +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; +typedef long LONG; +#endif + +typedef CHAR *PCHAR; +typedef CHAR *PCH; +typedef void *HANDLE; +typedef char CCHAR; + + +#define FALSE 0 +#define TRUE 1 + +typedef const unsigned short *PCWSTR; + +typedef char* PCSZ; + +typedef union _LARGE_INTEGER +{ + struct + { + DWORD LowPart; + LONG HighPart; + } u; + LONGLONG QuadPart; +} LARGE_INTEGER, *PLARGE_INTEGER; + +typedef union _ULARGE_INTEGER +{ + struct + { + DWORD LowPart; + DWORD HighPart; + } u; + ULONGLONG QuadPart; +} ULARGE_INTEGER, *PULARGE_INTEGER; + +#define CONST const + +#ifdef i386 +#define STDCALL __attribute__ ((stdcall)) +#define CDECL __attribute((cdecl)) +#define CALLBACK WINAPI +#define PASCAL WINAPI +#else +#define STDCALL +#define CDECL +#define CALLBACK +#define PASCAL +#endif + +typedef struct _LIST_ENTRY { + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; +} LIST_ENTRY, *PLIST_ENTRY; + +typedef struct _SINGLE_LIST_ENTRY { + struct _SINGLE_LIST_ENTRY *Next; +} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; + +typedef DWORD STDCALL (*PTHREAD_START_ROUTINE) (LPVOID); +typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; + +typedef unsigned short *PWCHAR; + +#ifdef __i386__ + +typedef struct _FLOATING_SAVE_AREA { + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[80]; + DWORD Cr0NpxState; +} FLOATING_SAVE_AREA; + +typedef struct _CONTEXT { + DWORD ContextFlags; + + DWORD Dr0; + DWORD Dr1; + DWORD Dr2; + DWORD Dr3; + DWORD Dr6; + DWORD Dr7; + + FLOATING_SAVE_AREA FloatSave; + + DWORD SegGs; + DWORD SegFs; + DWORD SegEs; + DWORD SegDs; + + DWORD Edi; + DWORD Esi; + DWORD Ebx; + DWORD Edx; + DWORD Ecx; + DWORD Eax; + + DWORD Ebp; + DWORD Eip; + DWORD SegCs; + DWORD EFlags; + DWORD Esp; + DWORD SegSs; +} CONTEXT, *PCONTEXT, *LPCONTEXT; + +#else /* __ppc__ */ + +typedef struct + { + /* Floating point registers returned when CONTEXT_FLOATING_POINT is set */ + double Fpr0; + double Fpr1; + double Fpr2; + double Fpr3; + double Fpr4; + double Fpr5; + double Fpr6; + double Fpr7; + double Fpr8; + double Fpr9; + double Fpr10; + double Fpr11; + double Fpr12; + double Fpr13; + double Fpr14; + double Fpr15; + double Fpr16; + double Fpr17; + double Fpr18; + double Fpr19; + double Fpr20; + double Fpr21; + double Fpr22; + double Fpr23; + double Fpr24; + double Fpr25; + double Fpr26; + double Fpr27; + double Fpr28; + double Fpr29; + double Fpr30; + double Fpr31; + double Fpscr; + + /* Integer registers returned when CONTEXT_INTEGER is set. */ + DWORD Gpr0; + DWORD Gpr1; + DWORD Gpr2; + DWORD Gpr3; + DWORD Gpr4; + DWORD Gpr5; + DWORD Gpr6; + DWORD Gpr7; + DWORD Gpr8; + DWORD Gpr9; + DWORD Gpr10; + DWORD Gpr11; + DWORD Gpr12; + DWORD Gpr13; + DWORD Gpr14; + DWORD Gpr15; + DWORD Gpr16; + DWORD Gpr17; + DWORD Gpr18; + DWORD Gpr19; + DWORD Gpr20; + DWORD Gpr21; + DWORD Gpr22; + DWORD Gpr23; + DWORD Gpr24; + DWORD Gpr25; + DWORD Gpr26; + DWORD Gpr27; + DWORD Gpr28; + DWORD Gpr29; + DWORD Gpr30; + DWORD Gpr31; + + DWORD Cr; /* Condition register */ + DWORD Xer; /* Fixed point exception register */ + + /* The following are set when CONTEXT_CONTROL is set. */ + DWORD Msr; /* Machine status register */ + DWORD Iar; /* Instruction address register */ + DWORD Lr; /* Link register */ + DWORD Ctr; /* Control register */ + + /* Control which context values are returned */ + DWORD ContextFlags; + DWORD Fill[3]; + + /* Registers returned if CONTEXT_DEBUG_REGISTERS is set. */ + DWORD Dr0; /* Breakpoint Register 1 */ + DWORD Dr1; /* Breakpoint Register 2 */ + DWORD Dr2; /* Breakpoint Register 3 */ + DWORD Dr3; /* Breakpoint Register 4 */ + DWORD Dr4; /* Breakpoint Register 5 */ + DWORD Dr5; /* Breakpoint Register 6 */ + DWORD Dr6; /* Debug Status Register */ + DWORD Dr7; /* Debug Control Register */ +} CONTEXT, *PCONTEXT, *LPCONTEXT; +#endif + +typedef HANDLE *PHANDLE; + +typedef struct value_ent { + LPWSTR ve_valuename; + DWORD ve_valuelen; + DWORD ve_valueptr; + DWORD ve_type; +} WVALENT, *PWVALENT; + +#define EXCEPTION_MAXIMUM_PARAMETERS (15) + +typedef struct _EXCEPTION_RECORD { + DWORD ExceptionCode; + DWORD ExceptionFlags; + struct _EXCEPTION_RECORD *ExceptionRecord; + PVOID ExceptionAddress; + DWORD NumberParameters; + DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; +} EXCEPTION_RECORD, *PEXCEPTION_RECORD, *LPEXCEPTION_RECORD; + +typedef long *PLONG; + +typedef const void *LPCVOID; +typedef BYTE *LPBYTE; + +typedef BYTE *PBYTE; + +typedef DWORD LCID; + +typedef const char *LPCSTR; + +typedef char *LPSTR; + +typedef const unsigned short *LPCWSTR; + +typedef struct _COORD { + SHORT X; + SHORT Y; +} COORD; + +typedef struct _SMALL_RECT { + SHORT Left; + SHORT Top; + SHORT Right; + SHORT Bottom; +} SMALL_RECT, *PSMALL_RECT; + +#endif /* __INCLUDE_TYPES_H */ diff --git a/reactos/include/structs.h b/reactos/include/structs.h index e7d73dc3320..c8f6f0a3921 100644 --- a/reactos/include/structs.h +++ b/reactos/include/structs.h @@ -33,313 +33,26 @@ #ifndef _GNU_H_WINDOWS32_STRUCTURES #define _GNU_H_WINDOWS32_STRUCTURES -typedef union _LARGE_INTEGER +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct _VALENT { - struct - { - DWORD LowPart; - LONG HighPart; - } u; - LONGLONG QuadPart; -} LARGE_INTEGER, *PLARGE_INTEGER; - -typedef union _ULARGE_INTEGER -{ - struct - { - DWORD LowPart; - DWORD HighPart; - } u; - ULONGLONG QuadPart; -} ULARGE_INTEGER, *PULARGE_INTEGER; - -#include - -typedef struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink; - struct _LIST_ENTRY *Blink; -} LIST_ENTRY, *PLIST_ENTRY; - -typedef struct _PARTITION_INFORMATION { - BYTE PartitionType; - BOOLEAN BootIndicator; - BOOLEAN RecognizedPartition; - BOOLEAN RewritePartition; - LARGE_INTEGER StartingOffset; - LARGE_INTEGER PartitionLength; - LARGE_INTEGER HiddenSectors; -} PARTITION_INFORMATION; - -typedef struct _SINGLE_LIST_ENTRY { - struct _SINGLE_LIST_ENTRY *Next; -} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; - -typedef struct _CRITICAL_SECTION_DEBUG { - WORD Type; - WORD CreatorBackTraceIndex; - struct _CRITICAL_SECTION *CriticalSection; - LIST_ENTRY ProcessLocksList; - DWORD EntryCount; - DWORD ContentionCount; - DWORD Depth; - PVOID OwnerBackTrace[ 5 ]; -} CRITICAL_SECTION_DEBUG, *PCRITICAL_SECTION_DEBUG; - -typedef struct _CRITICAL_SECTION { - PCRITICAL_SECTION_DEBUG DebugInfo; - LONG LockCount; - LONG RecursionCount; - HANDLE OwningThread; - HANDLE LockSemaphore; - DWORD Reserved; -} CRITICAL_SECTION, *PCRITICAL_SECTION, *LPCRITICAL_SECTION; - -typedef struct _GENERIC_MAPPING { - ACCESS_MASK GenericRead; - ACCESS_MASK GenericWrite; - ACCESS_MASK GenericExecute; - ACCESS_MASK GenericAll; -} GENERIC_MAPPING, *PGENERIC_MAPPING; - -typedef struct _PRIVILEGE_SET { - DWORD PrivilegeCount; - DWORD Control; - LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY]; -} PRIVILEGE_SET, *PPRIVILEGE_SET, *LPPRIVILEGE_SET; - -#ifdef __i386__ - -typedef struct _FLOATING_SAVE_AREA { - DWORD ControlWord; - DWORD StatusWord; - DWORD TagWord; - DWORD ErrorOffset; - DWORD ErrorSelector; - DWORD DataOffset; - DWORD DataSelector; - BYTE RegisterArea[80]; - DWORD Cr0NpxState; -} FLOATING_SAVE_AREA; - -typedef struct _CONTEXT { - DWORD ContextFlags; - - DWORD Dr0; - DWORD Dr1; - DWORD Dr2; - DWORD Dr3; - DWORD Dr6; - DWORD Dr7; - - FLOATING_SAVE_AREA FloatSave; - - DWORD SegGs; - DWORD SegFs; - DWORD SegEs; - DWORD SegDs; - - DWORD Edi; - DWORD Esi; - DWORD Ebx; - DWORD Edx; - DWORD Ecx; - DWORD Eax; - - DWORD Ebp; - DWORD Eip; - DWORD SegCs; - DWORD EFlags; - DWORD Esp; - DWORD SegSs; -} CONTEXT, *PCONTEXT, *LPCONTEXT; - -#else /* __ppc__ */ - -typedef struct - { - /* Floating point registers returned when CONTEXT_FLOATING_POINT is set */ - double Fpr0; - double Fpr1; - double Fpr2; - double Fpr3; - double Fpr4; - double Fpr5; - double Fpr6; - double Fpr7; - double Fpr8; - double Fpr9; - double Fpr10; - double Fpr11; - double Fpr12; - double Fpr13; - double Fpr14; - double Fpr15; - double Fpr16; - double Fpr17; - double Fpr18; - double Fpr19; - double Fpr20; - double Fpr21; - double Fpr22; - double Fpr23; - double Fpr24; - double Fpr25; - double Fpr26; - double Fpr27; - double Fpr28; - double Fpr29; - double Fpr30; - double Fpr31; - double Fpscr; - - /* Integer registers returned when CONTEXT_INTEGER is set. */ - DWORD Gpr0; - DWORD Gpr1; - DWORD Gpr2; - DWORD Gpr3; - DWORD Gpr4; - DWORD Gpr5; - DWORD Gpr6; - DWORD Gpr7; - DWORD Gpr8; - DWORD Gpr9; - DWORD Gpr10; - DWORD Gpr11; - DWORD Gpr12; - DWORD Gpr13; - DWORD Gpr14; - DWORD Gpr15; - DWORD Gpr16; - DWORD Gpr17; - DWORD Gpr18; - DWORD Gpr19; - DWORD Gpr20; - DWORD Gpr21; - DWORD Gpr22; - DWORD Gpr23; - DWORD Gpr24; - DWORD Gpr25; - DWORD Gpr26; - DWORD Gpr27; - DWORD Gpr28; - DWORD Gpr29; - DWORD Gpr30; - DWORD Gpr31; - - DWORD Cr; /* Condition register */ - DWORD Xer; /* Fixed point exception register */ - - /* The following are set when CONTEXT_CONTROL is set. */ - DWORD Msr; /* Machine status register */ - DWORD Iar; /* Instruction address register */ - DWORD Lr; /* Link register */ - DWORD Ctr; /* Control register */ - - /* Control which context values are returned */ - DWORD ContextFlags; - DWORD Fill[3]; - - /* Registers returned if CONTEXT_DEBUG_REGISTERS is set. */ - DWORD Dr0; /* Breakpoint Register 1 */ - DWORD Dr1; /* Breakpoint Register 2 */ - DWORD Dr2; /* Breakpoint Register 3 */ - DWORD Dr3; /* Breakpoint Register 4 */ - DWORD Dr4; /* Breakpoint Register 5 */ - DWORD Dr5; /* Breakpoint Register 6 */ - DWORD Dr6; /* Debug Status Register */ - DWORD Dr7; /* Debug Control Register */ -} CONTEXT, *PCONTEXT, *LPCONTEXT; -#endif - - -typedef struct value_ent { - LPTSTR ve_valuename; - DWORD ve_valuelen; - DWORD ve_valueptr; - DWORD ve_type; + LPTSTR ve_valuename; + DWORD ve_valuelen; + DWORD ve_valueptr; + DWORD ve_type; } VALENT, *PVALENT; - -typedef struct _EXCEPTION_RECORD { - DWORD ExceptionCode; - DWORD ExceptionFlags; - struct _EXCEPTION_RECORD *ExceptionRecord; - PVOID ExceptionAddress; - DWORD NumberParameters; - DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; -} EXCEPTION_RECORD, *PEXCEPTION_RECORD, *LPEXCEPTION_RECORD; - -typedef struct _DRIVE_LAYOUT_INFORMATION { - DWORD PartitionCount; - DWORD Signature; - PARTITION_INFORMATION PartitionEntry[1]; -} DRIVE_LAYOUT_INFORMATION; - -typedef struct _KEY_EVENT_RECORD { - WINBOOL bKeyDown; - WORD wRepeatCount; - WORD wVirtualKeyCode; - WORD wVirtualScanCode; - union { - WCHAR UnicodeChar; - CHAR AsciiChar; - } uChar; - DWORD dwControlKeyState; -} KEY_EVENT_RECORD PACKED; - -typedef struct _COORD { - SHORT X; - SHORT Y; -} COORD; - -typedef struct _MOUSE_EVENT_RECORD { - COORD dwMousePosition; - DWORD dwButtonState; - DWORD dwControlKeyState; - DWORD dwEventFlags; -} MOUSE_EVENT_RECORD; - -typedef struct _DISK_GEOMETRY { - LARGE_INTEGER Cylinders; - MEDIA_TYPE MediaType; - DWORD TracksPerCylinder; - DWORD SectorsPerTrack; - DWORD BytesPerSector; -} DISK_GEOMETRY ; - -typedef struct _MEMORY_BASIC_INFORMATION { - PVOID BaseAddress; - PVOID AllocationBase; - DWORD AllocationProtect; - DWORD RegionSize; - DWORD State; - DWORD Protect; - DWORD Type; -} MEMORY_BASIC_INFORMATION; -typedef MEMORY_BASIC_INFORMATION *PMEMORY_BASIC_INFORMATION; - -typedef struct _SYSTEMTIME { - WORD wYear; - WORD wMonth; - WORD wDayOfWeek; - WORD wDay; - WORD wHour; - WORD wMinute; - WORD wSecond; - WORD wMilliseconds; -} SYSTEMTIME, *LPSYSTEMTIME; - -typedef struct _TIME_ZONE_INFORMATION { - LONG Bias; - WCHAR StandardName[ 32 ]; - SYSTEMTIME StandardDate; - LONG StandardBias; - WCHAR DaylightName[ 32 ]; - SYSTEMTIME DaylightDate; - LONG DaylightBias; -} TIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION; - - #ifndef WIN32_LEAN_AND_MEAN #ifdef __cplusplus @@ -904,27 +617,7 @@ typedef struct _COMSTAT { DWORD cbInQue; DWORD cbOutQue; } COMSTAT, *LPCOMSTAT; - -typedef struct _CONSOLE_CURSOR_INFO { - DWORD dwSize; - WINBOOL bVisible; -} CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO; - -typedef struct _SMALL_RECT { - SHORT Left; - SHORT Top; - SHORT Right; - SHORT Bottom; -} SMALL_RECT, *PSMALL_RECT; -typedef struct _CONSOLE_SCREEN_BUFFER_INFO { - COORD dwSize; - COORD dwCursorPosition; - WORD wAttributes; - SMALL_RECT srWindow; - COORD dwMaximumWindowSize; -} CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO ; - typedef struct tagCONVCONTEXT { UINT cb; UINT wFlags; @@ -2293,9 +1986,6 @@ typedef struct _FMS_TOOLBARLOAD { HBITMAP hBitmap; } FMS_TOOLBARLOAD; -typedef struct _FOCUS_EVENT_RECORD { - WINBOOL bSetFocus; -} FOCUS_EVENT_RECORD; typedef struct _FORM_INFO_1 { DWORD Flags; @@ -2436,29 +2126,7 @@ typedef struct _IMAGEINFO { int Unused2; RECT rcImage; } IMAGEINFO; - -typedef struct _WINDOW_BUFFER_SIZE_RECORD { - COORD dwSize; -} WINDOW_BUFFER_SIZE_RECORD; - -typedef struct _MENU_EVENT_RECORD { - UINT dwCommandId; -} MENU_EVENT_RECORD, *PMENU_EVENT_RECORD; - -typedef struct _INPUT_RECORD { - WORD EventType; - union { -#ifndef __cplus_plus - /* this will be the wrong size in c++ */ - KEY_EVENT_RECORD KeyEvent; -#endif - MOUSE_EVENT_RECORD MouseEvent; - WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent; - MENU_EVENT_RECORD MenuEvent; - FOCUS_EVENT_RECORD FocusEvent; - } Event; -} INPUT_RECORD, *PINPUT_RECORD; - + typedef struct _JOB_INFO_1 { DWORD JobId; LPTSTR pPrinterName; @@ -3764,11 +3432,6 @@ typedef struct tagSCROLLINFO { } SCROLLINFO, *LPSCROLLINFO; typedef SCROLLINFO const *LPCSCROLLINFO; -typedef struct _SECURITY_ATTRIBUTES { - DWORD nLength; - LPVOID lpSecurityDescriptor; - WINBOOL bInheritHandle; -} SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; typedef struct _selchange { NMHDR nmhdr; diff --git a/reactos/include/win32k/debug1.h b/reactos/include/win32k/debug1.h new file mode 100644 index 00000000000..f1131e288a4 --- /dev/null +++ b/reactos/include/win32k/debug1.h @@ -0,0 +1,98 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/internal/debug.h + * PURPOSE: Useful debugging macros + * PROGRAMMER: David Welch (welch@mcmail.com) + * UPDATE HISTORY: + * 28/05/98: Created + */ + +/* + * NOTE: Define NDEBUG before including this header to disable debugging + * macros + */ + +#ifndef __INTERNAL_DEBUG +#define __INTERNAL_DEBUG + +#define UNIMPLEMENTED do {DbgPrint("%s at %s:%d is unimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;); } while(0); + +/* FIXME: should probably remove this later */ +#if !defined(CHECKED) && !defined(NDEBUG) +#define CHECKED +#endif + +#ifndef NASSERT +#define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); KeBugCheck(0); } +#else +#define assert(x) +#endif + +#define DPRINT1(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); ExAllocatePool(NonPagedPool,0); } while(0); +#define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); ExAllocatePool(NonPagedPool,0); } while(0); + +extern unsigned int old_idt[256][2]; +//extern unsigned int idt; +extern unsigned int old_idt_valid; + +#ifdef __NTOSKRNL__ +//#define DPRINT_CHECKS ExAllocatePool(NonPagedPool,0); assert(old_idt_valid || (!memcmp(old_idt,KiIdt,256*2))); +//#define DPRINT_CHECKS ExAllocatePool(NonPagedPool,0); +#define DPRINT_CHECKS +#else +#define DPRINT_CHECKS +#endif + +#ifndef NDEBUG +#define OLD_DPRINT(fmt,args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(fmt,args); } while(0); +#define DPRINT(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); DPRINT_CHECKS } while(0); +#define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); ExAllocatePool(NonPagedPool,0); } while(0); +#else +//#define DPRINT(args...) do { DPRINT_CHECKS } while (0); +#define DPRINT(args...) +#define OLD_DPRINT(args...) +#define CHECKPOINT +#endif /* NDEBUG */ + +/* + * FUNCTION: Assert a maximum value for the current irql + * ARGUMENTS: + * x = Maximum irql + */ +#define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x)) +#define assert_irql(x) assert(KeGetCurrentIrql()<=(x)) + +#define HBP_EXECUTE (0) +#define HBP_WRITE (1) +#define HBP_READWRITE (3) + +#define HBP_BYTE (0) +#define HBP_WORD (1) +#define HBP_DWORD (3) + +/* + * FUNCTION: Sets a hardware breakpoint + * ARGUMENTS: + * i = breakpoint to set (0 to 3) + * addr = linear address to break on + * type = Type of access to break on + * len = length of the variable to watch + * NOTES: + * The variable to watch must be aligned to its length (i.e. a dword + * breakpoint must be aligned to a dword boundary) + * + * A fatal exception will be generated on the access to the variable. + * It is (at the moment) only really useful for catching undefined + * pointers if you know the variable effected but not the buggy + * routine. + * + * FIXME: Extend to call out to kernel debugger on breakpoint + * Add support for I/O breakpoints + * REFERENCES: See the i386 programmer manual for more details + */ +void set_breakpoint(unsigned int i, unsigned int addr, unsigned int type, + unsigned int len); + + +#endif /* __INTERNAL_DEBUG */ diff --git a/reactos/include/windows.h b/reactos/include/windows.h index 7996aa633a2..83718a8692d 100644 --- a/reactos/include/windows.h +++ b/reactos/include/windows.h @@ -84,7 +84,7 @@ using Objective-C then you must use WINBOOL for Win32 operations. */ #ifndef __OBJC__ -typedef WINBOOL BOOL; +//typedef WINBOOL BOOL; #endif /* !__OBJC__ */ /* How do we get the VM page size on NT? */ diff --git a/reactos/lib/kernel32/file/delete.c b/reactos/lib/kernel32/file/delete.c index c9487b10aba..227ecaef2a9 100644 --- a/reactos/lib/kernel32/file/delete.c +++ b/reactos/lib/kernel32/file/delete.c @@ -1,4 +1,4 @@ -/* $Id: delete.c,v 1.7 2000/06/03 14:47:32 ea Exp $ +/* $Id: delete.c,v 1.8 2000/06/29 23:35:23 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -104,7 +104,7 @@ DeleteFileW ( return FALSE; } - FileDispInfo.DeleteFile = TRUE; + FileDispInfo.DoDeleteFile = TRUE; Status = NtSetInformationFile (FileHandle, &IoStatusBlock, diff --git a/reactos/lib/kernel32/file/dir.c b/reactos/lib/kernel32/file/dir.c index bf0f76cdf08..0cc4eeadd86 100644 --- a/reactos/lib/kernel32/file/dir.c +++ b/reactos/lib/kernel32/file/dir.c @@ -1,4 +1,4 @@ -/* $Id: dir.c,v 1.26 2000/06/03 14:47:32 ea Exp $ +/* $Id: dir.c,v 1.27 2000/06/29 23:35:23 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -276,7 +276,7 @@ RemoveDirectoryW ( return FALSE; } - FileDispInfo.DeleteFile = TRUE; + FileDispInfo.DoDeleteFile = TRUE; Status = NtSetInformationFile (DirectoryHandle, &IoStatusBlock, diff --git a/reactos/lib/kernel32/file/move.c b/reactos/lib/kernel32/file/move.c index 6d0f5695bcc..26dd1cc7c88 100644 --- a/reactos/lib/kernel32/file/move.c +++ b/reactos/lib/kernel32/file/move.c @@ -1,4 +1,4 @@ -/* $Id: move.c,v 1.3 2000/03/14 23:09:23 ekohl Exp $ +/* $Id: move.c,v 1.4 2000/06/29 23:35:24 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -13,6 +13,7 @@ #include #include +#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/file/volume.c b/reactos/lib/kernel32/file/volume.c index db9b2550186..129305012bb 100644 --- a/reactos/lib/kernel32/file/volume.c +++ b/reactos/lib/kernel32/file/volume.c @@ -1,4 +1,4 @@ -/* $Id: volume.c,v 1.16 2000/06/03 14:47:32 ea Exp $ +/* $Id: volume.c,v 1.17 2000/06/29 23:35:24 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -21,6 +21,7 @@ #include #include +#include #define NDEBUG #include diff --git a/reactos/lib/kernel32/mem/section.c b/reactos/lib/kernel32/mem/section.c index ff042228b21..9792a108dea 100644 --- a/reactos/lib/kernel32/mem/section.c +++ b/reactos/lib/kernel32/mem/section.c @@ -1,4 +1,4 @@ -/* $Id: section.c,v 1.10 2000/03/15 18:30:14 ekohl Exp $ +/* $Id: section.c,v 1.11 2000/06/29 23:35:25 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -10,6 +10,7 @@ /* INCLUDES ******************************************************************/ #include +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/kernel32/misc/time.c b/reactos/lib/kernel32/misc/time.c index d27176ea564..fb7b4d379df 100644 --- a/reactos/lib/kernel32/misc/time.c +++ b/reactos/lib/kernel32/misc/time.c @@ -13,7 +13,6 @@ #include #include -#include #include #define NDEBUG diff --git a/reactos/lib/kernel32/process/cmdline.c b/reactos/lib/kernel32/process/cmdline.c index acb1d67c71d..32f3298c3bc 100644 --- a/reactos/lib/kernel32/process/cmdline.c +++ b/reactos/lib/kernel32/process/cmdline.c @@ -1,4 +1,4 @@ -/* $Id: cmdline.c,v 1.11 2000/01/26 10:07:23 dwelch Exp $ +/* $Id: cmdline.c,v 1.12 2000/06/29 23:35:26 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #define NDEBUG diff --git a/reactos/lib/kernel32/process/create.c b/reactos/lib/kernel32/process/create.c index b9aa28211c7..156416a4779 100644 --- a/reactos/lib/kernel32/process/create.c +++ b/reactos/lib/kernel32/process/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.28 2000/06/03 14:47:33 ea Exp $ +/* $Id: create.c,v 1.29 2000/06/29 23:35:26 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -17,9 +17,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/reactos/lib/kernel32/process/lib.c b/reactos/lib/kernel32/process/lib.c index 43e2016192d..a84afc738ab 100644 --- a/reactos/lib/kernel32/process/lib.c +++ b/reactos/lib/kernel32/process/lib.c @@ -1,4 +1,4 @@ -/* $Id: lib.c,v 1.6 2000/04/14 01:49:18 ekohl Exp $ +/* $Id: lib.c,v 1.7 2000/06/29 23:35:26 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -18,8 +18,8 @@ #include #include #include -#include -#include +#include +#include #include diff --git a/reactos/lib/kernel32/process/proc.c b/reactos/lib/kernel32/process/proc.c index 5292447dff1..7bbf1f430d0 100644 --- a/reactos/lib/kernel32/process/proc.c +++ b/reactos/lib/kernel32/process/proc.c @@ -1,4 +1,4 @@ -/* $Id: proc.c,v 1.32 2000/04/25 23:22:54 ea Exp $ +/* $Id: proc.c,v 1.33 2000/06/29 23:35:26 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -19,8 +19,8 @@ #include #include #include -#include -#include +#include +#include #include diff --git a/reactos/lib/kernel32/thread/thread.c b/reactos/lib/kernel32/thread/thread.c index 7d2b5b44c9c..edf949df3e0 100644 --- a/reactos/lib/kernel32/thread/thread.c +++ b/reactos/lib/kernel32/thread/thread.c @@ -1,4 +1,4 @@ -/* $Id: thread.c,v 1.15 2000/05/30 23:41:06 ea Exp $ +/* $Id: thread.c,v 1.16 2000/06/29 23:35:26 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -16,7 +16,7 @@ #include #include #include -#include +#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/csr/api.c b/reactos/lib/ntdll/csr/api.c index 2925e0061af..583c1b30db7 100644 --- a/reactos/lib/ntdll/csr/api.c +++ b/reactos/lib/ntdll/csr/api.c @@ -1,4 +1,4 @@ -/* $Id: api.c,v 1.7 2000/04/26 06:56:11 ea Exp $ +/* $Id: api.c,v 1.8 2000/06/29 23:35:27 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,7 +11,6 @@ #include #include #include -#include #include @@ -86,12 +85,8 @@ NTSTATUS STDCALL CsrClientConnectToServer(VOID) } -NTSTATUS -STDCALL -CsrSetPriorityClass ( - HANDLE hProcess, - DWORD * PriorityClass - ) +NTSTATUS STDCALL CsrSetPriorityClass (HANDLE hProcess, + DWORD * PriorityClass) { /* FIXME: call csrss to get hProcess' priority */ *PriorityClass = CSR_PRIORITY_CLASS_NORMAL; diff --git a/reactos/lib/ntdll/ldr/utils.c b/reactos/lib/ntdll/ldr/utils.c index a8e631dd40e..b68100172fd 100644 --- a/reactos/lib/ntdll/ldr/utils.c +++ b/reactos/lib/ntdll/ldr/utils.c @@ -1,4 +1,4 @@ -/* $Id: utils.c,v 1.25 2000/03/18 13:57:02 ekohl Exp $ +/* $Id: utils.c,v 1.26 2000/06/29 23:35:27 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -14,9 +14,9 @@ #include #include #include -#include #include #include +#include #ifdef DBG_NTDLL_LDR_UTILS #define NDEBUG diff --git a/reactos/lib/ntdll/main/dllmain.c b/reactos/lib/ntdll/main/dllmain.c index a4abf26888e..3b40ecaa27c 100644 --- a/reactos/lib/ntdll/main/dllmain.c +++ b/reactos/lib/ntdll/main/dllmain.c @@ -1,4 +1,4 @@ -/* $Id: dllmain.c,v 1.6 2000/01/18 12:04:45 ekohl Exp $ +/* $Id: dllmain.c,v 1.7 2000/06/29 23:35:28 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,7 +11,7 @@ #include #include #include - +#include BOOL WINAPI DllMainCRTStartup(HINSTANCE hinstDll, DWORD fdwReason, diff --git a/reactos/lib/ntdll/rtl/acl.c b/reactos/lib/ntdll/rtl/acl.c index c64591ed553..5b580550616 100644 --- a/reactos/lib/ntdll/rtl/acl.c +++ b/reactos/lib/ntdll/rtl/acl.c @@ -1,4 +1,4 @@ -/* $Id: acl.c,v 1.2 2000/04/05 01:39:41 ekohl Exp $ +/* $Id: acl.c,v 1.3 2000/06/29 23:35:28 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,7 +13,7 @@ #include -#include +#include /* FUNCTIONS ***************************************************************/ diff --git a/reactos/lib/ntdll/rtl/apc.c b/reactos/lib/ntdll/rtl/apc.c index a99d7a05ef4..99ef246c165 100644 --- a/reactos/lib/ntdll/rtl/apc.c +++ b/reactos/lib/ntdll/rtl/apc.c @@ -1,4 +1,4 @@ -/* $Id: apc.c,v 1.2 2000/06/27 19:20:43 dwelch Exp $ +/* $Id: apc.c,v 1.3 2000/06/29 23:35:29 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,8 +12,6 @@ #include #include -#include - /* FUNCTIONS ***************************************************************/ VOID STDCALL KiUserApcDispatcher(PIO_APC_ROUTINE ApcRoutine, diff --git a/reactos/lib/ntdll/rtl/callback.c b/reactos/lib/ntdll/rtl/callback.c index 98aaae21033..d9fb0b1f9a0 100644 --- a/reactos/lib/ntdll/rtl/callback.c +++ b/reactos/lib/ntdll/rtl/callback.c @@ -1,4 +1,4 @@ -/* $Id: callback.c,v 1.1 2000/05/13 13:50:57 dwelch Exp $ +/* $Id: callback.c,v 1.2 2000/06/29 23:35:29 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,8 @@ #include #include -#include +#include -#include /* TYPES *********************************************************************/ diff --git a/reactos/lib/ntdll/rtl/critical.c b/reactos/lib/ntdll/rtl/critical.c index befbc7af17a..9480e6aabb2 100644 --- a/reactos/lib/ntdll/rtl/critical.c +++ b/reactos/lib/ntdll/rtl/critical.c @@ -1,4 +1,4 @@ -/* $Id: critical.c,v 1.6 2000/04/20 05:29:27 phreak Exp $ +/* $Id: critical.c,v 1.7 2000/06/29 23:35:29 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -59,7 +59,7 @@ InterlockedIncrement(PLONG Addend) LONG STDCALL -InterlockedDecrement(LPLONG lpAddend) +InterlockedDecrement(PLONG lpAddend) { long ret; __asm__ diff --git a/reactos/lib/ntdll/rtl/env.c b/reactos/lib/ntdll/rtl/env.c index 2158e1250eb..ce1ca6b8d19 100644 --- a/reactos/lib/ntdll/rtl/env.c +++ b/reactos/lib/ntdll/rtl/env.c @@ -1,4 +1,4 @@ -/* $Id: env.c,v 1.9 2000/02/27 15:45:57 ekohl Exp $ +/* $Id: env.c,v 1.10 2000/06/29 23:35:29 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -13,7 +13,7 @@ #include #include -#include +#include #include #define NDEBUG diff --git a/reactos/lib/ntdll/rtl/error.c b/reactos/lib/ntdll/rtl/error.c index c4e71f51fb0..5b790dae0a0 100644 --- a/reactos/lib/ntdll/rtl/error.c +++ b/reactos/lib/ntdll/rtl/error.c @@ -1,4 +1,4 @@ -/* $Id: error.c,v 1.5 2000/05/30 22:25:10 ea Exp $ +/* $Id: error.c,v 1.6 2000/06/29 23:35:29 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -14,6 +14,7 @@ /* INCLUDES *****************************************************************/ #include +#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/rtl/heap.c b/reactos/lib/ntdll/rtl/heap.c index 65766ff9fe2..1d3927e4778 100644 --- a/reactos/lib/ntdll/rtl/heap.c +++ b/reactos/lib/ntdll/rtl/heap.c @@ -8,6 +8,8 @@ #include #include #include +#include +#include #define NDEBUG #include @@ -857,7 +859,7 @@ HANDLE STDCALL RtlCreateHeap(ULONG flags, * TRUE: Success * FALSE: Failure */ -BOOL WINAPI RtlDestroyHeap( +BOOL STDCALL RtlDestroyHeap( HANDLE heap /* [in] Handle of heap */ ) { HEAP *heapPtr = HEAP_GetPtr( heap ); @@ -884,7 +886,7 @@ BOOL WINAPI RtlDestroyHeap( * Pointer to allocated memory block * NULL: Failure */ -PVOID WINAPI RtlAllocateHeap( +PVOID STDCALL RtlAllocateHeap( HANDLE heap, /* [in] Handle of private heap block */ ULONG flags, /* [in] Heap allocation control flags */ ULONG size /* [in] Number of bytes to allocate */ @@ -1003,7 +1005,7 @@ BOOLEAN STDCALL RtlFreeHeap( * Renamed RtlReAllocateHeap as in NT */ LPVOID -WINAPI +STDCALL RtlReAllocateHeap ( HANDLE heap, /* [in] Handle of heap block */ DWORD flags, /* [in] Heap reallocation flags */ @@ -1125,7 +1127,7 @@ RtlReAllocateHeap ( /*********************************************************************** * HeapCompact (KERNEL32.335) */ -DWORD WINAPI RtlCompactHeap( HANDLE heap, DWORD flags ) +DWORD STDCALL RtlCompactHeap( HANDLE heap, DWORD flags ) { return 0; } @@ -1139,7 +1141,7 @@ DWORD WINAPI RtlCompactHeap( HANDLE heap, DWORD flags ) * TRUE: Success * FALSE: Failure */ -BOOL WINAPI RtlLockHeap( +BOOL STDCALL RtlLockHeap( HANDLE heap /* [in] Handle of heap to lock for exclusive access */ ) { HEAP *heapPtr = HEAP_GetPtr( heap ); @@ -1157,7 +1159,7 @@ BOOL WINAPI RtlLockHeap( * TRUE: Success * FALSE: Failure */ -BOOL WINAPI RtlUnlockHeap( +BOOL STDCALL RtlUnlockHeap( HANDLE heap /* [in] Handle to the heap to unlock */ ) { HEAP *heapPtr = HEAP_GetPtr( heap ); @@ -1173,7 +1175,7 @@ BOOL WINAPI RtlUnlockHeap( * Size in bytes of allocated memory * 0: Failure */ -DWORD WINAPI RtlSizeHeap( +DWORD STDCALL RtlSizeHeap( HANDLE heap, /* [in] Handle of heap */ DWORD flags, /* [in] Heap size control flags */ LPVOID ptr /* [in] Address of memory to return size for */ @@ -1214,7 +1216,7 @@ DWORD WINAPI RtlSizeHeap( * TRUE: Success * FALSE: Failure */ -BOOL WINAPI RtlValidateHeap( +BOOL STDCALL RtlValidateHeap( HANDLE heap, /* [in] Handle to the heap */ DWORD flags, /* [in] Bit flags that control access during operation */ PVOID block /* [in] Optional pointer to memory block to validate */ @@ -1266,7 +1268,7 @@ BOOL WINAPI RtlValidateHeap( return TRUE; } -HANDLE WINAPI RtlGetProcessHeap(VOID) +HANDLE STDCALL RtlGetProcessHeap(VOID) { DPRINT("RtlGetProcessHeap()\n"); return (HANDLE)NtCurrentPeb()->ProcessHeap; @@ -1286,7 +1288,7 @@ RtlpInitProcessHeaps (PPEB Peb) NTSTATUS STDCALL RtlEnumProcessHeaps ( - DWORD WINAPI(*func)(void*,LONG), + DWORD STDCALL(*func)(void*,LONG), LONG lParam ) { diff --git a/reactos/lib/ntdll/rtl/luid.c b/reactos/lib/ntdll/rtl/luid.c index 6f59a1db672..afea0bb90d6 100644 --- a/reactos/lib/ntdll/rtl/luid.c +++ b/reactos/lib/ntdll/rtl/luid.c @@ -1,4 +1,4 @@ -/* $Id: luid.c,v 1.1 2000/04/15 23:10:41 ekohl Exp $ +/* $Id: luid.c,v 1.2 2000/06/29 23:35:31 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,8 +13,6 @@ #include -#include - /* FUNCTIONS *****************************************************************/ VOID diff --git a/reactos/lib/ntdll/rtl/mem.c b/reactos/lib/ntdll/rtl/mem.c index b5ce97262a7..b3887f91bc3 100644 --- a/reactos/lib/ntdll/rtl/mem.c +++ b/reactos/lib/ntdll/rtl/mem.c @@ -1,4 +1,4 @@ -/* $Id: mem.c,v 1.8 2000/03/09 00:14:10 ekohl Exp $ +/* $Id: mem.c,v 1.9 2000/06/29 23:35:31 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,10 +13,6 @@ #include #include -#include - -#define NDEBUG -#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/ppb.c b/reactos/lib/ntdll/rtl/ppb.c index 13073ac7a87..69fdc1d5e65 100644 --- a/reactos/lib/ntdll/rtl/ppb.c +++ b/reactos/lib/ntdll/rtl/ppb.c @@ -1,4 +1,4 @@ -/* $Id: ppb.c,v 1.6 2000/03/22 18:35:51 dwelch Exp $ +/* $Id: ppb.c,v 1.7 2000/06/29 23:35:31 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/reactos/lib/ntdll/rtl/process.c b/reactos/lib/ntdll/rtl/process.c index b8635a25830..c219df2d9fb 100644 --- a/reactos/lib/ntdll/rtl/process.c +++ b/reactos/lib/ntdll/rtl/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.18 2000/03/22 18:35:51 dwelch Exp $ +/* $Id: process.c,v 1.19 2000/06/29 23:35:31 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,9 +12,9 @@ /* INCLUDES ****************************************************************/ #include -#include +#include #include -#include +#include #include #include @@ -290,7 +290,7 @@ RtlCreateUserProcess ( PRTL_USER_PROCESS_PARAMETERS Ppb, // verified PSECURITY_DESCRIPTOR ProcessSd, PSECURITY_DESCRIPTOR ThreadSd, - WINBOOL bInheritHandles, + BOOL bInheritHandles, DWORD dwCreationFlags, ULONG Unknown8, ULONG Unknown9, diff --git a/reactos/lib/ntdll/rtl/sd.c b/reactos/lib/ntdll/rtl/sd.c index 638e0545c17..0a4ec64ed94 100644 --- a/reactos/lib/ntdll/rtl/sd.c +++ b/reactos/lib/ntdll/rtl/sd.c @@ -1,4 +1,4 @@ -/* $Id: sd.c,v 1.3 2000/04/06 02:29:16 ekohl Exp $ +/* $Id: sd.c,v 1.4 2000/06/29 23:35:32 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -402,15 +402,15 @@ STDCALL RtlSelfRelativeToAbsoluteSD ( PSECURITY_DESCRIPTOR RelSD, PSECURITY_DESCRIPTOR AbsSD, - LPDWORD AbsSDSize, + PDWORD AbsSDSize, PACL Dacl, - LPDWORD DaclSize, + PDWORD DaclSize, PACL Sacl, - LPDWORD SaclSize, + PDWORD SaclSize, PSID Owner, - LPDWORD OwnerSize, + PDWORD OwnerSize, PSID Group, - LPDWORD GroupSize + PDWORD GroupSize ) { UNIMPLEMENTED; diff --git a/reactos/lib/ntdll/rtl/thread.c b/reactos/lib/ntdll/rtl/thread.c index 8895c024166..c1d7651b1eb 100644 --- a/reactos/lib/ntdll/rtl/thread.c +++ b/reactos/lib/ntdll/rtl/thread.c @@ -12,8 +12,8 @@ /* INCLUDES *****************************************************************/ #include -#include -#include +#include +#include //#include #include diff --git a/reactos/lib/ntdll/rtl/time.c b/reactos/lib/ntdll/rtl/time.c index d08e66b2a83..da0bc1323e9 100644 --- a/reactos/lib/ntdll/rtl/time.c +++ b/reactos/lib/ntdll/rtl/time.c @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.6 2000/04/26 06:56:12 ea Exp $ +/* $Id: time.c,v 1.7 2000/06/29 23:35:32 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -15,8 +15,6 @@ #include #include -#include - #define TICKSPERSEC 10000000 #define TICKSPERMSEC 10000 #define SECSPERDAY 86400 diff --git a/reactos/lib/ntdll/rtl/unicode.c b/reactos/lib/ntdll/rtl/unicode.c index cf28abadd0f..dab4adc2acf 100644 --- a/reactos/lib/ntdll/rtl/unicode.c +++ b/reactos/lib/ntdll/rtl/unicode.c @@ -1,4 +1,4 @@ -/* $Id: unicode.c,v 1.15 2000/04/15 23:10:41 ekohl Exp $ +/* $Id: unicode.c,v 1.16 2000/06/29 23:35:32 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,10 +13,7 @@ #include //#include #include - -#define NDEBUG -#include - +#include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/cm/registry.c b/reactos/ntoskrnl/cm/registry.c index 844ea78d680..99022455b90 100644 --- a/reactos/ntoskrnl/cm/registry.c +++ b/reactos/ntoskrnl/cm/registry.c @@ -1,4 +1,4 @@ -/* $Id: registry.c,v 1.22 1999/12/09 02:45:05 rex Exp $ +/* $Id: registry.c,v 1.23 2000/06/29 23:35:33 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -1199,7 +1199,7 @@ NTSTATUS STDCALL NtQueryMultipleValueKey ( IN HANDLE KeyHandle, - IN PVALENT ListOfValuesToQuery, + IN PWVALENT ListOfValuesToQuery, IN ULONG NumberOfItems, OUT PVOID MultipleValueInformation, IN ULONG Length, diff --git a/reactos/ntoskrnl/ex/napi.c b/reactos/ntoskrnl/ex/napi.c index b62848cb26b..fc79e260a5f 100644 --- a/reactos/ntoskrnl/ex/napi.c +++ b/reactos/ntoskrnl/ex/napi.c @@ -14,7 +14,7 @@ /* GLOBALS ******************************************************************/ -#include +#include #include /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/hal/x86/bios32.c b/reactos/ntoskrnl/hal/x86/bios32.c index a449ed3d67c..2f265a33387 100644 --- a/reactos/ntoskrnl/hal/x86/bios32.c +++ b/reactos/ntoskrnl/hal/x86/bios32.c @@ -20,6 +20,7 @@ #include #include #include +#include /* TYPES ******************************************************************/ diff --git a/reactos/ntoskrnl/hal/x86/irq.c b/reactos/ntoskrnl/hal/x86/irq.c index 06f030d32c4..d16b7a84e1c 100644 --- a/reactos/ntoskrnl/hal/x86/irq.c +++ b/reactos/ntoskrnl/hal/x86/irq.c @@ -1,4 +1,4 @@ -/* $Id: irq.c,v 1.13 2000/06/12 14:53:38 ekohl Exp $ +/* $Id: irq.c,v 1.14 2000/06/29 23:35:34 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -40,22 +39,22 @@ #define NR_IRQS (16) #define IRQ_BASE (0x40) -asmlinkage void irq_handler_0(void); -asmlinkage void irq_handler_1(void); -asmlinkage void irq_handler_2(void); -asmlinkage void irq_handler_3(void); -asmlinkage void irq_handler_4(void); -asmlinkage void irq_handler_5(void); -asmlinkage void irq_handler_6(void); -asmlinkage void irq_handler_7(void); -asmlinkage void irq_handler_8(void); -asmlinkage void irq_handler_9(void); -asmlinkage void irq_handler_10(void); -asmlinkage void irq_handler_11(void); -asmlinkage void irq_handler_12(void); -asmlinkage void irq_handler_13(void); -asmlinkage void irq_handler_14(void); -asmlinkage void irq_handler_15(void); + void irq_handler_0(void); + void irq_handler_1(void); + void irq_handler_2(void); + void irq_handler_3(void); + void irq_handler_4(void); + void irq_handler_5(void); + void irq_handler_6(void); + void irq_handler_7(void); + void irq_handler_8(void); + void irq_handler_9(void); + void irq_handler_10(void); + void irq_handler_11(void); + void irq_handler_12(void); + void irq_handler_13(void); + void irq_handler_14(void); + void irq_handler_15(void); static unsigned int irq_handler[NR_IRQS]= { @@ -92,7 +91,7 @@ static KSPIN_LOCK isr_table_lock = {0,}; #define PRESENT (0x8000) #define I486_INTERRUPT_GATE (0xe00) -asmlinkage + VOID HalpDispatchInterrupt (ULONG irq) /* diff --git a/reactos/ntoskrnl/hal/x86/pci.c b/reactos/ntoskrnl/hal/x86/pci.c index 66675ce48c8..e227e06e567 100644 --- a/reactos/ntoskrnl/hal/x86/pci.c +++ b/reactos/ntoskrnl/hal/x86/pci.c @@ -15,6 +15,7 @@ /* INCLUDES ***************************************************************/ #include +#include /* FUNCTIONS **************************************************************/ diff --git a/reactos/include/internal/bitops.h b/reactos/ntoskrnl/include/internal/bitops.h similarity index 100% rename from reactos/include/internal/bitops.h rename to reactos/ntoskrnl/include/internal/bitops.h diff --git a/reactos/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h similarity index 74% rename from reactos/include/internal/cc.h rename to reactos/ntoskrnl/include/internal/cc.h index b28ffd93867..8750e29feef 100644 --- a/reactos/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -1,6 +1,6 @@ #ifndef __INCLUDE_INTERNAL_CC_H #define __INCLUDE_INTERNAL_CCS_H -/* $Id: cc.h,v 1.1 2000/03/05 19:17:39 ea Exp $ */ +/* $Id: cc.h,v 1.1 2000/06/29 23:35:36 dwelch Exp $ */ VOID STDCALL CcMdlReadCompleteDev ( diff --git a/reactos/include/internal/ctype.h b/reactos/ntoskrnl/include/internal/ctype.h similarity index 100% rename from reactos/include/internal/ctype.h rename to reactos/ntoskrnl/include/internal/ctype.h diff --git a/reactos/include/internal/dbg.h b/reactos/ntoskrnl/include/internal/dbg.h similarity index 100% rename from reactos/include/internal/dbg.h rename to reactos/ntoskrnl/include/internal/dbg.h diff --git a/reactos/include/internal/debug.h b/reactos/ntoskrnl/include/internal/debug.h similarity index 100% rename from reactos/include/internal/debug.h rename to reactos/ntoskrnl/include/internal/debug.h diff --git a/reactos/include/internal/dma.h b/reactos/ntoskrnl/include/internal/dma.h similarity index 99% rename from reactos/include/internal/dma.h rename to reactos/ntoskrnl/include/internal/dma.h index 4aa0f1762c1..9c0dcea2eb1 100644 --- a/reactos/include/internal/dma.h +++ b/reactos/ntoskrnl/include/internal/dma.h @@ -1,4 +1,4 @@ -/* $Id: dma.h,v 1.4 1998/11/29 19:39:40 rex Exp $ +/* $Id: dma.h,v 1.1 2000/06/29 23:35:36 dwelch Exp $ * linux/include/asm/dma.h: Defines for using and allocating dma channels. * Written by Hennus Bergman, 1992. * High DMA channel support & info by Hannu Savolainen diff --git a/reactos/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h similarity index 74% rename from reactos/include/internal/ex.h rename to reactos/ntoskrnl/include/internal/ex.h index 239b208e228..30f0f56a27e 100644 --- a/reactos/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -5,20 +5,13 @@ #ifndef _INCLUDE_INTERNAL_EXECUTIVE_H #define _INCLUDE_INTERNAL_EXECUTIVE_H - #include +#include /* GLOBAL VARIABLES *********************************************************/ TIME_ZONE_INFORMATION SystemTimeZoneInfo; - -/* INTERNAL EXECUTIVE FUNCTIONS *********************************************/ - -VOID ExUnmapPage(PVOID Addr); -PVOID ExAllocatePage(VOID); - - /* INITIALIZATION FUNCTIONS *************************************************/ VOID ExInit (VOID); @@ -27,5 +20,4 @@ VOID ExInitTimeZoneInfo (VOID); #endif /* _INCLUDE_INTERNAL_EXECUTIVE_H */ -/*EOF */ diff --git a/reactos/include/internal/hal.h b/reactos/ntoskrnl/include/internal/hal.h similarity index 100% rename from reactos/include/internal/hal.h rename to reactos/ntoskrnl/include/internal/hal.h diff --git a/reactos/include/internal/hal/io.h b/reactos/ntoskrnl/include/internal/hal/io.h similarity index 100% rename from reactos/include/internal/hal/io.h rename to reactos/ntoskrnl/include/internal/hal/io.h diff --git a/reactos/ntoskrnl/include/internal/hal/irq.h b/reactos/ntoskrnl/include/internal/hal/irq.h new file mode 100644 index 00000000000..db7ef233785 --- /dev/null +++ b/reactos/ntoskrnl/include/internal/hal/irq.h @@ -0,0 +1,7 @@ +/* + * PURPOSE: The number of device specific level levels + */ +#define NR_DEVICE_SPECIFIC_LEVELS (16) + + + diff --git a/reactos/include/internal/hal/page.h b/reactos/ntoskrnl/include/internal/hal/page.h similarity index 100% rename from reactos/include/internal/hal/page.h rename to reactos/ntoskrnl/include/internal/hal/page.h diff --git a/reactos/include/internal/hal/segment.h b/reactos/ntoskrnl/include/internal/hal/segment.h similarity index 100% rename from reactos/include/internal/hal/segment.h rename to reactos/ntoskrnl/include/internal/hal/segment.h diff --git a/reactos/include/internal/halio.h b/reactos/ntoskrnl/include/internal/halio.h similarity index 100% rename from reactos/include/internal/halio.h rename to reactos/ntoskrnl/include/internal/halio.h diff --git a/reactos/ntoskrnl/include/internal/i386/hal.h b/reactos/ntoskrnl/include/internal/i386/hal.h new file mode 100644 index 00000000000..d510189c997 --- /dev/null +++ b/reactos/ntoskrnl/include/internal/i386/hal.h @@ -0,0 +1,48 @@ +/* + * + */ + +#ifndef __INTERNAL_HAL_HAL_H +#define __INTERNAL_HAL_HAL_H + +#include +#include + +/* + * FUNCTION: Probes for a PCI bus + * RETURNS: True if found + */ +BOOL HalPciProbe(void); + +/* + * FUNCTION: Probes for a BIOS32 extension + */ +VOID Hal_bios32_probe(VOID); + +/* + * FUNCTION: Determines if a a bios32 service is present + */ +BOOLEAN Hal_bios32_is_service_present(ULONG service); + +VOID HalInitializeDisplay (boot_param *bp); +VOID HalResetDisplay (VOID); + +VOID +HalpInitBusHandlers (VOID); + +/* udelay.c */ +VOID HalpCalibrateStallExecution(VOID); + +/* irq.c */ +VOID HalpDispatchInterrupt (ULONG irq); +VOID HalpInitIRQs (VOID); + +BOOLEAN +STDCALL +HalInitSystem ( + ULONG Phase, + boot_param *bp + ); + + +#endif /* __INTERNAL_HAL_HAL_H */ diff --git a/reactos/include/internal/i386/io.h b/reactos/ntoskrnl/include/internal/i386/io.h similarity index 100% rename from reactos/include/internal/i386/io.h rename to reactos/ntoskrnl/include/internal/i386/io.h diff --git a/reactos/include/internal/i386/mmhal.h b/reactos/ntoskrnl/include/internal/i386/mmhal.h similarity index 100% rename from reactos/include/internal/i386/mmhal.h rename to reactos/ntoskrnl/include/internal/i386/mmhal.h diff --git a/reactos/ntoskrnl/include/internal/i386/segment.h b/reactos/ntoskrnl/include/internal/i386/segment.h new file mode 100644 index 00000000000..dc8d1eb2ed3 --- /dev/null +++ b/reactos/ntoskrnl/include/internal/i386/segment.h @@ -0,0 +1,353 @@ +#ifndef _ASM_SEGMENT_H +#define _ASM_SEGMENT_H + +#define KERNEL_CS (0x8) +#define KERNEL_DS (0x10) +#define USER_CS (0x18 + 0x3) +#define USER_DS (0x20 + 0x3) +#define RESERVED_FOR_TSS (0x28) +#define PCR_SELECTOR (0x30) +#define TEB_SELECTOR (0x38 + 0x3) + +//#define USER_CS (0x8+0x3) +//#define USER_DS (0x10+0x3) +//#define ZERO_DS 0x18 +//#define KERNEL_CS 0x20 +//#define KERNEL_DS 0x28 + +#ifndef __ASSEMBLY__ + +/* + * Uh, these should become the main single-value transfer routines.. + * They automatically use the right size if we just have the right + * pointer type.. + */ +#define put_user(x,ptr) __put_user((unsigned long)(x),(ptr),sizeof(*(ptr))) +#define get_user(ptr) ((__typeof__(*(ptr)))__get_user((ptr),sizeof(*(ptr)))) + +/* + * This is a silly but good way to make sure that + * the __put_user function is indeed always optimized, + * and that we use the correct sizes.. + */ +extern int bad_user_access_length(void); + +/* + * dummy pointer type structure.. gcc won't try to do something strange + * this way.. + */ +struct __segment_dummy { unsigned long a[100]; }; +#define __sd(x) ((struct __segment_dummy *) (x)) +#define __const_sd(x) ((const struct __segment_dummy *) (x)) + +static inline void __put_user(unsigned long x, void * y, int size) +{ + switch (size) { + case 1: + __asm__ ("movb %b1,%%fs:%0" + :"=m" (*__sd(y)) + :"iq" ((unsigned char) x), "m" (*__sd(y))); + break; + case 2: + __asm__ ("movw %w1,%%fs:%0" + :"=m" (*__sd(y)) + :"ir" ((unsigned short) x), "m" (*__sd(y))); + break; + case 4: + __asm__ ("movl %1,%%fs:%0" + :"=m" (*__sd(y)) + :"ir" (x), "m" (*__sd(y))); + break; + default: + bad_user_access_length(); + } +} + +static inline unsigned long __get_user(const void * y, int size) +{ + unsigned long result; + + switch (size) { + case 1: + __asm__ ("movb %%fs:%1,%b0" + :"=q" (result) + :"m" (*__const_sd(y))); + return (unsigned char) result; + case 2: + __asm__ ("movw %%fs:%1,%w0" + :"=r" (result) + :"m" (*__const_sd(y))); + return (unsigned short) result; + case 4: + __asm__ ("movl %%fs:%1,%0" + :"=r" (result) + :"m" (*__const_sd(y))); + return result; + default: + return bad_user_access_length(); + } +} + +static inline void __generic_memcpy_tofs(void * to, const void * from, unsigned long n) +{ + __asm__ volatile + (" cld + push %%es + push %%fs + cmpl $3,%0 + pop %%es + jbe 1f + movl %%edi,%%ecx + negl %%ecx + andl $3,%%ecx + subl %%ecx,%0 + rep; movsb + movl %0,%%ecx + shrl $2,%%ecx + rep; movsl + andl $3,%0 + 1: movl %0,%%ecx + rep; movsb + pop %%es" + :"=abd" (n) + :"0" (n),"D" ((long) to),"S" ((long) from) + :"cx","di","si"); +} + +static inline void __constant_memcpy_tofs(void * to, const void * from, unsigned long n) +{ + switch (n) { + case 0: + return; + case 1: + __put_user(*(const char *) from, (char *) to, 1); + return; + case 2: + __put_user(*(const short *) from, (short *) to, 2); + return; + case 3: + __put_user(*(const short *) from, (short *) to, 2); + __put_user(*(2+(const char *) from), 2+(char *) to, 1); + return; + case 4: + __put_user(*(const int *) from, (int *) to, 4); + return; + case 8: + __put_user(*(const int *) from, (int *) to, 4); + __put_user(*(1+(const int *) from), 1+(int *) to, 4); + return; + case 12: + __put_user(*(const int *) from, (int *) to, 4); + __put_user(*(1+(const int *) from), 1+(int *) to, 4); + __put_user(*(2+(const int *) from), 2+(int *) to, 4); + return; + case 16: + __put_user(*(const int *) from, (int *) to, 4); + __put_user(*(1+(const int *) from), 1+(int *) to, 4); + __put_user(*(2+(const int *) from), 2+(int *) to, 4); + __put_user(*(3+(const int *) from), 3+(int *) to, 4); + return; + } +#define COMMON(x) \ +__asm__("cld\n\t" \ + "push %%es\n\t" \ + "push %%fs\n\t" \ + "pop %%es\n\t" \ + "rep ; movsl\n\t" \ + x \ + "pop %%es" \ + : /* no outputs */ \ + :"c" (n/4),"D" ((long) to),"S" ((long) from) \ + :"cx","di","si") + + switch (n % 4) { + case 0: + COMMON(""); + return; + case 1: + COMMON("movsb\n\t"); + return; + case 2: + COMMON("movsw\n\t"); + return; + case 3: + COMMON("movsw\n\tmovsb\n\t"); + return; + } +#undef COMMON +} + +static inline void __generic_memcpy_fromfs(void * to, const void * from, unsigned long n) +{ + __asm__ volatile + (" cld + cmpl $3,%0 + jbe 1f + movl %%edi,%%ecx + negl %%ecx + andl $3,%%ecx + subl %%ecx,%0 + fs; rep; movsb + movl %0,%%ecx + shrl $2,%%ecx + fs; rep; movsl + andl $3,%0 + 1: movl %0,%%ecx + fs; rep; movsb" + :"=abd" (n) + :"0" (n),"D" ((long) to),"S" ((long) from) + :"cx","di","si", "memory"); +} + +static inline void __constant_memcpy_fromfs(void * to, const void * from, unsigned long n) +{ + switch (n) { + case 0: + return; + case 1: + *(char *)to = __get_user((const char *) from, 1); + return; + case 2: + *(short *)to = __get_user((const short *) from, 2); + return; + case 3: + *(short *) to = __get_user((const short *) from, 2); + *((char *) to + 2) = __get_user(2+(const char *) from, 1); + return; + case 4: + *(int *) to = __get_user((const int *) from, 4); + return; + case 8: + *(int *) to = __get_user((const int *) from, 4); + *(1+(int *) to) = __get_user(1+(const int *) from, 4); + return; + case 12: + *(int *) to = __get_user((const int *) from, 4); + *(1+(int *) to) = __get_user(1+(const int *) from, 4); + *(2+(int *) to) = __get_user(2+(const int *) from, 4); + return; + case 16: + *(int *) to = __get_user((const int *) from, 4); + *(1+(int *) to) = __get_user(1+(const int *) from, 4); + *(2+(int *) to) = __get_user(2+(const int *) from, 4); + *(3+(int *) to) = __get_user(3+(const int *) from, 4); + return; + } +#define COMMON(x) \ +__asm__("cld\n\t" \ + "rep ; fs ; movsl\n\t" \ + x \ + : /* no outputs */ \ + :"c" (n/4),"D" ((long) to),"S" ((long) from) \ + :"cx","di","si","memory") + + switch (n % 4) { + case 0: + COMMON(""); + return; + case 1: + COMMON("fs ; movsb"); + return; + case 2: + COMMON("fs ; movsw"); + return; + case 3: + COMMON("fs ; movsw\n\tfs ; movsb"); + return; + } +#undef COMMON +} + +#define memcpy_fromfs(to, from, n) \ +(__builtin_constant_p(n) ? \ + __constant_memcpy_fromfs((to),(from),(n)) : \ + __generic_memcpy_fromfs((to),(from),(n))) + +#define memcpy_tofs(to, from, n) \ +(__builtin_constant_p(n) ? \ + __constant_memcpy_tofs((to),(from),(n)) : \ + __generic_memcpy_tofs((to),(from),(n))) + +/* + * These are deprecated.. + * + * Use "put_user()" and "get_user()" with the proper pointer types instead. + */ + +#define get_fs_byte(addr) __get_user((const unsigned char *)(addr),1) +#define get_fs_word(addr) __get_user((const unsigned short *)(addr),2) +#define get_fs_long(addr) __get_user((const unsigned int *)(addr),4) + +#define put_fs_byte(x,addr) __put_user((x),(unsigned char *)(addr),1) +#define put_fs_word(x,addr) __put_user((x),(unsigned short *)(addr),2) +#define put_fs_long(x,addr) __put_user((x),(unsigned int *)(addr),4) + +#ifdef WE_REALLY_WANT_TO_USE_A_BROKEN_INTERFACE + +static inline unsigned short get_user_word(const short *addr) +{ + return __get_user(addr, 2); +} + +static inline unsigned char get_user_byte(const char * addr) +{ + return __get_user(addr,1); +} + +static inline unsigned long get_user_long(const int *addr) +{ + return __get_user(addr, 4); +} + +static inline void put_user_byte(char val,char *addr) +{ + __put_user(val, addr, 1); +} + +static inline void put_user_word(short val,short * addr) +{ + __put_user(val, addr, 2); +} + +static inline void put_user_long(unsigned long val,int * addr) +{ + __put_user(val, addr, 4); +} + +#endif + +/* + * Someone who knows GNU asm better than I should double check the following. + * It seems to work, but I don't know if I'm doing something subtly wrong. + * --- TYT, 11/24/91 + * [ nothing wrong here, Linus: I just changed the ax to be any reg ] + */ + +static inline unsigned long get_fs(void) +{ + unsigned long _v; + __asm__("mov %%fs,%w0":"=r" (_v):"0" (0)); + return _v; +} + +static inline unsigned long get_ds(void) +{ + unsigned long _v; + __asm__("mov %%ds,%w0":"=r" (_v):"0" (0)); + return _v; +} + +static inline void set_fs(unsigned long val) +{ + __asm__ __volatile__("mov %w0,%%fs": /* no output */ :"r" (val)); +} + +static inline void set_ds(unsigned long val) +{ + __asm__ __volatile__("mov %w0,%%ds": /* no output */ :"r" (val)); +} + + +#endif /* __ASSEMBLY__ */ + +#endif /* _ASM_SEGMENT_H */ diff --git a/reactos/include/internal/i386/string.h b/reactos/ntoskrnl/include/internal/i386/string.h similarity index 100% rename from reactos/include/internal/i386/string.h rename to reactos/ntoskrnl/include/internal/i386/string.h diff --git a/reactos/include/internal/id.h b/reactos/ntoskrnl/include/internal/id.h similarity index 100% rename from reactos/include/internal/id.h rename to reactos/ntoskrnl/include/internal/id.h diff --git a/reactos/include/internal/ifs.h b/reactos/ntoskrnl/include/internal/ifs.h similarity index 71% rename from reactos/include/internal/ifs.h rename to reactos/ntoskrnl/include/internal/ifs.h index 45370e4a289..0f03cd0c2dd 100644 --- a/reactos/include/internal/ifs.h +++ b/reactos/ntoskrnl/include/internal/ifs.h @@ -1,6 +1,6 @@ #ifndef __INCLUDE_INTERNAL_IFS_H #define __INCLUDE_INTERNAL_IFS_H -/* $Id: ifs.h,v 1.1 2000/03/01 22:52:27 ea Exp $ */ +/* $Id: ifs.h,v 1.1 2000/06/29 23:35:36 dwelch Exp $ */ /* Look for "FSrt" in mem view */ #define IFS_POOL_TAG 0x74725346 diff --git a/reactos/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h similarity index 97% rename from reactos/include/internal/io.h rename to reactos/ntoskrnl/include/internal/io.h index 0da009a891e..f6f3c09c5db 100644 --- a/reactos/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -1,4 +1,4 @@ -/* $Id: io.h,v 1.11 2000/05/09 16:13:07 ekohl Exp $ +/* $Id: io.h,v 1.1 2000/06/29 23:35:36 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel diff --git a/reactos/include/internal/kd.h b/reactos/ntoskrnl/include/internal/kd.h similarity index 81% rename from reactos/include/internal/kd.h rename to reactos/ntoskrnl/include/internal/kd.h index c3470b8c01f..6226f297bdc 100644 --- a/reactos/include/internal/kd.h +++ b/reactos/ntoskrnl/include/internal/kd.h @@ -1,4 +1,4 @@ -/* $Id: kd.h,v 1.1 2000/01/17 21:00:53 ekohl Exp $ +/* $Id: kd.h,v 1.1 2000/06/29 23:35:36 dwelch Exp $ * * kernel debugger prototypes */ diff --git a/reactos/include/internal/ke.h b/reactos/ntoskrnl/include/internal/ke.h similarity index 96% rename from reactos/include/internal/ke.h rename to reactos/ntoskrnl/include/internal/ke.h index 71da6429835..bbaab9cdce1 100644 --- a/reactos/include/internal/ke.h +++ b/reactos/ntoskrnl/include/internal/ke.h @@ -7,10 +7,8 @@ /* INCLUDES *****************************************************************/ -#include #include -#include #include /* INTERNAL KERNEL FUNCTIONS ************************************************/ diff --git a/reactos/include/internal/ldr.h b/reactos/ntoskrnl/include/internal/ldr.h similarity index 100% rename from reactos/include/internal/ldr.h rename to reactos/ntoskrnl/include/internal/ldr.h diff --git a/reactos/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h similarity index 95% rename from reactos/include/internal/mm.h rename to reactos/ntoskrnl/include/internal/mm.h index 08f5698f2c3..9edba7dccca 100644 --- a/reactos/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -5,9 +5,8 @@ #ifndef __INCLUDE_INTERNAL_MM_H #define __INCLUDE_INTERNAL_MM_H -#include #include -#include +#include /* TYPES *********************************************************************/ @@ -34,7 +33,9 @@ enum #define NR_SECTION_PAGE_TABLES (1024) #define NR_SECTION_PAGE_ENTRIES (1024) -#define SPE_PENDING (0x1) +#define SPE_PAGEIN_PENDING (0x1) +#define SPE_MPW_PENDING (0x2) +#define SPE_PAGEOUT_PENDING (0x4) typedef struct { @@ -112,8 +113,6 @@ NTSTATUS MmLockMemoryArea(MEMORY_AREA* MemoryArea); NTSTATUS MmUnlockMemoryArea(MEMORY_AREA* MemoryArea); NTSTATUS MmInitSectionImplementation(VOID); -/*void VirtualInit(boot_param* bp);*/ - #define MM_LOWEST_USER_ADDRESS (4096) PMEMORY_AREA MmSplitMemoryArea(PEPROCESS Process, @@ -195,6 +194,7 @@ MEMORY_AREA* MmOpenMemoryAreaByRegion(PMADDRESS_SPACE AddressSpace, PVOID Address, ULONG Length); - +VOID ExUnmapPage(PVOID Addr); +PVOID ExAllocatePage(VOID); #endif diff --git a/reactos/include/internal/mmhal.h b/reactos/ntoskrnl/include/internal/mmhal.h similarity index 100% rename from reactos/include/internal/mmhal.h rename to reactos/ntoskrnl/include/internal/mmhal.h diff --git a/reactos/include/internal/module.h b/reactos/ntoskrnl/include/internal/module.h similarity index 100% rename from reactos/include/internal/module.h rename to reactos/ntoskrnl/include/internal/module.h diff --git a/reactos/include/internal/nt.h b/reactos/ntoskrnl/include/internal/nt.h similarity index 100% rename from reactos/include/internal/nt.h rename to reactos/ntoskrnl/include/internal/nt.h diff --git a/reactos/include/internal/ntoskrnl.h b/reactos/ntoskrnl/include/internal/ntoskrnl.h similarity index 97% rename from reactos/include/internal/ntoskrnl.h rename to reactos/ntoskrnl/include/internal/ntoskrnl.h index 764c3d868df..d594d2473dd 100644 --- a/reactos/include/internal/ntoskrnl.h +++ b/reactos/ntoskrnl/include/internal/ntoskrnl.h @@ -42,11 +42,8 @@ typedef struct char kernel_parameters[256]; } boot_param; - -#include #include -#include #include /* diff --git a/reactos/include/internal/ob.h b/reactos/ntoskrnl/include/internal/ob.h similarity index 100% rename from reactos/include/internal/ob.h rename to reactos/ntoskrnl/include/internal/ob.h diff --git a/reactos/ntoskrnl/include/internal/pool.h b/reactos/ntoskrnl/include/internal/pool.h new file mode 100644 index 00000000000..000d93ea8ee --- /dev/null +++ b/reactos/ntoskrnl/include/internal/pool.h @@ -0,0 +1,13 @@ +#ifndef __INTERNAL_POOL_H +#define __INTERNAL_POOL_H + +PVOID STDCALL ExAllocateNonPagedPoolWithTag (POOL_TYPE type, + ULONG size, + ULONG Tag, + PVOID Caller); + +PVOID STDCALL ExAllocatePagedPoolWithTag (POOL_TYPE Type, + ULONG size, + ULONG Tag); + +#endif /* __INTERNAL_POOL_H */ diff --git a/reactos/include/internal/port.h b/reactos/ntoskrnl/include/internal/port.h similarity index 100% rename from reactos/include/internal/port.h rename to reactos/ntoskrnl/include/internal/port.h diff --git a/reactos/include/internal/ps.h b/reactos/ntoskrnl/include/internal/ps.h similarity index 96% rename from reactos/include/internal/ps.h rename to reactos/ntoskrnl/include/internal/ps.h index ed6a7cfeadd..d855d93c69e 100644 --- a/reactos/include/internal/ps.h +++ b/reactos/ntoskrnl/include/internal/ps.h @@ -1,5 +1,5 @@ -#ifndef __INCLUDE_INTERNAL_PSMGR_H -#define __INCLUDE_INTERNAL_PSMGR_H +#ifndef __INCLUDE_INTERNAL_PS_H +#define __INCLUDE_INTERNAL_PS_H #include @@ -70,4 +70,4 @@ VOID PsFreezeProcessThreads(PEPROCESS Process); VOID PsUnfreezeProcessThreads(PEPROCESS Process); PEPROCESS PsGetNextProcess(PEPROCESS OldProcess); -#endif +#endif /* __INCLUDE_INTERNAL_PS_H */ diff --git a/reactos/include/internal/psmgr.h b/reactos/ntoskrnl/include/internal/psmgr.h similarity index 100% rename from reactos/include/internal/psmgr.h rename to reactos/ntoskrnl/include/internal/psmgr.h diff --git a/reactos/include/internal/stddef.h b/reactos/ntoskrnl/include/internal/stddef.h similarity index 100% rename from reactos/include/internal/stddef.h rename to reactos/ntoskrnl/include/internal/stddef.h diff --git a/reactos/include/internal/string.h b/reactos/ntoskrnl/include/internal/string.h similarity index 100% rename from reactos/include/internal/string.h rename to reactos/ntoskrnl/include/internal/string.h diff --git a/reactos/include/internal/types.h b/reactos/ntoskrnl/include/internal/types.h similarity index 100% rename from reactos/include/internal/types.h rename to reactos/ntoskrnl/include/internal/types.h diff --git a/reactos/include/internal/wait.h b/reactos/ntoskrnl/include/internal/wait.h similarity index 100% rename from reactos/include/internal/wait.h rename to reactos/ntoskrnl/include/internal/wait.h diff --git a/reactos/ntoskrnl/io/device.c b/reactos/ntoskrnl/io/device.c index 7b96ff34a0a..36b22b5d320 100644 --- a/reactos/ntoskrnl/io/device.c +++ b/reactos/ntoskrnl/io/device.c @@ -1,4 +1,4 @@ -/* $Id: device.c,v 1.17 2000/06/18 15:23:40 ekohl Exp $ +/* $Id: device.c,v 1.18 2000/06/29 23:35:37 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/reactos/ntoskrnl/io/iomgr.c b/reactos/ntoskrnl/io/iomgr.c index 65c3071bcfb..ea6829435be 100644 --- a/reactos/ntoskrnl/io/iomgr.c +++ b/reactos/ntoskrnl/io/iomgr.c @@ -1,4 +1,4 @@ -/* $Id: iomgr.c,v 1.11 2000/06/15 18:38:19 ekohl Exp $ +/* $Id: iomgr.c,v 1.12 2000/06/29 23:35:37 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,6 +11,7 @@ /* INCLUDES ****************************************************************/ +#include #include #include #include diff --git a/reactos/ntoskrnl/io/symlink.c b/reactos/ntoskrnl/io/symlink.c index 4696b4dabeb..55bf65b0454 100644 --- a/reactos/ntoskrnl/io/symlink.c +++ b/reactos/ntoskrnl/io/symlink.c @@ -1,4 +1,4 @@ -/* $Id: symlink.c,v 1.14 2000/06/15 18:38:19 ekohl Exp $ +/* $Id: symlink.c,v 1.15 2000/06/29 23:35:38 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,6 +11,7 @@ /* INCLUDES *****************************************************************/ +#include #include #include #include diff --git a/reactos/ntoskrnl/ke/dpc.c b/reactos/ntoskrnl/ke/dpc.c index c11ec5ab788..5043c96fe04 100644 --- a/reactos/ntoskrnl/ke/dpc.c +++ b/reactos/ntoskrnl/ke/dpc.c @@ -30,13 +30,9 @@ ULONG DpcQueueSize = 0; /* FUNCTIONS ****************************************************************/ -VOID -STDCALL -KeInitializeDpc ( - PKDPC Dpc, - PKDEFERRED_ROUTINE DeferredRoutine, - PVOID DeferredContext - ) +VOID STDCALL KeInitializeDpc (PKDPC Dpc, + PKDEFERRED_ROUTINE DeferredRoutine, + PVOID DeferredContext) /* * FUNCTION: Initalizes a DPC * ARGUMENTS: @@ -52,7 +48,7 @@ KeInitializeDpc ( Dpc->Lock=0; } -void KeDrainDpcQueue(void) +VOID KeDrainDpcQueue(VOID) /* * FUNCTION: Called to execute queued dpcs */ @@ -98,11 +94,7 @@ void KeDrainDpcQueue(void) } } -BOOLEAN -STDCALL -KeRemoveQueueDpc ( - PKDPC Dpc - ) +BOOLEAN STDCALL KeRemoveQueueDpc (PKDPC Dpc) /* * FUNCTION: Removes DPC object from the system dpc queue * ARGUMENTS: @@ -127,13 +119,9 @@ KeRemoveQueueDpc ( return(TRUE); } -BOOLEAN -STDCALL -KeInsertQueueDpc ( - PKDPC Dpc, - PVOID SystemArgument1, - PVOID SystemArgument2 - ) +BOOLEAN STDCALL KeInsertQueueDpc (PKDPC Dpc, + PVOID SystemArgument1, + PVOID SystemArgument2) /* * FUNCTION: Queues a DPC for execution when the IRQL of a processor * drops below DISPATCH_LEVEL @@ -170,7 +158,7 @@ KeInsertQueueDpc ( return(TRUE); } -void KeInitDpc(void) +VOID KeInitDpc(VOID) /* * FUNCTION: Initialize DPC handling */ diff --git a/reactos/ntoskrnl/ke/event.c b/reactos/ntoskrnl/ke/event.c index a35da142924..8d2d27a44e1 100644 --- a/reactos/ntoskrnl/ke/event.c +++ b/reactos/ntoskrnl/ke/event.c @@ -12,6 +12,7 @@ #include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index 7ff024b137e..2354720f7a4 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -62,7 +62,7 @@ extern ULONG init_stack_top; "iret\n\t"); } #define EXCEPTION_HANDLER_WITHOUT_ERROR(x,y) \ - asmlinkage void exception_handler##y (void); \ + void exception_handler##y (void); \ void tmp_exception_handler##y (void) { \ __asm__("\n\t_exception_handler"##x":\n\t" \ "pushl $0\n\t" \ @@ -87,8 +87,8 @@ extern ULONG init_stack_top; "addl $4,%esp\n\t" \ "iret\n\t"); } -asmlinkage void exception_handler_unknown(void); -asmlinkage void tmp_exception_handler_unknown(void) + void exception_handler_unknown(void); + void tmp_exception_handler_unknown(void) { __asm__("\n\t_exception_handler_unknown:\n\t" "pushl $0\n\t" @@ -156,7 +156,7 @@ static void print_address(PVOID address) DbgPrint("<%x>", address); } -asmlinkage void exception_handler(unsigned int edi, + void exception_handler(unsigned int edi, unsigned int esi, unsigned int ebp, unsigned int esp, unsigned int ebx, unsigned int edx, unsigned int ecx, @@ -420,7 +420,7 @@ static void set_interrupt_gate(unsigned int sel, unsigned int func) KiIdt[sel].b = 0x8f00 + (((int)func)&0xffff0000); } -asmlinkage unsigned int ExHookException(exception_hook fn, unsigned int exp) + unsigned int ExHookException(exception_hook fn, unsigned int exp) /* * FUNCTION: Hook an exception */ @@ -433,7 +433,7 @@ asmlinkage unsigned int ExHookException(exception_hook fn, unsigned int exp) return(0); } -asmlinkage void KeInitExceptions(void) + void KeInitExceptions(void) /* * FUNCTION: Initalize CPU exception handling */ diff --git a/reactos/ntoskrnl/ke/i386/usercall.c b/reactos/ntoskrnl/ke/i386/usercall.c index c203d6ec740..76364c992e1 100644 --- a/reactos/ntoskrnl/ke/i386/usercall.c +++ b/reactos/ntoskrnl/ke/i386/usercall.c @@ -1,4 +1,4 @@ -/* $Id: usercall.c,v 1.12 2000/05/24 22:29:36 dwelch Exp $ +/* $Id: usercall.c,v 1.13 2000/06/29 23:35:38 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -17,7 +17,7 @@ #define NDEBUG #include -#include +#include #include diff --git a/reactos/ntoskrnl/ke/main.c b/reactos/ntoskrnl/ke/main.c index 7cc5a4f3b29..d380f7b9141 100644 --- a/reactos/ntoskrnl/ke/main.c +++ b/reactos/ntoskrnl/ke/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.47 2000/06/15 18:39:04 ekohl Exp $ +/* $Id: main.c,v 1.48 2000/06/29 23:35:38 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -162,7 +162,7 @@ unsigned int old_idt[256][2]; //extern unsigned int idt[]; unsigned int old_idt_valid = 1; -asmlinkage void _main(boot_param* _bp) +void _main(boot_param* _bp) /* * FUNCTION: Called by the boot loader to start the kernel * ARGUMENTS: diff --git a/reactos/ntoskrnl/ke/mutex.c b/reactos/ntoskrnl/ke/mutex.c index 368aa5138fe..c62c0c9c04e 100644 --- a/reactos/ntoskrnl/ke/mutex.c +++ b/reactos/ntoskrnl/ke/mutex.c @@ -1,4 +1,4 @@ -/* $Id: mutex.c,v 1.5 2000/06/04 19:50:12 ekohl Exp $ +/* $Id: mutex.c,v 1.6 2000/06/29 23:35:38 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,6 +13,7 @@ #include #include +#include #include diff --git a/reactos/ntoskrnl/ke/sem.c b/reactos/ntoskrnl/ke/sem.c index 4b432de20c7..a35cbeaab29 100644 --- a/reactos/ntoskrnl/ke/sem.c +++ b/reactos/ntoskrnl/ke/sem.c @@ -1,4 +1,4 @@ -/* $Id: sem.c,v 1.6 2000/06/04 19:50:12 ekohl Exp $ +/* $Id: sem.c,v 1.7 2000/06/29 23:35:38 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,19 +13,16 @@ #include #include +#include #define NDEBUG #include /* FUNCTIONS *****************************************************************/ -VOID -STDCALL -KeInitializeSemaphore ( - PKSEMAPHORE Semaphore, - LONG Count, - LONG Limit - ) +VOID STDCALL KeInitializeSemaphore (PKSEMAPHORE Semaphore, + LONG Count, + LONG Limit) { KeInitializeDispatcherHeader(&Semaphore->Header, InternalSemaphoreType, @@ -34,23 +31,15 @@ KeInitializeSemaphore ( Semaphore->Limit=Limit; } -LONG -STDCALL -KeReadStateSemaphore ( - PKSEMAPHORE Semaphore - ) +LONG STDCALL KeReadStateSemaphore (PKSEMAPHORE Semaphore) { return(Semaphore->Header.SignalState); } -LONG -STDCALL -KeReleaseSemaphore ( - PKSEMAPHORE Semaphore, - KPRIORITY Increment, - LONG Adjustment, - BOOLEAN Wait - ) +LONG STDCALL KeReleaseSemaphore (PKSEMAPHORE Semaphore, + KPRIORITY Increment, + LONG Adjustment, + BOOLEAN Wait) /* * FUNCTION: KeReleaseSemaphore releases a given semaphore object. This * routine supplies a runtime priority boost for waiting threads. If this diff --git a/reactos/ntoskrnl/ke/timer.c b/reactos/ntoskrnl/ke/timer.c index 24f13722910..a6644c17d5e 100644 --- a/reactos/ntoskrnl/ke/timer.c +++ b/reactos/ntoskrnl/ke/timer.c @@ -1,4 +1,4 @@ -/* $Id: timer.c,v 1.29 2000/06/09 20:07:20 ekohl Exp $ +/* $Id: timer.c,v 1.30 2000/06/29 23:35:38 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -23,6 +23,7 @@ #include #include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ke/wait.c b/reactos/ntoskrnl/ke/wait.c index ad62f3cab17..0139b2d827c 100644 --- a/reactos/ntoskrnl/ke/wait.c +++ b/reactos/ntoskrnl/ke/wait.c @@ -20,6 +20,7 @@ #include #include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ldr/init.c b/reactos/ntoskrnl/ldr/init.c index 04aa97e4264..ccadd1cfc75 100644 --- a/reactos/ntoskrnl/ldr/init.c +++ b/reactos/ntoskrnl/ldr/init.c @@ -20,15 +20,15 @@ #include #include -#include #include #include #include #include #include #include -#include +#include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ldr/loader.c b/reactos/ntoskrnl/ldr/loader.c index 5950b3cc522..7b01418e88c 100644 --- a/reactos/ntoskrnl/ldr/loader.c +++ b/reactos/ntoskrnl/ldr/loader.c @@ -1,4 +1,4 @@ -/* $Id: loader.c,v 1.56 2000/06/19 16:42:31 ekohl Exp $ +/* $Id: loader.c,v 1.57 2000/06/29 23:35:39 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -15,13 +15,13 @@ * JM 14/12/98 Built initial PE user module loader * RJJ 06/03/99 Moved user PE loader into NTDLL * JF 26/01/2000 Recoded some parts to retrieve export details correctly + * DW 27/06/00 Removed redundant header files */ /* INCLUDES *****************************************************************/ +#include #include -#include -#include #include #include #include @@ -860,8 +860,9 @@ LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject, } if (ExportAddress == 0) { - DbgPrint("Export not found for %d:%s\n", Hint, Name != NULL ? Name : "(Ordinal)"); - for(;;) ; + DbgPrint("Export not found for %d:%s\n", Hint, + Name != NULL ? Name : "(Ordinal)"); + KeBugCheck(0); } return ExportAddress; diff --git a/reactos/ntoskrnl/ldr/rtl.c b/reactos/ntoskrnl/ldr/rtl.c index c0889cfc40b..90c0ac4ee05 100644 --- a/reactos/ntoskrnl/ldr/rtl.c +++ b/reactos/ntoskrnl/ldr/rtl.c @@ -1,4 +1,4 @@ -/* $Id: rtl.c,v 1.7 2000/04/23 17:53:48 phreak Exp $ +/* $Id: rtl.c,v 1.8 2000/06/29 23:35:40 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,15 +11,12 @@ /* INCLUDES *****************************************************************/ #include -#include -#include #include #include #include #include #include #include -#include #include #define NDEBUG @@ -27,6 +24,79 @@ /* FUNCTIONS ****************************************************************/ +#if 0 +static PVOID LdrGetExportAddress(PMODULE_OBJECT ModuleObject, + PUCHAR Name, + USHORT Hint) +{ + WORD Idx; + DWORD ExportsStartRVA, ExportsEndRVA; + PVOID ExportAddress; + PWORD OrdinalList; + PDWORD FunctionList, NameList; + PIMAGE_SECTION_HEADER SectionHeader; + PIMAGE_EXPORT_DIRECTORY ExportDirectory; + + ExportsStartRVA = ModuleObject->Image.PE.OptionalHeader->DataDirectory + [IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress; + ExportsEndRVA = ExportsStartRVA + + ModuleObject->Image.PE.OptionalHeader->DataDirectory + [IMAGE_DIRECTORY_ENTRY_EXPORT].Size; + + /* Get the IMAGE_SECTION_HEADER that contains the exports. This is + usually the .edata section, but doesn't have to be. */ + SectionHeader = LdrPEGetEnclosingSectionHeader(ExportsStartRVA, ModuleObject); + + if (!SectionHeader) + { + return 0; + } + + ExportDirectory = MakePtr(PIMAGE_EXPORT_DIRECTORY, + ModuleObject->Base, + SectionHeader->VirtualAddress); + + FunctionList = (PDWORD)((DWORD)ExportDirectory->AddressOfFunctions + ModuleObject->Base); + NameList = (PDWORD)((DWORD)ExportDirectory->AddressOfNames + ModuleObject->Base); + OrdinalList = (PWORD)((DWORD)ExportDirectory->AddressOfNameOrdinals + ModuleObject->Base); + + ExportAddress = 0; + + if (Name != NULL) + { + for (Idx = 0; Idx < ExportDirectory->NumberOfNames; Idx++) + { +#if 0 + DPRINT(" Name:%s NameList[%d]:%s\n", + Name, + Idx, + (DWORD) ModuleObject->Base + NameList[Idx]); + +#endif + if (!strcmp(Name, (PCHAR) ((DWORD)ModuleObject->Base + NameList[Idx]))) + { + ExportAddress = (PVOID) ((DWORD)ModuleObject->Base + + FunctionList[OrdinalList[Idx]]); + break; + } + } + } + else /* use hint */ + { + ExportAddress = (PVOID) ((DWORD)ModuleObject->Base + + FunctionList[Hint - ExportDirectory->Base]); + } + if (ExportAddress == 0) + { + DbgPrint("Export not found for %d:%s\n", Hint, + Name != NULL ? Name : "(Ordinal)"); + KeBugCheck(0); + } + + return ExportAddress; +} +#endif + PIMAGE_NT_HEADERS STDCALL RtlImageNtHeader (IN PVOID BaseAddress) { PIMAGE_DOS_HEADER DosHeader; diff --git a/reactos/ntoskrnl/ldr/sysdll.c b/reactos/ntoskrnl/ldr/sysdll.c index bde5f98f2e7..911f0800b06 100644 --- a/reactos/ntoskrnl/ldr/sysdll.c +++ b/reactos/ntoskrnl/ldr/sysdll.c @@ -12,15 +12,12 @@ /* INCLUDES *****************************************************************/ #include -#include -#include #include #include #include #include #include #include -#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ldr/userldr.c b/reactos/ntoskrnl/ldr/userldr.c index c6eef4434cf..322b1f9e70b 100644 --- a/reactos/ntoskrnl/ldr/userldr.c +++ b/reactos/ntoskrnl/ldr/userldr.c @@ -12,15 +12,13 @@ /* INCLUDES *****************************************************************/ #include -#include -#include #include #include #include #include #include #include -#include +#include #include #define NDEBUG diff --git a/reactos/ntoskrnl/lpc/port.c b/reactos/ntoskrnl/lpc/port.c index 7ad2c1331a3..257119b220f 100644 --- a/reactos/ntoskrnl/lpc/port.c +++ b/reactos/ntoskrnl/lpc/port.c @@ -1,4 +1,4 @@ -/* $Id: port.c,v 1.1 2000/06/04 17:27:39 ea Exp $ +/* $Id: port.c,v 1.2 2000/06/29 23:35:40 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -14,6 +14,8 @@ /* INCLUDES *****************************************************************/ +#include + #include #include #include diff --git a/reactos/ntoskrnl/lpc/send.c b/reactos/ntoskrnl/lpc/send.c index c3e053c6b61..903b15b14bc 100644 --- a/reactos/ntoskrnl/lpc/send.c +++ b/reactos/ntoskrnl/lpc/send.c @@ -1,4 +1,4 @@ -/* $Id: send.c,v 1.1 2000/06/04 17:27:39 ea Exp $ +/* $Id: send.c,v 1.2 2000/06/29 23:35:40 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -34,21 +34,15 @@ * REVISIONS * */ -NTSTATUS -STDCALL -LpcSendTerminationPort ( - IN PEPORT Port, - IN TIME CreationTime - ) +NTSTATUS STDCALL LpcSendTerminationPort (IN PEPORT Port, + IN TIME CreationTime) { NTSTATUS Status; LPC_TERMINATION_MESSAGE Msg; Msg.CreationTime = CreationTime; - Status = LpcRequestPort ( - Port, - & Msg.Header - ); + Status = LpcRequestPort (Port, + &Msg.Header); return(Status); } @@ -65,17 +59,12 @@ LpcSendTerminationPort ( * REVISIONS * */ -NTSTATUS -STDCALL -LpcSendDebugMessagePort ( - IN PEPORT Port, - IN PLPC_DBG_MESSAGE Message - ) +NTSTATUS STDCALL LpcSendDebugMessagePort (IN PEPORT Port, + IN PLPC_DBG_MESSAGE Message) { NTSTATUS Status; - Status = LpcRequestPort(Port, - &Message->Header); + Status = LpcRequestPort(Port, &Message->Header); return(Status); } @@ -92,12 +81,8 @@ LpcSendDebugMessagePort ( * REVISIONS * */ -NTSTATUS -STDCALL -LpcRequestPort ( - IN PEPORT Port, - IN PLPC_MESSAGE LpcMessage - ) +NTSTATUS STDCALL LpcRequestPort (IN PEPORT Port, + IN PLPC_MESSAGE LpcMessage) { NTSTATUS Status; @@ -125,12 +110,8 @@ LpcRequestPort ( * REVISIONS * */ -NTSTATUS -STDCALL -NtRequestPort ( - IN HANDLE PortHandle, - IN PLPC_MESSAGE LpcMessage - ) +NTSTATUS STDCALL NtRequestPort (IN HANDLE PortHandle, + IN PLPC_MESSAGE LpcMessage) { NTSTATUS Status; PEPORT Port; @@ -170,13 +151,9 @@ NtRequestPort ( * REVISIONS * */ -NTSTATUS -STDCALL -NtRequestWaitReplyPort ( - IN HANDLE PortHandle, - PLPC_MESSAGE LpcRequest, - PLPC_MESSAGE LpcReply - ) +NTSTATUS STDCALL NtRequestWaitReplyPort (IN HANDLE PortHandle, + PLPC_MESSAGE LpcRequest, + PLPC_MESSAGE LpcReply) { NTSTATUS Status; PEPORT Port; @@ -249,18 +226,14 @@ NtRequestWaitReplyPort ( * REVISIONS * */ -NTSTATUS -STDCALL -NtWriteRequestData ( - HANDLE PortHandle, - PLPC_MESSAGE Message, - ULONG Index, - PVOID Buffer, - ULONG BufferLength, - PULONG ReturnLength - ) +NTSTATUS STDCALL NtWriteRequestData (HANDLE PortHandle, + PLPC_MESSAGE Message, + ULONG Index, + PVOID Buffer, + ULONG BufferLength, + PULONG ReturnLength) { - UNIMPLEMENTED; + UNIMPLEMENTED; } diff --git a/reactos/ntoskrnl/makefile_rex b/reactos/ntoskrnl/makefile_rex index 77258deae9e..44ab39c53d2 100644 --- a/reactos/ntoskrnl/makefile_rex +++ b/reactos/ntoskrnl/makefile_rex @@ -1,4 +1,4 @@ -# $Id: makefile_rex,v 1.74 2000/06/25 03:59:14 dwelch Exp $ +# $Id: makefile_rex,v 1.75 2000/06/29 23:35:32 dwelch Exp $ # # ReactOS Operating System # @@ -6,7 +6,8 @@ TARGETNAME = ntoskrnl OBJECTS_PATH = objects -BASE_CFLAGS = -I../include -D__NTOSKRNL__ +AS_BASEFLAGS = -Iinclude +BASE_CFLAGS = -I../include -Iinclude -D__NTOSKRNL__ all: \ @@ -430,7 +431,7 @@ CLEAN_FILES = $(OBJECTS_PATH)/*.o cc/*.o cm/*.o dbg/*.o ex/*.o hal/x86/*.o io/*. ke/*.o ldr/*.o mm/*.o nt/*.o ob/*.o ps/*.o rtl/*.o se/*.o \ ke/i386/*.o mm/i386/*.o fs/*.o po/*.o nls/*.o lpc/*.o \ kd/*.o utils/export/export $(TARGETNAME).o $(TARGETNAME).a junk.tmp \ - base.tmp temp.exp $(TARGETNAME).exe $(TARGETNAME).sym $(TARGETNAME).coff + base.tmp temp.exp $(TARGETNAME).exe $(TARGETNAME).nostrip.exe $(TARGETNAME).sym $(TARGETNAME).coff endif diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index e51ffbdc259..ab23b1c864a 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -1,4 +1,4 @@ -/* $Id: section.c,v 1.33 2000/06/26 19:41:43 dwelch Exp $ +/* $Id: section.c,v 1.34 2000/06/29 23:35:41 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,6 +11,7 @@ /* INCLUDES *****************************************************************/ +#include #include #include #include @@ -333,7 +334,7 @@ NTSTATUS MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, * Notify any other threads that fault on the same section offset * that a page-in is pending. */ - Entry = ((ULONG)Page) | SPE_PENDING; + Entry = ((ULONG)Page) | SPE_PAGEIN_PENDING; MmSetPageEntrySection(Section, Offset.u.LowPart, Entry); @@ -390,7 +391,7 @@ NTSTATUS MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, */ MmSetWaitPage(Page); } - else if (Entry & SPE_PENDING) + else if (Entry & SPE_PAGEIN_PENDING) { /* * If a page-in on that section offset is pending that wait for @@ -409,7 +410,7 @@ NTSTATUS MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, * FIXME: What if the event is set and cleared after we * unlock the section but before we wait. */ - Status = MmWaitForPage((PVOID)(Entry & (~SPE_PENDING))); + Status = MmWaitForPage((PVOID)(Entry & (~SPE_PAGEIN_PENDING))); if (!NT_SUCCESS(Status)) { /* @@ -434,7 +435,7 @@ NTSTATUS MmNotPresentFaultSectionView(PMADDRESS_SPACE AddressSpace, */ Entry = MmGetPageEntrySection(Section, Offset.u.LowPart); - } while (Entry & SPE_PENDING); + } while (Entry & SPE_PAGEIN_PENDING); /* * Setting the entry to null means the read failing. diff --git a/reactos/ntoskrnl/nt/ntevent.c b/reactos/ntoskrnl/nt/ntevent.c index ae99a291ae1..7b2ed40de28 100644 --- a/reactos/ntoskrnl/nt/ntevent.c +++ b/reactos/ntoskrnl/nt/ntevent.c @@ -10,8 +10,10 @@ /* INCLUDES *****************************************************************/ +#include #include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/nt/ntsem.c b/reactos/ntoskrnl/nt/ntsem.c index 39efb133dea..b55a2f833c9 100644 --- a/reactos/ntoskrnl/nt/ntsem.c +++ b/reactos/ntoskrnl/nt/ntsem.c @@ -10,8 +10,10 @@ /* INCLUDES *****************************************************************/ +#include #include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ob/namespc.c b/reactos/ntoskrnl/ob/namespc.c index 84c8f9cd9f4..e2ca04fdb21 100644 --- a/reactos/ntoskrnl/ob/namespc.c +++ b/reactos/ntoskrnl/ob/namespc.c @@ -10,6 +10,7 @@ /* INCLUDES ***************************************************************/ +#include #include #include #include diff --git a/reactos/ntoskrnl/ps/create.c b/reactos/ntoskrnl/ps/create.c index 03029da91ea..bf837135978 100644 --- a/reactos/ntoskrnl/ps/create.c +++ b/reactos/ntoskrnl/ps/create.c @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.17 2000/06/27 19:20:45 dwelch Exp $ +/* $Id: create.c,v 1.18 2000/06/29 23:35:44 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -28,6 +28,7 @@ #include #include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 107002dd6ab..b4cb73f3ddf 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.45 2000/06/25 03:59:17 dwelch Exp $ +/* $Id: process.c,v 1.46 2000/06/29 23:35:44 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,6 +11,7 @@ /* INCLUDES ******************************************************************/ +#include #include #include #include @@ -19,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/reactos/ntoskrnl/rtl/unicode.c b/reactos/ntoskrnl/rtl/unicode.c index 355f80002cc..dfcca454f95 100644 --- a/reactos/ntoskrnl/rtl/unicode.c +++ b/reactos/ntoskrnl/rtl/unicode.c @@ -1,4 +1,4 @@ -/* $Id: unicode.c,v 1.15 2000/04/15 23:13:48 ekohl Exp $ +/* $Id: unicode.c,v 1.16 2000/06/29 23:35:44 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,6 +12,7 @@ #include //#include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/se/token.c b/reactos/ntoskrnl/se/token.c index afaa5dbba0f..287ae0f84d3 100644 --- a/reactos/ntoskrnl/se/token.c +++ b/reactos/ntoskrnl/se/token.c @@ -1,4 +1,4 @@ -/* $Id: token.c,v 1.6 2000/05/25 15:55:35 ekohl Exp $ +/* $Id: token.c,v 1.7 2000/06/29 23:35:45 dwelch Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,6 +11,7 @@ /* INCLUDES *****************************************************************/ +#include #include #include diff --git a/reactos/ntoskrnl/tst/test.c b/reactos/ntoskrnl/tst/test.c deleted file mode 100644 index 267a5ea7ab5..00000000000 --- a/reactos/ntoskrnl/tst/test.c +++ /dev/null @@ -1,470 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/tst/test.c - * PURPOSE: Kernel regression tests - * PROGRAMMER: David Welch (welch@cwcom.net) - * UPDATE HISTORY: - * 28/05/98: Created - */ - -/* INCLUDES *****************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define NDEBUG -#include - -#include - -#define IDE_SECTOR_SZ 512 - -/* FUNCTIONS ****************************************************************/ - - -VOID ExExecuteShell(VOID) -{ - HANDLE ShellHandle; - HANDLE ThreadHandle; - PVOID BaseAddress; - HANDLE SectionHandle; - OBJECT_ATTRIBUTES attr; - HANDLE hfile; - ANSI_STRING afilename; - UNICODE_STRING ufilename; - LARGE_INTEGER SectionOffset; - ULONG Size, StackSize; - CONTEXT Context; - NTSTATUS Status; - ULONG Temp,BytesWritten; - - ZwCreateProcess(&ShellHandle, - PROCESS_ALL_ACCESS, - NULL, - SystemProcessHandle, - FALSE, - NULL, - NULL, - NULL); - - RtlInitAnsiString(&afilename,"\\??\\C:\\reactos\\system\\shell.bin"); - RtlAnsiStringToUnicodeString(&ufilename,&afilename,TRUE); - InitializeObjectAttributes(&attr,&ufilename,0,NULL,NULL); - Status = ZwOpenFile(&hfile,FILE_ALL_ACCESS,&attr,NULL,0,0); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Failed to open file\n"); - return; - } - - ZwCreateSection(&SectionHandle, - SECTION_ALL_ACCESS, - NULL, - NULL, - PAGE_READWRITE, - MEM_COMMIT, - hfile); - - BaseAddress = (PVOID)0x10000; - LARGE_INTEGER_QUAD_PART(SectionOffset) = 0; - Size = 0x20000; - ZwMapViewOfSection(SectionHandle, - ShellHandle, - &BaseAddress, - 0, - Size, - &SectionOffset, - &Size, - 0, - MEM_COMMIT, - PAGE_READWRITE); - - memset(&Context,0,sizeof(CONTEXT)); - - Context.SegSs = USER_DS; - Context.Esp = 0xf000 - 12; - Context.EFlags = 0x202; - Context.SegCs = USER_CS; - Context.Eip = 0x10000; - Context.SegDs = USER_DS; - Context.SegEs = USER_DS; - Context.SegFs = USER_DS; - Context.SegGs = USER_DS; - - BaseAddress = 0x1000; - StackSize = 0xe000; - ZwAllocateVirtualMemory(ShellHandle, - &BaseAddress, - 0, - &StackSize, - MEM_COMMIT, - PAGE_READWRITE); - - Temp = 0xf000 - 4; - ZwWriteVirtualMemory(ShellHandle, - 0xf000 - 8, - &Temp, - sizeof(Temp), - &BytesWritten); - - ZwCreateThread(&ThreadHandle, - THREAD_ALL_ACCESS, - NULL, - ShellHandle, - NULL, - &Context, - NULL, - FALSE); -} - -/* IDE TEST STUFF ***********************************************************/ - -typedef struct _BOOT_PARAMETERS { - WORD BytesBerSector; - BYTE SectorsPerAllocationUnit; - WORD ReservedSectorCount; - BYTE FATCount; - WORD RootDirEntryCount; - WORD TotalSectorCount; - BYTE MediaDescriptor; - WORD SectorsPerFAT; - WORD SectorsPerTrack; - WORD HeadCount; - DWORD HiddenSectorCount; - DWORD TotalSectorsInLogicalVolume; -} __attribute__ ((packed)) BOOT_PARAMETERS, __attribute__ ((packed)) *PBOOT_PARAMETERS; - -typedef struct _BOOT_BLOCK { - char JumpInstruction[3]; - char OEMName[8]; - BOOT_PARAMETERS BootParameters; - BYTE DriveNumber; - BYTE Reserved1; - BYTE ExtBootSignatureRecord; - DWORD BinaryVolumeID; - char VolumeLabel[11]; - char Reserved2[8]; - char Bootstrap[512 - 61]; -} __attribute__ ((packed)) BOOT_BLOCK, __attribute__ ((packed)) *PBOOT_BLOCK; - -typedef struct _ROOT_DIR_ENTRY { - char Filename[8]; - char Extension[3]; - char FileAttribute; - char Reserved1[10]; - WORD ModifiedTime; - WORD ModifiedDate; - WORD StartingCluster; - DWORD FileSize; -} __attribute__ ((packed)) ROOT_DIR_ENTRY; - -#define ENTRIES_PER_BLOCK (512 / sizeof(ROOT_DIR_ENTRY)) - -void TstIDERead(void) -{ - BOOLEAN TestFailed; - int Entry, i, j, BufferSize; - HANDLE FileHandle; - NTSTATUS Status; - LARGE_INTEGER BlockOffset; - ANSI_STRING AnsiDeviceName; - UNICODE_STRING UnicodeDeviceName; - OBJECT_ATTRIBUTES ObjectAttributes; - char *SectorBuffer; - PBOOT_BLOCK BootBlock; - ROOT_DIR_ENTRY DirectoryBlock[ENTRIES_PER_BLOCK]; - - DbgPrint("IDE Read Test\n"); - TestFailed = FALSE; - BufferSize = IDE_SECTOR_SZ * 300; - SectorBuffer = ExAllocatePool(NonPagedPool, BufferSize); - - /* open the first partition */ - DbgPrint("Opening Partition1\n"); - RtlInitAnsiString(&AnsiDeviceName, "\\Device\\HardDrive0\\Partition1"); - RtlAnsiStringToUnicodeString(&UnicodeDeviceName, &AnsiDeviceName, TRUE); - InitializeObjectAttributes(&ObjectAttributes, - &UnicodeDeviceName, - 0, - NULL, - NULL); - Status = ZwOpenFile(&FileHandle, - FILE_ALL_ACCESS, - &ObjectAttributes, - NULL, - 0, - FILE_SYNCHRONOUS_IO_ALERT); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Failed to open partition1\n"); - TestFailed = TRUE; - } - - /* Read the boot block */ - if (!TestFailed) - { - DbgPrint("Reading boot block from Partition1\n"); - RtlZeroMemory(SectorBuffer, sizeof(SectorBuffer)); - Status = ZwReadFile(FileHandle, - NULL, - NULL, - NULL, - NULL, - SectorBuffer, - 512, - 0, - 0); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Failed to read book block from partition1 status:%x\n", Status); - TestFailed = TRUE; - } - } - - /* %%% Check for valid boot block signature */ - - /* Spew info about boot block */ - if (!TestFailed) - { - BootBlock = (PBOOT_BLOCK) SectorBuffer; - DbgPrint("boot block on Partition1:\n"); - DbgPrint(" OEM Name: %.8s Bytes/Sector:%d Sectors/Cluster:%d\n", - BootBlock->OEMName, - BootBlock->BootParameters.BytesBerSector, - BootBlock->BootParameters.SectorsPerAllocationUnit); - DbgPrint(" ReservedSectors:%d FATs:%d RootDirEntries:%d\n", - BootBlock->BootParameters.ReservedSectorCount, - BootBlock->BootParameters.FATCount, - BootBlock->BootParameters.RootDirEntryCount); - DbgPrint(" TotalSectors:%d MediaDescriptor:%d Sectors/FAT:%d\n", - BootBlock->BootParameters.TotalSectorCount, - BootBlock->BootParameters.MediaDescriptor, - BootBlock->BootParameters.SectorsPerFAT); - DbgPrint(" Sectors/Track:%d Heads:%d HiddenSectors:%d\n", - BootBlock->BootParameters.SectorsPerTrack, - BootBlock->BootParameters.HeadCount, - BootBlock->BootParameters.HiddenSectorCount); - DbgPrint(" VolumeLabel:%.11s\n", BootBlock->VolumeLabel); - } - - /* Read the first root directory block */ - if (!TestFailed) - { - DbgPrint("Reading rootdir block from Partition1\n"); - LARGE_INTEGER_QUAD_PART(BlockOffset) = - BootBlock->BootParameters.ReservedSectorCount * 512 + - BootBlock->BootParameters.FATCount * - BootBlock->BootParameters.SectorsPerFAT * 512; - Status = ZwReadFile(FileHandle, - NULL, - NULL, - NULL, - NULL, - DirectoryBlock, - sizeof(DirectoryBlock), - &BlockOffset, - 0); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Failed to read root directory block from partition1\n"); - TestFailed = TRUE; - } - } - - /* Print the contents */ - if (!TestFailed) - { - for (Entry = 0; Entry < ENTRIES_PER_BLOCK; Entry++) - { - switch (DirectoryBlock[Entry].Filename[0]) - { - case 0x00: - DbgPrint("End of Directory.\n"); - Entry = ENTRIES_PER_BLOCK; - break; - - case 0x05: - DbgPrint(" FILE: %c%.7s.%.3s ATTR:%x Time:%04x Date:%04x offset:%d size:%d\n", - 0xe5, - &DirectoryBlock[Entry].Filename[1], - DirectoryBlock[Entry].Extension, - DirectoryBlock[Entry].FileAttribute, - DirectoryBlock[Entry].ModifiedTime, - DirectoryBlock[Entry].ModifiedDate, - DirectoryBlock[Entry].StartingCluster, - DirectoryBlock[Entry].FileSize); - break; - - case 0x2e: - DbgPrint(" ALIAS: %.8s ATTR:%x Time:%04x Date:%04x offset:%d size:%d\n", - &DirectoryBlock[Entry].Filename[1], - DirectoryBlock[Entry].FileAttribute, - DirectoryBlock[Entry].ModifiedTime, - DirectoryBlock[Entry].ModifiedDate, - DirectoryBlock[Entry].StartingCluster, - DirectoryBlock[Entry].FileSize); - break; - - case 0xe5: - break; - - default: - DbgPrint(" FILE: %.8s.%.3s ATTR:%x Time:%04x Date:%04x offset:%d size:%d\n", - DirectoryBlock[Entry].Filename, - DirectoryBlock[Entry].Extension, - DirectoryBlock[Entry].FileAttribute, - DirectoryBlock[Entry].ModifiedTime, - DirectoryBlock[Entry].ModifiedDate, - DirectoryBlock[Entry].StartingCluster, - DirectoryBlock[Entry].FileSize); - break; - } - } - } - - /* Execute a multiblock disk read/write test */ - if (!TestFailed) - { - DbgPrint("Reading data from blocks 10000-4 from Partition1\n"); - RtlFillMemory(SectorBuffer, BufferSize, 0xea); - LARGE_INTEGER_QUAD_PART(BlockOffset) = 10000 * IDE_SECTOR_SZ; - Status = ZwReadFile(FileHandle, - NULL, - NULL, - NULL, - NULL, - SectorBuffer, - BufferSize, - &BlockOffset, - 0); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Failed to read %d bytes of data to offset 10000 from partition1 status:%x\n", - BufferSize, - Status); - TestFailed = TRUE; - } - else - { - DbgPrint("%d bytes read from offset 10000 of partition1\n", BufferSize); - for (j = 0; j < BufferSize; j += IDE_SECTOR_SZ) - { - DbgPrint("%02x", (unsigned char)SectorBuffer[j]); - SectorBuffer[j]++; - if (((j / IDE_SECTOR_SZ + 1) % 30) == 0) - { - DbgPrint("\n"); - } - } - DbgPrint("\n"); -//RtlZeroMemory(SectorBuffer, BufferSize); - Status = ZwWriteFile(FileHandle, - NULL, - NULL, - NULL, - NULL, - SectorBuffer, - BufferSize, - &BlockOffset, - 0); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Failed to write %d bytes of data to offset 10000 of partition1 status:%x\n", - BufferSize, - Status); - TestFailed = TRUE; - } - else - { - DbgPrint("%d bytes written\n", BufferSize); - } - } - } - - if (FileHandle != NULL) - { - ZwClose(FileHandle); - } -} - - -NTSTATUS TstBeepDriver(DWORD dwFreq, DWORD dwDuration) -{ - NTSTATUS Status; - HANDLE hBeep; - ANSI_STRING AnsiDeviceName; - UNICODE_STRING UnicodeDeviceName; - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - BEEP_SET_PARAMETERS BeepSetParameters; - - RtlInitAnsiString(&AnsiDeviceName, "\\Device\\Beep"); - RtlAnsiStringToUnicodeString(&UnicodeDeviceName, - &AnsiDeviceName, TRUE); - - InitializeObjectAttributes(&ObjectAttributes, - &UnicodeDeviceName, - 0, - NULL, - NULL); - - Status = ZwCreateFile(&hBeep, - FILE_GENERIC_WRITE, - &ObjectAttributes, - &IoStatusBlock, - 0, - FILE_ATTRIBUTE_NORMAL, - 0, - FILE_OPEN, - 0, - NULL, - 0); - - if (!NT_SUCCESS(Status)) - { - return Status; - } - - /* Set beep data */ - BeepSetParameters.Frequency = dwFreq; - BeepSetParameters.Duration = dwDuration; - - Status = ZwDeviceIoControlFile(hBeep, - NULL, - NULL, - NULL, - &IoStatusBlock, - IOCTL_BEEP_SET, - &BeepSetParameters, - sizeof(BEEP_SET_PARAMETERS), - NULL, - 0); - - if (!NT_SUCCESS(Status)) - { - ZwClose (hBeep); - return Status; - } - - ZwClose(hBeep); - return STATUS_SUCCESS; -} - - -void TstBegin(void) -{ -// TstBeepDriver(440, 100); -// TstBeepDriver(880, 200); -// TstBeepDriver(440, 100); - ExExecuteShell(); -} - diff --git a/reactos/rules.mak b/reactos/rules.mak index f3431f5b60a..a8388116176 100644 --- a/reactos/rules.mak +++ b/reactos/rules.mak @@ -67,7 +67,6 @@ NATIVE_NM = nm CFLAGS = $(BASE_CFLAGS) \ -pipe \ -O2 \ - -Iinclude \ $(LEAN_AND_MEAN_DEFINE) \ $(DEFINES) -Wall \ -Wstrict-prototypes $(DEBUGGING_CFLAGS) \ @@ -78,7 +77,8 @@ LD = $(PREFIX)ld NM = $(PREFIX)nm OBJCOPY = $(PREFIX)objcopy STRIP = $(PREFIX)strip -AS = $(PREFIX)gcc -c -x assembler-with-cpp -D__ASM__ -I../include +AS_INCLUDES = -I../include +AS = $(PREFIX)gcc -c -x assembler-with-cpp -D__ASM__ $(AS_BASEFLAGS) $(AS_INCLUDES) CPP = $(PREFIX)cpp AR = $(PREFIX)ar RC = $(PREFIX)windres diff --git a/reactos/subsys/csrss/api.h b/reactos/subsys/csrss/api.h index 71a57bf137c..2d8fa9fa4db 100644 --- a/reactos/subsys/csrss/api.h +++ b/reactos/subsys/csrss/api.h @@ -1,8 +1,6 @@ -#include +#include #include -#include -#include /* Object type magic numbers */ diff --git a/reactos/subsys/smss/init.c b/reactos/subsys/smss/init.c index 1f4f75b82c6..43da81e29e9 100644 --- a/reactos/subsys/smss/init.c +++ b/reactos/subsys/smss/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.17 2000/04/03 21:54:41 dwelch Exp $ +/* $Id: init.c,v 1.18 2000/06/29 23:35:51 dwelch Exp $ * * init.c - Session Manager initialization * @@ -26,7 +26,7 @@ * 19990530 (Emanuele Aliberti) * Compiled successfully with egcs 1.1.2 */ -#include +#include #include #include diff --git a/reactos/subsys/win32k/eng/bitblt.c b/reactos/subsys/win32k/eng/bitblt.c index c22ff5825bb..71f14b2a04e 100644 --- a/reactos/subsys/win32k/eng/bitblt.c +++ b/reactos/subsys/win32k/eng/bitblt.c @@ -10,6 +10,7 @@ #include #include +#include #include "brush.h" #include "enum.h" #include "objects.h" diff --git a/reactos/subsys/win32k/eng/device.c b/reactos/subsys/win32k/eng/device.c index 13270af6e79..ca67bec74f1 100644 --- a/reactos/subsys/win32k/eng/device.c +++ b/reactos/subsys/win32k/eng/device.c @@ -10,7 +10,7 @@ #include -DWORD APIENTRY EngDeviceIoControl( +DWORD STDCALL EngDeviceIoControl( HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, diff --git a/reactos/subsys/win32k/main/dllmain.c b/reactos/subsys/win32k/main/dllmain.c index 9aca5cc100f..db24d44d5fa 100644 --- a/reactos/subsys/win32k/main/dllmain.c +++ b/reactos/subsys/win32k/main/dllmain.c @@ -1,4 +1,4 @@ -/* $Id: dllmain.c,v 1.15 2000/06/16 07:22:37 jfilby Exp $ +/* $Id: dllmain.c,v 1.16 2000/06/29 23:35:52 dwelch Exp $ * * Entry Point for win32k.sys */ @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/reactos/subsys/win32k/makefile b/reactos/subsys/win32k/makefile index 670b491cfd3..391b7fda37f 100644 --- a/reactos/subsys/win32k/makefile +++ b/reactos/subsys/win32k/makefile @@ -1,11 +1,11 @@ -# $Id: makefile,v 1.23 2000/06/18 17:37:57 ekohl Exp $ +# $Id: makefile,v 1.24 2000/06/29 23:35:51 dwelch Exp $ # # WIN32K.SYS build spec # TARGET=win32k -BASE_CFLAGS = -I../../include +BASE_CFLAGS = -I. -I../../include 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 \ diff --git a/reactos/subsys/win32k/misc/driver.c b/reactos/subsys/win32k/misc/driver.c index 84c24d5ce18..c497c1ebf9c 100644 --- a/reactos/subsys/win32k/misc/driver.c +++ b/reactos/subsys/win32k/misc/driver.c @@ -1,4 +1,4 @@ -/* $Id: driver.c,v 1.11 2000/03/17 21:02:59 jfilby Exp $ +/* $Id: driver.c,v 1.12 2000/06/29 23:35:53 dwelch Exp $ * * GDI Driver support routines * (mostly swiped from Wine) @@ -12,12 +12,12 @@ #include #include #include -#include +#include "../../ntoskrnl/include/internal/module.h" #include #include //#define NDEBUG -#include +//#include "../../ntoskrnl/include/internal/debug.h" typedef struct _GRAPHICS_DRIVER { diff --git a/reactos/subsys/win32k/objects/bitmaps.c b/reactos/subsys/win32k/objects/bitmaps.c index 3e4a1dc6c5f..66463ad61b5 100644 --- a/reactos/subsys/win32k/objects/bitmaps.c +++ b/reactos/subsys/win32k/objects/bitmaps.c @@ -7,7 +7,7 @@ //#include // #define NDEBUG -#include +#include BOOL STDCALL W32kBitBlt(HDC hDCDest, INT XDest, diff --git a/reactos/subsys/win32k/objects/brush.c b/reactos/subsys/win32k/objects/brush.c index e36f711484a..6924f98d801 100644 --- a/reactos/subsys/win32k/objects/brush.c +++ b/reactos/subsys/win32k/objects/brush.c @@ -1,4 +1,4 @@ -/* $Id: brush.c,v 1.9 2000/06/16 07:22:37 jfilby Exp $ +/* $Id: brush.c,v 1.10 2000/06/29 23:35:53 dwelch Exp $ */ @@ -10,7 +10,7 @@ //#include // #define NDEBUG -#include +#include HBRUSH STDCALL W32kCreateBrushIndirect(CONST LOGBRUSH *lb) { diff --git a/reactos/subsys/win32k/objects/cliprgn.c b/reactos/subsys/win32k/objects/cliprgn.c index 5268e8088a4..ef46d3a3246 100644 --- a/reactos/subsys/win32k/objects/cliprgn.c +++ b/reactos/subsys/win32k/objects/cliprgn.c @@ -6,7 +6,7 @@ #include // #define NDEBUG -#include +#include int STDCALL W32kExcludeClipRect(HDC hDC, int LeftRect, diff --git a/reactos/subsys/win32k/objects/color.c b/reactos/subsys/win32k/objects/color.c index e765bef6977..640ac758302 100644 --- a/reactos/subsys/win32k/objects/color.c +++ b/reactos/subsys/win32k/objects/color.c @@ -5,7 +5,7 @@ #include // #define NDEBUG -#include +#include BOOL STDCALL W32kAnimatePalette(HPALETTE hpal, UINT StartIndex, diff --git a/reactos/subsys/win32k/objects/coord.c b/reactos/subsys/win32k/objects/coord.c index e6548b21f79..7398e8dd320 100644 --- a/reactos/subsys/win32k/objects/coord.c +++ b/reactos/subsys/win32k/objects/coord.c @@ -7,7 +7,7 @@ #include // #define NDEBUG -#include +#include BOOL STDCALL W32kCombineTransform(LPXFORM XFormResult, CONST LPXFORM xform1, diff --git a/reactos/subsys/win32k/objects/dc.c b/reactos/subsys/win32k/objects/dc.c index 29256f1e132..6b948e47f8b 100644 --- a/reactos/subsys/win32k/objects/dc.c +++ b/reactos/subsys/win32k/objects/dc.c @@ -1,4 +1,4 @@ -/* $Id: dc.c,v 1.16 2000/06/16 07:22:37 jfilby Exp $ +/* $Id: dc.c,v 1.17 2000/06/29 23:35:53 dwelch Exp $ * * DC.C - Device context functions * @@ -20,7 +20,7 @@ #include "../eng/objects.h" // #define NDEBUG -#include +#include void TestEngXxx(PDC Dc) { diff --git a/reactos/subsys/win32k/objects/fillshap.c b/reactos/subsys/win32k/objects/fillshap.c index 51703283a52..8d5139d00f3 100644 --- a/reactos/subsys/win32k/objects/fillshap.c +++ b/reactos/subsys/win32k/objects/fillshap.c @@ -7,7 +7,7 @@ #include // #define NDEBUG -#include +#include BOOL STDCALL diff --git a/reactos/subsys/win32k/objects/icm.c b/reactos/subsys/win32k/objects/icm.c index 9da141653d9..12720feec9d 100644 --- a/reactos/subsys/win32k/objects/icm.c +++ b/reactos/subsys/win32k/objects/icm.c @@ -6,7 +6,7 @@ #include // #define NDEBUG -#include +#include BOOL STDCALL diff --git a/reactos/subsys/win32k/objects/line.c b/reactos/subsys/win32k/objects/line.c index 12d010135e9..e9fe215e974 100644 --- a/reactos/subsys/win32k/objects/line.c +++ b/reactos/subsys/win32k/objects/line.c @@ -9,7 +9,7 @@ #include // #define NDEBUG -#include +#include BOOL STDCALL diff --git a/reactos/subsys/win32k/objects/metafile.c b/reactos/subsys/win32k/objects/metafile.c index ecd5f9d75d2..441c288eba9 100644 --- a/reactos/subsys/win32k/objects/metafile.c +++ b/reactos/subsys/win32k/objects/metafile.c @@ -6,7 +6,7 @@ #include // #define NDEBUG -#include +#include HENHMETAFILE STDCALL diff --git a/reactos/subsys/win32k/objects/paint.c b/reactos/subsys/win32k/objects/paint.c index f30905279b2..f1aa922b276 100644 --- a/reactos/subsys/win32k/objects/paint.c +++ b/reactos/subsys/win32k/objects/paint.c @@ -7,7 +7,7 @@ #include // #define NDEBUG -#include +#include BOOL STDCALL diff --git a/reactos/subsys/win32k/objects/path.c b/reactos/subsys/win32k/objects/path.c index 413d2bab48f..03585843e49 100644 --- a/reactos/subsys/win32k/objects/path.c +++ b/reactos/subsys/win32k/objects/path.c @@ -13,7 +13,7 @@ #include // #define NDEBUG -#include +#include #define NUM_ENTRIES_INITIAL 16 /* Initial size of points / flags arrays */ #define GROW_FACTOR_NUMER 2 /* Numerator of grow factor for the array */ diff --git a/reactos/subsys/win32k/objects/pen.c b/reactos/subsys/win32k/objects/pen.c index d0e66d654d0..5bac5527c9d 100644 --- a/reactos/subsys/win32k/objects/pen.c +++ b/reactos/subsys/win32k/objects/pen.c @@ -6,7 +6,7 @@ #include // #define NDEBUG -#include +#include HPEN STDCALL diff --git a/reactos/subsys/win32k/objects/print.c b/reactos/subsys/win32k/objects/print.c index e80f4fef489..c03d1da686c 100644 --- a/reactos/subsys/win32k/objects/print.c +++ b/reactos/subsys/win32k/objects/print.c @@ -6,7 +6,7 @@ #include // #define NDEBUG -#include +#include INT STDCALL diff --git a/reactos/subsys/win32k/objects/region.c b/reactos/subsys/win32k/objects/region.c index beeec8266a4..c84cfece5f9 100644 --- a/reactos/subsys/win32k/objects/region.c +++ b/reactos/subsys/win32k/objects/region.c @@ -6,7 +6,7 @@ #include // #define NDEBUG -#include +#include INT STDCALL diff --git a/reactos/subsys/win32k/objects/text.c b/reactos/subsys/win32k/objects/text.c index 0be97f70078..dc357ed2f8b 100644 --- a/reactos/subsys/win32k/objects/text.c +++ b/reactos/subsys/win32k/objects/text.c @@ -8,7 +8,7 @@ #include // #define NDEBUG -#include +#include int STDCALL diff --git a/reactos/subsys/win32k/objects/wingl.c b/reactos/subsys/win32k/objects/wingl.c index 341caef2e1f..0973cf0c7ec 100644 --- a/reactos/subsys/win32k/objects/wingl.c +++ b/reactos/subsys/win32k/objects/wingl.c @@ -5,7 +5,7 @@ #include // #define NDEBUG -#include +#include INT STDCALL