DWORD old_protect;
if (!VirtualProtect(addr, size, prot, &old_protect)) {
- error_report("%s: VirtualProtect failed with error code %ld",
- __func__, GetLastError());
+ g_autofree gchar *emsg = g_win32_error_message(GetLastError());
+ error_report("%s: VirtualProtect failed: %s", __func__, emsg);
return -1;
}
return 0;