Some call require the application to pass in a buffer filled with data. This error is returned if the data buffer is too small. For example: DosSetFileInfo requires 4 bytes of ata. If a two byte buffer is passed in then this error is returned. error_buffer_overflow is used when the output buffer in not big enough.从这段说明可以看出,这个错误码是在获取或者设置某种信息时,给出的缓冲区小于要求的结构大小时才会出现的。而ReadFile不是这种功能,当ReadFile给出的缓冲区过小时,错误是访问内存无效;ReadFile给出的长度不是整扇区时,错误是参数无效。这个错误看起来是系统中的其它操作产生的。
呵呵,cnzdgs很热心,多谢了,我们最后写了个测试程序,发现只有读到我们划分的某个块时才会出这样的错误,所以得出的结论是磁盘磁道可能坏了,换了个磁盘没有在出现这错误了,谢了阿~~。 顺便问下,你这段“Some call require the application to pass in a buffer filled with data. This error is returned if the data buffer is too small. For example: DosSetFileInfo requires 4 bytes of ata. If a two byte buffer is passed in then this error is returned. error_buffer_overflow is used when the output buffer in not big enough. ”英文那里找的,当出了这个问题的时候我发现很难找到关于Windows error 错误的详细解释,能告诉我那里找的么,谢了
Microsoft Visual Studio 8\VC\PlatformSDK\Include\Error.h(152)
m_DiskHandle2 = CreateFile(diskpath,
GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
FILE_FLAG_NO_BUFFERING,
NULL);
我是以没有缓冲区的方式来创建的句柄
读取代码为
bReadResult = ReadFile(m_DiskHandle2,pTemBuffer,m_nSize,&dwBytesReadReal,NULL);
pTemBuffer 数据接收8M
nSize 8M
pTemBuffer是怎么分配的空间?
This error is returned if the data buffer is too small.
For example: DosSetFileInfo requires 4 bytes of ata.
If a two byte buffer is passed in then this error is returned.
error_buffer_overflow is used when the output buffer in not big enough.从这段说明可以看出,这个错误码是在获取或者设置某种信息时,给出的缓冲区小于要求的结构大小时才会出现的。而ReadFile不是这种功能,当ReadFile给出的缓冲区过小时,错误是访问内存无效;ReadFile给出的长度不是整扇区时,错误是参数无效。这个错误看起来是系统中的其它操作产生的。
顺便问下,你这段“Some call require the application to pass in a buffer filled with data.
This error is returned if the data buffer is too small.
For example: DosSetFileInfo requires 4 bytes of ata.
If a two byte buffer is passed in then this error is returned.
error_buffer_overflow is used when the output buffer in not big enough. ”英文那里找的,当出了这个问题的时候我发现很难找到关于Windows error 错误的详细解释,能告诉我那里找的么,谢了