reactos
diff -u -r1.231 -r1.231.4.1
--- Makefile 15 Jun 2004 22:33:45 -0000 1.231
+++ Makefile 28 Jun 2004 21:45:00 -0000 1.231.4.1
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.231 2004/06/15 22:33:45 gvg Exp $
+# $Id: Makefile,v 1.231.4.1 2004/06/28 21:45:00 hyperion Exp $
#
# Global makefile
#
@@ -32,7 +32,7 @@
LIB_FSLIB = vfatlib
# Static libraries
-LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt
+LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt pseh
# Keyboard layout libraries
DLLS_KBD = kbddv kbdfr kbdgr kbdse kbduk kbdus
reactos/drivers/dd/null
diff -u -r1.18 -r1.18.16.1
--- makefile 17 Nov 2003 20:48:22 -0000 1.18
+++ makefile 28 Jun 2004 21:45:00 -0000 1.18.16.1
@@ -1,17 +1,17 @@
-# $Id: makefile,v 1.18 2003/11/17 20:48:22 sedwards Exp $
+# $Id: makefile,v 1.18.16.1 2004/06/28 21:45:00 hyperion Exp $
PATH_TO_TOP = ../../..
+include $(PATH_TO_TOP)/rules.mak
+
TARGET_TYPE = driver
TARGET_NAME = null
TARGET_OBJECTS = null.o
-TARGET_CFLAGS = -Wall -Werror
+TARGET_CFLAGS = -Wall -Werror -D__USE_W32API
-#TARGET_LFLAGS = -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20
-
-include $(PATH_TO_TOP)/rules.mak
+TARGET_LIBS = $(SDK_PATH_LIB)/pseh.a
include $(TOOLS_PATH)/helper.mk
reactos/drivers/dd/null
diff -u -r1.13 -r1.13.10.1
--- null.c 10 Feb 2004 16:22:55 -0000 1.13
+++ null.c 28 Jun 2004 21:45:00 -0000 1.13.10.1
@@ -1,4 +1,4 @@
-/* $Id: null.c,v 1.13 2004/02/10 16:22:55 navaraf Exp $
+/* $Id: null.c,v 1.13.10.1 2004/06/28 21:45:00 hyperion Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -8,11 +8,15 @@
* UPDATE HISTORY:
* 13/08/1998: Created
* 29/04/2002: Fixed bugs, added zero-stream device
+ * 28/06/2004: Compile against the DDK, use PSEH where necessary
*/
/* INCLUDES */
-#include <ddk/ntddk.h>
+#include <ntddk.h>
+
#include <rosrtl/string.h>
+#include <pseh.h>
+
#include "null.h"
/* OBJECTS */
@@ -27,15 +31,24 @@
NTSTATUS nErrCode;
nErrCode = STATUS_SUCCESS;
+ Irp->IoStatus.Information = 0;
switch(piosStack->MajorFunction)
{
/* opening and closing handles to the device */
case IRP_MJ_CREATE:
case IRP_MJ_CLOSE:
- {
+ switch(NULL_DEVICE_TYPE(DeviceObject))
+ {
+ case NullBitBucket:
+ case NullZeroStream:
+ break;
+
+ default:
+ ASSERT(FALSE);
+ }
+
break;
- }
/* write data */
case IRP_MJ_WRITE:
@@ -47,9 +60,11 @@
break;
case NullZeroStream:
+ nErrCode = STATUS_INVALID_DEVICE_REQUEST;
+ break;
+
default:
- Irp->IoStatus.Information = 0;
- nErrCode = STATUS_NOT_IMPLEMENTED;
+ ASSERT(FALSE);
}
break;
@@ -61,13 +76,21 @@
switch(NULL_DEVICE_TYPE(DeviceObject))
{
case NullBitBucket:
- Irp->IoStatus.Information = 0;
nErrCode = STATUS_END_OF_FILE;
break;
case NullZeroStream:
- RtlZeroMemory(Irp->AssociatedIrp.SystemBuffer, piosStack->Parameters.Read.Length);
- Irp->IoStatus.Information = piosStack->Parameters.Read.Length;
+ _SEH_TRY
+ {
+ RtlZeroMemory(Irp->AssociatedIrp.SystemBuffer, piosStack->Parameters.Read.Length);
+ Irp->IoStatus.Information = piosStack->Parameters.Read.Length;
+ }
+ _SEH_HANDLE
+ {
+ nErrCode = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
break;
default:
@@ -78,11 +101,8 @@
break;
}
- /* unsupported operations */
default:
- {
- nErrCode = STATUS_NOT_IMPLEMENTED;
- }
+ ASSERT(FALSE);
}
Irp->IoStatus.Status = nErrCode;
@@ -96,6 +116,7 @@
{
}
+/* TODO: \Device\Zero should be memory-mappable */
NTSTATUS STDCALL
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
@@ -109,7 +130,6 @@
DriverObject->MajorFunction[IRP_MJ_CREATE] = NullDispatch;
DriverObject->MajorFunction[IRP_MJ_WRITE] = NullDispatch;
DriverObject->MajorFunction[IRP_MJ_READ] = NullDispatch;
- /* DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = NullDispatch; */
DriverObject->DriverUnload = NullUnload;
/* create null device */