+2013-09-02 Pierre Muller <muller@sourceware.org>
+
+ * windows-nat.c (windows_xfer_memory): Handle ERROR_PARTIAL_COPY
+ error code.
+
2013-09-02 Pierre Muller <muller@sourceware.org>
* windows-nat.c (windows_xfer_memory): Fix compilation failure
{
SIZE_T done = 0;
BOOL success;
+ DWORD lasterror = 0;
if (writebuf != NULL)
{
success = WriteProcessMemory (current_process_handle,
(LPVOID) (uintptr_t) memaddr, writebuf,
len, &done);
+ if (!success)
+ lasterror = GetLastError ();
FlushInstructionCache (current_process_handle,
(LPCVOID) (uintptr_t) memaddr, len);
}
success = ReadProcessMemory (current_process_handle,
(LPCVOID) (uintptr_t) memaddr, readbuf,
len, &done);
+ if (!success)
+ lasterror = GetLastError ();
}
- return success ? done : TARGET_XFER_E_IO;
+ if (!success && lasterror == ERROR_PARTIAL_COPY && done > 0)
+ return done;
+ else
+ return success ? done : TARGET_XFER_E_IO;
}
static void