hi all
I used "allocateCommonBuffer" function to assign the memory allocation
for
DMA transmission.
At the meantime, the data transferred from AP through "DeciveioCotrol"
function are copied using "RtlCopyMemory" function, and then both data
are
compared using "RtlCompareMemory", there are some difference between
the two
in some circumstances. Why is that so?
The code is as follow:
case IOCTL_SEND_DATA:
pMPG = (PMPG_PARAM) pIrp->AssociatedIrp.SystemBuffer;
pOutBuf = (PULONG) pLDI->DMABuffers[0].Virtual;<--form
allocateCommonBuffer
RtlCopyMemory(pOutBuf, pMPG->pMessage, pMPG->nDataLen);
DbgTrace(("Cnt: %d \n",RtlCompareMemory(
pOutBuf,pMPG->pMessage,pMPG->nDataLen)));
break;
The struct of MPG_PARA is
typedef struct _MPG_PARAM {
ULONG nDataLen;
ULONG pMessage[1];
} MPG_PARAM ,*PMPG_PARAM;
Thanks a lot