Made an error message more verbose.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2617 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Molgrum 2007-08-30 02:58:45 +00:00
parent e5357ebc09
commit 324c93ff10
1 changed files with 12 additions and 1 deletions

View File

@ -447,7 +447,18 @@ void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
//@@@ copy on write or just read-write?
if (!VirtualProtect((LPVOID)startaddr, length, PAGE_READWRITE, &flOldProtect))
Sys_Error("Protection change failed\n");
{
char str[1024];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
str,
sizeof(str),
NULL);
Sys_Error("Protection change failed!\nError %d: %s\n", GetLastError(), str);
}
}