Author: hpoussin
Date: Fri Jul 25 15:24:46 2008
New Revision: 34791
URL:
http://svn.reactos.org/svn/reactos?rev=34791&view=rev
Log:
Replace DPRINT/DPRINT1 by dynamic traces
Modified:
trunk/reactos/drivers/input/kbdclass/kbdclass.c
trunk/reactos/drivers/input/kbdclass/kbdclass.h
trunk/reactos/drivers/input/kbdclass/misc.c
trunk/reactos/drivers/input/mouclass/misc.c
trunk/reactos/drivers/input/mouclass/mouclass.c
trunk/reactos/drivers/input/mouclass/mouclass.h
Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/kbdclass/kbd…
==============================================================================
--- trunk/reactos/drivers/input/kbdclass/kbdclass.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/kbdclass/kbdclass.c [iso-8859-1] Fri Jul 25 15:24:46 2008
@@ -37,7 +37,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CREATE\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_CREATE\n");
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -54,7 +54,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CLOSE\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_CLOSE\n");
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -71,7 +71,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CLEANUP\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_CLEANUP\n");
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -92,7 +92,7 @@
KIRQL OldIrql;
NTSTATUS Status;
- DPRINT("IRP_MJ_READ\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_READ\n");
ASSERT(DeviceExtension->Common.IsClassDO);
@@ -122,7 +122,7 @@
PCLASS_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status = STATUS_NOT_SUPPORTED;
- DPRINT("IRP_MJ_DEVICE_CONTROL\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_DEVICE_CONTROL\n");
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -170,7 +170,7 @@
break;
}
default:
- DPRINT1("IRP_MJ_DEVICE_CONTROL / unknown I/O control code 0x%lx\n",
+ WARN_(CLASS_NAME, "IRP_MJ_DEVICE_CONTROL / unknown I/O control code
0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->Parameters.DeviceIoControl.IoControlCode);
ASSERT(FALSE);
break;
@@ -200,7 +200,7 @@
return ForwardIrpAndForget(DeviceObject, Irp);
default:
{
- DPRINT1("Port DO stub for major function 0x%lx\n",
+ ERR_(CLASS_NAME, "Port DO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
}
@@ -208,7 +208,7 @@
}
else
{
- DPRINT1("Class DO stub for major function 0x%lx\n",
+ ERR_(CLASS_NAME, "Class DO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
}
@@ -236,7 +236,7 @@
ParametersRegistryKey.Buffer = ExAllocatePoolWithTag(PagedPool,
ParametersRegistryKey.MaximumLength, CLASS_TAG);
if (!ParametersRegistryKey.Buffer)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
return STATUS_NO_MEMORY;
}
RtlCopyUnicodeString(&ParametersRegistryKey, RegistryPath);
@@ -315,7 +315,7 @@
PCLASS_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
- DPRINT("CreateClassDeviceObject(0x%p)\n", DriverObject);
+ TRACE_(CLASS_NAME, "CreateClassDeviceObject(0x%p)\n", DriverObject);
/* Create new device object */
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
@@ -328,19 +328,19 @@
DeviceNameU.Buffer = ExAllocatePoolWithTag(PagedPool, DeviceNameU.MaximumLength,
CLASS_TAG);
if (!DeviceNameU.Buffer)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
return STATUS_NO_MEMORY;
}
Status = RtlAppendUnicodeToString(&DeviceNameU, L"\\Device\\");
if (!NT_SUCCESS(Status))
{
- DPRINT("RtlAppendUnicodeToString() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "RtlAppendUnicodeToString() failed with status 0x%08lx\n",
Status);
goto cleanup;
}
Status = RtlAppendUnicodeStringToString(&DeviceNameU,
&DriverExtension->DeviceBaseName);
if (!NT_SUCCESS(Status))
{
- DPRINT("RtlAppendUnicodeStringToString() failed with status 0x%08lx\n",
Status);
+ WARN_(CLASS_NAME, "RtlAppendUnicodeStringToString() failed with status
0x%08lx\n", Status);
goto cleanup;
}
PrefixLength = DeviceNameU.MaximumLength - 4 * sizeof(WCHAR) - sizeof(UNICODE_NULL);
@@ -360,12 +360,12 @@
goto cleanup;
else if (Status != STATUS_OBJECT_NAME_COLLISION)
{
- DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "IoCreateDevice() failed with status 0x%08lx\n", Status);
goto cleanup;
}
DeviceId++;
}
- DPRINT("Too many devices starting with '\\Device\\%wZ'\n",
&DriverExtension->DeviceBaseName);
+ WARN_(CLASS_NAME, "Too many devices starting with '\\Device\\%wZ'\n",
&DriverExtension->DeviceBaseName);
Status = STATUS_TOO_MANY_NAMES;
cleanup:
if (!NT_SUCCESS(Status))
@@ -468,7 +468,7 @@
SIZE_T InputCount = DataEnd - DataStart;
SIZE_T ReadSize;
- DPRINT("ClassCallback()\n");
+ TRACE_(CLASS_NAME, "ClassCallback()\n");
ASSERT(ClassDeviceExtension->Common.IsClassDO);
@@ -506,7 +506,7 @@
}
KeReleaseSpinLock(&ClassDeviceExtension->SpinLock, OldIrql);
- DPRINT("Leaving ClassCallback()\n");
+ TRACE_(CLASS_NAME, "Leaving ClassCallback()\n");
return TRUE;
}
@@ -522,7 +522,7 @@
CONNECT_DATA ConnectData;
NTSTATUS Status;
- DPRINT("Connecting PortDO %p to ClassDO %p\n", PortDO, ClassDO);
+ TRACE_(CLASS_NAME, "Connecting PortDO %p to ClassDO %p\n", PortDO, ClassDO);
KeInitializeEvent(&Event, NotificationEvent, FALSE);
@@ -578,7 +578,7 @@
KIRQL OldIrql;
NTSTATUS Status;
- DPRINT("Destroying PortDO %p\n", PortDO);
+ TRACE_(CLASS_NAME, "Destroying PortDO %p\n", PortDO);
DeviceExtension = (PPORT_DEVICE_EXTENSION)PortDO->DeviceExtension;
ClassDeviceExtension = DeviceExtension->ClassDO->DeviceExtension;
@@ -634,7 +634,7 @@
PPORT_DEVICE_EXTENSION DeviceExtension = NULL;
NTSTATUS Status;
- DPRINT("ClassAddDevice called. Pdo = 0x%p\n", Pdo);
+ TRACE_(CLASS_NAME, "ClassAddDevice called. Pdo = 0x%p\n", Pdo);
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
@@ -653,7 +653,7 @@
&Fdo);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "IoCreateDevice() failed with status 0x%08lx\n", Status);
goto cleanup;
}
IoSetStartIoAttributes(Fdo, TRUE, TRUE);
@@ -666,7 +666,7 @@
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo,
&DeviceExtension->LowerDevice);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n",
Status);
+ WARN_(CLASS_NAME, "IoAttachDeviceToDeviceStackSafe() failed with status
0x%08lx\n", Status);
goto cleanup;
}
if (DeviceExtension->LowerDevice->Flags & DO_POWER_PAGABLE)
@@ -686,14 +686,14 @@
&DeviceExtension->ClassDO);
if (!NT_SUCCESS(Status))
{
- DPRINT("CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "CreateClassDeviceObject() failed with status 0x%08lx\n",
Status);
goto cleanup;
}
}
Status = ConnectPortDriver(Fdo, DeviceExtension->ClassDO);
if (!NT_SUCCESS(Status))
{
- DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ConnectPortDriver() failed with status 0x%08lx\n",
Status);
goto cleanup;
}
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
@@ -725,7 +725,7 @@
KIRQL OldIrql;
BOOLEAN wasQueued = FALSE;
- DPRINT("ClassCancelRoutine(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ TRACE_(CLASS_NAME, "ClassCancelRoutine(DeviceObject %p, Irp %p)\n",
DeviceObject, Irp);
ASSERT(ClassDeviceExtension->Common.IsClassDO);
@@ -762,7 +762,7 @@
PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
NTSTATUS Status;
- DPRINT("HandleReadIrp(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ TRACE_(CLASS_NAME, "HandleReadIrp(DeviceObject %p, Irp %p)\n", DeviceObject,
Irp);
ASSERT(DeviceExtension->Common.IsClassDO);
@@ -828,7 +828,7 @@
PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
KIRQL OldIrql;
- DPRINT("ClassStartIo(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ TRACE_(CLASS_NAME, "ClassStartIo(DeviceObject %p, Irp %p)\n", DeviceObject,
Irp);
ASSERT(DeviceExtension->Common.IsClassDO);
@@ -854,7 +854,7 @@
ULONG Size, ResultLength;
NTSTATUS Status;
- DPRINT("SearchForLegacyDrivers(%p %p %lu)\n",
+ TRACE_(CLASS_NAME, "SearchForLegacyDrivers(%p %p %lu)\n",
DriverObject, Context, Count);
if (Count != 1)
@@ -868,7 +868,7 @@
&PortBaseName);
if (!NT_SUCCESS(Status))
{
- DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "DuplicateUnicodeString() failed with status 0x%08lx\n",
Status);
goto cleanup;
}
PortBaseName.Length -= (sizeof(L"Class") - sizeof(UNICODE_NULL));
@@ -879,7 +879,7 @@
KeyValueInformation = ExAllocatePoolWithTag(PagedPool, Size, CLASS_TAG);
if (!KeyValueInformation)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -889,13 +889,13 @@
Status = ZwOpenKey(&hDeviceMapKey, 0, &ObjectAttributes);
if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
{
- DPRINT("HKLM\\HARDWARE\\DEVICEMAP is non-existent\n");
+ INFO_(CLASS_NAME, "HKLM\\HARDWARE\\DEVICEMAP is non-existent\n");
Status = STATUS_SUCCESS;
goto cleanup;
}
else if (!NT_SUCCESS(Status))
{
- DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ZwOpenKey() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -904,13 +904,13 @@
Status = ZwOpenKey(&hPortKey, KEY_QUERY_VALUE, &ObjectAttributes);
if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
{
- DPRINT("HKLM\\HARDWARE\\DEVICEMAP\\%wZ is non-existent\n",
&PortBaseName);
+ INFO_(CLASS_NAME, "HKLM\\HARDWARE\\DEVICEMAP\\%wZ is non-existent\n",
&PortBaseName);
Status = STATUS_SUCCESS;
goto cleanup;
}
else if (!NT_SUCCESS(Status))
{
- DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ZwOpenKey() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -928,16 +928,16 @@
Status = IoGetDeviceObjectPointer(&PortName, FILE_READ_ATTRIBUTES, &FileObject,
&PortDeviceObject);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoGetDeviceObjectPointer(%wZ) failed with status 0x%08lx\n",
&PortName, Status);
+ WARN_(CLASS_NAME, "IoGetDeviceObjectPointer(%wZ) failed with status
0x%08lx\n", &PortName, Status);
continue;
}
- DPRINT("Legacy driver found\n");
+ INFO_(CLASS_NAME, "Legacy driver found\n");
Status = ClassAddDevice(DriverObject, PortDeviceObject);
if (!NT_SUCCESS(Status))
{
/* FIXME: Log the error */
- DPRINT("ClassAddDevice() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ClassAddDevice() failed with status 0x%08lx\n", Status);
}
}
@@ -969,7 +969,7 @@
(PVOID*)&DriverExtension);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoAllocateDriverObjectExtension() failed with status 0x%08lx\n",
Status);
+ WARN_(CLASS_NAME, "IoAllocateDriverObjectExtension() failed with status
0x%08lx\n", Status);
return Status;
}
RtlZeroMemory(DriverExtension, sizeof(CLASS_DRIVER_EXTENSION));
@@ -980,14 +980,14 @@
&DriverExtension->RegistryPath);
if (!NT_SUCCESS(Status))
{
- DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "DuplicateUnicodeString() failed with status 0x%08lx\n",
Status);
return Status;
}
Status = ReadRegistryEntries(RegistryPath, DriverExtension);
if (!NT_SUCCESS(Status))
{
- DPRINT("ReadRegistryEntries() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ReadRegistryEntries() failed with status 0x%08lx\n",
Status);
return Status;
}
@@ -998,7 +998,7 @@
&DriverExtension->MainClassDeviceObject);
if (!NT_SUCCESS(Status))
{
- DPRINT("CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "CreateClassDeviceObject() failed with status 0x%08lx\n",
Status);
return Status;
}
}
Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/kbdclass/kbd…
==============================================================================
--- trunk/reactos/drivers/input/kbdclass/kbdclass.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/kbdclass/kbdclass.h [iso-8859-1] Fri Jul 25 15:24:46 2008
@@ -4,7 +4,6 @@
#include <stdio.h>
#include <pseh/pseh.h>
-#define NDEBUG
#include <debug.h>
#define MAX_PATH 260
@@ -13,6 +12,7 @@
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
#define CLASS_TAG TAG('K', 'b', 'd', 'C')
+#define DPFLTR_CLASS_NAME_ID DPFLTR_KBDCLASS_ID
typedef enum
{
Modified: trunk/reactos/drivers/input/kbdclass/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/kbdclass/mis…
==============================================================================
--- trunk/reactos/drivers/input/kbdclass/misc.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/kbdclass/misc.c [iso-8859-1] Fri Jul 25 15:24:46 2008
@@ -37,7 +37,7 @@
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
- DPRINT("Calling lower device %p\n", LowerDevice);
+ TRACE_(CLASS_NAME, "Calling lower device %p\n", LowerDevice);
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
Status = IoCallDriver(LowerDevice, Irp);
Modified: trunk/reactos/drivers/input/mouclass/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/mouclass/mis…
==============================================================================
--- trunk/reactos/drivers/input/mouclass/misc.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/mouclass/misc.c [iso-8859-1] Fri Jul 25 15:24:46 2008
@@ -37,7 +37,7 @@
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
- DPRINT("Calling lower device %p\n", LowerDevice);
+ TRACE_(CLASS_NAME, "Calling lower device %p\n", LowerDevice);
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
Status = IoCallDriver(LowerDevice, Irp);
Modified: trunk/reactos/drivers/input/mouclass/mouclass.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/mouclass/mou…
==============================================================================
--- trunk/reactos/drivers/input/mouclass/mouclass.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/mouclass/mouclass.c [iso-8859-1] Fri Jul 25 15:24:46 2008
@@ -37,7 +37,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CREATE\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_CREATE\n");
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -54,7 +54,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CLOSE\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_CLOSE\n");
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -71,7 +71,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CLEANUP\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_CLEANUP\n");
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -92,7 +92,7 @@
KIRQL OldIrql;
NTSTATUS Status;
- DPRINT("IRP_MJ_READ\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_READ\n");
ASSERT(DeviceExtension->Common.IsClassDO);
@@ -122,7 +122,7 @@
PCLASS_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status = STATUS_NOT_SUPPORTED;
- DPRINT("IRP_MJ_DEVICE_CONTROL\n");
+ TRACE_(CLASS_NAME, "IRP_MJ_DEVICE_CONTROL\n");
if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -147,7 +147,7 @@
break;
}
default:
- DPRINT1("IRP_MJ_DEVICE_CONTROL / unknown I/O control code 0x%lx\n",
+ WARN_(CLASS_NAME, "IRP_MJ_DEVICE_CONTROL / unknown I/O control code
0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->Parameters.DeviceIoControl.IoControlCode);
ASSERT(FALSE);
break;
@@ -177,7 +177,7 @@
return ForwardIrpAndForget(DeviceObject, Irp);
default:
{
- DPRINT1("Port DO stub for major function 0x%lx\n",
+ ERR_(CLASS_NAME, "Port DO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
}
@@ -185,7 +185,7 @@
}
else
{
- DPRINT1("Class DO stub for major function 0x%lx\n",
+ ERR_(CLASS_NAME, "Class DO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
}
@@ -213,7 +213,7 @@
ParametersRegistryKey.Buffer = ExAllocatePoolWithTag(PagedPool,
ParametersRegistryKey.MaximumLength, CLASS_TAG);
if (!ParametersRegistryKey.Buffer)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
return STATUS_NO_MEMORY;
}
RtlCopyUnicodeString(&ParametersRegistryKey, RegistryPath);
@@ -292,7 +292,7 @@
PCLASS_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
- DPRINT("CreateClassDeviceObject(0x%p)\n", DriverObject);
+ TRACE_(CLASS_NAME, "CreateClassDeviceObject(0x%p)\n", DriverObject);
/* Create new device object */
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
@@ -305,19 +305,19 @@
DeviceNameU.Buffer = ExAllocatePoolWithTag(PagedPool, DeviceNameU.MaximumLength,
CLASS_TAG);
if (!DeviceNameU.Buffer)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
return STATUS_NO_MEMORY;
}
Status = RtlAppendUnicodeToString(&DeviceNameU, L"\\Device\\");
if (!NT_SUCCESS(Status))
{
- DPRINT("RtlAppendUnicodeToString() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "RtlAppendUnicodeToString() failed with status 0x%08lx\n",
Status);
goto cleanup;
}
Status = RtlAppendUnicodeStringToString(&DeviceNameU,
&DriverExtension->DeviceBaseName);
if (!NT_SUCCESS(Status))
{
- DPRINT("RtlAppendUnicodeStringToString() failed with status 0x%08lx\n",
Status);
+ WARN_(CLASS_NAME, "RtlAppendUnicodeStringToString() failed with status
0x%08lx\n", Status);
goto cleanup;
}
PrefixLength = DeviceNameU.MaximumLength - 4 * sizeof(WCHAR) - sizeof(UNICODE_NULL);
@@ -337,12 +337,12 @@
goto cleanup;
else if (Status != STATUS_OBJECT_NAME_COLLISION)
{
- DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "IoCreateDevice() failed with status 0x%08lx\n", Status);
goto cleanup;
}
DeviceId++;
}
- DPRINT("Too many devices starting with '\\Device\\%wZ'\n",
&DriverExtension->DeviceBaseName);
+ WARN_(CLASS_NAME, "Too many devices starting with '\\Device\\%wZ'\n",
&DriverExtension->DeviceBaseName);
Status = STATUS_TOO_MANY_NAMES;
cleanup:
if (!NT_SUCCESS(Status))
@@ -444,7 +444,7 @@
SIZE_T InputCount = DataEnd - DataStart;
SIZE_T ReadSize;
- DPRINT("ClassCallback()\n");
+ TRACE_(CLASS_NAME, "ClassCallback()\n");
ASSERT(ClassDeviceExtension->Common.IsClassDO);
@@ -482,7 +482,7 @@
}
KeReleaseSpinLock(&ClassDeviceExtension->SpinLock, OldIrql);
- DPRINT("Leaving ClassCallback()\n");
+ TRACE_(CLASS_NAME, "Leaving ClassCallback()\n");
return TRUE;
}
@@ -498,7 +498,7 @@
CONNECT_DATA ConnectData;
NTSTATUS Status;
- DPRINT("Connecting PortDO %p to ClassDO %p\n", PortDO, ClassDO);
+ TRACE_(CLASS_NAME, "Connecting PortDO %p to ClassDO %p\n", PortDO, ClassDO);
KeInitializeEvent(&Event, NotificationEvent, FALSE);
@@ -554,7 +554,7 @@
KIRQL OldIrql;
NTSTATUS Status;
- DPRINT("Destroying PortDO %p\n", PortDO);
+ TRACE_(CLASS_NAME, "Destroying PortDO %p\n", PortDO);
DeviceExtension = (PPORT_DEVICE_EXTENSION)PortDO->DeviceExtension;
ClassDeviceExtension = DeviceExtension->ClassDO->DeviceExtension;
@@ -610,7 +610,7 @@
PPORT_DEVICE_EXTENSION DeviceExtension = NULL;
NTSTATUS Status;
- DPRINT("ClassAddDevice called. Pdo = 0x%p\n", Pdo);
+ TRACE_(CLASS_NAME, "ClassAddDevice called. Pdo = 0x%p\n", Pdo);
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
@@ -629,7 +629,7 @@
&Fdo);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "IoCreateDevice() failed with status 0x%08lx\n", Status);
goto cleanup;
}
IoSetStartIoAttributes(Fdo, TRUE, TRUE);
@@ -642,7 +642,7 @@
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo,
&DeviceExtension->LowerDevice);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n",
Status);
+ WARN_(CLASS_NAME, "IoAttachDeviceToDeviceStackSafe() failed with status
0x%08lx\n", Status);
goto cleanup;
}
if (DeviceExtension->LowerDevice->Flags & DO_POWER_PAGABLE)
@@ -662,14 +662,14 @@
&DeviceExtension->ClassDO);
if (!NT_SUCCESS(Status))
{
- DPRINT("CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "CreateClassDeviceObject() failed with status 0x%08lx\n",
Status);
goto cleanup;
}
}
Status = ConnectPortDriver(Fdo, DeviceExtension->ClassDO);
if (!NT_SUCCESS(Status))
{
- DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ConnectPortDriver() failed with status 0x%08lx\n",
Status);
goto cleanup;
}
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
@@ -701,7 +701,7 @@
KIRQL OldIrql;
BOOLEAN wasQueued = FALSE;
- DPRINT("ClassCancelRoutine(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ TRACE_(CLASS_NAME, "ClassCancelRoutine(DeviceObject %p, Irp %p)\n",
DeviceObject, Irp);
ASSERT(ClassDeviceExtension->Common.IsClassDO);
@@ -738,7 +738,7 @@
PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
NTSTATUS Status;
- DPRINT("HandleReadIrp(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ TRACE_(CLASS_NAME, "HandleReadIrp(DeviceObject %p, Irp %p)\n", DeviceObject,
Irp);
ASSERT(DeviceExtension->Common.IsClassDO);
@@ -804,7 +804,7 @@
PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
KIRQL OldIrql;
- DPRINT("ClassStartIo(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ TRACE_(CLASS_NAME, "ClassStartIo(DeviceObject %p, Irp %p)\n", DeviceObject,
Irp);
ASSERT(DeviceExtension->Common.IsClassDO);
@@ -830,7 +830,7 @@
ULONG Size, ResultLength;
NTSTATUS Status;
- DPRINT("SearchForLegacyDrivers(%p %p %lu)\n",
+ TRACE_(CLASS_NAME, "SearchForLegacyDrivers(%p %p %lu)\n",
DriverObject, Context, Count);
if (Count != 1)
@@ -844,7 +844,7 @@
&PortBaseName);
if (!NT_SUCCESS(Status))
{
- DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "DuplicateUnicodeString() failed with status 0x%08lx\n",
Status);
goto cleanup;
}
PortBaseName.Length -= (sizeof(L"Class") - sizeof(UNICODE_NULL));
@@ -855,7 +855,7 @@
KeyValueInformation = ExAllocatePoolWithTag(PagedPool, Size, CLASS_TAG);
if (!KeyValueInformation)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -865,13 +865,13 @@
Status = ZwOpenKey(&hDeviceMapKey, 0, &ObjectAttributes);
if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
{
- DPRINT("HKLM\\HARDWARE\\DEVICEMAP is non-existent\n");
+ INFO_(CLASS_NAME, "HKLM\\HARDWARE\\DEVICEMAP is non-existent\n");
Status = STATUS_SUCCESS;
goto cleanup;
}
else if (!NT_SUCCESS(Status))
{
- DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ZwOpenKey() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -880,13 +880,13 @@
Status = ZwOpenKey(&hPortKey, KEY_QUERY_VALUE, &ObjectAttributes);
if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
{
- DPRINT("HKLM\\HARDWARE\\DEVICEMAP\\%wZ is non-existent\n",
&PortBaseName);
+ INFO_(CLASS_NAME, "HKLM\\HARDWARE\\DEVICEMAP\\%wZ is non-existent\n",
&PortBaseName);
Status = STATUS_SUCCESS;
goto cleanup;
}
else if (!NT_SUCCESS(Status))
{
- DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ZwOpenKey() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -904,16 +904,16 @@
Status = IoGetDeviceObjectPointer(&PortName, FILE_READ_ATTRIBUTES, &FileObject,
&PortDeviceObject);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoGetDeviceObjectPointer(%wZ) failed with status 0x%08lx\n",
&PortName, Status);
+ WARN_(CLASS_NAME, "IoGetDeviceObjectPointer(%wZ) failed with status
0x%08lx\n", &PortName, Status);
continue;
}
- DPRINT("Legacy driver found\n");
+ INFO_(CLASS_NAME, "Legacy driver found\n");
Status = ClassAddDevice(DriverObject, PortDeviceObject);
if (!NT_SUCCESS(Status))
{
/* FIXME: Log the error */
- DPRINT("ClassAddDevice() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ClassAddDevice() failed with status 0x%08lx\n", Status);
}
}
@@ -945,7 +945,7 @@
(PVOID*)&DriverExtension);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoAllocateDriverObjectExtension() failed with status 0x%08lx\n",
Status);
+ WARN_(CLASS_NAME, "IoAllocateDriverObjectExtension() failed with status
0x%08lx\n", Status);
return Status;
}
RtlZeroMemory(DriverExtension, sizeof(CLASS_DRIVER_EXTENSION));
@@ -956,14 +956,14 @@
&DriverExtension->RegistryPath);
if (!NT_SUCCESS(Status))
{
- DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "DuplicateUnicodeString() failed with status 0x%08lx\n",
Status);
return Status;
}
Status = ReadRegistryEntries(RegistryPath, DriverExtension);
if (!NT_SUCCESS(Status))
{
- DPRINT("ReadRegistryEntries() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "ReadRegistryEntries() failed with status 0x%08lx\n",
Status);
return Status;
}
@@ -974,7 +974,7 @@
&DriverExtension->MainClassDeviceObject);
if (!NT_SUCCESS(Status))
{
- DPRINT("CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
+ WARN_(CLASS_NAME, "CreateClassDeviceObject() failed with status 0x%08lx\n",
Status);
return Status;
}
}
Modified: trunk/reactos/drivers/input/mouclass/mouclass.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/mouclass/mou…
==============================================================================
--- trunk/reactos/drivers/input/mouclass/mouclass.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/mouclass/mouclass.h [iso-8859-1] Fri Jul 25 15:24:46 2008
@@ -4,7 +4,6 @@
#include <stdio.h>
#include <pseh/pseh.h>
-#define NDEBUG
#include <debug.h>
#define MAX_PATH 260
@@ -13,6 +12,7 @@
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
#define CLASS_TAG TAG('M', 'o', 'u', 'C')
+#define DPFLTR_CLASS_NAME_ID DPFLTR_MOUCLASS_ID
typedef enum
{