|
BOOL WINAPI SFileReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
这个函数我不会用哦
我用C#编的
声明部分
[DllImport("SFmpq.dll")]
public static extern ulong SFileGetFileSize(uint hFile,uint lpFileSizeHigh);
[DllImport("SFmpq.dll")]
public static extern ulong SFileReadFile(uint hFile,ref byte[] lpBuffer,ulong nNumberOfBytesToRead,ref uint lpNumberOfBytesRead,ref IntPtr lpOverlapped);
功能实现部分..
ulong size = 0;
byte[] lpBuffer;
uint lpNumberOfBytesRead=0;
IntPtr lpOverlapped=(IntPtr)0;
size= MPQRW.SFileGetFileSize(hFile, 0);
lpBuffer=new byte[size+1];
MPQRW.SFileReadFile(hFile, ref lpBuffer, size, ref lpNumberOfBytesRead, ref lpOverlapped);
lpBuffer数组竟然全是0
PS:MPQ、war3map.j的handle都获取成功了,文件大小获取也成功了 |
|