[PATCH] urlmon: Improve stub for CreateZoneEnumerator

Detlef Riekenberg wine.dev at web.de
Wed Jun 17 17:02:29 CDT 2009


---
 dlls/urlmon/sec_mgr.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c
index 943b6dd..bb10a63 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 zone_count;
 } ZoneMgrImpl;
 
 /********************************************************************
@@ -789,7 +790,17 @@ 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;
+
+    /* Enum Zone "0" upto Zone "4" in the registry */
+    *pdwCount = This->zone_count = 5;
+    *pdwEnum = 0x7700cafe;
+
     return E_NOTIMPL;
 }
 
@@ -811,8 +822,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 */
+    if (dwEnum == 0x7700cafe)
+        return S_OK;
+
+    return E_INVALIDARG;
 }
 
 /********************************************************************
@@ -850,7 +868,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


--=-Fr5UD5qaYx2wmyfDxlaZ--




More information about the wine-patches mailing list