[ros-diffs] [cwittich] 36216: sync hhctrl.ocx with wine 1.1.4

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Sep 14 08:08:59 CEST 2008


Author: cwittich
Date: Sun Sep 14 01:08:59 2008
New Revision: 36216

URL: http://svn.reactos.org/svn/reactos?rev=36216&view=rev
Log:
sync hhctrl.ocx with wine 1.1.4

Added:
    trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc   (with props)
Modified:
    trunk/reactos/dll/win32/hhctrl.ocx/chm.c
    trunk/reactos/dll/win32/hhctrl.ocx/help.c
    trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h
    trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc
    trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c

Added: trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc?rev=36216&view=auto
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc (added)
+++ trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -1,0 +1,100 @@
+/*
+ * HTML Help (Simplified and Traditional Chinese Resources)
+ *
+ * Copyright 2008 Hongbo Ni <hongbo.at.njstar.com>
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* Chinese text is encoded in UTF-8 */
+#pragma code_page(65001)
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+
+STRINGTABLE
+BEGIN
+    IDS_CONTENTS     "å†
容(&C)"
+    IDS_INDEX        "目录(&N)"
+    IDS_SEARCH       "搜寻(&S)"
+    IDS_FAVORITES    "最爱(&I)"
+END
+
+STRINGTABLE
+BEGIN
+    IDTB_EXPAND      "显示"
+    IDTB_CONTRACT    "隐藏"
+    IDTB_STOP        "停止"
+    IDTB_REFRESH     "刷新"
+    IDTB_BACK        "向后"
+    IDTB_HOME        "首页"
+    IDTB_SYNC        "同步"
+    IDTB_PRINT       "打印"
+    IDTB_OPTIONS     "选项"
+    IDTB_FORWARD     "向前"
+    IDTB_NOTES       "说明"
+    IDTB_BROWSE_FWD  "向前"
+    IDTB_BROWSE_BACK "向后"
+    IDTB_CONTENTS    "å†
容"
+    IDTB_INDEX       "目录"
+    IDTB_SEARCH      "搜寻"
+    IDTB_HISTORY     "历史"
+    IDTB_FAVORITES   "最爱"
+    IDTB_JUMP1       "Jump1"
+    IDTB_JUMP2       "Jump2"
+    IDTB_CUSTOMIZE   "个性化"
+    IDTB_ZOOM        "放大"
+    IDTB_TOC_NEXT    "后一项"
+    IDTB_TOC_PREV    "前一项"
+END
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
+
+STRINGTABLE
+BEGIN
+    IDS_CONTENTS     "å
§å®¹(&C)"
+    IDS_INDEX        "目錄(&N)"
+    IDS_SEARCH       "搜尋(&S)"
+    IDS_FAVORITES    "最愛(&I)"
+END
+
+STRINGTABLE
+BEGIN
+    IDTB_EXPAND      "顯示"
+    IDTB_CONTRACT    "隱藏"
+    IDTB_STOP        "停止"
+    IDTB_REFRESH     "刷新"
+    IDTB_BACK        "向後"
+    IDTB_HOME        "首頁"
+    IDTB_SYNC        "同步"
+    IDTB_PRINT       "列印"
+    IDTB_OPTIONS     "選é 
"
+    IDTB_FORWARD     "向前"
+    IDTB_NOTES       "說明"
+    IDTB_BROWSE_FWD  "向前"
+    IDTB_BROWSE_BACK "向後"
+    IDTB_CONTENTS    "å
§å®¹"
+    IDTB_INDEX       "目錄"
+    IDTB_SEARCH      "搜尋"
+    IDTB_HISTORY     "歷史"
+    IDTB_FAVORITES   "最愛"
+    IDTB_JUMP1       "Jump1"
+    IDTB_JUMP2       "Jump2"
+    IDTB_CUSTOMIZE   "個性化"
+    IDTB_ZOOM        "放大"
+    IDTB_TOC_NEXT    "後一é 
"
+    IDTB_TOC_PREV    "前一é 
"
+END
+
+#pragma code_page(default)

Propchange: trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/dll/win32/hhctrl.ocx/chm.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/chm.c?rev=36216&r1=36215&r2=36216&view=diff
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/chm.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/chm.c [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -413,7 +413,7 @@
         IStream_Release(chm->strings_stream);
 
     if(chm->strings_size) {
-        int i;
+        DWORD i;
 
         for(i=0; i<chm->strings_size; i++)
             heap_free(chm->strings[i]);

Modified: trunk/reactos/dll/win32/hhctrl.ocx/help.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/help.c?rev=36216&r1=36215&r2=36216&view=diff
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/help.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/help.c [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -89,7 +89,7 @@
     BOOL ret;
     HRESULT hres;
 
-    static const WCHAR url_indicator[] = {':', '/', '/'};
+    static const WCHAR url_indicator[] = {':', '/', '/', 0};
 
     TRACE("%s\n", debugstr_w(surl));
 
@@ -587,7 +587,7 @@
         heap_free(szBuf);
     }
 
-    SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)&buttons);
+    SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)buttons);
     SendMessageW(hToolbar, TB_AUTOSIZE, 0, 0);
     ShowWindow(hToolbar, SW_SHOW);
 

Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h?rev=36216&r1=36215&r2=36216&view=diff
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -141,22 +141,22 @@
 
 /* memory allocation functions */
 
-static inline void *heap_alloc(size_t len)
+static inline void __WINE_ALLOC_SIZE(1) *heap_alloc(size_t len)
 {
     return HeapAlloc(GetProcessHeap(), 0, len);
 }
 
-static inline void *heap_alloc_zero(size_t len)
+static inline void __WINE_ALLOC_SIZE(1) *heap_alloc_zero(size_t len)
 {
     return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
 }
 
-static inline void *heap_realloc(void *mem, size_t len)
+static inline void __WINE_ALLOC_SIZE(2) *heap_realloc(void *mem, size_t len)
 {
     return HeapReAlloc(GetProcessHeap(), 0, mem, len);
 }
 
-static inline void *heap_realloc_zero(void *mem, size_t len)
+static inline void __WINE_ALLOC_SIZE(2) *heap_realloc_zero(void *mem, size_t len)
 {
     return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
 }

Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc?rev=36216&r1=36215&r2=36216&view=diff
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -45,3 +45,4 @@
 #include "Si.rc"
 #include "Sv.rc"
 #include "Tr.rc"
+#include "Zh.rc"

Modified: trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c?rev=36216&r1=36215&r2=36216&view=diff
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -20,6 +20,10 @@
 
 #include "hhctrl.h"
 
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp);
+
 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
 
 typedef struct IOleClientSiteImpl
@@ -37,45 +41,62 @@
     HWND hwndWindow;
 } IOleClientSiteImpl;
 
+#define CLIENTSITE(x)    ((IOleClientSite*)     &(x)->lpVtbl)
+#define DOCHOSTUI(x)     ((IDocHostUIHandler*)  &(x)->lpvtblDocHostUIHandler)
+#define INPLACESITE(x)   ((IOleInPlaceSite*)    &(x)->lpvtblOleInPlaceSite)
+#define INPLACEFRAME(x)  ((IOleInPlaceFrame*)   &(x)->lpvtblOleInPlaceFrame)
+
 static HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppvObj)
 {
     ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface);
+
     *ppvObj = NULL;
 
-    if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IOleClientSite))
-    {
-        *ppvObj = This;
+    if (IsEqualIID(riid, &IID_IUnknown)) {
+        TRACE("(%p)->(IID_IUnknown %p)\n", This, ppvObj);
+        *ppvObj = CLIENTSITE(This);
+    }else if(IsEqualIID(riid, &IID_IOleClientSite)) {
+        TRACE("(%p)->(IID_IOleClientSite %p)\n", This, ppvObj);
+        *ppvObj = CLIENTSITE(This);
+    }else if (IsEqualIID(riid, &IID_IOleInPlaceSite)) {
+        TRACE("(%p)->(IID_IOleInPlaceSite %p)\n", This, ppvObj);
+        *ppvObj = &(This->lpvtblOleInPlaceSite);
+    }else if (IsEqualIID(riid, &IID_IOleInPlaceFrame)) {
+        TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This, ppvObj);
+        *ppvObj = &(This->lpvtblOleInPlaceSite);
+    }else if (IsEqualIID(riid, &IID_IDocHostUIHandler)) {
+        TRACE("(%p)->(IID_IDocHostUIHandler %p)\n", This, ppvObj);
+        *ppvObj = &(This->lpvtblDocHostUIHandler);
+    }else {
+        TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj);
+        return E_NOINTERFACE;
     }
-    else if (IsEqualIID(riid, &IID_IOleInPlaceSite))
-    {
-        *ppvObj = &(This->lpvtblOleInPlaceSite);
-    }
-    else if (IsEqualIID(riid, &IID_IDocHostUIHandler))
-    {
-        *ppvObj = &(This->lpvtblDocHostUIHandler);
-    }
-    else
-        return E_NOINTERFACE;
-
+
+    IUnknown_AddRef((IUnknown*)*ppvObj);
     return S_OK;
 }
 
 static ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite *iface)
 {
     ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface);
-    return InterlockedIncrement(&This->ref);
+    LONG ref = InterlockedIncrement(&This->ref);
+
+    TRACE("(%p) ref=%d\n", This, ref);
+
+    return ref;
 }
 
 static ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite *iface)
 {
     ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface);
-    LONG refCount = InterlockedDecrement(&This->ref);
-
-    if (refCount)
-        return refCount;
-
-    heap_free(This);
-    return 0;
+    LONG ref = InterlockedDecrement(&This->ref);
+
+    TRACE("(%p) ref=%d\n", This, ref);
+
+    if(!ref)
+        heap_free(This);
+
+    return ref;
 }
 
 static HRESULT STDMETHODCALLTYPE Site_SaveObject(IOleClientSite *iface)
@@ -126,17 +147,22 @@
 static HRESULT STDMETHODCALLTYPE UI_QueryInterface(IDocHostUIHandler *iface, REFIID riid, LPVOID *ppvObj)
 {
     ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblDocHostUIHandler, iface);
-    return Site_QueryInterface((IOleClientSite *)This, riid, ppvObj);
+
+    return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppvObj);
 }
 
 static ULONG STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler *iface)
 {
-    return 1;
+    ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblDocHostUIHandler, iface);
+
+    return IOleClientSite_AddRef(CLIENTSITE(This));
 }
 
 static ULONG STDMETHODCALLTYPE UI_Release(IDocHostUIHandler * iface)
 {
-    return 2;
+    ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblDocHostUIHandler, iface);
+
+    return IOleClientSite_Release(CLIENTSITE(This));
 }
 
 static HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler *iface, DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
@@ -246,17 +272,22 @@
 static HRESULT STDMETHODCALLTYPE InPlace_QueryInterface(IOleInPlaceSite *iface, REFIID riid, LPVOID *ppvObj)
 {
     ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
-    return Site_QueryInterface((IOleClientSite *)This, riid, ppvObj);
+
+    return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppvObj);
 }
 
 static ULONG STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite *iface)
 {
-    return 1;
+    ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
+
+    return IOleClientSite_AddRef(CLIENTSITE(This));
 }
 
 static ULONG STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite *iface)
 {
-    return 2;
+    ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
+
+    return IOleClientSite_Release(CLIENTSITE(This));
 }
 
 static HRESULT STDMETHODCALLTYPE InPlace_GetWindow(IOleInPlaceSite *iface, HWND *lphwnd)
@@ -290,7 +321,10 @@
 static HRESULT STDMETHODCALLTYPE InPlace_GetWindowContext(IOleInPlaceSite *iface, LPOLEINPLACEFRAME *lplpFrame, LPOLEINPLACEUIWINDOW *lplpDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
 {
     ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
-    *lplpFrame = (LPOLEINPLACEFRAME)&This->lpvtblOleInPlaceFrame;
+
+    *lplpFrame = INPLACEFRAME(This);
+    IOleInPlaceFrame_AddRef(INPLACEFRAME(This));
+
     *lplpDoc = NULL;
 
     lpFrameInfo->fMDIApp = FALSE;
@@ -331,8 +365,12 @@
     ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
     IOleInPlaceObject *inplace;
 
-    if (!IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject, (void **)&inplace))
+    if (IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject,
+                                  (void **)&inplace) == S_OK)
+    {
         IOleInPlaceObject_SetObjectRects(inplace, lprcPosRect, lprcPosRect);
+        IOleInPlaceObject_Release(inplace);
+    }
 
     return S_OK;
 }
@@ -358,17 +396,23 @@
 
 static HRESULT STDMETHODCALLTYPE Frame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, LPVOID *ppvObj)
 {
-    return E_NOTIMPL;
+    ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceFrame, iface);
+
+    return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppvObj);
 }
 
 static ULONG STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame *iface)
 {
-    return 1;
+    ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceFrame, iface);
+
+    return IOleClientSite_AddRef(CLIENTSITE(This));
 }
 
 static ULONG STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame *iface)
 {
-    return 2;
+    ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceFrame, iface);
+
+    return IOleClientSite_Release(CLIENTSITE(This));
 }
 
 static HRESULT STDMETHODCALLTYPE Frame_GetWindow(IOleInPlaceFrame *iface, HWND *lphwnd)



More information about the Ros-diffs mailing list