hi all,
i am trying to receive data using TdiBuildReceive api, the buffer 10 kb provided in this api contains only 1 kb of data , i am expecting the large full 10 kb data.
i checked with wire shark that data is fully coming to the machine but api is unable to capture.
portion of code is as follows.
PMDL ReceiveBufferMdl = IoAllocateMdl(ReceiveBuffer, ReceiveBufferLength, FALSE, FALSE, NULL);
if(ReceiveBufferMdl)
{
//Flag, set if the page was blocked
unsigned_native_int PagesIsLocked = false;
//We are trying to lock pages in physical memory
__try{
MmProbeAndLockPages(ReceiveBufferMdl, KernelMode, IoWriteAccess);
PagesIsLocked = true;
}
__except(EXCEPTION_EXECUTE_HANDLER){
//A function call fails
ThisFunctionResult = STATUS_UNSUCCESSFUL;
}
//If the page has block
if(PagesIsLocked){
//Set the end of the list of MDL
ReceiveBufferMdl->Next = NULL;
//Timeout end processing IRP, in milliseconds
unsigned_native_int IRPCompletionWaitInterval = 20 * 60 * 1000;//20 minutes
/* Implementation based on the interface TDI */
#if defined(BUILD_KERNEL_SOCKETS_ON_TDI)
//Forming IRP - TDI_RECEIVE
TdiBuildReceive(Socket->Irp, Socket->TransportDeviceObject, Socket->ConnectionEndPointFile.Object, IRPCompletionRoutine, Socket, ReceiveBufferMdl, TDI_RECEIVE_NORMAL, ReceiveBufferLength);
//Call the function of the transport driver
ThisFunctionResult = IoCallDriver(Socket->TransportDeviceObject, Socket->Irp);
//If the IRP queued
if(ThisFunctionResult == STATUS_PENDING){
//Expect to process IRP
ThisFunctionResult = WaitForIRPCompletion(Socket, IRPCompletionWaitInterval);
}