Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/win32] Change the DLL base address type to LPVOID
@ 2009-01-07 11:46 Joel Brobecker
  2009-01-07 14:43 ` Jan Kratochvil
  2009-01-07 17:04 ` Christopher Faylor
  0 siblings, 2 replies; 4+ messages in thread
From: Joel Brobecker @ 2009-01-07 11:46 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

This patch changes the type used to manipulate the DLL base address from
DWORD to LPVOID.  The Windows headers declare this address as an LPVOID,
and using DWORD causes problems on x86_64-windows because the types do
not have the same size.

2009-01-07  Joel Brobecker  <brobecker@adacore.com>

        * win32-nat.c (get_module_name): Change the type of parameter
        "base_address" to LPVOID.  Remove unnecessary cast.
        (struct lm_info): Change type of load_addr to LPVOID.
        (win32_make_so): Change the type of parameter "load_addr"
        to LPVOID.  Remove some unnecessary casts.
        (handle_unload_dll): Change the type of "lpBaseOfDll" to LPVOID.
        (win32_xfer_shared_libraries): Add missing cast.

Tested on x86-windows.
OK to apply?

Thanks,
-- 
Joel

[-- Attachment #2: farproc.diff --]
[-- Type: text/plain, Size: 1677 bytes --]

diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index 1b15dfb..5300731 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-09 10:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-07 11:46 [RFA/win32] Change the DLL base address type to LPVOID Joel Brobecker
2009-01-07 14:43 ` Jan Kratochvil
2009-01-07 17:04 ` Christopher Faylor
2009-01-09 10:55   ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox