MapViewOfFile failes with errorCode 6 (Invalid Handle)
问题 Im trying to map the file to the memory and use MapViewOfFile(), but it failes with error code 6. I tried just about anything, I also read about big files being the problem, but the problem happens also with a 1kb file. my code: HANDLE hFile = CreateFile(pFile, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); e = GetLastError(); printf("CreateFile Errorcode %d\n", GetLastError()); if (hFile == INVALID_HANDLE_VALUE) { printf("Error: could not create handle to file"); printf(