- Added stub implementation of IInternetZoneManager interface.
- Added implementation of CoInternetCreateZoneManager function.
- Added stub implementation of UrlMkGetSessionOption and corrected
declaration of UrlMkSetSessionOption.
- Code cleanup.
diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c
index b95f6be..549d395 100644
--- a/dlls/urlmon/sec_mgr.c
+++ b/dlls/urlmon/sec_mgr.c
@@ -1,7 +1,8 @@
/*
- * Internet Security Manager
+ * Internet Security and Zone Manager
*
* Copyright (c) 2004 Huw D M Davies
+ * Copyright 2004 Jacek Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,6 +22,8 @@
#include <stdarg.h>
#include <stdio.h>
+#define COBJMACROS
+
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
@@ -32,6 +35,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
+/***********************************************************************
+ * InternetSecurityManager implementation
+ *
+ */
typedef struct SecManagerImpl{
IInternetSecurityManagerVtbl* lpvtbl1; /* VTable relative to the IInternetSecurityManager interface.*/
@@ -40,55 +47,6 @@
} SecManagerImpl;
-/* IUnknown prototype functions */
-static HRESULT WINAPI SecManagerImpl_QueryInterface(IInternetSecurityManager* iface,REFIID riid,void** ppvObject);
-static ULONG WINAPI SecManagerImpl_AddRef(IInternetSecurityManager* iface);
-static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface);
-
-static HRESULT WINAPI SecManagerImpl_SetSecuritySite(IInternetSecurityManager *iface,
- IInternetSecurityMgrSite *pSite);
-static HRESULT WINAPI SecManagerImpl_GetSecuritySite(IInternetSecurityManager *iface,
- IInternetSecurityMgrSite **ppSite);
-static HRESULT WINAPI SecManagerImpl_MapUrlToZone(IInternetSecurityManager *iface,
- LPCWSTR pwszUrl, DWORD *pdwZone,
- DWORD dwFlags);
-static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *iface,
- LPCWSTR pwszUrl,
- BYTE *pbSecurityId, DWORD *pcbSecurityId,
- DWORD dwReserved);
-static HRESULT WINAPI SecManagerImpl_ProcessUrlAction(IInternetSecurityManager *iface,
- LPCWSTR pwszUrl, DWORD dwAction,
- BYTE *pPolicy, DWORD cbPolicy,
- BYTE *pContext, DWORD cbContext,
- DWORD dwFlags, DWORD dwReserved);
-static HRESULT WINAPI SecManagerImpl_QueryCustomPolicy(IInternetSecurityManager *iface,
- LPCWSTR pwszUrl, REFGUID guidKey,
- BYTE **ppPolicy, DWORD *pcbPolicy,
- BYTE *pContext, DWORD cbContext,
- DWORD dwReserved);
-static HRESULT WINAPI SecManagerImpl_SetZoneMapping(IInternetSecurityManager *iface,
- DWORD dwZone, LPCWSTR pwszPattern, DWORD dwFlags);
-static HRESULT WINAPI SecManagerImpl_GetZoneMappings(IInternetSecurityManager *iface,
- DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags);
-
-static HRESULT SecManagerImpl_Destroy(SecManagerImpl* This);
-HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
-
-static IInternetSecurityManagerVtbl VT_SecManagerImpl =
-{
- SecManagerImpl_QueryInterface,
- SecManagerImpl_AddRef,
- SecManagerImpl_Release,
- SecManagerImpl_SetSecuritySite,
- SecManagerImpl_GetSecuritySite,
- SecManagerImpl_MapUrlToZone,
- SecManagerImpl_GetSecurityId,
- SecManagerImpl_ProcessUrlAction,
- SecManagerImpl_QueryCustomPolicy,
- SecManagerImpl_SetZoneMapping,
- SecManagerImpl_GetZoneMappings
-};
-
static HRESULT WINAPI SecManagerImpl_QueryInterface(IInternetSecurityManager* iface,REFIID riid,void** ppvObject)
{
SecManagerImpl *This = (SecManagerImpl *)iface;
@@ -112,7 +70,7 @@
return E_NOINTERFACE;
/* Query Interface always increases the reference count by one when it is successful */
- SecManagerImpl_AddRef(iface);
+ IInternetSecurityManager_AddRef(iface);
return S_OK;
}
@@ -136,38 +94,11 @@
/* destroy the object if there's no more reference on it */
if (ref==0){
-
- SecManagerImpl_Destroy(This);
-
- return 0;
+ HeapFree(GetProcessHeap(),0,This);
}
return ref;
}
-static HRESULT SecManagerImpl_Destroy(SecManagerImpl* This)
-{
- TRACE("(%p)\n",This);
-
- HeapFree(GetProcessHeap(),0,This);
-
- return S_OK;
-}
-
-HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
-{
- SecManagerImpl *This;
-
- TRACE("(%p,%p)\n",pUnkOuter,ppobj);
- This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
-
- /* Initialize the virtual function table. */
- This->lpvtbl1 = &VT_SecManagerImpl;
- This->ref = 1;
-
- *ppobj = This;
- return S_OK;
-}
-
static HRESULT WINAPI SecManagerImpl_SetSecuritySite(IInternetSecurityManager *iface,
IInternetSecurityMgrSite *pSite)
{
@@ -238,6 +169,271 @@
return E_NOTIMPL;
}
+static IInternetSecurityManagerVtbl VT_SecManagerImpl =
+{
+ SecManagerImpl_QueryInterface,
+ SecManagerImpl_AddRef,
+ SecManagerImpl_Release,
+ SecManagerImpl_SetSecuritySite,
+ SecManagerImpl_GetSecuritySite,
+ SecManagerImpl_MapUrlToZone,
+ SecManagerImpl_GetSecurityId,
+ SecManagerImpl_ProcessUrlAction,
+ SecManagerImpl_QueryCustomPolicy,
+ SecManagerImpl_SetZoneMapping,
+ SecManagerImpl_GetZoneMappings
+};
+
+HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
+{
+ SecManagerImpl *This;
+
+ TRACE("(%p,%p)\n",pUnkOuter,ppobj);
+ This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+
+ /* Initialize the virtual function table. */
+ This->lpvtbl1 = &VT_SecManagerImpl;
+ This->ref = 1;
+
+ *ppobj = This;
+ return S_OK;
+}
+
+/***********************************************************************
+ * InternetZoneManager implementation
+ *
+ */
+typedef struct {
+ IInternetZoneManagerVtbl* lpVtbl;
+ ULONG ref;
+} ZoneMgrImpl;
+
+/********************************************************************
+ * IInternetZoneManager_QueryInterface
+ */
+static HRESULT WINAPI ZoneMgrImpl_QueryInterface(IInternetZoneManager* iface, REFIID riid, void** ppvObject)
+{
+ ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
+
+ TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);
+
+ if(!This || !ppvObject)
+ return E_INVALIDARG;
+
+ if(!IsEqualIID(&IID_IUnknown, riid) && !IsEqualIID(&IID_IInternetZoneManager, riid)) {
+ FIXME("Unknown interface: %s\n", debugstr_guid(riid));
+ *ppvObject = NULL;
+ return E_NOINTERFACE;
+ }
+
+ *ppvObject = iface;
+ IInternetZoneManager_AddRef(iface);
+
+ return S_OK;
+}
+
+/********************************************************************
+ * IInternetZoneManager_AddRef
+ */
+static ULONG WINAPI ZoneMgrImpl_AddRef(IInternetZoneManager* iface)
+{
+ ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
+
+ TRACE("(%p) was %lu\n", This, This->ref);
+
+ return InterlockedIncrement(&This->ref);
+}
+
+/********************************************************************
+ * IInternetZoneManager_Release
+ */
+static ULONG WINAPI ZoneMgrImpl_Release(IInternetZoneManager* iface)
+{
+ ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
+ ULONG ref;
+
+ TRACE("(%p) was %lu\n", This, This->ref);
+ ref = InterlockedDecrement(&This->ref);
+
+ if(!ref)
+ HeapFree(GetProcessHeap(), 0, This);
+
+ return ref;
+}
+
+/********************************************************************
+ * IInternetZoneManager_GetZoneAttributes
+ */
+static HRESULT WINAPI ZoneMgrImpl_GetZoneAttributes(IInternetZoneManager* iface,
+ DWORD dwZone,
+ ZONEATTRIBUTES* pZoneAttributes)
+{
+ FIXME("(%p)->(%ld %p) stub\n", iface, dwZone, pZoneAttributes);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_SetZoneAttributes
+ */
+static HRESULT WINAPI ZoneMgrImpl_SetZoneAttributes(IInternetZoneManager* iface,
+ DWORD dwZone,
+ ZONEATTRIBUTES* pZoneAttributes)
+{
+ FIXME("(%p)->(%08lx %p) stub\n", iface, dwZone, pZoneAttributes);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_GetZoneCustomPolicy
+ */
+static HRESULT WINAPI ZoneMgrImpl_GetZoneCustomPolicy(IInternetZoneManager* iface,
+ DWORD dwZone,
+ REFGUID guidKey,
+ BYTE** ppPolicy,
+ DWORD* pcbPolicy,
+ URLZONEREG ulrZoneReg)
+{
+ FIXME("(%p)->(%08lx %s %p %p %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
+ ppPolicy, pcbPolicy, ulrZoneReg);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_SetZoneCustomPolicy
+ */
+static HRESULT WINAPI ZoneMgrImpl_SetZoneCustomPolicy(IInternetZoneManager* iface,
+ DWORD dwZone,
+ REFGUID guidKey,
+ BYTE* ppPolicy,
+ DWORD cbPolicy,
+ URLZONEREG ulrZoneReg)
+{
+ FIXME("(%p)->(%08lx %s %p %08lx %08x) stub\n", iface, dwZone, debugstr_guid(guidKey),
+ ppPolicy, cbPolicy, ulrZoneReg);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_GetZoneActionPolicy
+ */
+static HRESULT WINAPI ZoneMgrImpl_GetZoneActionPolicy(IInternetZoneManager* iface,
+ DWORD dwZone,
+ DWORD dwAction,
+ BYTE* pPolicy,
+ DWORD cbPolicy,
+ URLZONEREG urlZoneReg)
+{
+ FIXME("(%p)->(%08lx %08lx %p %08lx %08x) stub\n", iface, dwZone, dwAction, pPolicy,
+ cbPolicy, urlZoneReg);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_SetZoneActionPolicy
+ */
+static HRESULT WINAPI ZoneMgrImpl_SetZoneActionPolicy(IInternetZoneManager* iface,
+ DWORD dwZone,
+ DWORD dwAction,
+ BYTE* pPolicy,
+ DWORD cbPolicy,
+ URLZONEREG urlZoneReg)
+{
+ FIXME("(%p)->(%08lx %08lx %p %08lx %08x) stub\n", iface, dwZone, dwAction, pPolicy,
+ cbPolicy, urlZoneReg);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_LogAction
+ */
+static HRESULT WINAPI ZoneMgrImpl_LogAction(IInternetZoneManager* iface,
+ DWORD dwAction,
+ LPCWSTR pwszUrl,
+ LPCWSTR pwszText,
+ DWORD dwLogFlags)
+{
+ FIXME("(%p)->(%08lx %s %s %08lx) stub\n", iface, dwAction, debugstr_w(pwszUrl),
+ debugstr_w(pwszText), dwLogFlags);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_CreateZoneEnumerator
+ */
+static HRESULT WINAPI ZoneMgrImpl_CreateZoneEnumerator(IInternetZoneManager* iface,
+ DWORD* pdwEnum,
+ DWORD* pdwCount,
+ DWORD dwFlags)
+{
+ FIXME("(%p)->(%p %p %08lx) stub\n", iface, pdwEnum, pdwCount, dwFlags);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_GetZoneAt
+ */
+static HRESULT WINAPI ZoneMgrImpl_GetZoneAt(IInternetZoneManager* iface,
+ DWORD dwEnum,
+ DWORD dwIndex,
+ DWORD* pdwZone)
+{
+ FIXME("(%p)->(%08lx %08lx %p) stub\n", iface, dwEnum, dwIndex, pdwZone);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_DestroyZoneEnumerator
+ */
+static HRESULT WINAPI ZoneMgrImpl_DestroyZoneEnumerator(IInternetZoneManager* iface,
+ DWORD dwEnum)
+{
+ FIXME("(%p)->(%08lx) stub\n", iface, dwEnum);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_CopyTemplatePoliciesToZone
+ */
+static HRESULT WINAPI ZoneMgrImpl_CopyTemplatePoliciesToZone(IInternetZoneManager* iface,
+ DWORD dwTemplate,
+ DWORD dwZone,
+ DWORD dwReserved)
+{
+ FIXME("(%p)->(%08lx %08lx %08lx) stub\n", iface, dwTemplate, dwZone, dwReserved);
+ return E_NOTIMPL;
+}
+
+/********************************************************************
+ * IInternetZoneManager_Construct
+ */
+static IInternetZoneManagerVtbl ZoneMgrImplVtbl = {
+ ZoneMgrImpl_QueryInterface,
+ ZoneMgrImpl_AddRef,
+ ZoneMgrImpl_Release,
+ ZoneMgrImpl_GetZoneAttributes,
+ ZoneMgrImpl_SetZoneAttributes,
+ ZoneMgrImpl_GetZoneCustomPolicy,
+ ZoneMgrImpl_SetZoneCustomPolicy,
+ ZoneMgrImpl_GetZoneActionPolicy,
+ ZoneMgrImpl_SetZoneActionPolicy,
+ ZoneMgrImpl_LogAction,
+ ZoneMgrImpl_CreateZoneEnumerator,
+ ZoneMgrImpl_GetZoneAt,
+ ZoneMgrImpl_DestroyZoneEnumerator,
+ ZoneMgrImpl_CopyTemplatePoliciesToZone,
+};
+HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
+{
+ ZoneMgrImpl* ret = HeapAlloc(GetProcessHeap(), 0, sizeof(ZoneMgrImpl));
+
+ TRACE("(%p %p)\n", pUnkOuter, ppobj);
+ ret->lpVtbl = &ZoneMgrImplVtbl;
+ ret->ref = 1;
+ *ppobj = (IInternetZoneManager*)ret;
+
+ return S_OK;
+}
+
/***********************************************************************
* CoInternetCreateSecurityManager (URLMON.@)
*
@@ -248,3 +444,12 @@
TRACE("%p %p %ld\n", pSP, ppSM, dwReserved );
return SecManagerImpl_Construct(NULL, (void**) ppSM);
}
+
+/********************************************************************
+ * CoInternetCreateZoneManager (URLMON.@)
+ */
+HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider* pSP, IInternetZoneManager** ppZM, DWORD dwReserved)
+{
+ TRACE("(%p %p %lx)\n", pSP, ppZM, dwReserved);
+ return ZoneMgrImpl_Construct(NULL, (void**)ppZM);
+}
diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c
index 0b5a8d4..8747836 100644
--- a/dlls/urlmon/umon.c
+++ b/dlls/urlmon/umon.c
@@ -63,99 +63,6 @@
HINTERNET hinternet, hconnect, hrequest;
} URLMonikerImpl;
-/********************************************************************************/
-/* URLMoniker prototype functions : */
-
-/* IUnknown prototype functions */
-static HRESULT WINAPI URLMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject);
-static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface);
-static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface);
-
-/* IPersist prototype functions */
-static HRESULT WINAPI URLMonikerImpl_GetClassID(IMoniker* iface, CLSID *pClassID);
-
-/* IPersistStream prototype functions */
-static HRESULT WINAPI URLMonikerImpl_IsDirty(IMoniker* iface);
-static HRESULT WINAPI URLMonikerImpl_Load(IMoniker* iface, IStream* pStm);
-static HRESULT WINAPI URLMonikerImpl_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty);
-static HRESULT WINAPI URLMonikerImpl_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize);
-
-/* IMoniker prototype functions */
-static HRESULT WINAPI URLMonikerImpl_BindToObject(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
-static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
-static HRESULT WINAPI URLMonikerImpl_Reduce(IMoniker* iface,IBindCtx* pbc, DWORD dwReduceHowFar,IMoniker** ppmkToLeft, IMoniker** ppmkReduced);
-static HRESULT WINAPI URLMonikerImpl_ComposeWith(IMoniker* iface,IMoniker* pmkRight,BOOL fOnlyIfNotGeneric, IMoniker** ppmkComposite);
-static HRESULT WINAPI URLMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker);
-static HRESULT WINAPI URLMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker);
-static HRESULT WINAPI URLMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash);
-static HRESULT WINAPI URLMonikerImpl_IsRunning(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, IMoniker* pmkNewlyRunning);
-static HRESULT WINAPI URLMonikerImpl_GetTimeOfLastChange(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, FILETIME* pFileTime);
-static HRESULT WINAPI URLMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk);
-static HRESULT WINAPI URLMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther, IMoniker** ppmkPrefix);
-static HRESULT WINAPI URLMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath);
-static HRESULT WINAPI URLMonikerImpl_GetDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName);
-static HRESULT WINAPI URLMonikerImpl_ParseDisplayName(IMoniker* iface,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut);
-static HRESULT WINAPI URLMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys);
-
-/* IBinding interface to moniker */
-static HRESULT WINAPI URLMonikerImpl_IBinding_QueryInterface(IBinding* iface,REFIID riid,void** ppvObject);
-static ULONG WINAPI URLMonikerImpl_IBinding_AddRef(IBinding* iface);
-static ULONG WINAPI URLMonikerImpl_IBinding_Release(IBinding* iface);
-static HRESULT WINAPI URLMonikerImpl_IBinding_Abort(IBinding* iface);
-static HRESULT WINAPI URLMonikerImpl_IBinding_Suspend(IBinding* iface);
-static HRESULT WINAPI URLMonikerImpl_IBinding_Resume(IBinding* iface);
-static HRESULT WINAPI URLMonikerImpl_IBinding_SetPriority(IBinding* iface, LONG nPriority);
-static HRESULT WINAPI URLMonikerImpl_IBinding_GetPriority(IBinding* iface, LONG* pnPriority);
-static HRESULT WINAPI URLMonikerImpl_IBinding_GetBindResult(IBinding* iface, CLSID* pclsidProtocol, DWORD* pdwResult, LPOLESTR* pszResult, DWORD* pdwReserved);
-
-/* Local function used by urlmoniker implementation */
-static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* iface, LPCOLESTR lpszLeftURL, LPCOLESTR lpszURL);
-static HRESULT URLMonikerImpl_Destroy(URLMonikerImpl* iface);
-
-/********************************************************************************/
-/* Virtual function table for the URLMonikerImpl class which include IPersist,*/
-/* IPersistStream and IMoniker functions. */
-static IMonikerVtbl VT_URLMonikerImpl =
-{
- URLMonikerImpl_QueryInterface,
- URLMonikerImpl_AddRef,
- URLMonikerImpl_Release,
- URLMonikerImpl_GetClassID,
- URLMonikerImpl_IsDirty,
- URLMonikerImpl_Load,
- URLMonikerImpl_Save,
- URLMonikerImpl_GetSizeMax,
- URLMonikerImpl_BindToObject,
- URLMonikerImpl_BindToStorage,
- URLMonikerImpl_Reduce,
- URLMonikerImpl_ComposeWith,
- URLMonikerImpl_Enum,
- URLMonikerImpl_IsEqual,
- URLMonikerImpl_Hash,
- URLMonikerImpl_IsRunning,
- URLMonikerImpl_GetTimeOfLastChange,
- URLMonikerImpl_Inverse,
- URLMonikerImpl_CommonPrefixWith,
- URLMonikerImpl_RelativePathTo,
- URLMonikerImpl_GetDisplayName,
- URLMonikerImpl_ParseDisplayName,
- URLMonikerImpl_IsSystemMoniker
-};
-
-static IBindingVtbl VTBinding_URLMonikerImpl =
-{
- URLMonikerImpl_IBinding_QueryInterface,
- URLMonikerImpl_IBinding_AddRef,
- URLMonikerImpl_IBinding_Release,
- URLMonikerImpl_IBinding_Abort,
- URLMonikerImpl_IBinding_Suspend,
- URLMonikerImpl_IBinding_Resume,
- URLMonikerImpl_IBinding_SetPriority,
- URLMonikerImpl_IBinding_GetPriority,
- URLMonikerImpl_IBinding_GetBindResult
-};
-
-
/*******************************************************************************
* URLMoniker_QueryInterface
*******************************************************************************/
@@ -185,7 +92,7 @@
return E_NOINTERFACE;
/* Query Interface always increases the reference count by one when it is successful */
- URLMonikerImpl_AddRef(iface);
+ IMoniker_AddRef(iface);
return S_OK;
}
@@ -215,7 +122,12 @@
ref = InterlockedDecrement(&This->ref);
/* destroy the object if there's no more reference on it */
- if (ref == 0) URLMonikerImpl_Destroy(This);
+ if (ref == 0) {
+ if (This->URLName!=NULL)
+ HeapFree(GetProcessHeap(),0,This->URLName);
+
+ HeapFree(GetProcessHeap(),0,This);
+ }
return ref;
}
@@ -333,67 +245,6 @@
}
/******************************************************************************
- * URLMoniker_Construct (local function)
- *******************************************************************************/
-static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
-{
- HRESULT hres;
- DWORD sizeStr;
-
- TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
- memset(This, 0, sizeof(*This));
-
- /* Initialize the virtual function table. */
- This->lpvtbl1 = &VT_URLMonikerImpl;
- This->lpvtbl2 = &VTBinding_URLMonikerImpl;
- This->ref = 0;
-
- if(lpszLeftURLName) {
- hres = UrlCombineW(lpszLeftURLName, lpszURLName, NULL, &sizeStr, 0);
- if(FAILED(hres)) {
- return hres;
- }
- sizeStr++;
- }
- else
- sizeStr = lstrlenW(lpszURLName)+1;
-
- This->URLName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr));
-
- if (This->URLName==NULL)
- return E_OUTOFMEMORY;
-
- if(lpszLeftURLName) {
- hres = UrlCombineW(lpszLeftURLName, lpszURLName, This->URLName, &sizeStr, 0);
- if(FAILED(hres)) {
- HeapFree(GetProcessHeap(), 0, This->URLName);
- return hres;
- }
- }
- else
- strcpyW(This->URLName,lpszURLName);
-
- return S_OK;
-}
-
-
-
-/******************************************************************************
- * URLMoniker_Destroy (local function)
- *******************************************************************************/
-static HRESULT URLMonikerImpl_Destroy(URLMonikerImpl* This)
-{
- TRACE("(%p)\n",This);
-
- if (This->URLName!=NULL)
- HeapFree(GetProcessHeap(),0,This->URLName);
-
- HeapFree(GetProcessHeap(),0,This);
-
- return S_OK;
-}
-
-/******************************************************************************
* URLMoniker_BindToObject
******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_BindToObject(IMoniker* iface,
@@ -868,7 +719,7 @@
return E_NOINTERFACE;
/* Query Interface always increases the reference count by one when it is successful */
- URLMonikerImpl_IBinding_AddRef(iface);
+ IBinding_AddRef(iface);
return S_OK;
@@ -938,6 +789,93 @@
return E_NOTIMPL;
}
+/********************************************************************************/
+/* Virtual function table for the URLMonikerImpl class which include IPersist,*/
+/* IPersistStream and IMoniker functions. */
+static IMonikerVtbl VT_URLMonikerImpl =
+{
+ URLMonikerImpl_QueryInterface,
+ URLMonikerImpl_AddRef,
+ URLMonikerImpl_Release,
+ URLMonikerImpl_GetClassID,
+ URLMonikerImpl_IsDirty,
+ URLMonikerImpl_Load,
+ URLMonikerImpl_Save,
+ URLMonikerImpl_GetSizeMax,
+ URLMonikerImpl_BindToObject,
+ URLMonikerImpl_BindToStorage,
+ URLMonikerImpl_Reduce,
+ URLMonikerImpl_ComposeWith,
+ URLMonikerImpl_Enum,
+ URLMonikerImpl_IsEqual,
+ URLMonikerImpl_Hash,
+ URLMonikerImpl_IsRunning,
+ URLMonikerImpl_GetTimeOfLastChange,
+ URLMonikerImpl_Inverse,
+ URLMonikerImpl_CommonPrefixWith,
+ URLMonikerImpl_RelativePathTo,
+ URLMonikerImpl_GetDisplayName,
+ URLMonikerImpl_ParseDisplayName,
+ URLMonikerImpl_IsSystemMoniker
+};
+
+static IBindingVtbl VTBinding_URLMonikerImpl =
+{
+ URLMonikerImpl_IBinding_QueryInterface,
+ URLMonikerImpl_IBinding_AddRef,
+ URLMonikerImpl_IBinding_Release,
+ URLMonikerImpl_IBinding_Abort,
+ URLMonikerImpl_IBinding_Suspend,
+ URLMonikerImpl_IBinding_Resume,
+ URLMonikerImpl_IBinding_SetPriority,
+ URLMonikerImpl_IBinding_GetPriority,
+ URLMonikerImpl_IBinding_GetBindResult
+};
+
+/******************************************************************************
+ * URLMoniker_Construct (local function)
+ *******************************************************************************/
+static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
+{
+ HRESULT hres;
+ DWORD sizeStr;
+
+ TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
+ memset(This, 0, sizeof(*This));
+
+ /* Initialize the virtual function table. */
+ This->lpvtbl1 = &VT_URLMonikerImpl;
+ This->lpvtbl2 = &VTBinding_URLMonikerImpl;
+ This->ref = 0;
+
+ if(lpszLeftURLName) {
+ hres = UrlCombineW(lpszLeftURLName, lpszURLName, NULL, &sizeStr, 0);
+ if(FAILED(hres)) {
+ return hres;
+ }
+ sizeStr++;
+ }
+ else
+ sizeStr = lstrlenW(lpszURLName)+1;
+
+ This->URLName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr));
+
+ if (This->URLName==NULL)
+ return E_OUTOFMEMORY;
+
+ if(lpszLeftURLName) {
+ hres = UrlCombineW(lpszLeftURLName, lpszURLName, This->URLName, &sizeStr, 0);
+ if(FAILED(hres)) {
+ HeapFree(GetProcessHeap(), 0, This->URLName);
+ return hres;
+ }
+ }
+ else
+ strcpyW(This->URLName,lpszURLName);
+
+ return S_OK;
+}
+
/***********************************************************************
* CreateAsyncBindCtx (URLMON.@)
*/
@@ -1167,7 +1105,7 @@
{
IBindStatusCallback *prev;
- TRACE("(%p,%p,%p,%lu)\n", pbc, pbsc, ppbscPrevious, dwReserved);
+ TRACE("(%p,%p,%p,%lu)\n", pbc, pbsc, ppbscPrevious, dwReserved);
if (pbc == NULL || pbsc == NULL)
return E_INVALIDARG;
diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec
index ce9ac91..4ee1554 100644
--- a/dlls/urlmon/urlmon.spec
+++ b/dlls/urlmon/urlmon.spec
@@ -8,7 +8,7 @@
@ stdcall CoInternetCombineUrl(wstr wstr long wstr long ptr long)
@ stdcall CoInternetCompareUrl(wstr wstr long)
@ stdcall CoInternetCreateSecurityManager(ptr ptr long)
-@ stub CoInternetCreateZoneManager
+@ stdcall CoInternetCreateZoneManager(ptr ptr long)
@ stub CoInternetGetProtocolFlags
@ stub CoInternetGetSecurityUrl
@ stdcall CoInternetGetSession(long ptr long)
@@ -71,7 +71,7 @@
@ stub URLOpenStreamA
@ stub URLOpenStreamW
@ stub UrlMkBuildVersion
-@ stub UrlMkGetSessionOption
+@ stdcall UrlMkGetSessionOption(long ptr long ptr long)
@ stdcall UrlMkSetSessionOption(long ptr long long)
@ stub WriteHitLogging
@ stub ZonesReInit
diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c
index e8e773b..03f0ed9 100644
--- a/dlls/urlmon/urlmon_main.c
+++ b/dlls/urlmon/urlmon_main.c
@@ -101,7 +101,8 @@
static const struct object_creation_info object_creation[] =
{
- { &CLSID_InternetSecurityManager, &SecManagerImpl_Construct }
+ { &CLSID_InternetSecurityManager, &SecManagerImpl_Construct },
+ { &CLSID_InternetZoneManager, ZoneMgrImpl_Construct }
};
static HRESULT WINAPI
@@ -240,10 +241,21 @@
/**************************************************************************
* UrlMkSetSessionOption (URLMON.@)
*/
- HRESULT WINAPI UrlMkSetSessionOption(long lost, LPVOID *splat, long time,
- long nosee)
+HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID *pBuffer, DWORD dwBufferLength,
+ DWORD Reserved)
{
- FIXME("(%#lx, %p, %#lx, %#lx): stub\n", lost, splat, time, nosee);
+ FIXME("(%#lx, %p, %#lx): stub\n", dwOption, pBuffer, dwBufferLength);
+
+ return S_OK;
+}
+
+/**************************************************************************
+ * UrlMkGetSessionOption (URLMON.@)
+ */
+HRESULT WINAPI UrlMkGetSessionOption(DWORD dwOption, LPVOID *pBuffer, DWORD dwBufferLength,
+ DWORD* pdwBufferLength, DWORD dwReserved)
+{
+ FIXME("(%#lx, %p, %#lx, %p): stub\n", dwOption, pBuffer, dwBufferLength, pdwBufferLength);
return S_OK;
}
diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h
index 9b00cd8..45fb593 100644
--- a/dlls/urlmon/urlmon_main.h
+++ b/dlls/urlmon/urlmon_main.h
@@ -26,7 +26,7 @@
extern HINSTANCE URLMON_hInstance;
extern HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
-
+extern HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))