if (NT_SUCCESS(Status)) {
Status = ObReferenceObjectByHandle(*Handle, /* Handle to open file */
GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, /* Access mode */
- IoFileObjectType, /* Object type */
+ *IoFileObjectType, /* Object type */
KernelMode, /* Access mode */
(PVOID*)Object, /* Pointer to object */
NULL); /* Handle information */
EaLength = sizeof(FILE_FULL_EA_INFORMATION) +
TDI_TRANSPORT_ADDRESS_LENGTH +
TaLengthOfTransportAddress( Name ) + 1;
- EaInfo = (PFILE_FULL_EA_INFORMATION)ExAllocatePool(NonPagedPool, EaLength);
+ EaInfo = (PFILE_FULL_EA_INFORMATION)ExAllocatePoolWithTag(NonPagedPool,
+ EaLength,
+ TAG_AFD_EA_INFO);
if (!EaInfo)
return STATUS_INSUFFICIENT_RESOURCES;
ShareType,
AddressHandle,
AddressObject);
- ExFreePool(EaInfo);
+ ExFreePoolWithTag(EaInfo, TAG_AFD_EA_INFO);
return Status;
}
PTDI_MAX_DATAGRAM_INFO Buffer;
NTSTATUS Status = STATUS_SUCCESS;
- Buffer = ExAllocatePool(NonPagedPool, sizeof(TDI_MAX_DATAGRAM_INFO));
+ Buffer = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(TDI_MAX_DATAGRAM_INFO),
+ TAG_AFD_DATA_BUFFER);
+
if (!Buffer) return STATUS_NO_MEMORY;
Mdl = IoAllocateMdl(Buffer, sizeof(TDI_MAX_DATAGRAM_INFO), FALSE, FALSE, NULL);
if (!Mdl)
{
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, TAG_AFD_DATA_BUFFER);
return STATUS_NO_MEMORY;
}
{
AFD_DbgPrint(MIN_TRACE,("Failed to lock pages\n"));
IoFreeMdl(Mdl);
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, TAG_AFD_DATA_BUFFER);
return Status;
}
Mdl);
if (!NT_SUCCESS(Status))
{
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, TAG_AFD_DATA_BUFFER);
return Status;
}
*MaxDatagramLength = Buffer->MaxDatagramSize;
- ExFreePool(Buffer);
+ ExFreePoolWithTag(Buffer, TAG_AFD_DATA_BUFFER);
return STATUS_SUCCESS;
}
TDI_CONNECTION_CONTEXT_LENGTH +
sizeof(PVOID) + 1;
- EaInfo = (PFILE_FULL_EA_INFORMATION)ExAllocatePool(NonPagedPool, EaLength);
+ EaInfo = (PFILE_FULL_EA_INFORMATION)ExAllocatePoolWithTag(NonPagedPool,
+ EaLength,
+ TAG_AFD_EA_INFO);
if (!EaInfo)
return STATUS_INSUFFICIENT_RESOURCES;
AFD_SHARE_UNIQUE,
ConnectionHandle,
ConnectionObject);
- ExFreePool(EaInfo);
+ ExFreePoolWithTag(EaInfo, TAG_AFD_EA_INFO);
return Status;
}
PFILE_OBJECT ConnectionObject,
PTDI_CONNECTION_INFORMATION ConnectionCallInfo,
PTDI_CONNECTION_INFORMATION ConnectionReturnInfo,
- PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext)
/*
DeviceObject, /* Device object */
ConnectionObject, /* File object */
NULL, /* Event */
- Iosb); /* Status */
+ NULL); /* Status */
if (!*Irp) {
return STATUS_INSUFFICIENT_RESOURCES;
}
ConnectionCallInfo, /* Request connection information */
ConnectionReturnInfo); /* Return connection information */
- TdiCall(*Irp, DeviceObject, NULL, Iosb);
+ TdiCall(*Irp, DeviceObject, NULL, NULL);
return STATUS_PENDING;
}
PFILE_OBJECT ConnectionObject,
PTDI_CONNECTION_INFORMATION *RequestConnectionInfo,
PTDI_CONNECTION_INFORMATION *ReturnConnectionInfo,
- PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext)
/*
DeviceObject, /* Device object */
ConnectionObject, /* File object */
NULL, /* Event */
- Iosb); /* Status */
+ NULL); /* Status */
if (*Irp == NULL)
return STATUS_INSUFFICIENT_RESOURCES;
*RequestConnectionInfo, /* Request connection information */
*ReturnConnectionInfo); /* Return connection information */
- TdiCall(*Irp, DeviceObject, NULL /* Don't wait for completion */, Iosb);
+ TdiCall(*Irp, DeviceObject, NULL /* Don't wait for completion */, NULL);
return STATUS_PENDING;
}
TDIEntityID *Entities;
ULONG EntityCount;
ULONG EntityType;
- IPSNMP_INFO SnmpInfo;
+ IPSNMPInfo SnmpInfo;
PIPADDR_ENTRY IpAddress;
ULONG BufferSize;
NTSTATUS Status = STATUS_SUCCESS;
AFD_DbgPrint(MAX_TRACE, ("Called\n"));
BufferSize = sizeof(TDIEntityID) * 20;
- Entities = (TDIEntityID*)ExAllocatePool(NonPagedPool, BufferSize);
+ Entities = (TDIEntityID*)ExAllocatePoolWithTag(NonPagedPool,
+ BufferSize,
+ TAG_AFD_TRANSPORT_ADDRESS);
if (!Entities) {
AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
return STATUS_INSUFFICIENT_RESOURCES;
&BufferSize); /* Output buffer size */
if (!NT_SUCCESS(Status)) {
AFD_DbgPrint(MIN_TRACE, ("Unable to get list of supported entities (Status = 0x%X).\n", Status));
- ExFreePool(Entities);
+ ExFreePoolWithTag(Entities, TAG_AFD_TRANSPORT_ADDRESS);
return Status;
}
IP_MIB_STATS_ID, /* Entity id */
&SnmpInfo, /* Output buffer */
&BufferSize); /* Output buffer size */
- if (!NT_SUCCESS(Status) || (SnmpInfo.NumAddr == 0)) {
+ if (!NT_SUCCESS(Status) || (SnmpInfo.ipsi_numaddr == 0)) {
AFD_DbgPrint(MIN_TRACE, ("Unable to get SNMP information or no IP addresses available (Status = 0x%X).\n", Status));
break;
}
/* Query device for all IP addresses */
- if (SnmpInfo.NumAddr != 0) {
- BufferSize = SnmpInfo.NumAddr * sizeof(IPADDR_ENTRY);
- IpAddress = (PIPADDR_ENTRY)ExAllocatePool(NonPagedPool, BufferSize);
+ if (SnmpInfo.ipsi_numaddr != 0) {
+ BufferSize = SnmpInfo.ipsi_numaddr * sizeof(IPADDR_ENTRY);
+ IpAddress = (PIPADDR_ENTRY)ExAllocatePoolWithTag(NonPagedPool,
+ BufferSize,
+ TAG_AFD_SNMP_ADDRESS_INFO);
if (!IpAddress) {
AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
break;
&BufferSize); /* Output buffer size */
if (!NT_SUCCESS(Status)) {
AFD_DbgPrint(MIN_TRACE, ("Unable to get IP address (Status = 0x%X).\n", Status));
- ExFreePool(IpAddress);
+ ExFreePoolWithTag(IpAddress, TAG_AFD_SNMP_ADDRESS_INFO);
break;
}
- if (SnmpInfo.NumAddr != 1) {
+ if (SnmpInfo.ipsi_numaddr != 1) {
/* Skip loopback address */
*Address = DN2H(IpAddress[1].Addr);
} else {
*Address = DN2H(IpAddress->Addr);
}
- ExFreePool(IpAddress);
+ ExFreePoolWithTag(IpAddress, TAG_AFD_SNMP_ADDRESS_INFO);
} else {
Status = STATUS_UNSUCCESSFUL;
break;
}
}
- ExFreePool(Entities);
+ ExFreePoolWithTag(Entities, TAG_AFD_TRANSPORT_ADDRESS);
AFD_DbgPrint(MAX_TRACE, ("Leaving\n"));
USHORT Flags,
PCHAR Buffer,
UINT BufferLength,
- PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext)
{
DeviceObject, /* Device object */
TransportObject, /* File object */
NULL, /* Event */
- Iosb); /* Status */
+ NULL); /* Status */
if (!*Irp) {
AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
}
_SEH2_TRY {
- MmProbeAndLockPages(Mdl, (*Irp)->RequestorMode, IoModifyAccess);
+ MmProbeAndLockPages(Mdl, (*Irp)->RequestorMode, IoReadAccess);
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
AFD_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
IoFreeMdl(Mdl);
Flags, /* Flags */
BufferLength); /* Length of data */
- TdiCall(*Irp, DeviceObject, NULL, Iosb);
+ TdiCall(*Irp, DeviceObject, NULL, NULL);
/* Does not block... The MDL is deleted in the receive completion
routine. */
USHORT Flags,
PCHAR Buffer,
UINT BufferLength,
- PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext)
{
DeviceObject, /* Device object */
TransportObject, /* File object */
NULL, /* Event */
- Iosb); /* Status */
+ NULL); /* Status */
if (!*Irp) {
AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
BufferLength); /* Length of data */
- TdiCall(*Irp, DeviceObject, NULL, Iosb);
+ TdiCall(*Irp, DeviceObject, NULL, NULL);
/* Does not block... The MDL is deleted in the receive completion
routine. */
PCHAR Buffer,
UINT BufferLength,
PTDI_CONNECTION_INFORMATION Addr,
- PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext)
/*
DeviceObject, /* Device object */
TransportObject, /* File object */
NULL, /* Event */
- Iosb); /* Status */
+ NULL); /* Status */
if (!*Irp) {
AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
Addr,
Flags); /* Length of data */
- TdiCall(*Irp, DeviceObject, NULL, Iosb);
+ TdiCall(*Irp, DeviceObject, NULL, NULL);
/* Does not block... The MDL is deleted in the receive completion
routine. */
PCHAR Buffer,
UINT BufferLength,
PTDI_CONNECTION_INFORMATION Addr,
- PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext)
/*
return STATUS_INVALID_PARAMETER;
}
+ if (BufferLength == 0)
+ {
+ AFD_DbgPrint(MID_TRACE, ("Succeeding send with length 0.\n"));
+ return STATUS_SUCCESS;
+ }
+
*Irp = TdiBuildInternalDeviceControlIrp(TDI_SEND_DATAGRAM, /* Sub function */
DeviceObject, /* Device object */
TransportObject, /* File object */
NULL, /* Event */
- Iosb); /* Status */
+ NULL); /* Status */
if (!*Irp) {
AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
}
_SEH2_TRY {
- MmProbeAndLockPages(Mdl, (*Irp)->RequestorMode, IoModifyAccess);
+ MmProbeAndLockPages(Mdl, (*Irp)->RequestorMode, IoReadAccess);
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
AFD_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
IoFreeMdl(Mdl);
BufferLength, /* Bytes to send */
Addr); /* Address */
- TdiCall(*Irp, DeviceObject, NULL, Iosb);
+ TdiCall(*Irp, DeviceObject, NULL, NULL);
/* Does not block... The MDL is deleted in the send completion
routine. */
PFILE_OBJECT TransportObject,
PLARGE_INTEGER Time,
USHORT Flags,
- PIO_STATUS_BLOCK Iosb,
PIO_COMPLETION_ROUTINE CompletionRoutine,
PVOID CompletionContext,
PTDI_CONNECTION_INFORMATION RequestConnectionInfo,
DeviceObject, /* Device object */
TransportObject, /* File object */
NULL, /* Event */
- Iosb); /* Status */
+ NULL); /* Status */
if (!*Irp) {
AFD_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
RequestConnectionInfo, /* Indication of who to disconnect */
ReturnConnectionInfo); /* Indication of who disconnected */
- TdiCall(*Irp, DeviceObject, NULL, Iosb);
+ TdiCall(*Irp, DeviceObject, NULL, NULL);
return STATUS_PENDING;
}