diff --git a/dlls/urlmon/.cvsignore b/dlls/urlmon/.cvsignore index b557119ad9a..b87d5770129 100644 --- a/dlls/urlmon/.cvsignore +++ b/dlls/urlmon/.cvsignore @@ -1,3 +1,4 @@ Makefile liburlmon.def +rsrc.res urlmon.dll.dbg.c diff --git a/dlls/urlmon/Makefile.in b/dlls/urlmon/Makefile.in index 3a98f2de86b..d03e05f5088 100644 --- a/dlls/urlmon/Makefile.in +++ b/dlls/urlmon/Makefile.in @@ -14,6 +14,8 @@ C_SRCS = \ umstream.c \ urlmon_main.c +RC_SRCS = rsrc.rc + SUBDIRS = tests @MAKE_DLL_RULES@ diff --git a/dlls/urlmon/regsvr.c b/dlls/urlmon/regsvr.c index bacd892c13f..af5333a2fc2 100644 --- a/dlls/urlmon/regsvr.c +++ b/dlls/urlmon/regsvr.c @@ -20,6 +20,7 @@ #define COM_NO_WINDOWS_H #include +#include #include #include "windef.h" @@ -28,6 +29,7 @@ #include "wingdi.h" #include "winreg.h" #include "winerror.h" +#include "advpub.h" #include "objbase.h" @@ -35,6 +37,9 @@ #include "wine/debug.h" +#include "initguid.h" +#include "urlmon_main.h" + WINE_DEFAULT_DEBUG_CHANNEL(urlmon); /* @@ -511,6 +516,48 @@ static struct regsvr_coclass const coclass_list[] = { "urlmon.dll", "Apartment" }, + { &CLSID_CdlProtocol, + "CDL: Asynchronous Pluggable Protocol Handler", + NULL, + "urlmon.dll", + "Apartment" + }, + { &CLSID_FileProtocol, + "file:, local: Asynchronous Pluggable Protocol Handler", + NULL, + "urlmon.dll", + "Apartment" + }, + { &CLSID_FtpProtocol, + "ftp: Asynchronous Pluggable Protocol Handler", + NULL, + "urlmon.dll", + "Apartment" + }, + { &CLSID_GopherProtocol, + "gopher: Asynchronous Pluggable Protocol Handler", + NULL, + "urlmon.dll", + "Apartment" + }, + { &CLSID_HttpProtocol, + "http: Asynchronous Pluggable Protocol Handler", + NULL, + "urlmon.dll", + "Apartment" + }, + { &CLSID_HttpsProtocol, + "https: Asynchronous Pluggable Protocol Handler", + NULL, + "urlmon.dll", + "Apartment" + }, + { &CLSID_MkProtocol, + "mk: Asynchronous Pluggable Protocol Handler", + NULL, + "urlmon.dll", + "Apartment" + }, { NULL } /* list terminator */ }; @@ -522,6 +569,58 @@ static struct regsvr_interface const interface_list[] = { { NULL } /* list terminator */ }; +/*********************************************************************** + * register_inf + */ + +#define INF_SET_CLSID(clsid) \ + pse[i].pszName = "CLSID_" #clsid; \ + clsids[i++] = &CLSID_ ## clsid; + +static HRESULT register_inf(BOOL doregister) +{ + HRESULT hres; + HMODULE hAdvpack; + typeof(RegInstall) *pRegInstall; + STRTABLE strtable; + STRENTRY pse[7]; + static CLSID const *clsids[34]; + int i = 0; + + static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; + + INF_SET_CLSID(CdlProtocol); + INF_SET_CLSID(FileProtocol); + INF_SET_CLSID(FtpProtocol); + INF_SET_CLSID(GopherProtocol); + INF_SET_CLSID(HttpProtocol); + INF_SET_CLSID(HttpsProtocol); + INF_SET_CLSID(MkProtocol); + + for(i = 0; i < sizeof(pse)/sizeof(pse[0]); i++) { + pse[i].pszValue = HeapAlloc(GetProcessHeap(), 0, 39); + sprintf(pse[i].pszValue, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0], + clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4], + clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]); + } + + strtable.cEntries = sizeof(pse)/sizeof(pse[0]); + strtable.pse = pse; + + hAdvpack = LoadLibraryW(wszAdvpack); + pRegInstall = (typeof(RegInstall)*)GetProcAddress(hAdvpack, "RegInstall"); + + hres = pRegInstall(URLMON_hInstance, doregister ? "RegisterDll" : "UnregisterDll", &strtable); + + for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++) + HeapFree(GetProcessHeap(), 0, pse[i].pszValue); + + return hres; +} + +#undef INF_SET_CLSID + /*********************************************************************** * DllRegisterServer (URLMON.@) */ @@ -534,7 +633,9 @@ HRESULT WINAPI URLMON_DllRegisterServer(void) hr = register_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = register_interfaces(interface_list); - return hr; + if(FAILED(hr)) + return hr; + return register_inf(TRUE); } /*********************************************************************** @@ -549,5 +650,7 @@ HRESULT WINAPI URLMON_DllUnregisterServer(void) hr = unregister_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = unregister_interfaces(interface_list); - return hr; + if(FAILED(hr)) + return hr; + return register_inf(FALSE); } diff --git a/dlls/urlmon/rsrc.rc b/dlls/urlmon/rsrc.rc new file mode 100644 index 00000000000..3217540f833 --- /dev/null +++ b/dlls/urlmon/rsrc.rc @@ -0,0 +1,19 @@ +/* + * Copyright 2005 Jacek Caban + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +REGINST REGINST urlmon.inf diff --git a/dlls/urlmon/urlmon.inf b/dlls/urlmon/urlmon.inf new file mode 100644 index 00000000000..d87c8ae0053 --- /dev/null +++ b/dlls/urlmon/urlmon.inf @@ -0,0 +1,29 @@ +[version] +Signature="$CHICAGO$" + + +[RegisterDll] +AddReg=Protocols.Reg + + +[UnregisterDll] +DelReg=Protocols.Reg + + +[Protocols.Reg] +HKCR,"PROTOCOLS\Handler\cdl",,,"CDL: Asynchronous Pluggable Protocol Handler" +HKCR,"PROTOCOLS\Handler\cdl","CLSID",,"%CLSID_CdlProtocol%" +HKCR,"PROTOCOLS\Handler\file",,,"file:, local: Asynchronous Pluggable Protocol Handler" +HKCR,"PROTOCOLS\Handler\file","CLSID",,"%CLSID_FileProtocol%" +HKCR,"PROTOCOLS\Handler\local",,,"file:, local: Asynchronous Pluggable Protocol Handler" +HKCR,"PROTOCOLS\Handler\local","CLSID",,"%CLSID_FileProtocol%" +HKCR,"PROTOCOLS\Handler\ftp",,,"ftp: Asynchronous Pluggable Protocol Handler" +HKCR,"PROTOCOLS\Handler\ftp","CLSID",,"%CLSID_FtpProtocol%" +HKCR,"PROTOCOLS\Handler\gopher",,,"gopher: Asynchronous Pluggable Protocol Handler" +HKCR,"PROTOCOLS\Handler\gopher","CLSID",,"%CLSID_GopherProtocol%" +HKCR,"PROTOCOLS\Handler\http",,,"http: Asynchronous Pluggable Protocol Handler" +HKCR,"PROTOCOLS\Handler\http","CLSID",,"%CLSID_HttpProtocol%" +HKCR,"PROTOCOLS\Handler\https",,,"https: Asynchronous Pluggable Protocol Handler" +HKCR,"PROTOCOLS\Handler\https","CLSID",,"%CLSID_HttpsProtocol%" +HKCR,"PROTOCOLS\Handler\mk",,,"mk: Asynchronous Pluggable Protocol Handler" +HKCR,"PROTOCOLS\Handler\mk","CLSID",,"%CLSID_MkProtocol%" diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 9a6093dc134..3c912f78c8f 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -50,4 +50,13 @@ typedef struct HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL, DWORD dwSize, LPWSTR pszFileName, HANDLE *phfile, IUMCacheStream **ppstr); void UMCloseCacheFileStream(IUMCacheStream *pstr); +DEFINE_GUID(CLSID_CdlProtocol, 0x3dd53d40, 0x7b8b, 0x11D0, 0xb0,0x13, 0x00,0xaa,0x00,0x59,0xce,0x02); +DEFINE_GUID(CLSID_FileProtocol, 0x79EAC9E7, 0xBAF9, 0x11CE, 0x8C,0x82, 0x00,0xAA,0x00,0x4B,0xA9,0x0B); +DEFINE_GUID(CLSID_FtpProtocol, 0x79EAC9E3, 0xBAF9, 0x11CE, 0x8C,0x82, 0x00,0xAA,0x00,0x4B,0xA9,0x0B); +DEFINE_GUID(CLSID_GopherProtocol, 0x79EAC9E4, 0xBAF9, 0x11CE, 0x8C,0x82, 0x00,0xAA,0x00,0x4B,0xA9,0x0B); +DEFINE_GUID(CLSID_HttpProtocol, 0x79EAC9E2, 0xBAF9, 0x11CE, 0x8C,0x82, 0x00,0xAA,0x00,0x4B,0xA9,0x0B); +DEFINE_GUID(CLSID_HttpsProtocol, 0x79EAC9E5, 0xBAF9, 0x11CE, 0x8C,0x82, 0x00,0xAA,0x00,0x4B,0xA9,0x0B); +DEFINE_GUID(CLSID_MkProtocol, 0x79EAC9E6, 0xBAF9, 0x11CE, 0x8C,0x82, 0x00,0xAA,0x00,0x4B,0xA9,0x0B); + + #endif /* __WINE_URLMON_MAIN_H */