Jactry jactry92@gmail.com writes:
- chBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size+2);
- if(!chBuffer)
- {
CloseHandle(hFile);
return HRESULT_FROM_WIN32(GetLastError());
- }
It's not useful to zero the buffer since you are reading into it. Also GetLastError won't do anything useful here.