[PATCH] urlmon: Improve stub for CreateZoneEnumerator
Detlef Riekenberg
wine.dev at web.de
Mon Jun 15 17:20:02 CDT 2009
---
dlls/urlmon/sec_mgr.c | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c
index 943b6dd..6c7f400 100644
--- a/dlls/urlmon/sec_mgr.c
+++ b/dlls/urlmon/sec_mgr.c
@@ -613,6 +613,7 @@ HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
typedef struct {
const IInternetZoneManagerVtbl* lpVtbl;
LONG ref;
+ DWORD next_enum;
} ZoneMgrImpl;
/********************************************************************
@@ -789,7 +790,16 @@ static HRESULT WINAPI ZoneMgrImpl_CreateZoneEnumerator(IInternetZoneManager* ifa
DWORD* pdwCount,
DWORD dwFlags)
{
- FIXME("(%p)->(%p %p %08x) stub\n", iface, pdwEnum, pdwCount, dwFlags);
+ ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
+
+ TRACE("(%p)->(%p %p %08x) semi-stub\n", This, pdwEnum, pdwCount, dwFlags);
+
+ if (!pdwEnum || !pdwCount || (dwFlags != 0))
+ return E_INVALIDARG;
+
+ *pdwEnum = This->next_enum++;
+ *pdwCount = 0;
+
return E_NOTIMPL;
}
@@ -811,8 +821,15 @@ static HRESULT WINAPI ZoneMgrImpl_GetZoneAt(IInternetZoneManager* iface,
static HRESULT WINAPI ZoneMgrImpl_DestroyZoneEnumerator(IInternetZoneManager* iface,
DWORD dwEnum)
{
- FIXME("(%p)->(%08x) stub\n", iface, dwEnum);
- return E_NOTIMPL;
+ ZoneMgrImpl* This = (ZoneMgrImpl*)iface;
+
+ TRACE("(%p)->(%08x)\n", This, dwEnum);
+
+ /* we don't care about DestroyZoneEnumerator twice for the same enumerator */
+ if ((This->next_enum > 0) && (dwEnum < This->next_enum))
+ return S_OK;
+
+ return E_INVALIDARG;
}
/********************************************************************
@@ -850,7 +867,7 @@ static const IInternetZoneManagerVtbl ZoneMgrImplVtbl = {
HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
{
- ZoneMgrImpl* ret = heap_alloc(sizeof(ZoneMgrImpl));
+ ZoneMgrImpl* ret = heap_alloc_zero(sizeof(ZoneMgrImpl));
TRACE("(%p %p)\n", pUnkOuter, ppobj);
ret->lpVtbl = &ZoneMgrImplVtbl;
--
1.5.4.3
--=-2ayQsloehbDoE3mEKlRN--
More information about the wine-patches
mailing list