_hd := createFile('//./J:', GENERIC_READ or GENERIC_WRITE,
FILE_SHARE_READ or FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
改成
_hd := createFile('//./J:', GENERIC_READ or GENERIC_WRITE,
FILE_SHARE_READ or FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_WRITE_THROUGH, 0);
试试。
另外,closehandle前调用一下
BOOL FlushFileBuffers(
HANDLE hFile // open handle to file whose buffers are to be
// flushed
);
确保把缓存的内容写入磁盘。