Pointers being stored as DWORD, Changed to DWORD_PTR. 64 bit tests no longer segfault

Eddie Leung eddie.leung.2009 at anderson.ucla.edu
Thu Feb 19 21:20:02 CST 2009


---
 dlls/inetcomm/mimeole.c |    8 ++++----
 include/mimeole.idl     |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c
index 871ffa5..b283b94 100644
--- a/dlls/inetcomm/mimeole.c
+++ b/dlls/inetcomm/mimeole.c
@@ -1630,7 +1630,7 @@ static body_t *create_sub_body(MimeMessage *msg, IStream *pStm, BODYOFFSETS *off
     if(parent) MimeBody_set_offsets(impl_from_IMimeBody(mime_body), offset);
     IMimeBody_SetData(mime_body, IET_BINARY, NULL, NULL, &IID_IStream, pStm);
     body = new_body_entry(mime_body, msg->next_hbody, parent);
-    msg->next_hbody = (HBODY)((DWORD)msg->next_hbody + 1);
+    msg->next_hbody = (HBODY)((DWORD_PTR)msg->next_hbody + 1);
 
     if(IMimeBody_IsContentType(mime_body, "multipart", NULL) == S_OK)
     {
@@ -2009,17 +2009,17 @@ static HRESULT find_next(IMimeMessage *msg, LPFINDBODY find_body, HBODY *out)
     HBODY next;
 
     if(find_body->dwReserved == 0)
-        find_body->dwReserved = (DWORD)HBODY_ROOT;
+        find_body->dwReserved = (DWORD_PTR)HBODY_ROOT;
     else
     {
         hr = IMimeMessage_GetBody(msg, IBL_FIRST, (HBODY)find_body->dwReserved, &next);
         if(hr == S_OK)
-            find_body->dwReserved = (DWORD)next;
+            find_body->dwReserved = (DWORD_PTR)next;
         else
         {
             hr = IMimeMessage_GetBody(msg, IBL_NEXT, (HBODY)find_body->dwReserved, &next);
             if(hr == S_OK)
-                find_body->dwReserved = (DWORD)next;
+                find_body->dwReserved = (DWORD_PTR)next;
             else
                 return MIME_E_NOT_FOUND;
         }
diff --git a/include/mimeole.idl b/include/mimeole.idl
index d74cdb5..6e11828 100644
--- a/include/mimeole.idl
+++ b/include/mimeole.idl
@@ -746,7 +746,7 @@ cpp_quote("#endif")
         {
             LPSTR pszPriType;
             LPSTR pszSubType;
-            DWORD dwReserved;
+            DWORD_PTR dwReserved;
         } FINDBODY, *LPFINDBODY;
 
         HRESULT GetMessageSource(
-- 
1.5.6.3


--------------070401080703020604060808--



More information about the wine-patches mailing list