* win32-nat.c (has_detach_ability, set_process_privilege):

Cast the result of GetProcAddress to (void *) to avoid
        a compilation warning.
This commit is contained in:
Joel Brobecker 2009-01-09 10:48:36 +00:00
parent 5851ab761b
commit 308a880866
3 changed files with 26 additions and 18 deletions

View File

@ -1,3 +1,9 @@
2009-01-09 Joel Brobecker <brobecker@adacore.com>
* win32-nat.c (has_detach_ability, set_process_privilege):
Cast the result of GetProcAddress to (void *) to avoid
a compilation warning.
2009-01-09 Joel Brobecker <brobecker@adacore.com>
* win32-nat.c (CONTEXT_EXTENDED_REGISTERS): Define to 0 if not

View File

@ -1600,11 +1600,11 @@ has_detach_ability (void)
if (kernel32)
{
if (!kernel32_DebugSetProcessKillOnExit)
kernel32_DebugSetProcessKillOnExit = GetProcAddress (kernel32,
"DebugSetProcessKillOnExit");
kernel32_DebugSetProcessKillOnExit =
(void *) GetProcAddress (kernel32, "DebugSetProcessKillOnExit");
if (!kernel32_DebugActiveProcessStop)
kernel32_DebugActiveProcessStop = GetProcAddress (kernel32,
"DebugActiveProcessStop");
kernel32_DebugActiveProcessStop =
(void *) GetProcAddress (kernel32, "DebugActiveProcessStop");
if (kernel32_DebugSetProcessKillOnExit
&& kernel32_DebugActiveProcessStop)
return 1;
@ -1641,13 +1641,14 @@ set_process_privilege (const char *privilege, BOOL enable)
if (!(advapi32 = LoadLibrary ("advapi32.dll")))
goto out;
if (!OpenProcessToken)
OpenProcessToken = GetProcAddress (advapi32, "OpenProcessToken");
OpenProcessToken =
(void *) GetProcAddress (advapi32, "OpenProcessToken");
if (!LookupPrivilegeValue)
LookupPrivilegeValue = GetProcAddress (advapi32,
"LookupPrivilegeValueA");
LookupPrivilegeValue =
(void *) GetProcAddress (advapi32, "LookupPrivilegeValueA");
if (!AdjustTokenPrivileges)
AdjustTokenPrivileges = GetProcAddress (advapi32,
"AdjustTokenPrivileges");
AdjustTokenPrivileges =
(void *) GetProcAddress (advapi32, "AdjustTokenPrivileges");
if (!OpenProcessToken || !LookupPrivilegeValue || !AdjustTokenPrivileges)
{
advapi32 = NULL;

View File

@ -1600,11 +1600,11 @@ has_detach_ability (void)
if (kernel32)
{
if (!kernel32_DebugSetProcessKillOnExit)
kernel32_DebugSetProcessKillOnExit = GetProcAddress (kernel32,
"DebugSetProcessKillOnExit");
kernel32_DebugSetProcessKillOnExit =
(void *) GetProcAddress (kernel32, "DebugSetProcessKillOnExit");
if (!kernel32_DebugActiveProcessStop)
kernel32_DebugActiveProcessStop = GetProcAddress (kernel32,
"DebugActiveProcessStop");
kernel32_DebugActiveProcessStop =
(void *) GetProcAddress (kernel32, "DebugActiveProcessStop");
if (kernel32_DebugSetProcessKillOnExit
&& kernel32_DebugActiveProcessStop)
return 1;
@ -1641,13 +1641,14 @@ set_process_privilege (const char *privilege, BOOL enable)
if (!(advapi32 = LoadLibrary ("advapi32.dll")))
goto out;
if (!OpenProcessToken)
OpenProcessToken = GetProcAddress (advapi32, "OpenProcessToken");
OpenProcessToken =
(void *) GetProcAddress (advapi32, "OpenProcessToken");
if (!LookupPrivilegeValue)
LookupPrivilegeValue = GetProcAddress (advapi32,
"LookupPrivilegeValueA");
LookupPrivilegeValue =
(void *) GetProcAddress (advapi32, "LookupPrivilegeValueA");
if (!AdjustTokenPrivileges)
AdjustTokenPrivileges = GetProcAddress (advapi32,
"AdjustTokenPrivileges");
AdjustTokenPrivileges =
(void *) GetProcAddress (advapi32, "AdjustTokenPrivileges");
if (!OpenProcessToken || !LookupPrivilegeValue || !AdjustTokenPrivileges)
{
advapi32 = NULL;