Sync to Wine-0_9_1:
Jacek Caban <jack@itma.pwr.wroc.pl>
- Added IInternetPriority implementation to FileProtocol.
- Report BINDSTATUS_SENDINGREQUEST in FileProtocol::Start.
- Added implementation of IInternetPriority in HttpProtocol.
Added: trunk/reactos/lib/urlmon/binding.c
Modified: trunk/reactos/lib/urlmon/file.c
Modified: trunk/reactos/lib/urlmon/http.c
Modified: trunk/reactos/lib/urlmon/internet.c
Modified: trunk/reactos/lib/urlmon/session.c
Modified: trunk/reactos/lib/urlmon/umon.c
Modified: trunk/reactos/lib/urlmon/urlmon.spec
Modified: trunk/reactos/lib/urlmon/urlmon.xml
Modified: trunk/reactos/lib/urlmon/urlmon_main.h
Modified: trunk/reactos/w32api/include/urlmon.h

Copied: trunk/reactos/lib/urlmon/binding.c (from rev 19364, vendor/wine/dlls/urlmon/current/binding.c)
Property changes on: trunk/reactos/lib/urlmon/binding.c
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: trunk/reactos/lib/urlmon/file.c
--- trunk/reactos/lib/urlmon/file.c	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/lib/urlmon/file.c	2005-11-20 14:51:28 UTC (rev 19367)
@@ -33,16 +33,19 @@
 
 typedef struct {
     const IInternetProtocolVtbl  *lpInternetProtocolVtbl;
+    const IInternetPriorityVtbl  *lpInternetPriorityVtbl;
 
     HANDLE file;
+    LONG priority;
 
     LONG ref;
 } FileProtocol;
 
+#define PROTOCOL(x)  ((IInternetProtocol*)  &(x)->lpInternetProtocolVtbl)
+#define PRIORITY(x)  ((IInternetPriority*)  &(x)->lpInternetPriorityVtbl)
+
 #define PROTOCOL_THIS(iface) DEFINE_THIS(FileProtocol, InternetProtocol, iface)
 
-#define PROTOCOL(x)  ((IInternetProtocol*)  &(x)->lpInternetProtocolVtbl)
-
 static HRESULT WINAPI FileProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
 {
     FileProtocol *This = PROTOCOL_THIS(iface);
@@ -57,6 +60,9 @@
     }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
         TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
         *ppv = PROTOCOL(This);
+    }else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
+        TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
+        *ppv = PRIORITY(This);
     }
 
     if(*ppv) {
@@ -104,6 +110,7 @@
     LARGE_INTEGER size;
     DWORD len;
     LPWSTR url, mime = NULL;
+    WCHAR null_char = 0;
     HRESULT hres;
 
     static const WCHAR wszFile[]  = {'f','i','l','e',':'};
@@ -132,6 +139,8 @@
         IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_DIRECTBIND, mime);
 
     if(!This->file) {
+        IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, &null_char);
+
         This->file = CreateFileW(url+sizeof(wszFile)/sizeof(WCHAR), GENERIC_READ, FILE_SHARE_READ,
                 NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
 
@@ -263,6 +272,57 @@
     FileProtocol_UnlockRequest
 };
 
+#define PRIORITY_THIS(iface) DEFINE_THIS(FileProtocol, InternetPriority, iface)
+
+static HRESULT WINAPI FilePriority_QueryInterface(IInternetPriority *iface,
+                                                  REFIID riid, void **ppv)
+{
+    FileProtocol *This = PRIORITY_THIS(iface);
+    return IInternetProtocol_QueryInterface(PROTOCOL(This), riid, ppv);
+}
+
+static ULONG WINAPI FilePriority_AddRef(IInternetPriority *iface)
+{
+    FileProtocol *This = PRIORITY_THIS(iface);
+    return IInternetProtocol_AddRef(PROTOCOL(This));
+}
+
+static ULONG WINAPI FilePriority_Release(IInternetPriority *iface)
+{
+    FileProtocol *This = PRIORITY_THIS(iface);
+    return IInternetProtocol_Release(PROTOCOL(This));
+}
+
+static HRESULT WINAPI FilePriority_SetPriority(IInternetPriority *iface, LONG nPriority)
+{
+    FileProtocol *This = PRIORITY_THIS(iface);
+
+    TRACE("(%p)->(%ld)\n", This, nPriority);
+
+    This->priority = nPriority;
+    return S_OK;
+}
+
+static HRESULT WINAPI FilePriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
+{
+    FileProtocol *This = PRIORITY_THIS(iface);
+
+    TRACE("(%p)->(%p)\n", This, pnPriority);
+
+    *pnPriority = This->priority;
+    return S_OK;
+}
+
+#undef PRIORITY_THIS
+
+static const IInternetPriorityVtbl FilePriorityVtbl = {
+    FilePriority_QueryInterface,
+    FilePriority_AddRef,
+    FilePriority_Release,
+    FilePriority_SetPriority,
+    FilePriority_GetPriority
+};
+
 HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
 {
     FileProtocol *ret;
@@ -274,7 +334,9 @@
     ret = HeapAlloc(GetProcessHeap(), 0, sizeof(FileProtocol));
 
     ret->lpInternetProtocolVtbl = &FileProtocolVtbl;
+    ret->lpInternetPriorityVtbl = &FilePriorityVtbl;
     ret->file = NULL;
+    ret->priority = 0;
     ret->ref = 1;
 
     *ppobj = PROTOCOL(ret);

Modified: trunk/reactos/lib/urlmon/http.c
--- trunk/reactos/lib/urlmon/http.c	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/lib/urlmon/http.c	2005-11-20 14:51:28 UTC (rev 19367)
@@ -32,14 +32,19 @@
 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
 
 typedef struct {
-    const IInternetProtocolVtbl  *lpInternetProtocolVtbl;
+    const IInternetProtocolVtbl *lpInternetProtocolVtbl;
+    const IInternetPriorityVtbl *lpInternetPriorityVtbl;
+
+    LONG priority;
+
     LONG ref;
 } HttpProtocol;
 
+#define PROTOCOL(x)  ((IInternetProtocol*)  &(x)->lpInternetProtocolVtbl)
+#define PRIORITY(x)  ((IInternetPriority*)  &(x)->lpInternetPriorityVtbl)
+
 #define PROTOCOL_THIS(iface) DEFINE_THIS(HttpProtocol, InternetProtocol, iface)
 
-#define PROTOCOL(x)  ((IInternetProtocol*)  &(x)->lpInternetProtocolVtbl)
-
 static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
 {
     HttpProtocol *This = PROTOCOL_THIS(iface);
@@ -54,6 +59,9 @@
     }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
         TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
         *ppv = PROTOCOL(This);
+    }else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
+        TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
+        *ppv = PRIORITY(This);
     }
 
     if(*ppv) {
@@ -167,6 +175,56 @@
 
 #undef PROTOCOL_THIS
 
+#define PRIORITY_THIS(iface) DEFINE_THIS(HttpProtocol, InternetPriority, iface)
+
+static HRESULT WINAPI HttpPriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
+{
+    HttpProtocol *This = PRIORITY_THIS(iface);
+    return IInternetProtocol_QueryInterface(PROTOCOL(This), riid, ppv);
+}
+
+static ULONG WINAPI HttpPriority_AddRef(IInternetPriority *iface)
+{
+    HttpProtocol *This = PRIORITY_THIS(iface);
+    return IInternetProtocol_AddRef(PROTOCOL(This));
+}
+
+static ULONG WINAPI HttpPriority_Release(IInternetPriority *iface)
+{
+    HttpProtocol *This = PRIORITY_THIS(iface);
+    return IInternetProtocol_Release(PROTOCOL(This));
+}
+
+static HRESULT WINAPI HttpPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
+{
+    HttpProtocol *This = PRIORITY_THIS(iface);
+
+    TRACE("(%p)->(%ld)\n", This, nPriority);
+
+    This->priority = nPriority;
+    return S_OK;
+}
+
+static HRESULT WINAPI HttpPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
+{
+    HttpProtocol *This = PRIORITY_THIS(iface);
+
+    TRACE("(%p)->(%p)\n", This, pnPriority);
+
+    *pnPriority = This->priority;
+    return S_OK;
+}
+
+#undef PRIORITY_THIS
+
+static const IInternetPriorityVtbl HttpPriorityVtbl = {
+    HttpPriority_QueryInterface,
+    HttpPriority_AddRef,
+    HttpPriority_Release,
+    HttpPriority_SetPriority,
+    HttpPriority_GetPriority
+};
+
 static const IInternetProtocolVtbl HttpProtocolVtbl = {
     HttpProtocol_QueryInterface,
     HttpProtocol_AddRef,
@@ -194,8 +252,12 @@
     ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HttpProtocol));
 
     ret->lpInternetProtocolVtbl = &HttpProtocolVtbl;
+    ret->lpInternetPriorityVtbl = &HttpPriorityVtbl;
+
     ret->ref = 1;
 
+    ret->priority = 0;
+
     *ppobj = PROTOCOL(ret);
     
     return S_OK;

Modified: trunk/reactos/lib/urlmon/internet.c
--- trunk/reactos/lib/urlmon/internet.c	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/lib/urlmon/internet.c	2005-11-20 14:51:28 UTC (rev 19367)
@@ -64,47 +64,16 @@
 static IInternetProtocolInfo *get_protocol_info(LPCWSTR url)
 {
     IInternetProtocolInfo *ret = NULL;
-    WCHAR schema[64], str_clsid[64];
-    HKEY hkey = NULL;
-    DWORD res, type, size, schema_len;
-    CLSID clsid;
-    LPWSTR wszKey;
+    IUnknown *unk;
     HRESULT hres;
 
-    static const WCHAR wszProtocolsKey[] =
-        {'P','R','O','T','O','C','O','L','S','\\','H','a','n','d','l','e','r','\\'};
-    static const WCHAR wszCLSID[] = {'C','L','S','I','D',0};
-
-    hres = parse_schema(url, 0, schema, sizeof(schema)/sizeof(schema[0]), &schema_len);
-    if(FAILED(hres) || !schema_len)
+    hres = get_protocol_iface(url, &unk);
+    if(FAILED(hres))
         return NULL;
 
-    wszKey = HeapAlloc(GetProcessHeap(), 0, sizeof(wszProtocolsKey)+(schema_len+1)*sizeof(WCHAR));
-    memcpy(wszKey, wszProtocolsKey, sizeof(wszProtocolsKey));
-    memcpy(wszKey + sizeof(wszProtocolsKey)/sizeof(WCHAR), schema, (schema_len+1)*sizeof(WCHAR));
+    IUnknown_QueryInterface(unk, &IID_IInternetProtocolInfo, (void**)&ret);
+    IUnknown_Release(unk);
 
-    res = RegOpenKeyW(HKEY_CLASSES_ROOT, wszKey, &hkey);
-    HeapFree(GetProcessHeap(), 0, wszKey);
-    if(res != ERROR_SUCCESS) {
-        TRACE("Could not open key %s\n", debugstr_w(wszKey));
-        return NULL;
-    }
-    
-    size = sizeof(str_clsid);
-    res = RegQueryValueExW(hkey, wszCLSID, NULL, &type, (LPBYTE)str_clsid, &size);
-    RegCloseKey(hkey);
-    if(res != ERROR_SUCCESS || type != REG_SZ) {
-        WARN("Could not get protocol CLSID res=%ld\n", res);
-        return NULL;
-    }
-
-    hres = CLSIDFromString(str_clsid, &clsid);
-    if(FAILED(hres)) {
-        WARN("CLSIDFromString failed: %08lx\n", hres);
-        return NULL;
-    }
-
-    CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IInternetProtocolInfo, (void**)&ret);
     return ret;
 }
 

Modified: trunk/reactos/lib/urlmon/session.c
--- trunk/reactos/lib/urlmon/session.c	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/lib/urlmon/session.c	2005-11-20 14:51:28 UTC (rev 19367)
@@ -23,6 +23,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "winuser.h"
+#include "winreg.h"
 #include "ole2.h"
 #include "urlmon.h"
 #include "urlmon_main.h"
@@ -31,6 +32,52 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
 
+HRESULT get_protocol_iface(LPCWSTR url, IUnknown **ret)
+{
+    WCHAR schema[64], str_clsid[64];
+    HKEY hkey = NULL;
+    DWORD res, type, size, schema_len;
+    CLSID clsid;
+    LPWSTR wszKey;
+    HRESULT hres;
+
+    static const WCHAR wszProtocolsKey[] =
+        {'P','R','O','T','O','C','O','L','S','\\','H','a','n','d','l','e','r','\\'};
+    static const WCHAR wszCLSID[] = {'C','L','S','I','D',0};
+
+    hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(schema[0]),
+            &schema_len, 0);
+    if(FAILED(hres) || !schema_len)
+        return E_FAIL;
+
+    wszKey = HeapAlloc(GetProcessHeap(), 0, sizeof(wszProtocolsKey)+(schema_len+1)*sizeof(WCHAR));
+    memcpy(wszKey, wszProtocolsKey, sizeof(wszProtocolsKey));
+    memcpy(wszKey + sizeof(wszProtocolsKey)/sizeof(WCHAR), schema, (schema_len+1)*sizeof(WCHAR));
+
+    res = RegOpenKeyW(HKEY_CLASSES_ROOT, wszKey, &hkey);
+    HeapFree(GetProcessHeap(), 0, wszKey);
+    if(res != ERROR_SUCCESS) {
+        TRACE("Could not open key %s\n", debugstr_w(wszKey));
+        return E_FAIL;
+    }
+    
+    size = sizeof(str_clsid);
+    res = RegQueryValueExW(hkey, wszCLSID, NULL, &type, (LPBYTE)str_clsid, &size);
+    RegCloseKey(hkey);
+    if(res != ERROR_SUCCESS || type != REG_SZ) {
+        WARN("Could not get protocol CLSID res=%ld\n", res);
+        return E_FAIL;
+    }
+
+    hres = CLSIDFromString(str_clsid, &clsid);
+    if(FAILED(hres)) {
+        WARN("CLSIDFromString failed: %08lx\n", hres);
+        return hres;
+    }
+
+    return CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)ret);
+}
+
 static HRESULT WINAPI InternetSession_QueryInterface(IInternetSession *iface,
         REFIID riid, void **ppv)
 {

Modified: trunk/reactos/lib/urlmon/umon.c
--- trunk/reactos/lib/urlmon/umon.c	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/lib/urlmon/umon.c	2005-11-20 14:51:28 UTC (rev 19367)
@@ -198,7 +198,7 @@
 					    (This->total_read == written) ?
 					        BINDSTATUS_BEGINDOWNLOADDATA :
 					        BINDSTATUS_DOWNLOADINGDATA,
-					    NULL);
+					    This->URLName);
 	if (!hr)
 	{
 	    STGMEDIUM stg;
@@ -244,7 +244,8 @@
     stg.u.pstm = (IStream *)This->pstrCache;
     stg.pUnkForRelease = NULL;
 
-    IBindStatusCallback_OnProgress(This->pbscb, This->total_read, This->expected_size, BINDSTATUS_ENDDOWNLOADDATA, NULL);
+    IBindStatusCallback_OnProgress(This->pbscb, This->total_read, This->expected_size,
+                                   BINDSTATUS_ENDDOWNLOADDATA, This->URLName);
     IBindStatusCallback_OnDataAvailable(This->pbscb, BSCF_LASTDATANOTIFICATION, This->total_read, &fmt, &stg);
     if (hr)
     {
@@ -547,13 +548,12 @@
 /******************************************************************************
  *        URLMoniker_BindToStorage
  ******************************************************************************/
-static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
+static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName,
 						   IBindCtx* pbc,
 						   IMoniker* pmkToLeft,
 						   REFIID riid,
 						   VOID** ppvObject)
 {
-    URLMonikerImpl *This = (URLMonikerImpl *)iface;
     HRESULT hres;
     BINDINFO bi;
     DWORD bindf;
@@ -561,6 +561,9 @@
     Binding *bind;
     int len;
 
+    WARN("(%s %p %p %s %p)\n", debugstr_w(URLName), pbc, pmkToLeft, debugstr_guid(riid),
+            ppvObject);
+
     if(pmkToLeft) {
 	FIXME("pmkToLeft != NULL\n");
 	return E_NOTIMPL;
@@ -575,9 +578,9 @@
     bind->ref = 1;
     URLMON_LockModule();
 
-    len = lstrlenW(This->URLName)+1;
+    len = lstrlenW(URLName)+1;
     bind->URLName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
-    memcpy(bind->URLName, This->URLName, len*sizeof(WCHAR));
+    memcpy(bind->URLName, URLName, len*sizeof(WCHAR));
 
     hres = UMCreateStreamOnCacheFile(bind->URLName, 0, szFileName, &bind->hCacheFile, &bind->pstrCache);
 
@@ -855,6 +858,37 @@
     return hres;
 }
 
+static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
+                                                   IBindCtx* pbc,
+						   IMoniker* pmkToLeft,
+						   REFIID riid,
+						   VOID** ppvObject)
+{
+    URLMonikerImpl *This = (URLMonikerImpl*)iface;
+    WCHAR schema[64];
+    BOOL bret;
+
+    URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW), schema,
+        sizeof(schema)/sizeof(WCHAR), 0, NULL, 0, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0};
+
+    bret = InternetCrackUrlW(This->URLName, 0, ICU_ESCAPE, &url);
+    if(!bret) {
+        ERR("InternetCrackUrl failed: %ld\n", GetLastError());
+        return E_FAIL;
+    }
+
+    if(url.nScheme == INTERNET_SCHEME_HTTP
+       || url.nScheme== INTERNET_SCHEME_HTTPS
+       || url.nScheme== INTERNET_SCHEME_FTP
+       || url.nScheme == INTERNET_SCHEME_GOPHER
+       || url.nScheme == INTERNET_SCHEME_FILE)
+        return URLMonikerImpl_BindToStorage_hack(This->URLName, pbc, pmkToLeft, riid, ppvObject);
+
+    TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject);
+
+    return start_binding(This->URLName, pbc, riid, ppvObject);
+}
+
 /******************************************************************************
  *        URLMoniker_Reduce
  ******************************************************************************/
@@ -1609,6 +1643,51 @@
 }
 
 /***********************************************************************
+ *           URLDownloadToCacheFileA (URLMON.@)
+ */
+HRESULT WINAPI URLDownloadToCacheFileA(LPUNKNOWN lpUnkCaller, LPCSTR szURL, LPSTR szFileName,
+        DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
+{
+    LPWSTR url = NULL, file_name = NULL;
+    int len;
+    HRESULT hres;
+
+    TRACE("(%p %s %p %ld %ld %p)\n", lpUnkCaller, debugstr_a(szURL), szFileName,
+            dwBufLength, dwReserved, pBSC);
+
+    if(szURL) {
+        len = MultiByteToWideChar(CP_ACP, 0, szURL, -1, NULL, 0);
+        url = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
+        MultiByteToWideChar(CP_ACP, 0, szURL, -1, url, -1);
+    }
+
+    if(szFileName)
+        file_name = HeapAlloc(GetProcessHeap(), 0, dwBufLength*sizeof(WCHAR));
+
+    hres = URLDownloadToCacheFileW(lpUnkCaller, url, file_name, dwBufLength*sizeof(WCHAR),
+            dwReserved, pBSC);
+
+    if(SUCCEEDED(hres) && file_name)
+        WideCharToMultiByte(CP_ACP, 0, file_name, -1, szFileName, dwBufLength, NULL, NULL);
+
+    HeapFree(GetProcessHeap(), 0, url);
+    HeapFree(GetProcessHeap(), 0, file_name);
+
+    return hres;
+}
+
+/***********************************************************************
+ *           URLDownloadToCacheFileW (URLMON.@)
+ */
+HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName,
+                DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
+{
+    FIXME("(%p %s %p %ld %ld %p)\n", lpUnkCaller, debugstr_w(szURL), szFileName,
+            dwBufLength, dwReserved, pBSC);
+    return E_NOTIMPL;
+}
+
+/***********************************************************************
  *           HlinkSimpleNavigateToString (URLMON.@)
  */
 HRESULT WINAPI HlinkSimpleNavigateToString( LPCWSTR szTarget,

Modified: trunk/reactos/lib/urlmon/urlmon.spec
--- trunk/reactos/lib/urlmon/urlmon.spec	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/lib/urlmon/urlmon.spec	2005-11-20 14:51:28 UTC (rev 19367)
@@ -64,8 +64,8 @@
 @ stdcall RevokeFormatEnumerator(ptr ptr)
 @ stub SetSoftwareUpdateAdvertisementState
 @ stub URLDownloadA
-@ stub URLDownloadToCacheFileA
-@ stub URLDownloadToCacheFileW
+@ stdcall URLDownloadToCacheFileA(ptr str str long long ptr)
+@ stdcall URLDownloadToCacheFileW(ptr wstr wstr long long ptr)
 @ stdcall URLDownloadToFileA(ptr str str long ptr)
 @ stdcall URLDownloadToFileW(ptr wstr wstr long ptr)
 @ stub URLDownloadW

Modified: trunk/reactos/lib/urlmon/urlmon.xml
--- trunk/reactos/lib/urlmon/urlmon.xml	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/lib/urlmon/urlmon.xml	2005-11-20 14:51:28 UTC (rev 19367)
@@ -18,6 +18,7 @@
 	<library>shlwapi</library>
 	<library>cabinet</library>
 	<library>wininet</library>
+	<file>binding.c</file>
 	<file>file.c</file>
 	<file>format.c</file>
 	<file>ftp.c</file>

Modified: trunk/reactos/lib/urlmon/urlmon_main.h
--- trunk/reactos/lib/urlmon/urlmon_main.h	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/lib/urlmon/urlmon_main.h	2005-11-20 14:51:28 UTC (rev 19367)
@@ -54,4 +54,8 @@
 HRESULT	UMCreateStreamOnCacheFile(LPCWSTR pszURL, DWORD dwSize, LPWSTR pszFileName, HANDLE *phfile, IUMCacheStream **ppstr);
 void	UMCloseCacheFileStream(IUMCacheStream *pstr);
 
+HRESULT get_protocol_iface(LPCWSTR url, IUnknown **ret);
+
+HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
+
 #endif /* __WINE_URLMON_MAIN_H */

Modified: trunk/reactos/w32api/include/urlmon.h
--- trunk/reactos/w32api/include/urlmon.h	2005-11-20 14:48:19 UTC (rev 19366)
+++ trunk/reactos/w32api/include/urlmon.h	2005-11-20 14:51:28 UTC (rev 19367)
@@ -1,4 +1,4 @@
-/*** Autogenerated by WIDL 0.1 from urlmon.idl - Do not edit ***/
+/*** Autogenerated by WIDL 0.9.1 from urlmon.idl - Do not edit ***/
 #include <rpc.h>
 #include <rpcndr.h>
 
@@ -22,7 +22,6 @@
 #endif
 
 typedef IBinding *LPBINDING;
-
 /*****************************************************************************
  * IBinding interface
  */
@@ -188,14 +187,12 @@
 #endif
 
 typedef IBindStatusCallback *LPBINDSTATUSCALLBACK;
-
 typedef enum {
     BINDVERB_GET = 0x0,
     BINDVERB_POST = 0x1,
     BINDVERB_PUT = 0x2,
     BINDVERB_CUSTOM = 0x3
 } BINDVERB;
-
 typedef enum {
     BINDF_ASYNCHRONOUS = 0x1,
     BINDF_ASYNCSTORAGE = 0x2,
@@ -222,7 +219,6 @@
     BINDF_PREFERDEFAULTHANDLER = 0x400000,
     BINDF_ENFORCERESTRICTED = 0x800000
 } BINDF;
-
 typedef struct _tagBINDINFO {
     ULONG cbSize;
     LPWSTR szExtraInfo;
@@ -239,13 +235,11 @@
     IUnknown *pUnk;
     DWORD dwReserved;
 } BINDINFO;
-
 typedef struct _REMSECURITY_ATTRIBUTES {
     DWORD nLength;
     DWORD lpSecurityDescriptor;
     BOOL bInheritHandle;
 } REMSECURITY_ATTRIBUTES, *PREMSECURITY_ATTRIBUTES, *LPREMSECURITY_ATTRIBUTES;
-
 typedef struct _tagRemBINDINFO {
     ULONG cbSize;
     LPWSTR szExtraInfo;
@@ -261,7 +255,6 @@
     IUnknown *pUnk;
     DWORD dwReserved;
 } RemBINDINFO;
-
 typedef struct tagRemFORMATETC {
     DWORD cfFormat;
     DWORD ptd;
@@ -269,7 +262,6 @@
     LONG lindex;
     DWORD tymed;
 } RemFORMATETC, *LPREMFORMATETC;
-
 typedef enum {
     BSCF_FIRSTDATANOTIFICATION = 0x1,
     BSCF_INTERMEDIATEDATANOTIFICATION = 0x2,
@@ -277,7 +269,6 @@
     BSCF_DATAFULLYAVAILABLE = 0x8,
     BSCF_AVAILABLEDATASIZEUNKNOWN = 0x10
 } BSCF;
-
 typedef enum BINDSTATUS {
     BINDSTATUS_FINDINGRESOURCE = 1,
     BINDSTATUS_CONNECTING,
@@ -328,7 +319,6 @@
     BINDSTATUS_SESSION_COOKIES_ALLOWED,
     BINDSTATUS_CACHECONTROL
 } BINDSTATUS;
-
 /*****************************************************************************
  * IBindStatusCallback interface
  */
@@ -563,7 +553,6 @@
 #endif
 
 typedef IAuthenticate *LPAUTHENTICATION;
-
 /*****************************************************************************
  * IAuthenticate interface
  */
@@ -634,6 +623,204 @@
 
 #endif  /* __IAuthenticate_INTERFACE_DEFINED__ */
 
+#ifndef __IHttpNegotiate_FWD_DEFINED__
+#define __IHttpNegotiate_FWD_DEFINED__
+typedef struct IHttpNegotiate IHttpNegotiate;
+#endif
+
+typedef IHttpNegotiate *LPHTTPNEGOTIATE;
+/*****************************************************************************
+ * IHttpNegotiate interface
+ */
+#ifndef __IHttpNegotiate_INTERFACE_DEFINED__
+#define __IHttpNegotiate_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IHttpNegotiate, 0x79eac9d2, 0xbaf9, 0x11ce, 0x8c,0x82, 0x00,0xaa,0x00,0x4b,0xa9,0x0b);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IHttpNegotiate : public IUnknown
+{
+    virtual HRESULT STDMETHODCALLTYPE BeginningTransaction(
+        LPCWSTR szURL,
+        LPCWSTR szHeaders,
+        DWORD dwReserved,
+        LPWSTR* pszAdditionalHeaders) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE OnResponse(
+        DWORD dwResponseCode,
+        LPCWSTR szResponseHeaders,
+        LPCWSTR szRequestHeaders,
+        LPWSTR* pszAdditionalRequestHeaders) = 0;
+
+};
+#else
+typedef struct IHttpNegotiateVtbl IHttpNegotiateVtbl;
+struct IHttpNegotiate {
+    const IHttpNegotiateVtbl* lpVtbl;
+};
+struct IHttpNegotiateVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        IHttpNegotiate* This,
+        REFIID riid,
+        void** ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        IHttpNegotiate* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        IHttpNegotiate* This);
+
+    /*** IHttpNegotiate methods ***/
+    HRESULT (STDMETHODCALLTYPE *BeginningTransaction)(
+        IHttpNegotiate* This,
+        LPCWSTR szURL,
+        LPCWSTR szHeaders,
+        DWORD dwReserved,
+        LPWSTR* pszAdditionalHeaders);
+
+    HRESULT (STDMETHODCALLTYPE *OnResponse)(
+        IHttpNegotiate* This,
+        DWORD dwResponseCode,
+        LPCWSTR szResponseHeaders,
+        LPCWSTR szRequestHeaders,
+        LPWSTR* pszAdditionalRequestHeaders);
+
+    END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IHttpNegotiate_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IHttpNegotiate_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IHttpNegotiate_Release(p) (p)->lpVtbl->Release(p)
+/*** IHttpNegotiate methods ***/
+#define IHttpNegotiate_BeginningTransaction(p,a,b,c,d) (p)->lpVtbl->BeginningTransaction(p,a,b,c,d)
+#define IHttpNegotiate_OnResponse(p,a,b,c,d) (p)->lpVtbl->OnResponse(p,a,b,c,d)
+#endif
+
+#endif
+
+HRESULT CALLBACK IHttpNegotiate_BeginningTransaction_Proxy(
+    IHttpNegotiate* This,
+    LPCWSTR szURL,
+    LPCWSTR szHeaders,
+    DWORD dwReserved,
+    LPWSTR* pszAdditionalHeaders);
+void __RPC_STUB IHttpNegotiate_BeginningTransaction_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IHttpNegotiate_OnResponse_Proxy(
+    IHttpNegotiate* This,
+    DWORD dwResponseCode,
+    LPCWSTR szResponseHeaders,
+    LPCWSTR szRequestHeaders,
+    LPWSTR* pszAdditionalRequestHeaders);
+void __RPC_STUB IHttpNegotiate_OnResponse_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __IHttpNegotiate_INTERFACE_DEFINED__ */
+
+#ifndef __IHttpNegotiate2_FWD_DEFINED__
+#define __IHttpNegotiate2_FWD_DEFINED__
+typedef struct IHttpNegotiate2 IHttpNegotiate2;
+#endif
+
+typedef IHttpNegotiate2 *LPHTTPNEGOTIATE2;
+/*****************************************************************************
+ * IHttpNegotiate2 interface
+ */
+#ifndef __IHttpNegotiate2_INTERFACE_DEFINED__
+#define __IHttpNegotiate2_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IHttpNegotiate2, 0x4f9f9fcb, 0xe0f4, 0x48eb, 0xb7,0xab, 0xfa,0x2e,0xa9,0x36,0x5c,0xb4);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IHttpNegotiate2 : public IHttpNegotiate
+{
+    virtual HRESULT STDMETHODCALLTYPE GetRootSecurityId(
+        BYTE* pbSecurityId,
+        DWORD* pcbSecurityId,
+        DWORD_PTR dwReserved) = 0;
+
+};
+#else
+typedef struct IHttpNegotiate2Vtbl IHttpNegotiate2Vtbl;
+struct IHttpNegotiate2 {
+    const IHttpNegotiate2Vtbl* lpVtbl;
+};
+struct IHttpNegotiate2Vtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        IHttpNegotiate2* This,
+        REFIID riid,
+        void** ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        IHttpNegotiate2* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        IHttpNegotiate2* This);
+
+    /*** IHttpNegotiate methods ***/
+    HRESULT (STDMETHODCALLTYPE *BeginningTransaction)(
+        IHttpNegotiate2* This,
+        LPCWSTR szURL,
+        LPCWSTR szHeaders,
+        DWORD dwReserved,
+        LPWSTR* pszAdditionalHeaders);
+
+    HRESULT (STDMETHODCALLTYPE *OnResponse)(
+        IHttpNegotiate2* This,
+        DWORD dwResponseCode,
+        LPCWSTR szResponseHeaders,
+        LPCWSTR szRequestHeaders,
+        LPWSTR* pszAdditionalRequestHeaders);
+
+    /*** IHttpNegotiate2 methods ***/
+    HRESULT (STDMETHODCALLTYPE *GetRootSecurityId)(
+        IHttpNegotiate2* This,
+        BYTE* pbSecurityId,
+        DWORD* pcbSecurityId,
+        DWORD_PTR dwReserved);
+
+    END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IHttpNegotiate2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IHttpNegotiate2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IHttpNegotiate2_Release(p) (p)->lpVtbl->Release(p)
+/*** IHttpNegotiate methods ***/
+#define IHttpNegotiate2_BeginningTransaction(p,a,b,c,d) (p)->lpVtbl->BeginningTransaction(p,a,b,c,d)
+#define IHttpNegotiate2_OnResponse(p,a,b,c,d) (p)->lpVtbl->OnResponse(p,a,b,c,d)
+/*** IHttpNegotiate2 methods ***/
+#define IHttpNegotiate2_GetRootSecurityId(p,a,b,c) (p)->lpVtbl->GetRootSecurityId(p,a,b,c)
+#endif
+
+#endif
+
+HRESULT CALLBACK IHttpNegotiate2_GetRootSecurityId_Proxy(
+    IHttpNegotiate2* This,
+    BYTE* pbSecurityId,
+    DWORD* pcbSecurityId,
+    DWORD_PTR dwReserved);
+void __RPC_STUB IHttpNegotiate2_GetRootSecurityId_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __IHttpNegotiate2_INTERFACE_DEFINED__ */
+
 #define SID_IBindHost IID_IBindHost
 #define SID_SBindHost IID_IBindHost
 #ifndef __IBindHost_FWD_DEFINED__
@@ -642,7 +829,6 @@
 #endif
 
 typedef IBindHost *LPBINDHOST;
-
 /*****************************************************************************
  * IBindHost interface
  */
@@ -806,7 +992,6 @@
 #endif
 
 typedef IWinInetInfo *LPWININETINFO;
-
 /*****************************************************************************
  * IWinInetInfo interface
  */
@@ -893,7 +1078,6 @@
 #endif
 
 typedef IWinInetHttpInfo *LPWININETHTTPINFO;
-
 /*****************************************************************************
  * IWinInetHttpInfo interface
  */
@@ -999,7 +1183,6 @@
 #endif
 
 typedef IPersistMoniker *LPPERSISTMONIKER;
-
 /*****************************************************************************
  * IPersistMoniker interface
  */
@@ -1166,12 +1349,10 @@
 #endif
 
 typedef IMonikerProp *LPMONIKERPROP;
-
 typedef enum {
     MIMETYPEPROP = 0x0,
     USE_SRC_URL = 0x1
 } MONIKERPROPERTY;
-
 /*****************************************************************************
  * IMonikerProp interface
  */
@@ -1245,7 +1426,6 @@
 #endif
 
 typedef IInternetBindInfo *LPIINTERNETBINDINFO;
-
 typedef enum tagBINDSTRING {
     BINDSTRING_HEADERS = 1,
     BINDSTRING_ACCEPT_MIMES,
@@ -1260,9 +1440,11 @@
     BINDSTRING_ACCEPT_ENCODINGS,
     BINDSTRING_POST_COOKIE,
     BINDSTRING_POST_DATA_MIME,
-    BINDSTRING_URL
+    BINDSTRING_URL,
+    BINDSTRING_IID,
+    BINDSTRING_FLAG_BIND_TO_OBJECT,
+    BINDSTRING_PTR_BIND_CONTEXT
 } BINDSTRING;
-
 /*****************************************************************************
  * IInternetBindInfo interface
  */
@@ -1361,7 +1543,6 @@
 #endif
 
 typedef IInternetPriority *LPIINTERNETPRIORITY;
-
 /*****************************************************************************
  * IInternetPriority interface
  */
@@ -1448,7 +1629,6 @@
 #endif
 
 typedef IInternetProtocolRoot *LPIINTERNETPROTOCOLROOT;
-
 typedef enum _tagPI_FLAGS {
     PI_PARSE_URL = 0x1,
     PI_FILTER_MODE = 0x2,
@@ -1462,14 +1642,12 @@
     PI_CLASSINSTALL = 0x200,
     PD_FORCE_SWITCH = 0x10000
 } PI_FLAGS;
-
 typedef struct _tagPROTOCOLDATA {
     DWORD grfFlags;
     DWORD dwState;
     LPVOID pData;
     ULONG cbData;
 } PROTOCOLDATA;
-
 /*****************************************************************************
  * IInternetProtocolRoot interface
  */
@@ -1626,7 +1804,6 @@
 #endif  /* __IInternetProtocolRoot_INTERFACE_DEFINED__ */
 
 typedef IInternetProtocolSink *LPIINTERNETPROTOCOLSINK;
-
 /*****************************************************************************
  * IInternetProtocolSink interface
  */
@@ -1760,7 +1937,6 @@
 #endif
 
 typedef IInternetProtocol *LPIINTERNETPROTOCOL;
-
 /*****************************************************************************
  * IInternetProtocol interface
  */
@@ -1924,7 +2100,6 @@
 #endif
 
 typedef IInternetProtocolInfo *LPIINTERNETPROTOCOLINFO;
-
 typedef enum _tagPARSEACTION {
     PARSE_CANONICALIZE = 1,
     PARSE_FRIENDLY,
@@ -1946,12 +2121,10 @@
     PARSE_ESCAPE,
     PARSE_UNESCAPE
 } PARSEACTION;
-
 typedef enum _tagPSUACTION {
     PSU_DEFAULT = 1,
     PSU_SECURITY_URL_ONLY
 } PSUACTION;
-
 typedef enum _tagQUERYOPTION {
     QUERY_EXPIRATION_DATE = 1,
     QUERY_TIME_OF_LAST_CHANGE,
@@ -1968,7 +2141,6 @@
     QUERY_IS_SECURE,
     QUERY_IS_SAFE
 } QUERYOPTION;
-
 /*****************************************************************************
  * IInternetProtocolInfo interface
  */
@@ -2147,12 +2319,10 @@
 #endif
 
 typedef IInternetSession *LPIINTERNETSESSION;
-
 typedef enum _tagOIBDG_FLAGS {
     OIBDG_APARTMENTTHREADED = 0x100,
     OIBDG_DATAONLY = 0x1000
 } OIBDG_FLAGS;
-
[truncated at 1000 lines; 230 more skipped]