Don't return NULL for proxy details if there is no proxy

Mike Hearn mike at navi.cx
Sun Jun 5 10:38:07 CDT 2005


Outworlds 3D depends on this.

Mike Hearn <mh at codeweavers.com>
- Don't return NULL for proxy details if there is no proxy
- Remove stub message, it seems to be complete

Index: dlls/wininet/internet.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/internet.c,v
retrieving revision 1.124
diff -u -p -d -u -r1.124 internet.c
--- dlls/wininet/internet.c	24 May 2005 11:43:35 -0000	1.124
+++ dlls/wininet/internet.c	5 Jun 2005 15:35:44 -0000
@@ -1951,20 +1951,31 @@ static BOOL INET_QueryOptionHelper(BOOL 
                     if (lpwai->lpszProxy)
                     {
                         pPI->lpszProxy = (LPWSTR)((LPBYTE)lpBuffer +
-                         sizeof(INTERNET_PROXY_INFOW));
+                                                  sizeof(INTERNET_PROXY_INFOW));
                         lstrcpyW((LPWSTR)pPI->lpszProxy, lpwai->lpszProxy);
                     }
                     else
-                        pPI->lpszProxy = NULL;
+                    {
+                        pPI->lpszProxy = (LPWSTR)((LPBYTE)lpBuffer +
+                                                  sizeof(INTERNET_PROXY_INFOW));
+                        *((LPWSTR)(pPI->lpszProxy)) = (WCHAR) '\0';
+                    }
+
                     if (lpwai->lpszProxyBypass)
                     {
                         pPI->lpszProxyBypass = (LPWSTR)((LPBYTE)lpBuffer +
-                         sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired);
+                                                        sizeof(INTERNET_PROXY_INFOW) +
+                                                        proxyBytesRequired);
                         lstrcpyW((LPWSTR)pPI->lpszProxyBypass,
                          lpwai->lpszProxyBypass);
                     }
                     else
-                        pPI->lpszProxyBypass = NULL;
+                    {
+                        pPI->lpszProxyBypass = (LPWSTR)((LPBYTE)lpBuffer +
+                                                        sizeof(INTERNET_PROXY_INFOW) +
+                                                        proxyBytesRequired);
+                        *((LPWSTR)(pPI->lpszProxyBypass)) = (WCHAR) '\0';
+                    }
                     bSuccess = TRUE;
                 }
                 *lpdwBufferLength = sizeof(INTERNET_PROXY_INFOW) +
@@ -1987,16 +1998,20 @@ static BOOL INET_QueryOptionHelper(BOOL 
                 else
                 {
                     pPI->dwAccessType = lpwai->dwAccessType;
-                    FIXME("INTERNET_OPTION_PROXY: Stub\n");
                     if (lpwai->lpszProxy)
                     {
                         pPI->lpszProxy = (LPSTR)((LPBYTE)lpBuffer +
-                         sizeof(INTERNET_PROXY_INFOA));
+                                                 sizeof(INTERNET_PROXY_INFOA));
                         WideCharToMultiByte(CP_ACP, 0, lpwai->lpszProxy, -1,
                          (LPSTR)pPI->lpszProxy, proxyBytesRequired, NULL, NULL);
                     }
                     else
-                        pPI->lpszProxy = NULL;
+                    {
+                        pPI->lpszProxy = (LPSTR)((LPBYTE)lpBuffer +
+                                                 sizeof(INTERNET_PROXY_INFOA));
+                        *((LPSTR)(pPI->lpszProxy)) = '\0';
+                    }
+                    
                     if (lpwai->lpszProxyBypass)
                     {
                         pPI->lpszProxyBypass = (LPSTR)((LPBYTE)lpBuffer +
@@ -2007,7 +2022,12 @@ static BOOL INET_QueryOptionHelper(BOOL 
                          NULL, NULL);
                     }
                     else
-                        pPI->lpszProxyBypass = NULL;
+                    {
+                        pPI->lpszProxyBypass = (LPSTR)((LPBYTE)lpBuffer +
+                                                       sizeof(INTERNET_PROXY_INFOA) +
+                                                       proxyBytesRequired);
+                        *((LPSTR)(pPI->lpszProxyBypass)) = '\0';
+                    }
                     bSuccess = TRUE;
                 }
                 *lpdwBufferLength = sizeof(INTERNET_PROXY_INFOA) +



More information about the wine-patches mailing list