-#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
+#include <windows.h>
+#include <ddk/ntddk.h>
HANDLE OutputHandle;
HANDLE InputHandle;
-#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
+#include <windows.h>
HANDLE OutputHandle;
HANDLE InputHandle;
-/* $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 <ddk/ntddk.h>
+#include <windows.h>
#include <napi/lpc.h>
#include <stdarg.h>
#include <string.h>
-/* $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 <ddk/ntddk.h>
+#include <windows.h>
#include <napi/lpc.h>
#include <stdarg.h>
#include <string.h>
#include <ddk/ntddk.h>
+#include <windows.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
-/* $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 <ddk/ntddk.h>
+#include <windows.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
-# $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
$(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
-/* $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
*
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
-#include <reactos/version.h>
+#include "../../include/reactos/version.h"
#define FALSE 0
#define TRUE 1
-/* $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
#include <defines.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
/* DEFINITIONS ***************************************************************/
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;
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;
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;
-/* $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
// -------------------------------------------------------------------------
-#include <internal/i386/io.h>
+#include "../../../ntoskrnl/include/internal/i386/io.h"
#include <string.h>
-#include <internal/string.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "ide.h"
#include "idep.h"
-# $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
/* INCLUDES ****************************************************************/
#include <ddk/ntddk.h>
-#include <internal/mmhal.h>
-#include <internal/halio.h>
#include <string.h>
-#include <internal/string.h>
-#include <defines.h>
+#include <ntos/keyboard.h>
+#include "../../../ntoskrnl/include/internal/i386/io.h"
+#include <ntos/minmax.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "keyboard.h"
-# $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
-# $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
-/* $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
/* FUNCTIONS **************************************************************/
#include <ddk/ntddk.h>
-#include <internal/halio.h>
+#include "../../../ntoskrnl/include/internal/i386/io.h"
#include "parallel.h"
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#define LP_B (0x378)
-# $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
-/* $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)
*/
#include <ddk/ntddk.h>
-#include <internal/mmhal.h>
-#include <internal/halio.h>
+//#include <internal/mmhal.h>
+#include "../../../ntoskrnl/include/internal/i386/io.h"
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#define COM1 0x3F8
#include <ddk/ntddk.h>
//#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "minix.h"
#include <ddk/ntddk.h>
#include <string.h>
-#include <internal/string.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "minix.h"
#include <ddk/ntifs.h>
//#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "minix.h"
#include <string.h>
//#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "minix.h"
#include <ddk/ntddk.h>
#include <string.h>
-#include <internal/string.h>
-#include <internal/bitops.h>
+#include "../../../ntoskrnl/include/internal/bitops.h"
#include <ddk/ntifs.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "minix.h"
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-#include <internal/string.h>
#include <wstring.h>
//#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "minix_fs.h"
#include <ddk/ntifs.h>
//#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "minix.h"
#include <ddk/ntddk.h>
#include <string.h>
+#include <ntos/minmax.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "minix.h"
#include <ddk/ntddk.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
-/* $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
#include <ddk/ntddk.h>
#include <ddk/cctypes.h>
#include <wchar.h>
-#include <internal/string.h>
+#include <limits.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
#include <ddk/ntddk.h>
#include <wchar.h>
-#include <internal/string.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
-/* $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
#include <ddk/ntddk.h>
#include <ctype.h>
#include <wchar.h>
-#include <internal/string.h>
+#include <string.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
/*
- * $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
#include <ddk/ntddk.h>
#include <wchar.h>
-#include <internal/string.h>
#include <ddk/cctypes.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
-/* $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
#include <ddk/ntddk.h>
#include <wchar.h>
-#include <internal/string.h>
#include <ddk/cctypes.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
{
DPRINT("FsdSetDispositionInformation()\n");
- FileObject->DeletePending = DispositionInfo->DeleteFile;
+ FileObject->DeletePending = DispositionInfo->DoDeleteFile;
return(STATUS_SUCCESS);
}
-/* $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
#include <ddk/ntddk.h>
#include <wchar.h>
-#include <internal/string.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
-# $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
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
-/* $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
#include <ddk/ntddk.h>
#include <wchar.h>
-#include <internal/string.h>
#include <ddk/cctypes.h>
+#include <ntos/minmax.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
-/* $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
#include <ddk/ntddk.h>
#include <wchar.h>
-#include <internal/string.h>
#include <ddk/cctypes.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
-/* $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
#include <ddk/ntddk.h>
#include <wchar.h>
-#include <internal/string.h>
#include <ddk/cctypes.h>
#define NDEBUG
-#include <internal/debug.h>
+#include <debug.h>
#include "vfat.h"
#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 <ntos/types.h>
/* Check VOID before defining CHAR, SHORT, and LONG */
#ifndef VOID
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
#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;
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;
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;
#endif /* UNICODE */
typedef const unsigned short *LPCWCH;
-typedef const unsigned short *LPCWSTR;
typedef DWORD *LPDWORD;
/* typedef LPFRHOOKPROC; */
typedef HANDLE *LPHANDLE;
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;
/*
Enumerations
*/
-typedef enum _ACL_INFORMATION_CLASS {
- AclRevisionInformation = 1,
- AclSizeInformation
-} ACL_INFORMATION_CLASS;
#define RASCS_DONE 0x2000
typedef void (*CALLB) (void);
typedef CALLB PFNCALLBACK;
-typedef WINBOOL SECURITY_CONTEXT_TRACKING_MODE;
/* End of stuff from ddeml.h in old Cygnus headers */
/* ----------------------------------------------- */
#include <napi/lpc.h>
#include <ddk/ntddblue.h>
+#include <ntos/keyboard.h>
#define CSR_PRIORITY_CLASS_NORMAL (0x10)
#define CSR_PRIORITY_CLASS_IDLE (0x20)
#define _WIN32_WINNT 0x0400
-#include <internal/hal/irq.h>
-
#include <ddk/kedef.h>
#include <ddk/iodef.h>
#define MAXIMUM_VOLUME_LABEL_LENGTH (32)
+#include <ddk/i386/irql.h>
+
/*
* IRQ levels
*/
-/* $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
#ifndef __INCLUDE_INTERNAL_HAL_DDK_H
#define __INCLUDE_INTERNAL_HAL_DDK_H
-#include <internal/ntoskrnl.h>
-
/* HalReturnToFirmware */
#define FIRMWARE_HALT 1
#define FIRMWARE_REBOOT 3
ULONG ProcessorNumber
);
-BOOLEAN
-STDCALL
-HalInitSystem (
- ULONG Phase,
- boot_param *bp
- );
-
BOOLEAN
STDCALL
HalMakeBeep (
--- /dev/null
+#ifndef __INCLUDE_DDK_I386_PAGESIZE_H
+#define __INCLUDE_DDK_I386_PAGESIZE_H
+
+#define PAGESIZE (4096)
+
+#endif /* __INCLUDE_DDK_I386_PAGESIZE_H */
*
*/
-#ifndef __INTERNAL_HAL_HAL_H
-#define __INTERNAL_HAL_HAL_H
-
+#ifndef __INCLUDE_DDK_I386_TSS_H
+#define __INCLUDE_DDK_I386_TSS_H
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 */
-/* $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 <ntos/disk.h>
+#include <ntos/file.h>
+
#ifdef __NTOSKRNL__
extern POBJECT_TYPE EXPORTED IoAdapterObjectType;
extern POBJECT_TYPE EXPORTED IoDeviceHandlerObjectType;
#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 <internal/mmhal.h>
+#include <ddk/i386/pagesize.h>
#define PAGE_ROUND_UP(x) ( (((ULONG)x)%PAGESIZE) ? ((((ULONG)x)&(~0xfff))+0x1000) : ((ULONG)x) )
#define PAGE_ROUND_DOWN(x) (((ULONG)x)&(~0xfff))
-/* $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 <ntos/mm.h>
+
#ifdef __NTOSKRNL__
extern POBJECT_TYPE EXPORTED MmSectionObjectType;
#else
#ifndef _NTDDBLUE_H_INCLUDED_
#define _NTDDBLUE_H_INCLUDED_
+#include <ntos/console.h>
#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)
-/* $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
/* INCLUDES ***************************************************************/
-#define WIN32_NO_STATUS
-#include <windows.h>
-
/* GCC can not handle __fastcall */
#ifndef FASTCALL
#define FASTCALL STDCALL
#endif
-#include <internal/id.h>
+#include <ntos/types.h>
+#include <napi/types.h>
+
#include <ddk/status.h>
#include <ddk/ntdef.h>
#include <ddk/defines.h>
// #include <ddk/cfgtypes.h>
#include <ddk/cmtypes.h>
#include <ddk/ketypes.h>
+#include <ntos/security.h>
#include <ddk/obtypes.h>
#include <ddk/setypes.h>
#include <ddk/mmtypes.h>
#include <ddk/zwtypes.h>
#include <ddk/ioctrl.h>
#include <ddk/rtl.h>
-#include <internal/hal/ddk.h>
+#include <ddk/halddk.h>
#include <ddk/zw.h>
#include <ddk/cmfuncs.h>
#ifndef __INCLUDE_DDK_PSTYPES_H
#define __INCLUDE_DDK_PSTYPES_H
-#include <kernel32/atom.h>
-#include <internal/hal.h>
-#include <internal/teb.h>
+#include <ntos/ps.h>
+
+#include <ddk/i386/tss.h>
+#include <napi/teb.h>
#ifndef TLS_MINIMUM_AVAILABLE
#define TLS_MINIMUM_AVAILABLE (64)
-/* $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 $
*
*/
#define __DDK_RTL_H
#include <stddef.h>
+#include <stdarg.h>
+
+#include <pe.h>
typedef struct _CONTROLLER_OBJECT
{
#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);
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,
-/* $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
#ifndef __INCLUDE_DDK_SETYPES_H
#define __INCLUDE_DDK_SETYPES_H
-#include <security.h>
+#include <ntos/security.h>
/* SID */
#define SECURITY_NULL_RID (0L)
/* SYSTEM STRUCTURES ******************************************************/
-#include <internal/hal/hal.h>
#include <ddk/cfgtypes.h>
#include <ddk/ketypes.h>
#include <ddk/obtypes.h>
-#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)
*/
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 */
-/* $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
#ifndef __DDK_ZW_H
#define __DDK_ZW_H
-#include <security.h>
+#include <ntos/security.h>
+#include <ntos/atom.h>
#include <napi/npipe.h>
-#define LCID ULONG
+//#define LCID ULONG
//#define SECURITY_INFORMATION ULONG
//typedef ULONG SECURITY_INFORMATION;
STDCALL
NtQueryMultipleValueKey(
HANDLE KeyHandle,
- PVALENT ListOfValuesToQuery,
+ PWVALENT ListOfValuesToQuery,
ULONG NumberOfItems,
PVOID MultipleValueInformation,
ULONG Length,
STDCALL
ZwQueryMultipleValueKey(
HANDLE KeyHandle,
- PVALENT ListOfValuesToQuery,
+ PWVALENT ListOfValuesToQuery,
ULONG NumberOfItems,
PVOID MultipleValueInformation,
ULONG Length,
typedef struct _FILE_DISPOSITION_INFORMATION
{
- BOOLEAN DeleteFile;
+ BOOLEAN DoDeleteFile;
} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
typedef struct _FILE_END_OF_FILE_INFORMATION
--- /dev/null
+/*
+ * 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 */
#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)
#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)
#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
#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)
#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)
/* 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)
#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)
#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)
#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)
#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)
#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)
+++ /dev/null
-%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
+++ /dev/null
-/*
- *
- */
-
-#ifndef __INTERNAL_HAL_HAL_H
-#define __INTERNAL_HAL_HAL_H
-
-#include <internal/service.h>
-#include <internal/ntoskrnl.h>
-
-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 */
+++ /dev/null
-;
-; Useful prototypes and definitions
-;
-
-%define KERNEL_DS 028h
-%define KERNEL_CS 020h
+++ /dev/null
-#ifdef __cplusplus
-#define asmlinkage extern "C"
-#else
-#define asmlinkage
-#endif
+++ /dev/null
-#ifndef __INTERNAL_POOL_H
-#define __INTERNAL_POOL_H
-
-#include <internal/linkage.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 */
#ifndef __INCLUDE_NAPI_LPC_H
#define __INCLUDE_NAPI_LPC_H
-#include <security.h>
+#include <ntos/security.h>
#define MAX_MESSAGE_DATA (0x130)
#ifndef __INCLUDE_INTERNAL_TEB
#define __INCLUDE_INTERNAL_TEB
+#include <napi/types.h>
+
typedef struct _CLIENT_ID
{
HANDLE UniqueProcess;
--- /dev/null
+#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 */
+#include <ntos/ntdef.h>
+
#define UNIMPLEMENTED DbgPrint("%s in %s:%d is unimplemented\n",__FUNCTION__,__FILE__,__LINE__);
#ifdef NDEBUG
-/* $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 <napi/teb.h>
+
+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!!
*
PRTL_USER_PROCESS_PARAMETERS ProcessParameters, // verified
PSECURITY_DESCRIPTOR ProcessSd,
PSECURITY_DESCRIPTOR ThreadSd,
- WINBOOL bInheritHandles,
+ BOOL bInheritHandles,
DWORD dwCreationFlags,
ULONG Unknown8,
ULONG Unknown9,
#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 <ddk/ntddk.h>
+#include <ntos/heap.h>
+#include <ntos/synch.h>
+#include <ntos/keyboard.h>
+#include <ntos/console.h>
#endif /* ndef _NTOS_H */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * UPDATE HISTORY:
+ * 27/06/00: Created
+ */
+
+
+#ifndef __INCLUDE_ATOM_H
+#define __INCLUDE_ATOM_H
+
+typedef unsigned short ATOM;
+
+#endif /* __INCLUDE_ATOM_H */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
+
+
+
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * UPDATE HISTORY:
+ * 27/06/00: Created
+ */
+
+
+#ifndef __INCLUDE_KEYBOARD_H
+#define __INCLUDE_KEYBOARD_H
+
+#include <ntos/types.h>
+
+/* 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 */
+
+
+
--- /dev/null
+#ifndef max
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+
+#ifndef min
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#endif
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
#ifndef __INCLUDE_SECURITY_H
#define __INCLUDE_SECURITY_H
+#include <ntos/ntdef.h>
+#include <ntos/types.h>
+
+/* 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 {
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 */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * UPDATE HISTORY:
+ * 27/06/00: Created
+ */
+
+
+#ifndef __INCLUDE_TIME_H
+#define __INCLUDE_TIME_H
+
+#include <ntos/types.h>
+
+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 */
--- /dev/null
+/*
+ * 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 <welch@cwcom.net>
+ * 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 */
#ifndef _GNU_H_WINDOWS32_STRUCTURES
#define _GNU_H_WINDOWS32_STRUCTURES
-typedef union _LARGE_INTEGER
+#include <ntos/security.h>
+#include <ntos/time.h>
+#include <ntdll/rtl.h>
+#include <ntos/console.h>
+#include <ntos/keyboard.h>
+#include <ntos/heap.h>
+#include <ntos/atom.h>
+#include <ntos/mm.h>
+#include <ntos/file.h>
+#include <ntos/ps.h>
+#include <ntos/disk.h>
+
+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 <security.h>
-
-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
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;
HBITMAP hBitmap;
} FMS_TOOLBARLOAD;
-typedef struct _FOCUS_EVENT_RECORD {
- WINBOOL bSetFocus;
-} FOCUS_EVENT_RECORD;
typedef struct _FORM_INFO_1 {
DWORD Flags;
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;
} 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;
--- /dev/null
+/*
+ * 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 */
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? */
-/* $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
return FALSE;
}
- FileDispInfo.DeleteFile = TRUE;
+ FileDispInfo.DoDeleteFile = TRUE;
Status = NtSetInformationFile (FileHandle,
&IoStatusBlock,
-/* $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
return FALSE;
}
- FileDispInfo.DeleteFile = TRUE;
+ FileDispInfo.DoDeleteFile = TRUE;
Status = NtSetInformationFile (DirectoryHandle,
&IoStatusBlock,
-/* $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
#include <ddk/ntddk.h>
#include <windows.h>
+#include <ntos/minmax.h>
#define NDEBUG
#include <kernel32/kernel32.h>
-/* $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
#include <ddk/ntddk.h>
#include <windows.h>
+#include <ntos/minmax.h>
#define NDEBUG
#include <kernel32/kernel32.h>
-/* $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
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
+#include <windows.h>
/* FUNCTIONS *****************************************************************/
#include <ddk/ntddk.h>
#include <windows.h>
-#include <internal/string.h>
#include <string.h>
#define NDEBUG
-/* $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
#include <kernel32/thread.h>
#include <wchar.h>
#include <string.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
#include <ntdll/rtl.h>
#define NDEBUG
-/* $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
#include <kernel32/thread.h>
#include <wchar.h>
#include <string.h>
-#include <internal/i386/segment.h>
+#include <napi/i386/segment.h>
#include <ntdll/ldr.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
#include <ntdll/base.h>
#include <ntdll/rtl.h>
#include <csrss/csrss.h>
-/* $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
#include <kernel32/thread.h>
#include <wchar.h>
#include <string.h>
-#include <internal/i386/segment.h>
-#include <internal/teb.h>
+#include <napi/i386/segment.h>
+#include <napi/teb.h>
#include <kernel32/kernel32.h>
-/* $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
#include <kernel32/error.h>
#include <wchar.h>
#include <string.h>
-#include <internal/i386/segment.h>
-#include <internal/teb.h>
+#include <napi/i386/segment.h>
+#include <napi/teb.h>
#include <ntdll/csr.h>
-/* $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
#include <windows.h>
#include <kernel32/thread.h>
#include <string.h>
-#include <internal/i386/segment.h>
+#include <napi/i386/segment.h>
#define NDEBUG
#include <kernel32/kernel32.h>
-/* $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
#include <ddk/ntddk.h>
#include <ntdll/csr.h>
#include <string.h>
-#include <internal/ps.h>
#include <csrss/csrss.h>
}
-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;
-/* $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
#include <ddk/ntddk.h>
#include <windows.h>
#include <string.h>
-#include <internal/string.h>
#include <wchar.h>
#include <ntdll/ldr.h>
+#include <ntos/minmax.h>
#ifdef DBG_NTDLL_LDR_UTILS
#define NDEBUG
-/* $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
#include <stdarg.h>
#include <stdio.h>
#include <ntdll/ntdll.h>
-
+#include <windows.h>
BOOL WINAPI DllMainCRTStartup(HINSTANCE hinstDll,
DWORD fdwReason,
-/* $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
#include <ddk/ntddk.h>
-#include <internal/debug.h>
+#include <ntdll/ntdll.h>
/* FUNCTIONS ***************************************************************/
-/* $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
#include <ddk/ntddk.h>
#include <string.h>
-#include <internal/debug.h>
-
/* FUNCTIONS ***************************************************************/
VOID STDCALL KiUserApcDispatcher(PIO_APC_ROUTINE ApcRoutine,
-/* $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
#include <ddk/ntddk.h>
#include <string.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
-#include <internal/debug.h>
/* TYPES *********************************************************************/
-/* $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
LONG
STDCALL
-InterlockedDecrement(LPLONG lpAddend)
+InterlockedDecrement(PLONG lpAddend)
{
long ret;
__asm__
-/* $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
#include <ddk/ntddk.h>
#include <ntdll/rtl.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
#include <string.h>
#define NDEBUG
-/* $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
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
+#include <windows.h>
#define NDEBUG
#include <ntdll/ntdll.h>
#include <string.h>
#include <ddk/ntddk.h>
#include <ntdll/rtl.h>
+#include <ntos/heap.h>
+#include <ntos/minmax.h>
#define NDEBUG
#include <ntdll/ntdll.h>
* TRUE: Success
* FALSE: Failure
*/
-BOOL WINAPI RtlDestroyHeap(
+BOOL STDCALL RtlDestroyHeap(
HANDLE heap /* [in] Handle of heap */
) {
HEAP *heapPtr = HEAP_GetPtr( heap );
* 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 */
* Renamed RtlReAllocateHeap as in NT
*/
LPVOID
-WINAPI
+STDCALL
RtlReAllocateHeap (
HANDLE heap, /* [in] Handle of heap block */
DWORD flags, /* [in] Heap reallocation flags */
/***********************************************************************
* HeapCompact (KERNEL32.335)
*/
-DWORD WINAPI RtlCompactHeap( HANDLE heap, DWORD flags )
+DWORD STDCALL RtlCompactHeap( HANDLE heap, DWORD flags )
{
return 0;
}
* 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 );
* TRUE: Success
* FALSE: Failure
*/
-BOOL WINAPI RtlUnlockHeap(
+BOOL STDCALL RtlUnlockHeap(
HANDLE heap /* [in] Handle to the heap to unlock */
) {
HEAP *heapPtr = HEAP_GetPtr( heap );
* 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 */
* 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 */
return TRUE;
}
-HANDLE WINAPI RtlGetProcessHeap(VOID)
+HANDLE STDCALL RtlGetProcessHeap(VOID)
{
DPRINT("RtlGetProcessHeap()\n");
return (HANDLE)NtCurrentPeb()->ProcessHeap;
NTSTATUS
STDCALL
RtlEnumProcessHeaps (
- DWORD WINAPI(*func)(void*,LONG),
+ DWORD STDCALL(*func)(void*,LONG),
LONG lParam
)
{
-/* $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
#include <ddk/ntddk.h>
-#include <internal/debug.h>
-
/* FUNCTIONS *****************************************************************/
VOID
-/* $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
#include <ddk/ntddk.h>
#include <string.h>
-#include <internal/string.h>
-
-#define NDEBUG
-#include <internal/debug.h>
/* FUNCTIONS *****************************************************************/
-/* $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
#include <ddk/ntddk.h>
#include <ntdll/ldr.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
#include <ntdll/base.h>
#include <ntdll/rtl.h>
-/* $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
/* INCLUDES ****************************************************************/
#include <ddk/ntddk.h>
-#include <internal/i386/segment.h>
+#include <napi/i386/segment.h>
#include <ntdll/ldr.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
#include <ntdll/base.h>
#include <ntdll/rtl.h>
PRTL_USER_PROCESS_PARAMETERS Ppb, // verified
PSECURITY_DESCRIPTOR ProcessSd,
PSECURITY_DESCRIPTOR ThreadSd,
- WINBOOL bInheritHandles,
+ BOOL bInheritHandles,
DWORD dwCreationFlags,
ULONG Unknown8,
ULONG Unknown9,
-/* $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
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;
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-#include <internal/i386/segment.h>
-#include <internal/teb.h>
+#include <napi/i386/segment.h>
+#include <napi/teb.h>
//#include <string.h>
#include <ntdll/rtl.h>
-/* $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
#include <ddk/ntddk.h>
#include <ntdll/rtl.h>
-#include <internal/debug.h>
-
#define TICKSPERSEC 10000000
#define TICKSPERMSEC 10000
#define SECSPERDAY 86400
-/* $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
#include <ntdll/rtl.h>
//#include <internal/nls.h>
#include <ctype.h>
-
-#define NDEBUG
-#include <internal/debug.h>
-
+#include <ntos/minmax.h>
/* FUNCTIONS *****************************************************************/
-/* $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
STDCALL
NtQueryMultipleValueKey (
IN HANDLE KeyHandle,
- IN PVALENT ListOfValuesToQuery,
+ IN PWVALENT ListOfValuesToQuery,
IN ULONG NumberOfItems,
OUT PVOID MultipleValueInformation,
IN ULONG Length,
/* GLOBALS ******************************************************************/
-#include <internal/service.h>
+#include <ddk/service.h>
#include <ntdll/napi.h>
/* FUNCTIONS *****************************************************************/
#include <internal/string.h>
#include <internal/mmhal.h>
#include <internal/i386/segment.h>
+#include <internal/i386/hal.h>
/* TYPES ******************************************************************/
-/* $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
#include <internal/ntoskrnl.h>
#include <internal/ke.h>
#include <internal/bitops.h>
-#include <internal/linkage.h>
#include <string.h>
#include <internal/string.h>
#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]=
{
#define PRESENT (0x8000)
#define I486_INTERRUPT_GATE (0xe00)
-asmlinkage
+
VOID
HalpDispatchInterrupt (ULONG irq)
/*
/* INCLUDES ***************************************************************/
#include <ddk/ntddk.h>
+#include <internal/i386/hal.h>
/* FUNCTIONS **************************************************************/
#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 (
-/* $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
#ifndef _INCLUDE_INTERNAL_EXECUTIVE_H
#define _INCLUDE_INTERNAL_EXECUTIVE_H
-
#include <ddk/ntddk.h>
+#include <ntos/time.h>
/* GLOBAL VARIABLES *********************************************************/
TIME_ZONE_INFORMATION SystemTimeZoneInfo;
-
-/* INTERNAL EXECUTIVE FUNCTIONS *********************************************/
-
-VOID ExUnmapPage(PVOID Addr);
-PVOID ExAllocatePage(VOID);
-
-
/* INITIALIZATION FUNCTIONS *************************************************/
VOID ExInit (VOID);
#endif /* _INCLUDE_INTERNAL_EXECUTIVE_H */
-/*EOF */
--- /dev/null
+/*
+ * PURPOSE: The number of device specific level levels
+ */
+#define NR_DEVICE_SPECIFIC_LEVELS (16)
+
+
+
--- /dev/null
+/*
+ *
+ */
+
+#ifndef __INTERNAL_HAL_HAL_H
+#define __INTERNAL_HAL_HAL_H
+
+#include <ddk/service.h>
+#include <internal/ntoskrnl.h>
+
+/*
+ * 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 */
--- /dev/null
+#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 */
#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
-/* $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
-/* $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
*/
/* INCLUDES *****************************************************************/
-#include <windows.h>
#include <ddk/ntddk.h>
-#include <internal/linkage.h>
#include <stdarg.h>
/* INTERNAL KERNEL FUNCTIONS ************************************************/
#ifndef __INCLUDE_INTERNAL_MM_H
#define __INCLUDE_INTERNAL_MM_H
-#include <internal/linkage.h>
#include <internal/ntoskrnl.h>
-#include <windows.h>
+#include <internal/mmhal.h>
/* TYPES *********************************************************************/
#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
{
NTSTATUS MmUnlockMemoryArea(MEMORY_AREA* MemoryArea);
NTSTATUS MmInitSectionImplementation(VOID);
-/*void VirtualInit(boot_param* bp);*/
-
#define MM_LOWEST_USER_ADDRESS (4096)
PMEMORY_AREA MmSplitMemoryArea(PEPROCESS Process,
PVOID Address,
ULONG Length);
-
+VOID ExUnmapPage(PVOID Addr);
+PVOID ExAllocatePage(VOID);
#endif
char kernel_parameters[256];
} boot_param;
-
-#include <windows.h>
#include <ddk/ntddk.h>
-#include <internal/linkage.h>
#include <stdarg.h>
/*
--- /dev/null
+#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 */
-#ifndef __INCLUDE_INTERNAL_PSMGR_H
-#define __INCLUDE_INTERNAL_PSMGR_H
+#ifndef __INCLUDE_INTERNAL_PS_H
+#define __INCLUDE_INTERNAL_PS_H
#include <internal/hal.h>
VOID PsUnfreezeProcessThreads(PEPROCESS Process);
PEPROCESS PsGetNextProcess(PEPROCESS OldProcess);
-#endif
+#endif /* __INCLUDE_INTERNAL_PS_H */
-/* $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
#include <internal/io.h>
#include <internal/ob.h>
#include <internal/ldr.h>
+#include <internal/id.h>
#include <string.h>
#include <internal/string.h>
-/* $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
/* INCLUDES ****************************************************************/
+#include <limits.h>
#include <ddk/ntddk.h>
#include <internal/ob.h>
#include <internal/io.h>
-/* $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
/* INCLUDES *****************************************************************/
+#include <limits.h>
#include <ddk/ntddk.h>
#include <internal/ob.h>
#include <wchar.h>
/* 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:
Dpc->Lock=0;
}
-void KeDrainDpcQueue(void)
+VOID KeDrainDpcQueue(VOID)
/*
* FUNCTION: Called to execute queued dpcs
*/
}
}
-BOOLEAN
-STDCALL
-KeRemoveQueueDpc (
- PKDPC Dpc
- )
+BOOLEAN STDCALL KeRemoveQueueDpc (PKDPC Dpc)
/*
* FUNCTION: Removes DPC object from the system dpc queue
* ARGUMENTS:
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
return(TRUE);
}
-void KeInitDpc(void)
+VOID KeInitDpc(VOID)
/*
* FUNCTION: Initialize DPC handling
*/
#include <ddk/ntddk.h>
#include <internal/ke.h>
+#include <internal/id.h>
#define NDEBUG
#include <internal/debug.h>
"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" \
"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"
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,
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
*/
return(0);
}
-asmlinkage void KeInitExceptions(void)
+ void KeInitExceptions(void)
/*
* FUNCTION: Initalize CPU exception handling
*/
-/* $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
#define NDEBUG
#include <internal/debug.h>
-#include <internal/service.h>
+#include <ddk/service.h>
#include <ddk/defines.h>
-/* $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
//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:
-/* $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
#include <ddk/ntddk.h>
#include <internal/ke.h>
+#include <internal/id.h>
#include <internal/debug.h>
-/* $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
#include <ddk/ntddk.h>
#include <internal/ke.h>
+#include <internal/id.h>
#define NDEBUG
#include <internal/debug.h>
/* FUNCTIONS *****************************************************************/
-VOID
-STDCALL
-KeInitializeSemaphore (
- PKSEMAPHORE Semaphore,
- LONG Count,
- LONG Limit
- )
+VOID STDCALL KeInitializeSemaphore (PKSEMAPHORE Semaphore,
+ LONG Count,
+ LONG Limit)
{
KeInitializeDispatcherHeader(&Semaphore->Header,
InternalSemaphoreType,
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
-/* $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
#include <internal/string.h>
#include <stdio.h>
#include <internal/ke.h>
+#include <internal/id.h>
#define NDEBUG
#include <internal/debug.h>
#include <internal/ke.h>
#include <internal/ps.h>
#include <internal/ob.h>
+#include <internal/id.h>
#define NDEBUG
#include <internal/debug.h>
#include <ddk/ntddk.h>
#include <internal/i386/segment.h>
-#include <internal/linkage.h>
#include <internal/module.h>
#include <internal/ntoskrnl.h>
#include <internal/ob.h>
#include <internal/ps.h>
#include <string.h>
#include <internal/string.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
#include <internal/ldr.h>
+#include <napi/teb.h>
#define NDEBUG
#include <internal/debug.h>
-/* $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
* 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 <limits.h>
#include <ddk/ntddk.h>
-#include <internal/i386/segment.h>
-#include <internal/linkage.h>
#include <internal/module.h>
#include <internal/ntoskrnl.h>
#include <internal/mm.h>
}
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;
-/* $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
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-#include <internal/i386/segment.h>
-#include <internal/linkage.h>
#include <internal/module.h>
#include <internal/ntoskrnl.h>
#include <internal/ob.h>
#include <internal/ps.h>
#include <string.h>
#include <internal/string.h>
-#include <internal/teb.h>
#include <internal/ldr.h>
#define NDEBUG
/* 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;
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-#include <internal/i386/segment.h>
-#include <internal/linkage.h>
#include <internal/module.h>
#include <internal/ntoskrnl.h>
#include <internal/ob.h>
#include <internal/ps.h>
#include <string.h>
#include <internal/string.h>
-#include <internal/teb.h>
#define NDEBUG
#include <internal/debug.h>
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-#include <internal/i386/segment.h>
-#include <internal/linkage.h>
#include <internal/module.h>
#include <internal/ntoskrnl.h>
#include <internal/ob.h>
#include <internal/ps.h>
#include <string.h>
#include <internal/string.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
#include <internal/ldr.h>
#define NDEBUG
-/* $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
/* INCLUDES *****************************************************************/
+#include <limits.h>
+
#include <ddk/ntddk.h>
#include <internal/ob.h>
#include <string.h>
-/* $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
* 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);
}
* 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);
}
* REVISIONS
*
*/
-NTSTATUS
-STDCALL
-LpcRequestPort (
- IN PEPORT Port,
- IN PLPC_MESSAGE LpcMessage
- )
+NTSTATUS STDCALL LpcRequestPort (IN PEPORT Port,
+ IN PLPC_MESSAGE LpcMessage)
{
NTSTATUS Status;
* 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;
* 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;
* 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;
}
-# $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
#
OBJECTS_PATH = objects
-BASE_CFLAGS = -I../include -D__NTOSKRNL__
+AS_BASEFLAGS = -Iinclude
+BASE_CFLAGS = -I../include -Iinclude -D__NTOSKRNL__
all: \
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
-/* $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
/* INCLUDES *****************************************************************/
+#include <limits.h>
#include <ddk/ntddk.h>
#include <internal/mm.h>
#include <internal/ob.h>
* 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);
*/
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
* 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))
{
/*
*/
Entry = MmGetPageEntrySection(Section,
Offset.u.LowPart);
- } while (Entry & SPE_PENDING);
+ } while (Entry & SPE_PAGEIN_PENDING);
/*
* Setting the entry to null means the read failing.
/* INCLUDES *****************************************************************/
+#include <limits.h>
#include <ddk/ntddk.h>
#include <internal/ob.h>
+#include <ntos/synch.h>
#define NDEBUG
#include <internal/debug.h>
/* INCLUDES *****************************************************************/
+#include <limits.h>
#include <ddk/ntddk.h>
#include <internal/ob.h>
+#include <ntos/synch.h>
#define NDEBUG
#include <internal/debug.h>
/* INCLUDES ***************************************************************/
+#include <limits.h>
#include <wchar.h>
#include <ddk/ntddk.h>
#include <internal/ob.h>
-/* $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
#include <internal/hal.h>
#include <internal/ps.h>
#include <internal/ob.h>
+#include <internal/id.h>
#define NDEBUG
#include <internal/debug.h>
-/* $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
/* INCLUDES ******************************************************************/
+#include <limits.h>
#include <ddk/ntddk.h>
#include <internal/ob.h>
#include <internal/mm.h>
#include <string.h>
#include <internal/string.h>
#include <internal/id.h>
-#include <internal/teb.h>
+#include <napi/teb.h>
#include <internal/ldr.h>
#include <internal/port.h>
#include <napi/dbg.h>
-/* $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
#include <ddk/ntddk.h>
//#include <internal/nls.h>
#include <ctype.h>
+#include <ntos/minmax.h>
#define NDEBUG
#include <internal/debug.h>
-/* $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
/* INCLUDES *****************************************************************/
+#include <limits.h>
#include <ddk/ntddk.h>
#include <internal/debug.h>
+++ /dev/null
-/*
- * 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 <windows.h>
-#include <ddk/ntddk.h>
-#include <string.h>
-#include <internal/string.h>
-#include <internal/mm.h>
-#include <internal/mmhal.h>
-#include <internal/i386/segment.h>
-#include <internal/ps.h>
-
-#include <ddk/ntddbeep.h>
-
-#define NDEBUG
-#include <internal/debug.h>
-
-#include <in.h>
-
-#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();
-}
-
CFLAGS = $(BASE_CFLAGS) \
-pipe \
-O2 \
- -Iinclude \
$(LEAN_AND_MEAN_DEFINE) \
$(DEFINES) -Wall \
-Wstrict-prototypes $(DEBUGGING_CFLAGS) \
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
-#include <ddk/ntddk.h>
+#include <ntos.h>
#include <csrss/csrss.h>
-#include <defines.h>
-#include <structs.h>
/* Object type magic numbers */
-/* $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
*
* 19990530 (Emanuele Aliberti)
* Compiled successfully with egcs 1.1.2
*/
-#include <ddk/ntddk.h>
+#include <ntos.h>
#include <ntdll/rtl.h>
#include <napi/lpc.h>
#include <ddk/winddi.h>
#include <ddk/ntddk.h>
+#include <ntos/minmax.h>
#include "brush.h"
#include "enum.h"
#include "objects.h"
#include <ddk/ntddk.h>
-DWORD APIENTRY EngDeviceIoControl(
+DWORD STDCALL EngDeviceIoControl(
HANDLE hDevice,
DWORD dwIoControlCode,
LPVOID lpInBuffer,
-/* $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
*/
#include <windows.h>
#include <ddk/ntddk.h>
#include <ddk/winddi.h>
-#include <internal/service.h>
+#include <ddk/service.h>
#include <win32k/win32k.h>
-# $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 \
-/* $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)
#include <windows.h>
#include <win32k/driver.h>
#include <wchar.h>
-#include <internal/module.h>
+#include "../../ntoskrnl/include/internal/module.h"
#include <ddk/winddi.h>
#include <ddk/ntddvid.h>
//#define NDEBUG
-#include <internal/debug.h>
+//#include "../../ntoskrnl/include/internal/debug.h"
typedef struct _GRAPHICS_DRIVER
{
//#include <win32k/debug.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
BOOL STDCALL W32kBitBlt(HDC hDCDest,
INT XDest,
-/* $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 $
*/
//#include <win32k/debug.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
HBRUSH STDCALL W32kCreateBrushIndirect(CONST LOGBRUSH *lb)
{
#include <win32k/cliprgn.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
int STDCALL W32kExcludeClipRect(HDC hDC,
int LeftRect,
#include <win32k/color.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
BOOL STDCALL W32kAnimatePalette(HPALETTE hpal,
UINT StartIndex,
#include <win32k/dc.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
BOOL STDCALL W32kCombineTransform(LPXFORM XFormResult,
CONST LPXFORM xform1,
-/* $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
*
#include "../eng/objects.h"
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
void TestEngXxx(PDC Dc)
{
#include <win32k/pen.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
BOOL
STDCALL
#include <win32k/icm.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
BOOL
STDCALL
#include <win32k/pen.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
BOOL
STDCALL
#include <win32k/metafile.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
HENHMETAFILE
STDCALL
#include <win32k/paint.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
BOOL
STDCALL
#include <float.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
#define NUM_ENTRIES_INITIAL 16 /* Initial size of points / flags arrays */
#define GROW_FACTOR_NUMER 2 /* Numerator of grow factor for the array */
#include <win32k/pen.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
HPEN
STDCALL
#include <win32k/print.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
INT
STDCALL
#include <win32k/region.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
INT
STDCALL
#include <win32k/kapi.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
int
STDCALL
#include <win32k/wingl.h>
// #define NDEBUG
-#include <internal/debug.h>
+#include <win32k/debug1.h>
INT
STDCALL