]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dlmsw.cpp
update frm Ivan Masar
[wxWidgets.git] / src / msw / dlmsw.cpp
index d9a49f3a1f67b560d3bdbea359a0d83d22f79c37..a0e6ab8e55f3e1f06742fefebb8e6b9903780eb7 100644 (file)
@@ -79,8 +79,25 @@ public:
         wxVersionDLL *verDLL;
     };
 
         wxVersionDLL *verDLL;
     };
 
+    // the declared type of the first EnumModulesProc() parameter changed in
+    // recent SDK versions and is no PCSTR instead of old PSTR, we know that
+    // it's const in version 11 and non-const in version 8 included with VC8
+    // (and earlier), suppose that it's only changed in version 11
+    #if defined(API_VERSION_NUMBER) && API_VERSION_NUMBER >= 11
+        typedef PCSTR NameStr_t;
+    #else
+        typedef PSTR NameStr_t;
+    #endif
+
+    // TODO: fix EnumerateLoadedModules() to use EnumerateLoadedModules64()
+    #ifdef __WIN64__
+        typedef DWORD64 DWORD_32_64;
+    #else
+        typedef DWORD DWORD_32_64;
+    #endif
+
     static BOOL CALLBACK
     static BOOL CALLBACK
-        EnumModulesProc(PSTR name, DWORD64 base, ULONG size, void *data);
+    EnumModulesProc(NameStr_t name, DWORD_32_64 base, ULONG size, void *data);
 };
 
 // ----------------------------------------------------------------------------
 };
 
 // ----------------------------------------------------------------------------
@@ -174,7 +191,7 @@ wxString wxVersionDLL::GetFileVersion(const wxString& filename) const
     wxString ver;
     if ( m_dll.IsLoaded() )
     {
     wxString ver;
     if ( m_dll.IsLoaded() )
     {
-        wxChar *pc = wx_const_cast(wxChar *, filename.c_str());
+        wxChar *pc = wx_const_cast(wxChar *, filename.wx_str());
 
         DWORD dummy;
         DWORD sizeVerInfo = m_pfnGetFileVersionInfoSize(pc, &dummy);
 
         DWORD dummy;
         DWORD sizeVerInfo = m_pfnGetFileVersionInfoSize(pc, &dummy);
@@ -208,8 +225,8 @@ wxString wxVersionDLL::GetFileVersion(const wxString& filename) const
 
 /* static */
 BOOL CALLBACK
 
 /* static */
 BOOL CALLBACK
-wxDynamicLibraryDetailsCreator::EnumModulesProc(PSTR name,
-                                                DWORD64 base,
+wxDynamicLibraryDetailsCreator::EnumModulesProc(NameStr_t name,
+                                                DWORD_32_64 base,
                                                 ULONG size,
                                                 void *data)
 {
                                                 ULONG size,
                                                 void *data)
 {