mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Sync to Wine-20050725:
Felix Nawothnig <felix.nawothnig@t-online.de> - Fix misuse of UrlCombineW. Mike McCormack <mike@codeweavers.com> - Fix -Wpointer-sign warnings. Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> - URLMonikerImpl_BindToStorage: Don't use a HeapAllocated pointer for other purposes. - URLMonikerImpl_BindToStorage: Escape special characters. Jacek Caban <jack@itma.pwr.wroc.pl> - Register protocols. - Better module locking. - Fix handling of pmkContext in CreateURLMoniker. svn path=/trunk/; revision=17341
This commit is contained in:
parent
66359f3c63
commit
dbd7ad25e3
11 changed files with 286 additions and 44 deletions
|
@ -14,6 +14,8 @@ C_SRCS = \
|
||||||
umstream.c \
|
umstream.c \
|
||||||
urlmon_main.c
|
urlmon_main.c
|
||||||
|
|
||||||
|
RC_SRCS = rsrc.rc
|
||||||
|
|
||||||
SUBDIRS = tests
|
SUBDIRS = tests
|
||||||
|
|
||||||
@MAKE_DLL_RULES@
|
@MAKE_DLL_RULES@
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#define COM_NO_WINDOWS_H
|
#define COM_NO_WINDOWS_H
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
|
@ -28,6 +29,7 @@
|
||||||
#include "wingdi.h"
|
#include "wingdi.h"
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
|
#include "advpub.h"
|
||||||
|
|
||||||
#include "objbase.h"
|
#include "objbase.h"
|
||||||
|
|
||||||
|
@ -35,6 +37,9 @@
|
||||||
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "initguid.h"
|
||||||
|
#include "urlmon_main.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
|
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -511,6 +516,48 @@ static struct regsvr_coclass const coclass_list[] = {
|
||||||
"urlmon.dll",
|
"urlmon.dll",
|
||||||
"Apartment"
|
"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 */
|
{ NULL } /* list terminator */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -522,6 +569,58 @@ static struct regsvr_interface const interface_list[] = {
|
||||||
{ NULL } /* list terminator */
|
{ 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.@)
|
* DllRegisterServer (URLMON.@)
|
||||||
*/
|
*/
|
||||||
|
@ -534,7 +633,9 @@ HRESULT WINAPI URLMON_DllRegisterServer(void)
|
||||||
hr = register_coclasses(coclass_list);
|
hr = register_coclasses(coclass_list);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
hr = register_interfaces(interface_list);
|
hr = register_interfaces(interface_list);
|
||||||
|
if(FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
return register_inf(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -549,5 +650,7 @@ HRESULT WINAPI URLMON_DllUnregisterServer(void)
|
||||||
hr = unregister_coclasses(coclass_list);
|
hr = unregister_coclasses(coclass_list);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
hr = unregister_interfaces(interface_list);
|
hr = unregister_interfaces(interface_list);
|
||||||
|
if(FAILED(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
return register_inf(FALSE);
|
||||||
}
|
}
|
||||||
|
|
19
reactos/lib/urlmon/rsrc.rc
Normal file
19
reactos/lib/urlmon/rsrc.rc
Normal file
|
@ -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
|
|
@ -43,7 +43,7 @@ typedef struct SecManagerImpl{
|
||||||
|
|
||||||
const IInternetSecurityManagerVtbl* lpvtbl1; /* VTable relative to the IInternetSecurityManager interface.*/
|
const IInternetSecurityManagerVtbl* lpvtbl1; /* VTable relative to the IInternetSecurityManager interface.*/
|
||||||
|
|
||||||
ULONG ref; /* reference counter for this object */
|
LONG ref; /* reference counter for this object */
|
||||||
|
|
||||||
} SecManagerImpl;
|
} SecManagerImpl;
|
||||||
|
|
||||||
|
@ -82,8 +82,6 @@ static ULONG WINAPI SecManagerImpl_AddRef(IInternetSecurityManager* iface)
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||||
|
|
||||||
URLMON_LockModule();
|
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,9 +95,8 @@ static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface)
|
||||||
/* destroy the object if there's no more reference on it */
|
/* destroy the object if there's no more reference on it */
|
||||||
if (!refCount){
|
if (!refCount){
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
HeapFree(GetProcessHeap(),0,This);
|
||||||
}
|
|
||||||
|
|
||||||
URLMON_UnlockModule();
|
URLMON_UnlockModule();
|
||||||
|
}
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
@ -201,6 +198,9 @@ HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
|
||||||
This->ref = 1;
|
This->ref = 1;
|
||||||
|
|
||||||
*ppobj = This;
|
*ppobj = This;
|
||||||
|
|
||||||
|
URLMON_LockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const IInternetZoneManagerVtbl* lpVtbl;
|
const IInternetZoneManagerVtbl* lpVtbl;
|
||||||
ULONG ref;
|
LONG ref;
|
||||||
} ZoneMgrImpl;
|
} ZoneMgrImpl;
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
|
@ -247,8 +247,6 @@ static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||||
|
|
||||||
URLMON_LockModule();
|
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,10 +260,10 @@ static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface)
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
|
TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1);
|
||||||
|
|
||||||
if(!refCount)
|
if(!refCount) {
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
|
||||||
URLMON_UnlockModule();
|
URLMON_UnlockModule();
|
||||||
|
}
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
@ -457,6 +455,8 @@ HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
|
||||||
ret->ref = 1;
|
ret->ref = 1;
|
||||||
*ppobj = (IInternetZoneManager*)ret;
|
*ppobj = (IInternetZoneManager*)ret;
|
||||||
|
|
||||||
|
URLMON_LockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ static const WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e',
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const IBindingVtbl *lpVtbl;
|
const IBindingVtbl *lpVtbl;
|
||||||
|
|
||||||
ULONG ref;
|
LONG ref;
|
||||||
|
|
||||||
LPWSTR URLName;
|
LPWSTR URLName;
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ typedef struct {
|
||||||
|
|
||||||
const IMonikerVtbl* lpvtbl; /* VTable relative to the IMoniker interface.*/
|
const IMonikerVtbl* lpvtbl; /* VTable relative to the IMoniker interface.*/
|
||||||
|
|
||||||
ULONG ref; /* reference counter for this object */
|
LONG ref; /* reference counter for this object */
|
||||||
|
|
||||||
LPOLESTR URLName; /* URL string identified by this URLmoniker */
|
LPOLESTR URLName; /* URL string identified by this URLmoniker */
|
||||||
} URLMonikerImpl;
|
} URLMonikerImpl;
|
||||||
|
@ -340,8 +340,6 @@ static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
|
||||||
|
|
||||||
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1);
|
||||||
|
|
||||||
URLMON_LockModule();
|
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,9 +357,9 @@ static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface)
|
||||||
if (!refCount) {
|
if (!refCount) {
|
||||||
HeapFree(GetProcessHeap(),0,This->URLName);
|
HeapFree(GetProcessHeap(),0,This->URLName);
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
HeapFree(GetProcessHeap(),0,This);
|
||||||
}
|
|
||||||
|
|
||||||
URLMON_UnlockModule();
|
URLMON_UnlockModule();
|
||||||
|
}
|
||||||
|
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
@ -600,7 +598,7 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
|
||||||
if(SUCCEEDED(hres)) {
|
if(SUCCEEDED(hres)) {
|
||||||
WCHAR *urlcopy, *tmpwc;
|
WCHAR *urlcopy, *tmpwc;
|
||||||
URL_COMPONENTSW url;
|
URL_COMPONENTSW url;
|
||||||
WCHAR *host, *path, *user, *pass;
|
WCHAR *host, *path, *partial_path, *user, *pass;
|
||||||
DWORD lensz = sizeof(bind->expected_size);
|
DWORD lensz = sizeof(bind->expected_size);
|
||||||
DWORD dwService = 0;
|
DWORD dwService = 0;
|
||||||
BOOL bSuccess;
|
BOOL bSuccess;
|
||||||
|
@ -638,7 +636,7 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
|
||||||
memset(&url, 0, sizeof(url));
|
memset(&url, 0, sizeof(url));
|
||||||
url.dwStructSize = sizeof(url);
|
url.dwStructSize = sizeof(url);
|
||||||
url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = url.dwUserNameLength = url.dwPasswordLength = 1;
|
url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = url.dwUserNameLength = url.dwPasswordLength = 1;
|
||||||
InternetCrackUrlW(urlcopy, 0, 0, &url);
|
InternetCrackUrlW(urlcopy, 0, ICU_ESCAPE, &url);
|
||||||
host = HeapAlloc(GetProcessHeap(), 0, (url.dwHostNameLength + 1) * sizeof(WCHAR));
|
host = HeapAlloc(GetProcessHeap(), 0, (url.dwHostNameLength + 1) * sizeof(WCHAR));
|
||||||
memcpy(host, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR));
|
memcpy(host, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR));
|
||||||
host[url.dwHostNameLength] = '\0';
|
host[url.dwHostNameLength] = '\0';
|
||||||
|
@ -799,9 +797,9 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INTERNET_SCHEME_FILE:
|
case INTERNET_SCHEME_FILE:
|
||||||
path = bind->URLName + 5; /* Skip the "file:" part */
|
partial_path = bind->URLName + 5; /* Skip the "file:" part */
|
||||||
if ((path[0] != '/' && path[0] != '\\') ||
|
if ((partial_path[0] != '/' && partial_path[0] != '\\') ||
|
||||||
(path[1] != '/' && path[1] != '\\'))
|
(partial_path[1] != '/' && partial_path[1] != '\\'))
|
||||||
{
|
{
|
||||||
hres = E_FAIL;
|
hres = E_FAIL;
|
||||||
}
|
}
|
||||||
|
@ -809,10 +807,10 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
|
||||||
{
|
{
|
||||||
HANDLE h;
|
HANDLE h;
|
||||||
|
|
||||||
path += 2;
|
partial_path += 2;
|
||||||
if (path[0] == '/' || path[0] == '\\')
|
if (partial_path[0] == '/' || partial_path[0] == '\\')
|
||||||
++path;
|
++partial_path;
|
||||||
h = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
|
h = CreateFileW(partial_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
|
||||||
if (h == (HANDLE) HFILE_ERROR)
|
if (h == (HANDLE) HFILE_ERROR)
|
||||||
{
|
{
|
||||||
hres = HRESULT_FROM_WIN32(GetLastError());
|
hres = HRESULT_FROM_WIN32(GetLastError());
|
||||||
|
@ -1136,7 +1134,7 @@ static const IMonikerVtbl VT_URLMonikerImpl =
|
||||||
static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
|
static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
DWORD sizeStr;
|
DWORD sizeStr = INTERNET_MAX_URL_LENGTH;
|
||||||
|
|
||||||
TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
|
TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
|
||||||
memset(This, 0, sizeof(*This));
|
memset(This, 0, sizeof(*This));
|
||||||
|
@ -1170,6 +1168,8 @@ static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeft
|
||||||
else
|
else
|
||||||
strcpyW(This->URLName,lpszURLName);
|
strcpyW(This->URLName,lpszURLName);
|
||||||
|
|
||||||
|
URLMON_LockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1255,11 +1255,12 @@ HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
if(pmkContext) {
|
if(pmkContext) {
|
||||||
CLSID clsid;
|
|
||||||
IBindCtx* bind;
|
IBindCtx* bind;
|
||||||
IMoniker_GetClassID(pmkContext, &clsid);
|
DWORD dwMksys = 0;
|
||||||
if(IsEqualCLSID(&clsid, &CLSID_StdURLMoniker) && SUCCEEDED(CreateBindCtx(0, &bind))) {
|
IMoniker_IsSystemMoniker(pmkContext, &dwMksys);
|
||||||
URLMonikerImpl_GetDisplayName(pmkContext, bind, NULL, &lefturl);
|
if(dwMksys == MKSYS_URLMONIKER && SUCCEEDED(CreateBindCtx(0, &bind))) {
|
||||||
|
IMoniker_GetDisplayName(pmkContext, bind, NULL, &lefturl);
|
||||||
|
TRACE("lefturl = %s\n", debugstr_w(lefturl));
|
||||||
IBindCtx_Release(bind);
|
IBindCtx_Release(bind);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,7 +253,8 @@ static HRESULT WINAPI IStream_fnSeek ( IStream * iface,
|
||||||
DWORD dwOrigin,
|
DWORD dwOrigin,
|
||||||
ULARGE_INTEGER* plibNewPosition)
|
ULARGE_INTEGER* plibNewPosition)
|
||||||
{
|
{
|
||||||
DWORD pos, newposlo, newposhi;
|
DWORD pos, newposlo;
|
||||||
|
LONG newposhi;
|
||||||
|
|
||||||
IUMCacheStream *This = (IUMCacheStream *)iface;
|
IUMCacheStream *This = (IUMCacheStream *)iface;
|
||||||
|
|
||||||
|
@ -262,7 +263,7 @@ static HRESULT WINAPI IStream_fnSeek ( IStream * iface,
|
||||||
pos = dlibMove.QuadPart; /* FIXME: truncates */
|
pos = dlibMove.QuadPart; /* FIXME: truncates */
|
||||||
newposhi = 0;
|
newposhi = 0;
|
||||||
newposlo = SetFilePointer( This->handle, pos, &newposhi, dwOrigin );
|
newposlo = SetFilePointer( This->handle, pos, &newposhi, dwOrigin );
|
||||||
if( newposlo == INVALID_SET_FILE_POINTER )
|
if( newposlo == INVALID_SET_FILE_POINTER && GetLastError())
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
if (plibNewPosition)
|
if (plibNewPosition)
|
||||||
|
|
29
reactos/lib/urlmon/urlmon.inf
Normal file
29
reactos/lib/urlmon/urlmon.inf
Normal file
|
@ -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%"
|
|
@ -23,5 +23,6 @@
|
||||||
<file>umon.c</file>
|
<file>umon.c</file>
|
||||||
<file>umstream.c</file>
|
<file>umstream.c</file>
|
||||||
<file>urlmon_main.c</file>
|
<file>urlmon_main.c</file>
|
||||||
|
<file>rsrc.rc</file>
|
||||||
<file>urlmon.spec</file>
|
<file>urlmon.spec</file>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -89,7 +89,7 @@ HRESULT WINAPI URLMON_DllCanUnloadNow(void)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
IClassFactory ITF_IClassFactory;
|
IClassFactory ITF_IClassFactory;
|
||||||
|
|
||||||
DWORD ref;
|
LONG ref;
|
||||||
HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj);
|
HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj);
|
||||||
} IClassFactoryImpl;
|
} IClassFactoryImpl;
|
||||||
|
|
||||||
|
@ -125,8 +125,6 @@ CF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
|
||||||
static ULONG WINAPI CF_AddRef(LPCLASSFACTORY iface)
|
static ULONG WINAPI CF_AddRef(LPCLASSFACTORY iface)
|
||||||
{
|
{
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||||
URLMON_LockModule();
|
|
||||||
|
|
||||||
return InterlockedIncrement(&This->ref);
|
return InterlockedIncrement(&This->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,10 +134,10 @@ static ULONG WINAPI CF_Release(LPCLASSFACTORY iface)
|
||||||
|
|
||||||
ULONG ref = InterlockedDecrement(&This->ref);
|
ULONG ref = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
if (ref == 0)
|
if (ref == 0) {
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
|
||||||
URLMON_UnlockModule();
|
URLMON_UnlockModule();
|
||||||
|
}
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
@ -229,10 +227,12 @@ DWORD WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||||
|
|
||||||
factory->ITF_IClassFactory.lpVtbl = &CF_Vtbl;
|
factory->ITF_IClassFactory.lpVtbl = &CF_Vtbl;
|
||||||
factory->ref = 1;
|
factory->ref = 1;
|
||||||
|
|
||||||
factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
|
factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
|
||||||
|
|
||||||
*ppv = &(factory->ITF_IClassFactory);
|
*ppv = &(factory->ITF_IClassFactory);
|
||||||
|
|
||||||
|
URLMON_LockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ static inline void URLMON_UnlockModule(void) { InterlockedDecrement( &URLMON_ref
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
const IStreamVtbl *lpVtbl;
|
const IStreamVtbl *lpVtbl;
|
||||||
DWORD ref;
|
LONG ref;
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
BOOL closed;
|
BOOL closed;
|
||||||
WCHAR *pszFileName;
|
WCHAR *pszFileName;
|
||||||
|
@ -50,4 +50,13 @@ typedef struct
|
||||||
HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL, DWORD dwSize, LPWSTR pszFileName, HANDLE *phfile, IUMCacheStream **ppstr);
|
HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL, DWORD dwSize, LPWSTR pszFileName, HANDLE *phfile, IUMCacheStream **ppstr);
|
||||||
void UMCloseCacheFileStream(IUMCacheStream *pstr);
|
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 */
|
#endif /* __WINE_URLMON_MAIN_H */
|
||||||
|
|
77
reactos/w32api/include/advpub.h
Normal file
77
reactos/w32api/include/advpub.h
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2004 Huw D M Davies
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
#ifndef __WINE_ADVPUB_H
|
||||||
|
#define __WINE_ADVPUB_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct _CabInfo {
|
||||||
|
PSTR pszCab;
|
||||||
|
PSTR pszInf;
|
||||||
|
PSTR pszSection;
|
||||||
|
char szSrcPath[MAX_PATH];
|
||||||
|
DWORD dwFlags;
|
||||||
|
} CABINFO, *PCABINFO;
|
||||||
|
|
||||||
|
typedef struct _StrEntry {
|
||||||
|
LPSTR pszName;
|
||||||
|
LPSTR pszValue;
|
||||||
|
} STRENTRY, *LPSTRENTRY;
|
||||||
|
|
||||||
|
typedef const STRENTRY CSTRENTRY;
|
||||||
|
typedef CSTRENTRY *LPCSTRENTRY;
|
||||||
|
|
||||||
|
typedef struct _StrTable {
|
||||||
|
DWORD cEntries;
|
||||||
|
LPSTRENTRY pse;
|
||||||
|
} STRTABLE, *LPSTRTABLE;
|
||||||
|
|
||||||
|
typedef const STRTABLE CSTRTABLE;
|
||||||
|
typedef CSTRTABLE *LPCSTRTABLE;
|
||||||
|
|
||||||
|
/* Flags for RunSetupCommand */
|
||||||
|
#define RSC_FLAG_INF 0x00000001
|
||||||
|
#define RSC_FLAG_SKIPDISKSPACECHECK 0x00000002
|
||||||
|
#define RSC_FLAG_QUIET 0x00000004
|
||||||
|
#define RSC_FLAG_NGCONV 0x00000008
|
||||||
|
#define RSC_FLAG_UPDHLPDLLS 0x00000010
|
||||||
|
#define RSC_FLAG_DELAYREGISTEROCX 0x00000200
|
||||||
|
#define RSC_FLAG_SETUPAPI 0x00000400
|
||||||
|
|
||||||
|
/* Flags for DelNode */
|
||||||
|
#define ADN_DEL_IF_EMPTY 0x00000001
|
||||||
|
#define ADN_DONT_DEL_SUBDIRS 0x00000002
|
||||||
|
#define ADN_DONT_DEL_DIR 0x00000004
|
||||||
|
|
||||||
|
HRESULT WINAPI RunSetupCommand(HWND hWnd,
|
||||||
|
LPCSTR szCmdName, LPCSTR szInfSection, LPCSTR szDir, LPCSTR lpszTitle,
|
||||||
|
HANDLE *phEXE, DWORD dwFlags, LPVOID pvReserved);
|
||||||
|
HRESULT WINAPI DelNode(LPCSTR pszFileOrDirName, DWORD dwFlags);
|
||||||
|
DWORD WINAPI NeedRebootInit(VOID);
|
||||||
|
BOOL WINAPI NeedReboot(DWORD dwRebootCheck);
|
||||||
|
HRESULT WINAPI RegInstall(HMODULE hm, LPCSTR pszSection, LPCSTRTABLE pstTable);
|
||||||
|
HRESULT WINAPI GetVersionFromFile(LPSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion);
|
||||||
|
HRESULT WINAPI GetVersionFromFileEx(LPSTR lpszFilename, LPDWORD pdwMSVer, LPDWORD pdwLSVer, BOOL bVersion);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __WINE_ADVPUB_H */
|
Loading…
Reference in a new issue