i have this code for reading files:
Code:
HANDLE h;
h = CreateFile("D:\\Dev-Cpp\\Works\\Updater\\Client\\abc\\Client.exe", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if(h == INVALID_HANDLE_VALUE) Error("invalid handle");
char buf[1024];
DWORD w;
ReadFile(h, buf, 1023, &w, NULL);
Msg(buf);
CloseHandle(h);
and it works just fine with .txt files but not with .exe
it prints me just 2 characters instead of 1023.
is there another way to read it?