I got this simple code:
#include "stdio.h"
#include "stdlib.h"
#include "windows.h"
int main(int argc, CHAR* argv[])
{
HANDLE hFile = NULL;
HANDLE hMapFile = NULL;
LPBYTE fileView;
hFile = CreateFile(argv[1],GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
if(hFile == INVALID_HANDLE_VALUE)
{
printf("CreateFile function failed\n");
goto clean;
}
***** hMapFile = (LPBYTE)CreateFileMapping(hFile,NULL,PAGE_READONLY,0,256,NULL);*****
if(hMapFile == NULL)
{
printf("CreateFileMapping function failed\n");
goto clean;
}
fileView = MapViewOfFile(hMapFile,FILE_MAP_READ,0,0,0);
if(fileView == NULL)
{
printf("CreateFileMapping function failed\n");
goto clean;
}
clean:
CloseHandle(hFile);
CloseHandle(hMapFile);
system("PAUSE");
return 0;
}
And for some reason in the line that is underlined it says that I cannot convert LPVOID to LPBYTE