mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 05:41:52 +00:00
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:
parent
e5357ebc09
commit
324c93ff10
1 changed files with 12 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue