Thead
unicode编码还是gb2312?这些要确定
FLT_POSTOP_CALLBACK_STATUS
SwapPostReadBuffers(
__inout PFLT_CALLBACK_DATA Data,
__in PCFLT_RELATED_OBJECTS FltObjects,
__in PVOID CompletionContext,
__in FLT_POST_OPERATION_FLAGS Flags
)
{
PVOID origBuf;
PFLT_IO_PARAMETER_BLOCK iopb = Data->Iopb;
FLT_POSTOP_CALLBACK_STATUS retValue = FLT_POSTOP_FINISHED_PROCESSING;
PPRE_2_POST_CONTEXT p2pCtx = CompletionContext;
BOOLEAN cleanupAllocatedBuffer = TRUE;
ASSERT(!FlagOn(Flags, FLTFL_POST_OPERATION_DRAINING));
try {
if (!NT_SUCCESS(Data->IoStatus.Status) ||
(Data->IoStatus.Information == 0)) {
leave;
}
if (iopb->Parameters.Read.MdlAddress != NULL)
{
origBuf = MmGetSystemAddressForMdlSafe( iopb->Parameters.Read.MdlAddress,NormalPagePriority );
if (origBuf == NULL)
{
Data->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
Data->IoStatus.Information = 0;
leave;
}
} else if (FlagOn(Data->Flags,FLTFL_CALLBACK_DATA_SYSTEM_BUFFER) ||
FlagOn(Data->Flags,FLTFL_CALLBACK_DATA_FAST_IO_OPERATION))
{
origBuf = iopb->Parameters.Read.ReadBuffer;
} else
{
if (FltDoCompletionProcessingWhenSafe( Data,
FltObjects,
CompletionContext,
Flags,
SwapPostReadBuffersWhenSafe,
&retValue ))
{
cleanupAllocatedBuffer = FALSE;
} else {
Data->IoStatus.Status = STATUS_UNSUCCESSFUL;
Data->IoStatus.Information = 0;
}
leave;
}
try {
RtlCopyMemory( origBuf,
p2pCtx->SwappedBuffer,
Data->IoStatus.Information );
} except (EXCEPTION_EXECUTE_HANDLER) {
Data->IoStatus.Status = GetExceptionCode();
Data->IoStatus.Information = 0;
}
} finally {
if (cleanupAllocatedBuffer)
{
ExFreePool( p2pCtx->SwappedBuffer );
FltReleaseContext( p2pCtx->VolCtx );
ExFreeToNPagedLookasideList( &Pre2PostContextList,
p2pCtx );
}
}
KdPrint(("111111 \n"));
KdPrint(("%Z \n",origBuf));
KdPrint(("\n 222222 \n"));
return retValue;
}
以上就是代码,在read的后操作数中,代码是wdk中swapBuffers的例子,没有改,就加了一个打印,打开的文件我用notepad++改成ANSI编码了