Author: cgutman
Date: Fri Aug 8 12:50:00 2008
New Revision: 35189
URL:
http://svn.reactos.org/svn/reactos?rev=35189&view=rev
Log:
- Remove ASSERTs and return STATUS_INVALID_PARAMETER
- Should fix Christoph's problem with ROS crashing when closing emule
Modified:
branches/aicom-network-fixes/drivers/network/afd/afd/tdi.c
Modified: branches/aicom-network-fixes/drivers/network/afd/afd/tdi.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/afd/tdi.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/afd/afd/tdi.c [iso-8859-1] Fri Aug 8
12:50:00 2008
@@ -291,7 +291,11 @@
AFD_DbgPrint(MAX_TRACE, ("Called\n"));
- assert(ConnectionObject);
+ if (!ConnectionObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad connection object.\n"));
+ *Irp = NULL;
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(ConnectionObject);
if (!DeviceObject) {
@@ -345,7 +349,10 @@
AFD_DbgPrint(MAX_TRACE, ("Called. AddressHandle (0x%X) ConnectionObject
(0x%X)\n",
AddressHandle, ConnectionObject));
- assert(ConnectionObject);
+ if (!ConnectionObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad connection object.\n"));
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(ConnectionObject);
if (!DeviceObject) {
@@ -399,7 +406,11 @@
AFD_DbgPrint(MAX_TRACE, ("Called\n"));
- assert(ConnectionObject);
+ if (!ConnectionObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad connection object.\n"));
+ *Irp = NULL;
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(ConnectionObject);
if (!DeviceObject) {
@@ -465,7 +476,10 @@
AFD_DbgPrint(MAX_TRACE, ("Called\n"));
- assert(FileObject);
+ if (!FileObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad file object.\n"));
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(FileObject);
if (!DeviceObject) {
@@ -527,7 +541,10 @@
KEVENT Event;
PIRP Irp;
- assert(FileObject);
+ if (!FileObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad file object.\n"));
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(FileObject);
if (!DeviceObject) {
@@ -578,7 +595,10 @@
KEVENT Event;
PIRP Irp;
- assert(FileObject);
+ if (!FileObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad file object.\n"));
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(FileObject);
if (!DeviceObject) {
@@ -803,7 +823,11 @@
NTSTATUS Status = STATUS_SUCCESS;
PMDL Mdl;
- assert(TransportObject);
+ if (!TransportObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad transport object.\n"));
+ *Irp = NULL;
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(TransportObject);
if (!DeviceObject) {
@@ -885,7 +909,11 @@
PDEVICE_OBJECT DeviceObject;
PMDL Mdl;
- assert(TransportObject);
+ if (!TransportObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad transport object.\n"));
+ *Irp = NULL;
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(TransportObject);
if (!DeviceObject) {
@@ -986,7 +1014,11 @@
NTSTATUS Status;
PMDL Mdl;
- assert(TransportObject);
+ if (!TransportObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad tranport object.\n"));
+ *Irp = NULL;
+ return STATUS_INVALID_PARAMETER;
+ }
DeviceObject = IoGetRelatedDeviceObject(TransportObject);
if (!DeviceObject) {
@@ -1077,7 +1109,11 @@
NTSTATUS Status;
PMDL Mdl;
- assert(TransportObject);
+ if (!TransportObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad transport object.\n"));
+ *Irp = NULL;
+ return STATUS_INVALID_PARAMETER;
+ }
AFD_DbgPrint(MID_TRACE,("Called(TransportObject %x)\n", TransportObject));
@@ -1159,7 +1195,10 @@
KeInitializeEvent(&Event, NotificationEvent, FALSE);
- assert(TransportObject);
+ if (!TransportObject) {
+ AFD_DbgPrint(MIN_TRACE, ("Bad transport object.\n"));
+ return STATUS_INVALID_PARAMETER;
+ }
AFD_DbgPrint(MID_TRACE,("Called(TransportObject %x)\n", TransportObject));