Use kernel facilities to change debug level at runtime

svn path=/trunk/; revision=31482
This commit is contained in:
Hervé Poussineau 2007-12-28 21:10:07 +00:00
parent 84f1d84f2d
commit 3a0687218d
26 changed files with 180 additions and 189 deletions

View file

@ -13,7 +13,7 @@ SermouseCreate(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT("IRP_MJ_CREATE\n");
TRACE_(SERMOUSE, "IRP_MJ_CREATE\n");
ASSERT(((PSERMOUSE_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->PnpState == dsStarted);
Irp->IoStatus.Status = STATUS_SUCCESS;
@ -27,7 +27,7 @@ SermouseClose(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT("IRP_MJ_CLOSE\n");
TRACE_(SERMOUSE, "IRP_MJ_CLOSE\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
@ -40,7 +40,7 @@ SermouseCleanup(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT("IRP_MJ_CLEANUP\n");
TRACE_(SERMOUSE, "IRP_MJ_CLEANUP\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

View file

@ -39,7 +39,7 @@ DeviceIoControl(
&IoStatus);
if (Irp == NULL)
{
DPRINT("IoBuildDeviceIoControlRequest() failed\n");
WARN_(SERMOUSE, "IoBuildDeviceIoControlRequest() failed\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -47,7 +47,7 @@ DeviceIoControl(
if (Status == STATUS_PENDING)
{
DPRINT("Operation pending\n");
INFO_(SERMOUSE, "Operation pending\n");
KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
Status = IoStatus.Status;
}
@ -91,7 +91,7 @@ ReadBytes(
KeWaitForSingleObject(&event, Suspended, KernelMode, FALSE, NULL);
Status = ioStatus.Status;
}
DPRINT("Bytes received: %lu/%lu\n",
INFO_(SERMOUSE, "Bytes received: %lu/%lu\n",
ioStatus.Information, BufferSize);
*FilledBytes = ioStatus.Information;
return Status;
@ -125,7 +125,7 @@ SermouseDetectLegacyDevice(
SERMOUSE_MOUSE_TYPE MouseType = mtNone;
NTSTATUS Status;
DPRINT("SermouseDetectLegacyDevice(LowerDevice %p)\n", LowerDevice);
TRACE_(SERMOUSE, "SermouseDetectLegacyDevice(LowerDevice %p)\n", LowerDevice);
RtlZeroMemory(Buffer, sizeof(Buffer));
@ -205,7 +205,7 @@ SermouseDetectLegacyDevice(
if (Buffer[i] == 'B')
{
/* Sign for Microsoft Ballpoint */
DPRINT1("Microsoft Ballpoint device detected. THIS DEVICE IS NOT YET SUPPORTED");
ERR_(SERMOUSE, "Microsoft Ballpoint device detected. THIS DEVICE IS NOT YET SUPPORTED");
MouseType = mtNone;
goto ByeBye;
}
@ -220,13 +220,13 @@ SermouseDetectLegacyDevice(
switch (Buffer[i + 1])
{
case '3':
DPRINT("Microsoft Mouse with 3-buttons detected\n");
INFO_(SERMOUSE, "Microsoft Mouse with 3-buttons detected\n");
MouseType = mtLogitech;
case 'Z':
DPRINT("Microsoft Wheel Mouse detected\n");
INFO_(SERMOUSE, "Microsoft Wheel Mouse detected\n");
MouseType = mtWheelZ;
default:
DPRINT("Microsoft Mouse with 2-buttons detected\n");
INFO_(SERMOUSE, "Microsoft Mouse with 2-buttons detected\n");
MouseType = mtMicrosoft;
}
goto ByeBye;

View file

@ -18,7 +18,7 @@ SermouseAddDevice(
PSERMOUSE_DEVICE_EXTENSION DeviceExtension = NULL;
NTSTATUS Status;
DPRINT("SermouseAddDevice called. Pdo = 0x%p\n", Pdo);
TRACE_(SERMOUSE, "SermouseAddDevice called. Pdo = 0x%p\n", Pdo);
if (Pdo == NULL)
return STATUS_SUCCESS;
@ -35,7 +35,7 @@ SermouseAddDevice(
&Fdo);
if (!NT_SUCCESS(Status))
{
DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
WARN_(SERMOUSE, "IoCreateDevice() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@ -48,7 +48,7 @@ SermouseAddDevice(
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
if (!NT_SUCCESS(Status))
{
DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
WARN_(SERMOUSE, "IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
goto cleanup;
}
if (DeviceExtension->LowerDevice->Flags & DO_POWER_PAGABLE)
@ -90,7 +90,7 @@ SermouseStartDevice(
MouseType = SermouseDetectLegacyDevice(DeviceExtension->LowerDevice);
if (MouseType == mtNone)
{
DPRINT("No mouse connected to Fdo %p\n",
WARN_(SERMOUSE, "No mouse connected to Fdo %p\n",
DeviceExtension->LowerDevice);
return STATUS_DEVICE_NOT_CONNECTED;
}
@ -110,7 +110,7 @@ SermouseStartDevice(
DeviceExtension->AttributesInformation.NumberOfButtons = 3;
break;
default:
DPRINT("Unknown mouse type 0x%lx\n", MouseType);
WARN_(SERMOUSE, "Unknown mouse type 0x%lx\n", MouseType);
ASSERT(FALSE);
return STATUS_UNSUCCESSFUL;
}
@ -170,7 +170,7 @@ SermousePnp(
*/
case IRP_MN_START_DEVICE: /* 0x0 */
{
DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
TRACE_(SERMOUSE, "IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
/* Call lower driver */
Status = ForwardIrpAndWait(DeviceObject, Irp);
if (NT_SUCCESS(Status))
@ -184,12 +184,12 @@ SermousePnp(
case BusRelations:
{
PDEVICE_RELATIONS DeviceRelations = NULL;
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
TRACE_(SERMOUSE, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
DeviceRelations = ExAllocatePoolWithTag(PagedPool, FIELD_OFFSET(DEVICE_RELATIONS, Objects), SERMOUSE_TAG);
if (!DeviceRelations)
{
DPRINT("ExAllocatePoolWithTag() failed\n");
WARN_(SERMOUSE, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
}
else
@ -202,7 +202,7 @@ SermousePnp(
}
default:
{
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
TRACE_(SERMOUSE, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
Stack->Parameters.QueryDeviceRelations.Type);
return ForwardIrpAndForget(DeviceObject, Irp);
}
@ -211,7 +211,7 @@ SermousePnp(
}
default:
{
DPRINT1("IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
TRACE_(SERMOUSE, "IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
return ForwardIrpAndForget(DeviceObject, Irp);
}
}

View file

@ -24,7 +24,7 @@ SermouseInternalDeviceControl(
{
case IOCTL_INTERNAL_MOUSE_CONNECT:
{
DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_MOUSE_CONNECT\n");
TRACE_(SERMOUSE, "IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_MOUSE_CONNECT\n");
DeviceExtension->ConnectData =
*((PCONNECT_DATA)Stack->Parameters.DeviceIoControl.Type3InputBuffer);
Status = STATUS_SUCCESS;
@ -32,7 +32,7 @@ SermouseInternalDeviceControl(
}
case IOCTL_INTERNAL_MOUSE_DISCONNECT:
{
DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_MOUSE_DISCONNECT\n");
TRACE_(SERMOUSE, "IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_MOUSE_DISCONNECT\n");
/* Ask read loop to end */
KeSetEvent(&DeviceExtension->StopWorkerThreadEvent, (KPRIORITY)0, FALSE);
@ -41,7 +41,7 @@ SermouseInternalDeviceControl(
}
case IOCTL_MOUSE_QUERY_ATTRIBUTES:
{
DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_MOUSE_QUERY_ATTRIBUTES\n");
TRACE_(SERMOUSE, "IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_MOUSE_QUERY_ATTRIBUTES\n");
if (Stack->Parameters.DeviceIoControl.OutputBufferLength >= sizeof(MOUSE_ATTRIBUTES))
{
*(PMOUSE_ATTRIBUTES)Irp->AssociatedIrp.SystemBuffer =
@ -57,7 +57,7 @@ SermouseInternalDeviceControl(
}
default:
{
DPRINT1("IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
WARN_(SERMOUSE, "IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
Stack->Parameters.DeviceIoControl.IoControlCode);
ASSERT(FALSE);
Status = STATUS_INVALID_DEVICE_REQUEST;

View file

@ -33,7 +33,7 @@ ForwardIrpAndWait(
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
DPRINT("Calling lower device %p\n", LowerDevice);
TRACE_(SERMOUSE, "Calling lower device %p\n", LowerDevice);
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
Status = IoCallDriver(LowerDevice, Irp);

View file

@ -37,7 +37,7 @@ SermouseDeviceIoControl(
&IoStatus);
if (Irp == NULL)
{
DPRINT("IoBuildDeviceIoControlRequest() failed\n");
WARN_(SERMOUSE, "IoBuildDeviceIoControlRequest() failed\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -45,7 +45,7 @@ SermouseDeviceIoControl(
if (Status == STATUS_PENDING)
{
DPRINT("Operation pending\n");
INFO_(SERMOUSE, "Operation pending\n");
KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
Status = IoStatus.Status;
}
@ -82,7 +82,7 @@ SermouseDeviceWorker(
LARGE_INTEGER Zero;
NTSTATUS Status;
DPRINT("SermouseDeviceWorker() called\n");
TRACE_(SERMOUSE, "SermouseDeviceWorker() called\n");
DeviceExtension = (PSERMOUSE_DEVICE_EXTENSION)((PDEVICE_OBJECT)Context)->DeviceExtension;
LowerDevice = DeviceExtension->LowerDevice;
@ -169,7 +169,7 @@ SermouseDeviceWorker(
for (i = 0; i < ioStatus.Information; i++)
{
ReceivedByte = Buffer[i];
DPRINT("ReceivedByte 0x%02x\n", ReceivedByte);
INFO_(SERMOUSE, "ReceivedByte 0x%02x\n", ReceivedByte);
/* Synchronize */
if ((ReceivedByte & 0x40) == 0x40)

View file

@ -24,7 +24,7 @@ IrpStub(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT1("Irp stub for major function 0x%lx\n",
ERR_(SERMOUSE, "Irp stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_SUPPORTED;
@ -46,7 +46,7 @@ ReadRegistryEntries(
ParametersRegistryKey.Buffer = ExAllocatePoolWithTag(PagedPool, ParametersRegistryKey.MaximumLength, SERMOUSE_TAG);
if (!ParametersRegistryKey.Buffer)
{
DPRINT("ExAllocatePoolWithTag() failed\n");
WARN_(SERMOUSE, "ExAllocatePoolWithTag() failed\n");
return STATUS_NO_MEMORY;
}
RtlCopyUnicodeString(&ParametersRegistryKey, RegistryPath);
@ -103,7 +103,7 @@ DriverEntry(
(PVOID*)&DriverExtension);
if (!NT_SUCCESS(Status))
{
DPRINT("IoAllocateDriverObjectExtension() failed with status 0x%08lx\n", Status);
WARN_(SERMOUSE, "IoAllocateDriverObjectExtension() failed with status 0x%08lx\n", Status);
return Status;
}
RtlZeroMemory(DriverExtension, sizeof(SERMOUSE_DRIVER_EXTENSION));
@ -111,7 +111,7 @@ DriverEntry(
Status = ReadRegistryEntries(RegistryPath, DriverExtension);
if (!NT_SUCCESS(Status))
{
DPRINT("ReadRegistryEntries() failed with status 0x%08lx\n", Status);
WARN_(SERMOUSE, "ReadRegistryEntries() failed with status 0x%08lx\n", Status);
return Status;
}

View file

@ -1,7 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="sermouse" type="kernelmodedriver" installbase="system32/drivers" installname="sermouse.sys">
<include base="sermouse">.</include>
<library>ntoskrnl</library>
<library>hal</library>
<file>createclose.c</file>

View file

@ -38,7 +38,7 @@ DeviceIoControl(
&IoStatus);
if (Irp == NULL)
{
DPRINT("IoBuildDeviceIoControlRequest() failed\n");
WARN_(SERENUM, "IoBuildDeviceIoControlRequest() failed\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -46,7 +46,7 @@ DeviceIoControl(
if (Status == STATUS_PENDING)
{
DPRINT("Operation pending\n");
INFO_(SERENUM, "Operation pending\n");
KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
Status = IoStatus.Status;
}
@ -90,7 +90,7 @@ ReadBytes(
KeWaitForSingleObject(&event, Suspended, KernelMode, FALSE, NULL);
Status = ioStatus.Status;
}
DPRINT("Bytes received: %lu/%lu\n",
INFO_(SERENUM, "Bytes received: %lu/%lu\n",
ioStatus.Information, BufferSize);
*FilledBytes = ioStatus.Information;
return Status;
@ -110,7 +110,7 @@ ReportDetectedDevice(
PFDO_DEVICE_EXTENSION FdoDeviceExtension;
NTSTATUS Status;
DPRINT("ReportDetectedDevice() called with %wZ (%wZ) detected\n", DeviceId, DeviceDescription);
TRACE_(SERENUM, "ReportDetectedDevice() called with %wZ (%wZ) detected\n", DeviceId, DeviceDescription);
Status = IoCreateDevice(
DeviceObject->DriverObject,
@ -175,9 +175,14 @@ IsValidPnpIdString(
IN PUCHAR Buffer,
IN ULONG BufferLength)
{
ANSI_STRING String;
/* FIXME: IsValidPnpIdString not implemented */
DPRINT1("IsValidPnpIdString() unimplemented\n");
return STATUS_SUCCESS;
UNIMPLEMENTED;
String.Length = String.MaximumLength = BufferLength;
String.Buffer = (PCHAR)Buffer;
ERR_(SERENUM, "Buffer %Z\n", &String);
return TRUE;
}
static NTSTATUS
@ -185,13 +190,13 @@ ReportDetectedPnpDevice(
IN PUCHAR Buffer,
IN ULONG BufferLength)
{
ULONG i;
ANSI_STRING String;
/* FIXME: ReportDetectedPnpDevice not implemented */
DPRINT1("ReportDetectedPnpDevice() unimplemented\n");
DPRINT1("");
for (i = 0; i < BufferLength; i++)
DbgPrint("%c", Buffer[i]);
DbgPrint("\n");
UNIMPLEMENTED;
String.Length = String.MaximumLength = BufferLength;
String.Buffer = (PCHAR)Buffer;
ERR_(SERENUM, "Buffer %Z\n", &String);
/* Call ReportDetectedDevice */
return STATUS_SUCCESS;
}
@ -453,7 +458,7 @@ SerenumDetectLegacyDevice(
UNICODE_STRING CompatibleIds;
NTSTATUS Status;
DPRINT("SerenumDetectLegacyDevice(DeviceObject %p, LowerDevice %p)\n",
TRACE_(SERENUM, "SerenumDetectLegacyDevice(DeviceObject %p, LowerDevice %p)\n",
DeviceObject,
LowerDevice);

View file

@ -18,7 +18,7 @@ SerenumAddDevice(
PFDO_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
DPRINT("SerenumAddDevice called. Pdo = %p\n", Pdo);
TRACE_(SERENUM, "SerenumAddDevice called. Pdo = %p\n", Pdo);
/* Create new device object */
Status = IoCreateDevice(DriverObject,
@ -30,7 +30,7 @@ SerenumAddDevice(
&Fdo);
if (!NT_SUCCESS(Status))
{
DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
WARN_(SERENUM, "IoCreateDevice() failed with status 0x%08lx\n", Status);
return Status;
}
DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension;
@ -44,7 +44,7 @@ SerenumAddDevice(
&DeviceExtension->SerenumInterfaceName);
if (!NT_SUCCESS(Status))
{
DPRINT("IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status);
WARN_(SERENUM, "IoRegisterDeviceInterface() failed with status 0x%08lx\n", Status);
IoDeleteDevice(Fdo);
return Status;
}
@ -56,7 +56,7 @@ SerenumAddDevice(
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
if (!NT_SUCCESS(Status))
{
DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
WARN_(SERENUM, "IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
IoDeleteDevice(Fdo);
return Status;
}
@ -79,7 +79,7 @@ SerenumFdoStartDevice(
PFDO_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
DPRINT("SerenumFdoStartDevice() called\n");
TRACE_(SERENUM, "SerenumFdoStartDevice() called\n");
DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
ASSERT(DeviceExtension->Common.PnpState == dsStopped);
@ -87,7 +87,7 @@ SerenumFdoStartDevice(
Status = IoSetDeviceInterfaceState(&DeviceExtension->SerenumInterfaceName, TRUE);
if (!NT_SUCCESS(Status))
{
DPRINT("IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status);
WARN_(SERENUM, "IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status);
return Status;
}
@ -177,7 +177,7 @@ SerenumFdoPnp(
*/
case IRP_MN_START_DEVICE: /* 0x0 */
{
DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
/* Call lower driver */
Status = ForwardIrpAndWait(DeviceObject, Irp);
if (NT_SUCCESS(Status))
@ -191,13 +191,13 @@ SerenumFdoPnp(
case BusRelations:
{
PDEVICE_RELATIONS DeviceRelations = NULL;
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
Status = SerenumFdoQueryBusRelations(DeviceObject, &DeviceRelations);
Information = (ULONG_PTR)DeviceRelations;
break;
}
default:
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
Stack->Parameters.QueryDeviceRelations.Type);
return ForwardIrpAndForget(DeviceObject, Irp);
}
@ -205,12 +205,12 @@ SerenumFdoPnp(
}
case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* 0xd */
{
DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
return ForwardIrpAndForget(DeviceObject, Irp);
}
default:
{
DPRINT1("IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
TRACE_(SERENUM, "IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
return ForwardIrpAndForget(DeviceObject, Irp);
}
}

View file

@ -115,7 +115,7 @@ ForwardIrpAndWait(
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
DPRINT("Calling lower device %p\n", LowerDevice);
TRACE_(SERENUM, "Calling lower device %p\n", LowerDevice);
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
Status = IoCallDriver(LowerDevice, Irp);
@ -142,7 +142,7 @@ ForwardIrpToLowerDeviceAndForget(
LowerDevice = DeviceExtension->LowerDevice;
ASSERT(LowerDevice);
DPRINT("Calling lower device 0x%p\n", LowerDevice);
TRACE_(SERENUM, "Calling lower device 0x%p\n", LowerDevice);
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(LowerDevice, Irp);
}
@ -160,7 +160,7 @@ ForwardIrpToAttachedFdoAndForget(
Fdo = DeviceExtension->AttachedFdo;
ASSERT(Fdo);
DPRINT("Calling attached Fdo 0x%p\n", Fdo);
TRACE_(SERENUM, "Calling attached Fdo 0x%p\n", Fdo);
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(Fdo, Irp);
}

View file

@ -43,28 +43,28 @@ SerenumPdoQueryId(
{
case BusQueryDeviceID:
{
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n");
SourceString = &DeviceExtension->DeviceId;
break;
}
case BusQueryHardwareIDs:
{
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
SourceString = &DeviceExtension->HardwareIds;
break;
}
case BusQueryCompatibleIDs:
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
SourceString = &DeviceExtension->CompatibleIds;
break;
case BusQueryInstanceID:
{
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
SourceString = &DeviceExtension->InstanceId;
break;
}
default:
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
WARN_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
ASSERT(FALSE);
return STATUS_NOT_SUPPORTED;
}
@ -140,7 +140,7 @@ SerenumPdoPnp(
*/
case IRP_MN_START_DEVICE: /* 0x0 */
{
DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
Status = SerenumPdoStartDevice(DeviceObject);
break;
}
@ -155,14 +155,14 @@ SerenumPdoPnp(
case TargetDeviceRelation:
{
PDEVICE_RELATIONS DeviceRelations = NULL;
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
Status = SerenumPdoQueryDeviceRelations(DeviceObject, &DeviceRelations);
Information = (ULONG_PTR)DeviceRelations;
break;
}
default:
{
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
WARN_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
Stack->Parameters.QueryDeviceRelations.Type);
ASSERT(FALSE);
Status = STATUS_NOT_IMPLEMENTED;
@ -175,7 +175,7 @@ SerenumPdoPnp(
{
PDEVICE_CAPABILITIES DeviceCapabilities;
ULONG i;
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities;
/* FIXME: capabilities can change with connected device */
@ -201,7 +201,7 @@ SerenumPdoPnp(
}
case IRP_MN_QUERY_RESOURCES: /* 0xa */
{
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES\n");
/* Serial devices don't need resources, except the ones of
* the serial port. This PDO is the serial device PDO, so
* report no resource by not changing Information and
@ -213,7 +213,7 @@ SerenumPdoPnp(
}
case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0xb */
{
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
/* Serial devices don't need resources, except the ones of
* the serial port. This PDO is the serial device PDO, so
* report no resource by not changing Information and
@ -231,7 +231,7 @@ SerenumPdoPnp(
{
PUNICODE_STRING Source;
PWSTR Description;
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
Source = &((PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->DeviceDescription;
Description = ExAllocatePoolWithTag(PagedPool, Source->Length + sizeof(WCHAR), SERENUM_TAG);
@ -257,7 +257,7 @@ SerenumPdoPnp(
}
default:
{
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / unknown type 0x%lx\n",
WARN_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / unknown type 0x%lx\n",
Stack->Parameters.QueryDeviceText.DeviceTextType);
ASSERT(FALSE);
Status = STATUS_NOT_SUPPORTED;
@ -277,7 +277,7 @@ SerenumPdoPnp(
case IRP_MN_QUERY_BUS_INFORMATION: /* 0x15 */
{
PPNP_BUS_INFORMATION BusInfo;
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_BUS_INFORMATION\n");
TRACE_(SERENUM, "IRP_MJ_PNP / IRP_MN_QUERY_BUS_INFORMATION\n");
BusInfo = (PPNP_BUS_INFORMATION)ExAllocatePoolWithTag(PagedPool, sizeof(PNP_BUS_INFORMATION), SERENUM_TAG);
if (!BusInfo)
@ -300,7 +300,7 @@ SerenumPdoPnp(
{
/* We can't forward request to the lower driver, because
* we are a Pdo, so we don't have lower driver... */
DPRINT1("IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
WARN_(SERENUM, "IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
ASSERT(FALSE);
Information = Irp->IoStatus.Information;
Status = Irp->IoStatus.Status;

View file

@ -53,7 +53,7 @@ IrpStub(
return ForwardIrpToLowerDeviceAndForget(DeviceObject, Irp);
default:
{
DPRINT1("Serenum: FDO stub for major function 0x%lx\n",
WARN_(SERENUM, "FDO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
Status = Irp->IoStatus.Status;
@ -74,7 +74,7 @@ IrpStub(
return ForwardIrpToAttachedFdoAndForget(DeviceObject, Irp);
default:
{
DPRINT1("Serenum: PDO stub for major function 0x%lx\n",
WARN_(SERENUM, "PDO stub for major function 0x%lx\n",
IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
ASSERT(FALSE);
Status = Irp->IoStatus.Status;

View file

@ -1,8 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="serenum" type="kernelmodedriver" installbase="system32/drivers" installname="serenum.sys">
<include base="serenum">.</include>
<define name="NDEBUG" />
<library>ntoskrnl</library>
<library>hal</library>
<file>detect.c</file>

View file

@ -14,7 +14,7 @@ InitializeCircularBuffer(
IN PCIRCULAR_BUFFER pBuffer,
IN ULONG BufferSize)
{
DPRINT("InitializeCircularBuffer(pBuffer %p, BufferSize %lu)\n", pBuffer, BufferSize);
TRACE_(SERIAL, "InitializeCircularBuffer(pBuffer %p, BufferSize %lu)\n", pBuffer, BufferSize);
ASSERT(pBuffer);
pBuffer->Buffer = (PUCHAR)ExAllocatePoolWithTag(NonPagedPool, BufferSize * sizeof(UCHAR), SERIAL_TAG);
if (!pBuffer->Buffer)
@ -28,7 +28,7 @@ NTSTATUS
FreeCircularBuffer(
IN PCIRCULAR_BUFFER pBuffer)
{
DPRINT("FreeCircularBuffer(pBuffer %p)\n", pBuffer);
TRACE_(SERIAL, "FreeCircularBuffer(pBuffer %p)\n", pBuffer);
ASSERT(pBuffer);
if (pBuffer->Buffer != NULL)
ExFreePoolWithTag(pBuffer->Buffer, SERIAL_TAG);
@ -39,7 +39,7 @@ BOOLEAN
IsCircularBufferEmpty(
IN PCIRCULAR_BUFFER pBuffer)
{
DPRINT("IsCircularBufferEmpty(pBuffer %p)\n", pBuffer);
TRACE_(SERIAL, "IsCircularBufferEmpty(pBuffer %p)\n", pBuffer);
ASSERT(pBuffer);
return (pBuffer->ReadPosition == pBuffer->WritePosition);
}
@ -48,7 +48,7 @@ ULONG
GetNumberOfElementsInCircularBuffer(
IN PCIRCULAR_BUFFER pBuffer)
{
DPRINT("GetNumberOfElementsInCircularBuffer(pBuffer %p)\n", pBuffer);
TRACE_(SERIAL, "GetNumberOfElementsInCircularBuffer(pBuffer %p)\n", pBuffer);
ASSERT(pBuffer);
return (pBuffer->WritePosition + pBuffer->Length - pBuffer->ReadPosition) % pBuffer->Length;
}
@ -59,7 +59,7 @@ PushCircularBufferEntry(
IN UCHAR Entry)
{
ULONG NextPosition;
DPRINT("PushCircularBufferEntry(pBuffer %p, Entry 0x%x)\n", pBuffer, Entry);
TRACE_(SERIAL, "PushCircularBufferEntry(pBuffer %p, Entry 0x%x)\n", pBuffer, Entry);
ASSERT(pBuffer);
ASSERT(pBuffer->Length);
NextPosition = (pBuffer->WritePosition + 1) % pBuffer->Length;
@ -75,7 +75,7 @@ PopCircularBufferEntry(
IN PCIRCULAR_BUFFER pBuffer,
OUT PUCHAR Entry)
{
DPRINT("PopCircularBufferEntry(pBuffer %p)\n", pBuffer);
TRACE_(SERIAL, "PopCircularBufferEntry(pBuffer %p)\n", pBuffer);
ASSERT(pBuffer);
ASSERT(pBuffer->Length);
if (IsCircularBufferEmpty(pBuffer))
@ -92,7 +92,7 @@ IncreaseCircularBufferSize(
{
PUCHAR NewBuffer;
DPRINT("IncreaseCircularBufferSize(pBuffer %p, NewBufferSize %lu)\n", pBuffer, NewBufferSize);
TRACE_(SERIAL, "IncreaseCircularBufferSize(pBuffer %p, NewBufferSize %lu)\n", pBuffer, NewBufferSize);
ASSERT(pBuffer);
ASSERT(pBuffer->Length);
if (pBuffer->Length > NewBufferSize)

View file

@ -14,7 +14,7 @@ SerialCleanup(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT("IRP_MJ_CLEANUP\n");
TRACE_(SERIAL, "IRP_MJ_CLEANUP\n");
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);

View file

@ -16,7 +16,7 @@ SerialClose(
{
PSERIAL_DEVICE_EXTENSION pDeviceExtension;
DPRINT("IRP_MJ_CLOSE\n");
TRACE_(SERIAL, "IRP_MJ_CLOSE\n");
pDeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
pDeviceExtension->IsOpened = FALSE;

View file

@ -18,7 +18,7 @@ SerialCreate(
PSERIAL_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
DPRINT("IRP_MJ_CREATE\n");
TRACE_(SERIAL, "IRP_MJ_CREATE\n");
Stack = IoGetCurrentIrpStackLocation(Irp);
DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
@ -31,12 +31,12 @@ SerialCreate(
if(DeviceExtension->IsOpened)
{
DPRINT("COM%lu is already opened\n", DeviceExtension->ComPort);
WARN_(SERIAL, "COM%lu is already opened\n", DeviceExtension->ComPort);
Status = STATUS_ACCESS_DENIED;
goto ByeBye;
}
DPRINT("Open COM%lu: successfull\n", DeviceExtension->ComPort);
INFO_(SERIAL, "Open COM%lu: successfull\n", DeviceExtension->ComPort);
DeviceExtension->IsOpened = TRUE;
Status = STATUS_SUCCESS;

View file

@ -64,7 +64,7 @@ SerialSetBaudRate(
if (NT_SUCCESS(Status))
{
UCHAR Lcr;
DPRINT("SerialSetBaudRate(COM%lu, %lu Bauds)\n", DeviceExtension->ComPort, BaudRate);
TRACE_(SERIAL, "SerialSetBaudRate(COM%lu, %lu Bauds)\n", DeviceExtension->ComPort, BaudRate);
/* Set Bit 7 of LCR to expose baud registers */
Lcr = READ_PORT_UCHAR(SER_LCR(ComPortBase));
WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr | SR_LCR_DLAB);
@ -94,7 +94,7 @@ SerialSetLineControl(
ASSERT(DeviceExtension);
ASSERT(NewSettings);
DPRINT("SerialSetLineControl(COM%lu, Settings { %lu %lu %lu })\n",
TRACE_(SERIAL, "SerialSetLineControl(COM%lu, Settings { %lu %lu %lu })\n",
DeviceExtension->ComPort, NewSettings->StopBits, NewSettings->Parity, NewSettings->WordLength);
/* Verify parameters */
@ -288,7 +288,7 @@ SerialDeviceControl(
PUCHAR ComPortBase;
NTSTATUS Status;
DPRINT("IRP_MJ_DEVICE_CONTROL dispatch\n");
TRACE_(SERIAL, "IRP_MJ_DEVICE_CONTROL dispatch\n");
Stack = IoGetCurrentIrpStackLocation(Irp);
LengthIn = Stack->Parameters.DeviceIoControl.InputBufferLength;
@ -304,7 +304,7 @@ SerialDeviceControl(
{
case IOCTL_SERIAL_CLEAR_STATS:
{
DPRINT("IOCTL_SERIAL_CLEAR_STATS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_CLEAR_STATS\n");
KeSynchronizeExecution(
DeviceExtension->Interrupt,
(PKSYNCHRONIZE_ROUTINE)SerialClearPerfStats,
@ -314,7 +314,7 @@ SerialDeviceControl(
}
case IOCTL_SERIAL_CLR_DTR:
{
DPRINT("IOCTL_SERIAL_CLR_DTR\n");
TRACE_(SERIAL, "IOCTL_SERIAL_CLR_DTR\n");
/* FIXME: If the handshake flow control of the device is configured to
* automatically use DTR, return STATUS_INVALID_PARAMETER */
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, ULongToPtr(DeviceExtension->ComPort));
@ -328,7 +328,7 @@ SerialDeviceControl(
}
case IOCTL_SERIAL_CLR_RTS:
{
DPRINT("IOCTL_SERIAL_CLR_RTS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_CLR_RTS\n");
/* FIXME: If the handshake flow control of the device is configured to
* automatically use RTS, return STATUS_INVALID_PARAMETER */
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, ULongToPtr(DeviceExtension->ComPort));
@ -344,7 +344,7 @@ SerialDeviceControl(
{
/* Obsolete on Microsoft Windows 2000+ */
PULONG pConfigSize;
DPRINT("IOCTL_SERIAL_CONFIG_SIZE\n");
TRACE_(SERIAL, "IOCTL_SERIAL_CONFIG_SIZE\n");
if (LengthOut != sizeof(ULONG) || BufferOut == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -358,7 +358,7 @@ SerialDeviceControl(
}
case IOCTL_SERIAL_GET_BAUD_RATE:
{
DPRINT("IOCTL_SERIAL_GET_BAUD_RATE\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_BAUD_RATE\n");
if (LengthOut < sizeof(SERIAL_BAUD_RATE))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferOut == NULL)
@ -374,13 +374,13 @@ SerialDeviceControl(
case IOCTL_SERIAL_GET_CHARS:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_GET_CHARS not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_GET_CHARS not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_GET_COMMSTATUS:
{
DPRINT("IOCTL_SERIAL_GET_COMMSTATUS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_COMMSTATUS\n");
if (LengthOut < sizeof(SERIAL_STATUS))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferOut == NULL)
@ -395,7 +395,7 @@ SerialDeviceControl(
case IOCTL_SERIAL_GET_DTRRTS:
{
PULONG pDtrRts;
DPRINT("IOCTL_SERIAL_GET_DTRRTS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_DTRRTS\n");
if (LengthOut != sizeof(ULONG) || BufferOut == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -414,13 +414,13 @@ SerialDeviceControl(
case IOCTL_SERIAL_GET_HANDFLOW:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_GET_HANDFLOW not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_GET_HANDFLOW not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_GET_LINE_CONTROL:
{
DPRINT("IOCTL_SERIAL_GET_LINE_CONTROL\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_LINE_CONTROL\n");
if (LengthOut < sizeof(SERIAL_LINE_CONTROL))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferOut == NULL)
@ -436,7 +436,7 @@ SerialDeviceControl(
case IOCTL_SERIAL_GET_MODEM_CONTROL:
{
PULONG pMCR;
DPRINT("IOCTL_SERIAL_GET_MODEM_CONTROL\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_MODEM_CONTROL\n");
if (LengthOut != sizeof(ULONG) || BufferOut == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -451,7 +451,7 @@ SerialDeviceControl(
case IOCTL_SERIAL_GET_MODEMSTATUS:
{
PULONG pMSR;
DPRINT("IOCTL_SERIAL_GET_MODEMSTATUS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_MODEMSTATUS\n");
if (LengthOut != sizeof(ULONG) || BufferOut == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -465,7 +465,7 @@ SerialDeviceControl(
}
case IOCTL_SERIAL_GET_PROPERTIES:
{
DPRINT("IOCTL_SERIAL_GET_PROPERTIES\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_PROPERTIES\n");
if (LengthOut < sizeof(SERIAL_COMMPROP))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferOut == NULL)
@ -479,7 +479,7 @@ SerialDeviceControl(
}
case IOCTL_SERIAL_GET_STATS:
{
DPRINT("IOCTL_SERIAL_GET_STATS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_STATS\n");
if (LengthOut < sizeof(SERIALPERF_STATS))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferOut == NULL)
@ -495,7 +495,7 @@ SerialDeviceControl(
}
case IOCTL_SERIAL_GET_TIMEOUTS:
{
DPRINT("IOCTL_SERIAL_GET_TIMEOUTS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_TIMEOUTS\n");
if (LengthOut != sizeof(SERIAL_TIMEOUTS) || BufferOut == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -509,7 +509,7 @@ SerialDeviceControl(
case IOCTL_SERIAL_GET_WAIT_MASK:
{
PULONG pWaitMask;
DPRINT("IOCTL_SERIAL_GET_WAIT_MASK\n");
TRACE_(SERIAL, "IOCTL_SERIAL_GET_WAIT_MASK\n");
if (LengthOut != sizeof(ULONG) || BufferOut == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -524,21 +524,21 @@ SerialDeviceControl(
case IOCTL_SERIAL_IMMEDIATE_CHAR:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_IMMEDIATE_CHAR not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_IMMEDIATE_CHAR not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_LSRMST_INSERT:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_LSRMST_INSERT not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_LSRMST_INSERT not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_PURGE:
{
KIRQL Irql;
DPRINT("IOCTL_SERIAL_PURGE\n");
TRACE_(SERIAL, "IOCTL_SERIAL_PURGE\n");
/* FIXME: SERIAL_PURGE_RXABORT and SERIAL_PURGE_TXABORT
* should stop current request */
if (LengthIn != sizeof(ULONG) || BufferIn == NULL)
@ -588,14 +588,14 @@ SerialDeviceControl(
case IOCTL_SERIAL_RESET_DEVICE:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_RESET_DEVICE not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_RESET_DEVICE not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_BAUD_RATE:
{
PULONG pNewBaudRate;
DPRINT("IOCTL_SERIAL_SET_BAUD_RATE\n");
TRACE_(SERIAL, "IOCTL_SERIAL_SET_BAUD_RATE\n");
if (LengthIn != sizeof(ULONG) || BufferIn == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -608,21 +608,21 @@ SerialDeviceControl(
case IOCTL_SERIAL_SET_BREAK_OFF:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_SET_BREAK_OFF not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_SET_BREAK_OFF not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_BREAK_ON:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_SET_BREAK_ON not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_SET_BREAK_ON not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_CHARS:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_SET_CHARS not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_SET_CHARS not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
@ -630,7 +630,7 @@ SerialDeviceControl(
{
/* FIXME: If the handshake flow control of the device is configured to
* automatically use DTR, return STATUS_INVALID_PARAMETER */
DPRINT("IOCTL_SERIAL_SET_DTR\n");
TRACE_(SERIAL, "IOCTL_SERIAL_SET_DTR\n");
if (!(DeviceExtension->MCR & SR_MCR_DTR))
{
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, ULongToPtr(DeviceExtension->ComPort));
@ -647,7 +647,7 @@ SerialDeviceControl(
}
case IOCTL_SERIAL_SET_FIFO_CONTROL:
{
DPRINT("IOCTL_SERIAL_SET_FIFO_CONTROL\n");
TRACE_(SERIAL, "IOCTL_SERIAL_SET_FIFO_CONTROL\n");
if (LengthIn != sizeof(ULONG) || BufferIn == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -664,13 +664,13 @@ SerialDeviceControl(
case IOCTL_SERIAL_SET_HANDFLOW:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_SET_HANDFLOW not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_SET_HANDFLOW not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_LINE_CONTROL:
{
DPRINT("IOCTL_SERIAL_SET_LINE_CONTROL\n");
TRACE_(SERIAL, "IOCTL_SERIAL_SET_LINE_CONTROL\n");
if (LengthIn < sizeof(SERIAL_LINE_CONTROL))
Status = STATUS_BUFFER_TOO_SMALL;
else if (BufferIn == NULL)
@ -682,7 +682,7 @@ SerialDeviceControl(
case IOCTL_SERIAL_SET_MODEM_CONTROL:
{
PULONG pMCR;
DPRINT("IOCTL_SERIAL_SET_MODEM_CONTROL\n");
TRACE_(SERIAL, "IOCTL_SERIAL_SET_MODEM_CONTROL\n");
if (LengthIn != sizeof(ULONG) || BufferIn == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -728,7 +728,7 @@ SerialDeviceControl(
{
/* FIXME: If the handshake flow control of the device is configured to
* automatically use DTR, return STATUS_INVALID_PARAMETER */
DPRINT("IOCTL_SERIAL_SET_RTS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_SET_RTS\n");
if (!(DeviceExtension->MCR & SR_MCR_RTS))
{
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, ULongToPtr(DeviceExtension->ComPort));
@ -745,7 +745,7 @@ SerialDeviceControl(
}
case IOCTL_SERIAL_SET_TIMEOUTS:
{
DPRINT("IOCTL_SERIAL_SET_TIMEOUTS\n");
TRACE_(SERIAL, "IOCTL_SERIAL_SET_TIMEOUTS\n");
if (LengthIn != sizeof(SERIAL_TIMEOUTS) || BufferIn == NULL)
Status = STATUS_INVALID_PARAMETER;
else
@ -758,13 +758,13 @@ SerialDeviceControl(
case IOCTL_SERIAL_SET_WAIT_MASK:
{
PULONG pWaitMask = (PULONG)BufferIn;
DPRINT("IOCTL_SERIAL_SET_WAIT_MASK\n");
TRACE_(SERIAL, "IOCTL_SERIAL_SET_WAIT_MASK\n");
if (LengthIn != sizeof(ULONG) || BufferIn == NULL)
Status = STATUS_INVALID_PARAMETER;
else if (DeviceExtension->WaitOnMaskIrp) /* FIXME: Race condition ; field may be currently in modification */
{
DPRINT("An IRP is already currently processed\n");
WARN_(SERIAL, "An IRP is already currently processed\n");
Status = STATUS_INVALID_PARAMETER;
}
else
@ -777,21 +777,21 @@ SerialDeviceControl(
case IOCTL_SERIAL_SET_XOFF:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_SET_XOFF not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_SET_XOFF not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_SET_XON:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_SET_XON not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_SET_XON not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
case IOCTL_SERIAL_WAIT_ON_MASK:
{
PIRP WaitingIrp;
DPRINT("IOCTL_SERIAL_WAIT_ON_MASK\n");
TRACE_(SERIAL, "IOCTL_SERIAL_WAIT_ON_MASK\n");
if (LengthOut != sizeof(ULONG) || BufferOut == NULL)
Status = STATUS_INVALID_PARAMETER;
@ -810,7 +810,7 @@ SerialDeviceControl(
if (WaitingIrp != NULL)
{
/* Unable to have a 2nd pending IRP for this IOCTL */
DPRINT("Unable to pend a second IRP for IOCTL_SERIAL_WAIT_ON_MASK\n");
WARN_(SERIAL, "Unable to pend a second IRP for IOCTL_SERIAL_WAIT_ON_MASK\n");
Status = STATUS_INVALID_PARAMETER;
}
else
@ -824,14 +824,14 @@ SerialDeviceControl(
case IOCTL_SERIAL_XOFF_COUNTER:
{
/* FIXME */
DPRINT1("IOCTL_SERIAL_XOFF_COUNTER not implemented.\n");
ERR_(SERIAL, "IOCTL_SERIAL_XOFF_COUNTER not implemented.\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
}
default:
{
/* Pass Irp to lower driver */
DPRINT("Unknown IOCTL code 0x%x\n", Stack->Parameters.DeviceIoControl.IoControlCode);
TRACE_(SERIAL, "Unknown IOCTL code 0x%x\n", Stack->Parameters.DeviceIoControl.IoControlCode);
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(DeviceExtension->LowerDevice, Irp);
}

View file

@ -32,7 +32,7 @@ SerialQueryInformation(
{
PFILE_STANDARD_INFORMATION StandardInfo = (PFILE_STANDARD_INFORMATION)SystemBuffer;
DPRINT("IRP_MJ_QUERY_INFORMATION / FileStandardInformation\n");
TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION / FileStandardInformation\n");
if (BufferLength < sizeof(FILE_STANDARD_INFORMATION))
Status = STATUS_BUFFER_OVERFLOW;
else if (!StandardInfo)
@ -54,7 +54,7 @@ SerialQueryInformation(
ASSERT(PositionInfo);
DPRINT("IRP_MJ_QUERY_INFORMATION / FilePositionInformation\n");
TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION / FilePositionInformation\n");
if (BufferLength < sizeof(PFILE_POSITION_INFORMATION))
Status = STATUS_BUFFER_OVERFLOW;
else if (!PositionInfo)
@ -68,7 +68,7 @@ SerialQueryInformation(
}
default:
{
DPRINT("IRP_MJ_QUERY_INFORMATION: Unexpected file information class 0x%02x\n", Stack->Parameters.QueryFile.FileInformationClass);
TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION: Unexpected file information class 0x%02x\n", Stack->Parameters.QueryFile.FileInformationClass);
return ForwardIrpAndForget(DeviceObject, Irp);
}
}

View file

@ -37,7 +37,7 @@ ForwardIrpAndWait(
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(Irp);
DPRINT("Calling lower device %p\n", LowerDevice);
TRACE_(SERIAL, "Calling lower device %p\n", LowerDevice);
IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
Status = IoCallDriver(LowerDevice, Irp);
@ -85,7 +85,7 @@ SerialReceiveByte(
while (READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_DATA_RECEIVED)
{
Byte = READ_PORT_UCHAR(SER_RBR(ComPortBase));
DPRINT("Byte received on COM%lu: 0x%02x\n",
INFO_(SERIAL, "Byte received on COM%lu: 0x%02x\n",
DeviceExtension->ComPort, Byte);
Status = PushCircularBufferEntry(&DeviceExtension->InputBuffer, Byte);
if (NT_SUCCESS(Status))
@ -126,7 +126,7 @@ SerialSendByte(
if (!NT_SUCCESS(Status))
break;
WRITE_PORT_UCHAR(SER_THR(ComPortBase), Byte);
DPRINT("Byte sent to COM%lu: 0x%02x\n",
INFO_(SERIAL, "Byte sent to COM%lu: 0x%02x\n",
DeviceExtension->ComPort, Byte);
DeviceExtension->SerialPerfStats.TransmittedCount++;
}
@ -178,7 +178,7 @@ SerialInterruptService(
case SR_IIR_MSR_CHANGE:
{
UCHAR MSR, IER;
DPRINT("SR_IIR_MSR_CHANGE\n");
TRACE_(SERIAL, "SR_IIR_MSR_CHANGE\n");
MSR = READ_PORT_UCHAR(SER_MSR(ComPortBase));
if (MSR & SR_MSR_CTS_CHANGED)
@ -199,12 +199,12 @@ SerialInterruptService(
}
if (MSR & SR_MSR_RI_CHANGED)
{
DPRINT("SR_MSR_RI_CHANGED changed: now %d\n", MSR & SI_MSR_RI);
INFO_(SERIAL, "SR_MSR_RI_CHANGED changed: now %d\n", MSR & SI_MSR_RI);
Events |= SERIAL_EV_RING;
}
if (MSR & SR_MSR_DCD_CHANGED)
{
DPRINT("SR_MSR_DCD_CHANGED changed: now %d\n", MSR & SR_MSR_DCD);
INFO_(SERIAL, "SR_MSR_DCD_CHANGED changed: now %d\n", MSR & SR_MSR_DCD);
Events |= SERIAL_EV_RLSD;
}
IER = READ_PORT_UCHAR(SER_IER(ComPortBase));
@ -215,7 +215,7 @@ SerialInterruptService(
}
case SR_IIR_THR_EMPTY:
{
DPRINT("SR_IIR_THR_EMPTY\n");
TRACE_(SERIAL, "SR_IIR_THR_EMPTY\n");
KeInsertQueueDpc(&DeviceExtension->SendByteDpc, NULL, NULL);
Events |= SERIAL_EV_TXEMPTY;
@ -226,7 +226,7 @@ SerialInterruptService(
case SR_IIR_DATA_RECEIVED:
{
ULONG AlreadyReceivedBytes, Limit;
DPRINT("SR_IIR_DATA_RECEIVED\n");
TRACE_(SERIAL, "SR_IIR_DATA_RECEIVED\n");
KeInsertQueueDpc(&DeviceExtension->ReceivedByteDpc, NULL, NULL);
Events |= SERIAL_EV_RXCHAR;
@ -247,7 +247,7 @@ SerialInterruptService(
case SR_IIR_ERROR:
{
UCHAR LSR;
DPRINT("SR_IIR_ERROR\n");
TRACE_(SERIAL, "SR_IIR_ERROR\n");
LSR = READ_PORT_UCHAR(SER_LSR(ComPortBase));
if (LSR & SR_LSR_OVERRUN_ERROR)

View file

@ -27,7 +27,7 @@ SerialAddDeviceInternal(
static ULONG DeviceNumber = 0;
static ULONG ComPortNumber = 1;
DPRINT("SerialAddDeviceInternal()\n");
TRACE_(SERIAL, "SerialAddDeviceInternal()\n");
ASSERT(DriverObject);
ASSERT(Pdo);
@ -44,7 +44,7 @@ SerialAddDeviceInternal(
&Fdo);
if (!NT_SUCCESS(Status))
{
DPRINT("IoCreateDevice() failed with status 0x%08x\n", Status);
WARN_(SERIAL, "IoCreateDevice() failed with status 0x%08x\n", Status);
Fdo = NULL;
goto ByeBye;
}
@ -55,7 +55,7 @@ SerialAddDeviceInternal(
Status = IoRegisterDeviceInterface(Pdo, &GUID_DEVINTERFACE_COMPORT, NULL, &DeviceExtension->SerialInterfaceName);
if (!NT_SUCCESS(Status))
{
DPRINT("IoRegisterDeviceInterface() failed with status 0x%08x\n", Status);
WARN_(SERIAL, "IoRegisterDeviceInterface() failed with status 0x%08x\n", Status);
goto ByeBye;
}
@ -81,7 +81,7 @@ SerialAddDeviceInternal(
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
if (!NT_SUCCESS(Status))
{
DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08x\n", Status);
WARN_(SERIAL, "IoAttachDeviceToDeviceStackSafe() failed with status 0x%08x\n", Status);
goto ByeBye;
}
if (DeviceExtension->LowerDevice->Flags & DO_POWER_PAGABLE)
@ -160,12 +160,12 @@ SerialPnpStartDevice(
if (!ResourceList)
{
DPRINT("No allocated resources sent to driver\n");
WARN_(SERIAL, "No allocated resources sent to driver\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
if (ResourceList->Count != 1)
{
DPRINT("Wrong number of allocated resources sent to driver\n");
WARN_(SERIAL, "Wrong number of allocated resources sent to driver\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
if (ResourceList->List[0].PartialResourceList.Version != 1
@ -173,7 +173,7 @@ SerialPnpStartDevice(
|| ResourceListTranslated->List[0].PartialResourceList.Version != 1
|| ResourceListTranslated->List[0].PartialResourceList.Revision != 1)
{
DPRINT("Revision mismatch: %u.%u != 1.1 or %u.%u != 1.1\n",
WARN_(SERIAL, "Revision mismatch: %u.%u != 1.1 or %u.%u != 1.1\n",
ResourceList->List[0].PartialResourceList.Version,
ResourceList->List[0].PartialResourceList.Revision,
ResourceListTranslated->List[0].PartialResourceList.Version,
@ -209,7 +209,7 @@ SerialPnpStartDevice(
break;
}
}
DPRINT("New COM port. Base = 0x%lx, Irql = %u\n",
INFO_(SERIAL, "New COM port. Base = 0x%lx, Irql = %u\n",
DeviceExtension->BaseAddress, Dirql);
if (!DeviceExtension->BaseAddress)
return STATUS_INSUFFICIENT_RESOURCES;
@ -220,7 +220,7 @@ SerialPnpStartDevice(
/* Test if we are trying to start the serial port used for debugging */
if (*KdComPortInUse == ULongToPtr(DeviceExtension->BaseAddress))
{
DPRINT("Failing IRP_MN_START_DEVICE as this serial port is used for debugging\n");
INFO_(SERIAL, "Failing IRP_MN_START_DEVICE as this serial port is used for debugging\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -236,7 +236,7 @@ SerialPnpStartDevice(
Status = SerialSetBaudRate(DeviceExtension, DeviceExtension->BaudRate);
if (!NT_SUCCESS(Status))
{
DPRINT("SerialSetBaudRate() failed with status 0x%08x\n", Status);
WARN_(SERIAL, "SerialSetBaudRate() failed with status 0x%08x\n", Status);
return Status;
}
@ -247,7 +247,7 @@ SerialPnpStartDevice(
Status = SerialSetLineControl(DeviceExtension, &DeviceExtension->SerialLineControl);
if (!NT_SUCCESS(Status))
{
DPRINT("SerialSetLineControl() failed with status 0x%08x\n", Status);
WARN_(SERIAL, "SerialSetLineControl() failed with status 0x%08x\n", Status);
return Status;
}
@ -269,7 +269,7 @@ SerialPnpStartDevice(
Status = IoCreateSymbolicLink(&LinkName, &DeviceName);
if (!NT_SUCCESS(Status))
{
DPRINT("IoCreateSymbolicLink() failed with status 0x%08x\n", Status);
WARN_(SERIAL, "IoCreateSymbolicLink() failed with status 0x%08x\n", Status);
return Status;
}
@ -282,7 +282,7 @@ SerialPnpStartDevice(
Affinity, FALSE);
if (!NT_SUCCESS(Status))
{
DPRINT("IoConnectInterrupt() failed with status 0x%08x\n", Status);
WARN_(SERIAL, "IoConnectInterrupt() failed with status 0x%08x\n", Status);
IoSetDeviceInterfaceState(&DeviceExtension->SerialInterfaceName, FALSE);
IoDeleteSymbolicLink(&LinkName);
return Status;
@ -337,7 +337,7 @@ SerialPnp(
IRP_MN_QUERY_REMOVE_DEVICE 0x1
IRP_MN_REMOVE_DEVICE 0x2
{
DPRINT("IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n");
TRACE_(SERIAL, "IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n");
IoAcquireRemoveLock
IoReleaseRemoveLockAndWait
pass request to DeviceExtension-LowerDriver
@ -360,7 +360,7 @@ SerialPnp(
*/
case IRP_MN_START_DEVICE: /* 0x0 */
{
DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
TRACE_(SERIAL, "IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
ASSERT(((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->PnpState == dsStopped);
@ -379,16 +379,16 @@ SerialPnp(
{
case BusRelations:
{
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
TRACE_(SERIAL, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
return ForwardIrpAndForget(DeviceObject, Irp);
}
case RemovalRelations:
{
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
TRACE_(SERIAL, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
return ForwardIrpAndForget(DeviceObject, Irp);
}
default:
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
TRACE_(SERIAL, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
Stack->Parameters.QueryDeviceRelations.Type);
return ForwardIrpAndForget(DeviceObject, Irp);
}
@ -396,12 +396,12 @@ SerialPnp(
}
case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* (optional) 0xd */
{
DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
TRACE_(SERIAL, "IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
return ForwardIrpAndForget(DeviceObject, Irp);
}
default:
{
DPRINT1("Unknown minor function 0x%x\n", MinorFunction);
TRACE_(SERIAL, "Unknown minor function 0x%x\n", MinorFunction);
return ForwardIrpAndForget(DeviceObject, Irp);
}
}

View file

@ -14,7 +14,7 @@ SerialPower(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
DPRINT("IRP_MJ_POWER dispatch\n");
TRACE_(SERIAL, "IRP_MJ_POWER dispatch\n");
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(Irp, IO_NO_INCREMENT);

View file

@ -45,10 +45,10 @@ ReadBytes(
Length = IoGetCurrentIrpStackLocation(Irp)->Parameters.Read.Length;
Buffer = SerialGetUserBuffer(Irp);
DPRINT("UseIntervalTimeout = %s, IntervalTimeout = %lu\n",
INFO_(SERIAL, "UseIntervalTimeout = %s, IntervalTimeout = %lu\n",
WorkItemData->UseIntervalTimeout ? "YES" : "NO",
WorkItemData->UseIntervalTimeout ? WorkItemData->IntervalTimeout.QuadPart : 0);
DPRINT("UseTotalTimeout = %s\n",
INFO_(SERIAL, "UseTotalTimeout = %s\n",
WorkItemData->UseTotalTimeout ? "YES" : "NO");
ObjectCount = 1;
@ -70,7 +70,7 @@ ReadBytes(
&& Length > 0)
{
PopCircularBufferEntry(&DeviceExtension->InputBuffer, &ReceivedByte);
DPRINT("Reading byte from buffer: 0x%02x\n", ReceivedByte);
INFO_(SERIAL, "Reading byte from buffer: 0x%02x\n", ReceivedByte);
Buffer[Information++] = ReceivedByte;
Length--;
@ -81,7 +81,7 @@ ReadBytes(
if (WorkItemData->DontWait
&& !(WorkItemData->ReadAtLeastOneByte && Information == 0))
{
DPRINT("Buffer empty. Don't wait more bytes\n");
INFO_(SERIAL, "Buffer empty. Don't wait more bytes\n");
break;
}
@ -98,7 +98,7 @@ ReadBytes(
if (Status == STATUS_TIMEOUT /* interval timeout */
|| Status == STATUS_WAIT_1) /* total timeout */
{
DPRINT("Timeout when reading bytes. Status = 0x%08lx\n", Status);
TRACE_(SERIAL, "Timeout when reading bytes. Status = 0x%08lx\n", Status);
break;
}
}
@ -122,7 +122,7 @@ SerialReadWorkItem(
PWORKITEM_DATA WorkItemData;
PIRP Irp;
DPRINT("SerialReadWorkItem() called\n");
TRACE_(SERIAL, "SerialReadWorkItem() called\n");
WorkItemData = (PWORKITEM_DATA)pWorkItemData;
Irp = WorkItemData->Irp;
@ -148,7 +148,7 @@ SerialRead(
PIO_WORKITEM WorkItem;
NTSTATUS Status;
DPRINT("IRP_MJ_READ\n");
TRACE_(SERIAL, "IRP_MJ_READ\n");
Stack = IoGetCurrentIrpStackLocation(Irp);
Length = Stack->Parameters.Read.Length;
@ -260,7 +260,7 @@ SerialWrite(
KIRQL Irql;
NTSTATUS Status = STATUS_SUCCESS;
DPRINT("IRP_MJ_WRITE\n");
TRACE_(SERIAL, "IRP_MJ_WRITE\n");
/* FIXME: pend operation if possible */
/* FIXME: use write timeouts */
@ -297,7 +297,7 @@ SerialWrite(
}
else
{
DPRINT("Buffer overrun on COM%lu\n", DeviceExtension->ComPort);
WARN_(SERIAL, "Buffer overrun on COM%lu\n", DeviceExtension->ComPort);
DeviceExtension->SerialPerfStats.BufferOverrunErrorCount++;
break;
}

View file

@ -11,17 +11,7 @@
#include <ndk/haltypes.h>
#include <ntddser.h>
#include <stdio.h>
#if defined(__GNUC__)
#include <debug.h>
#elif defined(_MSC_VER)
#define DPRINT1 DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
#define CHECKPOINT1 DbgPrint("(%s:%d)\n", __FILE__, __LINE__)
#define DPRINT
#define CHECKPOINT
#else
#error Unknown compiler!
#endif
#include <debug.h>
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))

View file

@ -1,7 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="serial" type="kernelmodedriver" installbase="system32/drivers" installname="serial.sys">
<define name="NDEBUG" />
<library>ntoskrnl</library>
<library>hal</library>
<file>circularbuffer.c</file>