wininet: Use the proper macros to access the payload in HINTERNET handles.

Michael Stefaniuc mstefani at redhat.de
Tue Mar 3 16:57:00 CST 2009


The payload HINTERNET handles is a small unsigned integer.
---
 dlls/wininet/internet.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c
index 785a1ef..2a9032f 100644
--- a/dlls/wininet/internet.c
+++ b/dlls/wininet/internet.c
@@ -146,7 +146,7 @@ HINTERNET WININET_AllocHandle( LPWININETHANDLEHEADER info )
 end:
     LeaveCriticalSection( &WININET_cs );
 
-    return info->hInternet = (HINTERNET) (handle+1);
+    return info->hInternet = ULongToHandle( handle + 1 );
 }
 
 LPWININETHANDLEHEADER WININET_AddRef( LPWININETHANDLEHEADER info )
@@ -159,7 +159,7 @@ LPWININETHANDLEHEADER WININET_AddRef( LPWININETHANDLEHEADER info )
 LPWININETHANDLEHEADER WININET_GetObject( HINTERNET hinternet )
 {
     LPWININETHANDLEHEADER info = NULL;
-    UINT handle = (UINT) hinternet;
+    UINT handle = HandleToULong( hinternet );
 
     EnterCriticalSection( &WININET_cs );
 
@@ -204,7 +204,7 @@ BOOL WININET_Release( LPWININETHANDLEHEADER info )
 BOOL WININET_FreeHandle( HINTERNET hinternet )
 {
     BOOL ret = FALSE;
-    UINT handle = (UINT) hinternet;
+    UINT handle = HandleToULong( hinternet );
     LPWININETHANDLEHEADER info = NULL, child, next;
 
     EnterCriticalSection( &WININET_cs );
@@ -232,7 +232,7 @@ BOOL WININET_FreeHandle( HINTERNET hinternet )
         LIST_FOR_EACH_ENTRY_SAFE( child, next, &info->children, WININETHANDLEHEADER, entry )
         {
             TRACE( "freeing child handle %d for parent handle %d\n",
-                   (UINT)child->hInternet, handle+1);
+                   HandleToULong( child->hInternet ), handle + 1 );
             WININET_FreeHandle( child->hInternet );
         }
         WININET_Release( info );
-- 
1.6.2.rc2



More information about the wine-patches mailing list