urlmon: Fix compilation on systems that don't support nameless unions.

Francois Gouget fgouget at free.fr
Wed Aug 8 03:48:45 CDT 2007


---
 dlls/urlmon/http.c           |    3 ++-
 dlls/urlmon/tests/protocol.c |    6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c
index 8dc3432..08d6419 100644
--- a/dlls/urlmon/http.c
+++ b/dlls/urlmon/http.c
@@ -25,6 +25,7 @@
 #include <stdarg.h>
 
 #define COBJMACROS
+#define NONAMELESSUNION
 
 #include "windef.h"
 #include "winbase.h"
@@ -516,7 +517,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
             WARN("Expected This->bind_info.stgmedData.tymed to be TYMED_HGLOBAL, not %d\n",
                  This->bind_info.stgmedData.tymed);
         else
-            optional = (LPWSTR)This->bind_info.stgmedData.hGlobal;
+            optional = (LPWSTR)This->bind_info.stgmedData.u.hGlobal;
     }
     if (!HttpSendRequestW(This->request, This->full_header, lstrlenW(This->full_header),
                           optional,
diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c
index 72cb2fc..13b0f15 100644
--- a/dlls/urlmon/tests/protocol.c
+++ b/dlls/urlmon/tests/protocol.c
@@ -547,14 +547,14 @@ static HRESULT WINAPI BindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *grfB
     {
         /* Must be GMEM_FIXED, GMEM_MOVABLE does not work properly
          * with urlmon on native (Win98 and WinXP) */
-        pbindinfo->stgmedData.hGlobal = GlobalAlloc(GPTR, sizeof(szPostData));
-        if (!pbindinfo->stgmedData.hGlobal)
+        U(pbindinfo->stgmedData).hGlobal = GlobalAlloc(GPTR, sizeof(szPostData));
+        if (!U(pbindinfo->stgmedData).hGlobal)
         {
             http_post_test = FALSE;
             skip("Out of memory\n");
             return E_OUTOFMEMORY;
         }
-        lstrcpy((LPSTR)pbindinfo->stgmedData.hGlobal, szPostData);
+        lstrcpy((LPSTR)U(pbindinfo->stgmedData).hGlobal, szPostData);
         pbindinfo->cbstgmedData = sizeof(szPostData)-1;
         pbindinfo->dwBindVerb = BINDVERB_POST;
         pbindinfo->stgmedData.tymed = TYMED_HGLOBAL;
-- 
1.5.2.4




More information about the wine-patches mailing list