Jacek Caban : urlmon: Removed not used code.

Alexandre Julliard julliard at wine.codeweavers.com
Sat Dec 31 08:20:35 CST 2005


Module: wine
Branch: refs/heads/master
Commit: 3a04ff683690171deceb49a44736978743eca706
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=3a04ff683690171deceb49a44736978743eca706

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sat Dec 31 13:19:32 2005 +0100

urlmon: Removed not used code.

---

 dlls/urlmon/umon.c |  115 ++--------------------------------------------------
 1 files changed, 5 insertions(+), 110 deletions(-)

diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c
index d722220..affcdfa 100644
--- a/dlls/urlmon/umon.c
+++ b/dlls/urlmon/umon.c
@@ -3,6 +3,7 @@
  *
  * Copyright 1999 Ulrich Czekalla for Corel Corporation
  * Copyright 2002 Huw D M Davies for CodeWeavers
+ * Copyright 2005 Jacek Caban for CodeWeavers
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -496,55 +497,6 @@ static HRESULT WINAPI URLMonikerImpl_Bin
     return E_NOTIMPL;
 }
 
-typedef struct {
-    enum {OnProgress, OnDataAvailable} callback;
-} URLMON_CallbackData;
-
-
-#if 0
-static LRESULT CALLBACK URLMON_WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
-{
-    return DefWindowProcA(hwnd, msg, wparam, lparam);
-}
-
-static void PostOnProgress(URLMonikerImpl *This, UINT progress, UINT maxprogress, DWORD status, LPCWSTR *str)
-{
-}
-
-static void CALLBACK URLMON_InternetCallback(HINTERNET hinet, /*DWORD_PTR*/ DWORD context, DWORD status,
-					     void *status_info, DWORD status_info_len)
-{
-    URLMonikerImpl *This = (URLMonikerImpl *)context;
-    TRACE("handle %p this %p status %08lx\n", hinet, This, status);
-
-    if(This->filesize == -1) {
-	switch(status) {
-	case INTERNET_STATUS_RESOLVING_NAME:
-	    PostOnProgess(This, 0, 0, BINDSTATUS_FINDINGRESOURCE, status_info);
-	    break;
-	case INTERNET_STATUS_CONNECTING_TO_SERVER:
-	    PostOnProgress(This, 0, 0, BINDSTATUS_CONNECTING, NULL);
-	    break;
-	case INTERNET_STATUS_SENDING_REQUEST:
-	    PostOnProgress(This, 0, 0, BINDSTATUS_SENDINGREQUEST, NULL);
-	    break;
-	case INTERNET_REQUEST_COMPLETE:
-	  {
-	      DWORD len, lensz = sizeof(len);
-
-	    HttpQueryInfoW(hrequest, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &len, &lensz, NULL);
-	    TRACE("res = %ld gle = %08lx url len = %ld\n", hres, GetLastError(), len);
-	    This->filesize = len;
-	    break;
-	  }
-	}
-    }
-
-    return;
-}
-#endif
-
-
 /******************************************************************************
  *        URLMoniker_BindToStorage
  ******************************************************************************/
@@ -601,7 +553,7 @@ static HRESULT URLMonikerImpl_BindToStor
             if(SUCCEEDED(hres)) {
                 WCHAR *urlcopy, *tmpwc;
                 URL_COMPONENTSW url;
-                WCHAR *host, *path, *partial_path, *user, *pass;
+                WCHAR *host, *path, *user, *pass;
                 DWORD lensz = sizeof(bind->expected_size);
                 DWORD dwService = 0;
                 BOOL bSuccess;
@@ -622,17 +574,6 @@ static HRESULT URLMonikerImpl_BindToStor
                     if (*tmpwc == '\\')
                             *tmpwc = '/';
 
-#if 0
-                if(!registered_wndclass) {
-                    WNDCLASSA urlmon_wndclass = {0, URLMON_WndProc,0, 0, URLMON_hInstance, 0, 0, 0, NULL, "URLMON_Callback_Window_Class"};
-                    RegisterClassA(&urlmon_wndclass);
-                    registered_wndclass = TRUE;
-                }
-
-                This->hwndCallback = CreateWindowA("URLMON_Callback_Window_Class", NULL, 0, 0, 0, 0, 0, 0, 0,
-                                                   URLMON_hInstance, NULL);
-
-#endif
                 bind->expected_size = 0;
                 bind->total_read = 0;
 
@@ -667,15 +608,9 @@ static HRESULT URLMonikerImpl_BindToStor
                     pass = 0;
                 }
 
-                switch ((DWORD) url.nScheme)
-                {
-                case INTERNET_SCHEME_FTP:
-                case INTERNET_SCHEME_GOPHER:
-                case INTERNET_SCHEME_HTTP:
-                case INTERNET_SCHEME_HTTPS:
 
-                    bind->hinternet = InternetOpenA("User Agent", 0, NULL, NULL, 0 /*INTERNET_FLAG_ASYNC*/);
-/*                  InternetSetStatusCallback(bind->hinternet, URLMON_InternetCallback);*/
+                do {
+                    bind->hinternet = InternetOpenA("User Agent", 0, NULL, NULL, 0);
                     if (!bind->hinternet)
                     {
                             hres = HRESULT_FROM_WIN32(GetLastError());
@@ -797,48 +732,8 @@ static HRESULT URLMonikerImpl_BindToStor
             
                     InternetCloseHandle(bind->hconnect);
                     InternetCloseHandle(bind->hinternet);
-                    break;
-
-                case INTERNET_SCHEME_FILE:
-                    partial_path = bind->URLName + 5; /* Skip the "file:" part */
-                    if ((partial_path[0] != '/' && partial_path[0] != '\\') ||
-                        (partial_path[1] != '/' && partial_path[1] != '\\'))
-                    {
-                        hres = E_FAIL;
-                    }
-                    else
-                    {
-                        HANDLE h;
-
-                        partial_path += 2;
-                        if (partial_path[0] == '/' || partial_path[0] == '\\')
-                            ++partial_path;
-                        h = CreateFileW(partial_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
-                        if (h == (HANDLE) HFILE_ERROR)
-                        {
-                            hres = HRESULT_FROM_WIN32(GetLastError());
-                        }
-                        else
-                        {
-                            char buf[4096];
-                            DWORD bufread;
-
-                            IBindStatusCallback_OnProgress(bind->pbscb, 0, 0, BINDSTATUS_CACHEFILENAMEAVAILABLE, szFileName);
-
-                            while (ReadFile(h, buf, sizeof(buf), &bufread, NULL) && bufread > 0)
-                                hres = Binding_MoreCacheData(bind, buf, bufread);
+                } while(0);
 
-                            CloseHandle(h);
-                            hres = S_OK;
-                        }
-                    }
-                        
-                    break;
-
-                default:
-                    FIXME("Unsupported URI scheme");
-                    break;
-                }
                 Binding_CloseCacheDownload(bind);
                 Binding_FinishedDownload(bind, hres);
 




More information about the wine-cvs mailing list