Tuesday, July 16, 2013

Only part of a ReadProcessMemory or WriteProcessMemory request was completed

When I try get processname from PID,

get exception :
 Only part of a ReadProcessMemory or WriteProcessMemory request was completed.

the error came from :

 HANDLE Handle;
 char buffer[MAX_PATH];
 Handle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, PID);
 if (Handle != 0)
 {
 if (GetModuleFileNameEx(Handle, 0, buffer, MAX_PATH) != 0)
 {
 }else{
   here getlasterror got error message

 }
 CloseHandle(Handle);
}

I try search  it because 32bit  try open 64bit process.

I use QueryFullProcessImage  replace with GetModuleFileNameEx

fix this problem.

No comments:

Post a Comment