- Added stub implementation of IInternetZoneManager interface.

- Added implementation of CoInternetCreateZoneManager function.
- Added stub implementation of UrlMkGetSessionOption and corrected
  declaration of UrlMkSetSessionOption.
- Code cleanup.
This commit is contained in:
Jacek Caban 2004-11-30 21:14:21 +00:00 committed by Alexandre Julliard
parent 7c98f01159
commit d9ce4cd628
6 changed files with 532 additions and 245 deletions

View File

@ -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 @@ typedef struct SecManagerImpl{
} 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 @@ static HRESULT WINAPI SecManagerImpl_QueryInterface(IInternetSecurityManager* if
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 @@ static ULONG WINAPI SecManagerImpl_Release(IInternetSecurityManager* iface)
/* 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 @@ static HRESULT WINAPI SecManagerImpl_GetZoneMappings(IInternetSecurityManager *i
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 @@ HRESULT WINAPI CoInternetCreateSecurityManager( IServiceProvider *pSP,
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);
}

View File

@ -63,99 +63,6 @@ typedef struct URLMonikerImpl{
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 @@ static HRESULT WINAPI URLMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,
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 @@ static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface)
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;
}
@ -332,67 +244,6 @@ static HRESULT WINAPI URLMonikerImpl_GetSizeMax(IMoniker* iface,
return S_OK;
}
/******************************************************************************
* 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
******************************************************************************/
@ -868,7 +719,7 @@ static HRESULT WINAPI URLMonikerImpl_IBinding_QueryInterface(IBinding* iface,REF
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 @@ static HRESULT WINAPI URLMonikerImpl_IBinding_Suspend(IBinding* iface)
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 @@ HRESULT WINAPI RegisterBindStatusCallback(
{
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;

View File

@ -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

View File

@ -101,7 +101,8 @@ struct object_creation_info
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 @@ HRESULT WINAPI URLMON_DllRegisterServerEx(void)
/**************************************************************************
* 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;
}

View File

@ -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))

View File

@ -657,8 +657,139 @@ cpp_quote("#define MAX_SIZE_SECURITY_ID 512")
[out] IEnumString **ppenumString,
[in] DWORD dwFlags);
};
cpp_quote("DEFINE_GUID(CLSID_InternetSecurityManager, 0x7b8a2d94, 0x0ac9, 0x11d1, 0x89, 0x6c, 0x00, 0xc0, 0x4f, 0xB6, 0xbf, 0xc4);")
/*****************************************************************************
* IInternetZoneManager interface
*/
[
local,
object,
uuid(79EAC9EF-BAf9-11CE-8C82-00AA004BA90B),
pointer_default(unique)
]
interface IInternetZoneManager : IUnknown
{
typedef [unique] IInternetZoneManager* LPURLZONEMANAGER;
typedef enum tagURLZONE
{
URLZONE_PREDEFINED_MIN = 0,
URLZONE_LOCAL_MACHINE = 0,
URLZONE_INTRANET = 1,
URLZONE_TRUSTED = 2,
URLZONE_INTERNET = 3,
URLZONE_UNTRUSTED = 4,
URLZONE_PREDEFINED_MAX = 999,
URLZONE_USER_MIN = 1000,
URLZONE_USER_MAX = 10000,
} URLZONE;
typedef enum tagURLTEMPLATE
{
URLTEMPLATE_CUSTOM = 0x00000,
URLTEMPLATE_PREDEFINED_MIN = 0x10000,
URLTEMPLATE_LOW = 0x10000,
URLTEMPLATE_MEDIUM = 0x11000,
URLTEMPLATE_HIGH = 0x12000,
URLTEMPLATE_PREDEFINED_MAX = 0x20000,
} URLTEMPLATE ;
typedef enum {
ZAFLAGS_CUSTOM_EDIT = 0x00000001,
ZAFLAGS_ADD_SITES = 0x00000002,
ZAFLAGS_REQUIRE_VERIFICATION = 0x00000004,
ZAFLAGS_INCLUDE_PROXY_OVERRIDE = 0x00000008,
ZAFLAGS_INCLUDE_INTRANET_SITES = 0x00000010,
ZAFLAGS_NO_UI = 0x00000020,
ZAFLAGS_SUPPORTS_VERIFICATION = 0x00000040,
ZAFLAGS_UNC_AS_INTRANET = 0x00000080,
} ZAFLAGS ;
enum {
MAX_ZONE_PATH = 260,
MAX_ZONE_DESCRIPTION = 200
};
typedef struct _ZONEATTRIBUTES {
ULONG cbSize;
WCHAR szDisplayName[MAX_ZONE_PATH];
WCHAR szDescription[MAX_ZONE_DESCRIPTION];
WCHAR szIconPath[MAX_ZONE_PATH];
DWORD dwTemplateMinLevel;
DWORD dwTemplateRecommended;
DWORD dwTemplateCurrentLevel;
DWORD dwFlags;
} ZONEATTRIBUTES, *LPZONEATTRIBUTES;
typedef enum _URLZONEREG {
URLZONEREG_DEFAULT,
URLZONEREG_HKLM,
URLZONEREG_HKCU
} URLZONEREG;
HRESULT GetZoneAttributes(
[in] DWORD dwZone,
[in, out, unique] ZONEATTRIBUTES* pZoneAttributes);
HRESULT SetZoneAttributes(
[in] DWORD dwZone,
[in] ZONEATTRIBUTES* pZoneAttributes);
HRESULT GetZoneCustomPolicy(
[in] DWORD dwZone,
[in] REFGUID guidKey,
[out] BYTE **ppPolicy,
[out] DWORD* pcbPolicy,
[in] URLZONEREG ulrZoneReg);
HRESULT SetZoneCustomPolicy(
[in] DWORD dwZone,
[in] REFGUID guidKey,
[in] BYTE *ppPolicy,
[in] DWORD pcbPolicy,
[in] URLZONEREG ulrZoneReg);
HRESULT GetZoneActionPolicy(
[in] DWORD dwZone,
[in] DWORD dwAction,
[out] BYTE* pPolicy,
[in] DWORD cbPolicy,
[in] URLZONEREG urlZoneReg);
HRESULT SetZoneActionPolicy(
[in] DWORD dwZone,
[in] DWORD dwAction,
[in] BYTE* pPolicy,
[in] DWORD cbPolicy,
[in] URLZONEREG urlZoneReg);
HRESULT LogAction(
[in] DWORD dwAction,
[in] LPCWSTR pwszUrl,
[in] LPCWSTR pwszText,
[in] DWORD dwLogFlags);
HRESULT CreateZoneEnumerator(
[out] DWORD* pdwEnum,
[out] DWORD* pdwCount,
[in] DWORD dwFlags);
HRESULT GetZoneAt(
[in] DWORD dwEnum,
[in] DWORD dwIndex,
[out] DWORD* pdwZone);
HRESULT DestroyZoneEnumerator(
[in] DWORD dwEnum);
HRESULT CopyTemplatePoliciesToZone(
[in] DWORD dwTemplate,
[in] DWORD dwZone,
[in] DWORD dwReserved);
}
cpp_quote("DEFINE_GUID(CLSID_InternetSecurityManager, 0x7b8a2d94, 0x0ac9, 0x11d1, 0x89, 0x6c, 0x00, 0xc0, 0x4f, 0xB6, 0xbf, 0xc4);")
cpp_quote("DEFINE_GUID(CLSID_InternetZoneManager, 0x7B8A2D95, 0x0AC9, 0x11D1, 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4);")
cpp_quote("DEFINE_GUID(IID_IAsyncMoniker, 0x79EAC9D3, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
cpp_quote("DEFINE_GUID(CLSID_StdURLMoniker, 0x79EAC9E0, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
@ -698,6 +829,7 @@ cpp_quote("HRESULT WINAPI IsAsyncMoniker(IMoniker* pmk);")
cpp_quote("HRESULT WINAPI CreateAsyncBindCtx(DWORD, IBindStatusCallback*, IEnumFORMATETC*, IBindCtx**);")
cpp_quote("HRESULT WINAPI CoInternetCombineUrl(LPCWSTR,LPCWSTR,DWORD,LPWSTR,DWORD,DWORD*,DWORD);")
cpp_quote("HRESULT WINAPI CoInternetCompareUrl(LPCWSTR,LPCWSTR,DWORD);");
cpp_quote("HRESULT WINAPI CoInternetCreateZoneManager(IServiceProvider*, IInternetZoneManager**, DWORD);");
cpp_quote("#define OInetCombineUrl CoInternetCombineUrl")
cpp_quote("#define OInetCompareUrl CoInternetCompareUrl")