HANDLE hFile;
HANDLE hBufferIn,hBufferOut;
hFile=CreateFile((char*)&NameFileOpen,GENERIC_ALL,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
FileSize=GetFileSize(hFile,0);
hBufferIn=VirtualAlloc(0,FileSize,MEM_RESERVE | MEM_TOP_DOWN | MEM_COMMIT,PAGE_READWRITE);
hBufferOut=VirtualAlloc(0,FileSize*2,MEM_RESERVE | MEM_TOP_DOWN | MEM_COMMIT,PAGE_READWRITE);
ReadFile(hFile,hBufferIn,FileSize,&ByteRead,0);
for(int i=0;i!=FileSize;)
{
hBufferOut=atof(hBufferIn+i);
for(;hBufferIn!=0x20;i++);
}
Преаброзование типов HANDLE.
Код:
DWORD dwSize = 1024;
DWORD i = 0;
LPSTR lpBase = (LPSTR)VirtualAlloc(NULL, dwSize, ...);
do
{
*(lpBase + i) = (char)i;
}while (++i < dwSize);
DWORD i = 0;
LPSTR lpBase = (LPSTR)VirtualAlloc(NULL, dwSize, ...);
do
{
*(lpBase + i) = (char)i;
}while (++i < dwSize);