驱动编程中出现BAD_POOL_HEADER错误--转

以下是引用MSDN上的:

Cause
The pool is already corrupted at the time of the current request.

This may or may not be due to the caller.

Resolving the Problem
The internal pool links must be walked to figure out a possible cause of the problem.

Then you can use special pool for the suspect pool tags, or use Driver Verifier on the suspect driver. The !analyze debugger extension may be of help in pinpointing the suspect driver, but this is frequently not the case with pool corrupters.

我实际遇到的这个例子是我的GUI程序和驱动程序通信时在DeviceIOControl中出现的,当时并没有判断GUI提供的缓冲区是否够了,然后就向里面pIrp->AssociatedIrp.SystemBuffer直接拷贝数据。

这个错误估计是和堆栈溢出差不多的,多余的数据覆盖了IRP的一部分,导致在这个DeviceIOControl函数的结尾

pIrp->IoStatus.Status = status;
pIrp->IoStatus.Information = info; // bytes xfered
IoCompleteRequest( pIrp, IO_NO_INCREMENT );
return status;

出现了这个错误。

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/instruder/archive/2010/04/13/5482203.aspx

posted @ 2010-06-03 17:46  xinjun  阅读(1416)  评论(0编辑  收藏  举报