[ros-diffs] [dchapyshev] 42869: - Sync winemp3.acm and hhctrl.ocx with Wine 1.1.28 - Delete unneeded .diff file

dchapyshev at svn.reactos.org dchapyshev at svn.reactos.org
Sat Aug 22 21:13:33 CEST 2009


Author: dchapyshev
Date: Sat Aug 22 21:13:32 2009
New Revision: 42869

URL: http://svn.reactos.org/svn/reactos?rev=42869&view=rev
Log:
- Sync winemp3.acm and hhctrl.ocx with Wine 1.1.28
- Delete unneeded .diff file

Removed:
    trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff
Modified:
    trunk/reactos/dll/win32/hhctrl.ocx/chm.c
    trunk/reactos/dll/win32/hhctrl.ocx/help.c
    trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c
    trunk/reactos/dll/win32/hhctrl.ocx/resource.h
    trunk/reactos/dll/win32/winemp3.acm/layer3.c

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=42869&r1=42868&r2=42869&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] Sat Aug 22 21:13:32 2009
@@ -362,15 +362,18 @@
 /* Opens the CHM file for reading */
 CHMInfo *OpenCHM(LPCWSTR szFile)
 {
-    WCHAR file[MAX_PATH] = {0};
     HRESULT hres;
+    CHMInfo *ret;
 
     static const WCHAR wszSTRINGS[] = {'#','S','T','R','I','N','G','S',0};
 
-    CHMInfo *ret = heap_alloc_zero(sizeof(CHMInfo));
-
-    GetFullPathNameW(szFile, sizeof(file)/sizeof(file[0]), file, NULL);
-    ret->szFile = strdupW(file);
+    if (!(ret = heap_alloc_zero(sizeof(CHMInfo))))
+        return NULL;
+
+    if (!(ret->szFile = strdupW(szFile))) {
+        heap_free(ret);
+        return NULL;
+    }
 
     hres = CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER,
             &IID_IITStorage, (void **) &ret->pITStorage) ;
@@ -423,6 +426,7 @@
     heap_free(chm->defTitle);
     heap_free(chm->defTopic);
     heap_free(chm->defToc);
+    heap_free(chm->szFile);
     heap_free(chm);
 
     return NULL;

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=42869&r1=42868&r2=42869&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] Sat Aug 22 21:13:32 2009
@@ -115,7 +115,9 @@
     LPWSTR ptr;
 
     static const WCHAR url_format[] =
-        {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s',0};
+        {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s','%','s',0};
+    static const WCHAR slash[] = {'/',0};
+    static const WCHAR empty[] = {0};
 
     TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
 
@@ -127,7 +129,7 @@
         return FALSE;
     }
 
-    wsprintfW(buf, url_format, full_path, index);
+    wsprintfW(buf, url_format, full_path, (!index || index[0] == '/') ? empty : slash, index);
 
     /* FIXME: HACK */
     if((ptr = strchrW(buf, '#')))

Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c?rev=42869&r1=42868&r2=42869&view=diff
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c [iso-8859-1] Sat Aug 22 21:13:32 2009
@@ -86,11 +86,27 @@
 #undef X
 }
 
+static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD buflen)
+{
+    static const WCHAR helpW[] = {'\\','h','e','l','p','\\',0};
+
+    GetFullPathNameW(filename, buflen, fullname, NULL);
+    if (GetFileAttributesW(fullname) == INVALID_FILE_ATTRIBUTES)
+    {
+        GetWindowsDirectoryW(fullname, buflen);
+        strcatW(fullname, helpW);
+        strcatW(fullname, filename);
+    }
+    return (GetFileAttributesW(fullname) != INVALID_FILE_ATTRIBUTES);
+}
+
 /******************************************************************
  *		HtmlHelpW (HHCTRL.OCX.15)
  */
 HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR data)
 {
+    WCHAR fullname[MAX_PATH];
+
     TRACE("(%p, %s, command=%s, data=%lx)\n",
           caller, debugstr_w( filename ),
           command_to_string( command ), data);
@@ -119,13 +135,14 @@
             filename = chm_file;
             index += 2; /* advance beyond "::" for calling NavigateToChm() later */
         }
-        else
-        {
-            if (command!=HH_DISPLAY_SEARCH) /* FIXME - use HH_FTS_QUERYW structure in data */
-                index = (const WCHAR*)data;
-        }
-
-        info = CreateHelpViewer(filename);
+
+        if (!resolve_filename(filename, fullname, MAX_PATH))
+        {
+            WARN("can't find %s\n", debugstr_w(filename));
+            return 0;
+        }
+
+        info = CreateHelpViewer(fullname);
         if(!info)
             return NULL;
 
@@ -147,7 +164,13 @@
         if (!filename)
             return NULL;
 
-        info = CreateHelpViewer(filename);
+        if (!resolve_filename(filename, fullname, MAX_PATH))
+        {
+            WARN("can't find %s\n", debugstr_w(filename));
+            return 0;
+        }
+
+        info = CreateHelpViewer(fullname);
         if(!info)
             return NULL;
 

Removed: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff?rev=42868&view=auto
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.ocx_ros.diff (removed)
@@ -1,16 +1,0 @@
-Index: hhctrl.ocx.rbuild
-===================================================================
---- hhctrl.ocx.rbuild	(revision 32840)
-+++ hhctrl.ocx.rbuild	(working copy)
-@@ -6,9 +6,11 @@
- 	<importlibrary definition="hhctrl.ocx.spec.def" />
- 	<include base="hhctrl">.</include>
- 	<include base="ReactOS">include/reactos/wine</include>
-+	<include base="ReactOS" root="intermediate">include/reactos</include>
- 	<define name="__WINESRC__" />
- 	<define name="WINVER">0x600</define>
- 	<define name="_WIN32_WINNT">0x600</define>
-+	<dependency>wineheaders</dependency>
- 	<file>chm.c</file>
- 	<file>content.c</file>
- 	<file>help.c</file>

Modified: trunk/reactos/dll/win32/hhctrl.ocx/resource.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/resource.h?rev=42869&r1=42868&r2=42869&view=diff
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/resource.h [iso-8859-1] Sat Aug 22 21:13:32 2009
@@ -18,6 +18,11 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <htmlhelp.h>
+
 #define IDS_CONTENTS    1
 #define IDS_INDEX       2
 #define IDS_SEARCH      3

Modified: trunk/reactos/dll/win32/winemp3.acm/layer3.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winemp3.acm/layer3.c?rev=42869&r1=42868&r2=42869&view=diff
==============================================================================
--- trunk/reactos/dll/win32/winemp3.acm/layer3.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winemp3.acm/layer3.c [iso-8859-1] Sat Aug 22 21:13:32 2009
@@ -1061,8 +1061,9 @@
  * and mode = mixed_mode
  */
            int sfb = gr_info->maxbandl;
-           int idx = bi->longIdx[sfb];
-
+           int idx;
+           if(sfb > 21) return; /* similarity fix related to CVE-2006-1655 */
+           idx = bi->longIdx[sfb];
            for ( ; sfb<8; sfb++ )
            {
              int sb = bi->longDiff[sfb];
@@ -1085,7 +1086,9 @@
       else /* ((gr_info->block_type != 2)) */
       {
         int sfb = gr_info->maxbandl;
-        int is_p,idx = bi->longIdx[sfb];
+        int is_p,idx;
+        if (sfb > 21)  return; /* tightened fix for CVE-2006-1655 */
+        idx  = bi->longIdx[sfb];
         for ( ; sfb<21; sfb++)
         {
           int sb = bi->longDiff[sfb];




More information about the Ros-diffs mailing list