* DumpData = Pointer to dump data for the log entry
*/
{
-#if 0
PIO_ERROR_LOG_PACKET LogEntry;
UCHAR EntrySize;
ULONG StringSize;
EntrySize += (UCHAR)StringSize;
}
- LogEntry = (PIO_ERROR_LOG_PACKET)IoAllocateErrorLogEntry(
- DriverContext, EntrySize);
-
- if (LogEntry) {
- LogEntry->MajorFunctionCode = -1;
- LogEntry->RetryCount = -1;
- LogEntry->DumpDataSize = (USHORT)(DumpDataCount * sizeof(ULONG));
- LogEntry->NumberOfStrings = (String == NULL) ? 1 : 2;
- LogEntry->StringOffset = sizeof(IO_ERROR_LOG_PACKET) + (DumpDataCount-1) * sizeof(ULONG);
- LogEntry->EventCategory = 0;
- LogEntry->ErrorCode = ErrorCode;
- LogEntry->UniqueErrorValue = UniqueErrorValue;
- LogEntry->FinalStatus = FinalStatus;
- LogEntry->SequenceNumber = -1;
- LogEntry->IoControlCode = 0;
-
- if (DumpDataCount)
- RtlCopyMemory(LogEntry->DumpData, DumpData, DumpDataCount * sizeof(ULONG));
-
- pString = ((PUCHAR)LogEntry) + LogEntry->StringOffset;
- RtlCopyMemory(pString, DriverName, sizeof(DriverName));
- pString += sizeof(DriverName);
-
- if (String)
- RtlCopyMemory(pString, String, StringSize);
-
- IoWriteErrorLogEntry(LogEntry);
- }
-#endif
+ /* Fail if the required error log entry is too large */
+ if (EntrySize > ERROR_LOG_MAXIMUM_SIZE)
+ return;
+
+ LogEntry = (PIO_ERROR_LOG_PACKET)IoAllocateErrorLogEntry(DriverContext, EntrySize);
+ if (!LogEntry)
+ return;
+
+ LogEntry->MajorFunctionCode = -1;
+ LogEntry->RetryCount = -1;
+ LogEntry->DumpDataSize = (USHORT)(DumpDataCount * sizeof(ULONG));
+ LogEntry->NumberOfStrings = (String == NULL) ? 1 : 2;
+ LogEntry->StringOffset = sizeof(IO_ERROR_LOG_PACKET) + (DumpDataCount * sizeof(ULONG));
+ LogEntry->EventCategory = 0;
+ LogEntry->ErrorCode = ErrorCode;
+ LogEntry->UniqueErrorValue = UniqueErrorValue;
+ LogEntry->FinalStatus = FinalStatus;
+ LogEntry->SequenceNumber = -1;
+ LogEntry->IoControlCode = 0;
+
+ if (DumpDataCount)
+ RtlCopyMemory(LogEntry->DumpData, DumpData, DumpDataCount * sizeof(ULONG));
+
+ pString = ((PUCHAR)LogEntry) + LogEntry->StringOffset;
+ RtlCopyMemory(pString, DriverName, sizeof(DriverName));
+ pString += sizeof(DriverName);
+
+ if (String)
+ RtlCopyMemory(pString, String, StringSize);
+
+ IoWriteErrorLogEntry(LogEntry);
}
/*
TI_DbgPrint(MIN_TRACE, ("AddressCount: %d\n", Address->TAAddressCount));
if( Address->TAAddressCount == 1 )
{
- TI_DbgPrint(MIN_TRACE, ("AddressLength: %\n",
+ TI_DbgPrint(MIN_TRACE, ("AddressLength: %u\n",
Address->Address[0].AddressLength));
- TI_DbgPrint(MIN_TRACE, ("AddressType: %\n",
+ TI_DbgPrint(MIN_TRACE, ("AddressType: %u\n",
Address->Address[0].AddressType));
}
break;
}
+ if (NT_SUCCESS(Status))
+ ExFreePoolWithTag(Context, TRANS_CONTEXT_TAG);
+
Irp->IoStatus.Status = Status;
return Irp->IoStatus.Status;
Status = DispTdiDeleteIPAddress(Irp, IrpSp);
break;
+ case IOCTL_QUERY_IP_HW_ADDRESS:
+ TI_DbgPrint(MIN_TRACE, ("QUERY_IP_HW_ADDRESS\n"));
+ Status = DispTdiQueryIpHwAddress(DeviceObject, Irp, IrpSp);
+ break;
+
default:
TI_DbgPrint(MIN_TRACE, ("Unknown IOCTL 0x%X\n",
IrpSp->Parameters.DeviceIoControl.IoControlCode));