[ros-diffs] [winesync] 27921: Autosyncing with Wine HEAD

winesync at svn.reactos.org winesync at svn.reactos.org
Fri Jul 27 12:17:43 CEST 2007


Author: winesync
Date: Fri Jul 27 14:17:42 2007
New Revision: 27921

URL: http://svn.reactos.org/svn/reactos?rev=27921&view=rev
Log:
Autosyncing with Wine HEAD

Added:
    trunk/reactos/dll/win32/version/ver.spec   (with props)
    trunk/reactos/dll/win32/version/ver16.c   (with props)
    trunk/reactos/dll/win32/version/version.spec   (with props)
    trunk/reactos/dll/win32/version/version_ros.diff   (with props)
Removed:
    trunk/reactos/dll/win32/version/misc/
    trunk/reactos/dll/win32/version/version.def
    trunk/reactos/dll/win32/version/version_specs
Modified:
    trunk/reactos/dll/win32/version/info.c
    trunk/reactos/dll/win32/version/install.c
    trunk/reactos/dll/win32/version/resource.c
    trunk/reactos/dll/win32/version/version.rbuild
    trunk/reactos/dll/win32/version/version.rc

Modified: trunk/reactos/dll/win32/version/info.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/info.c?rev=27921&r1=27920&r2=27921&view=diff
==============================================================================
--- trunk/reactos/dll/win32/version/info.c (original)
+++ trunk/reactos/dll/win32/version/info.c Fri Jul 27 14:17:42 2007
@@ -18,7 +18,7 @@
  *
  * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
  */
 
@@ -28,10 +28,10 @@
 
 #include "windef.h"
 #include "winbase.h"
-#include "winreg.h"
 #include "winver.h"
 #include "winternl.h"
 #include "winuser.h"
+#include "wine/winuser16.h"
 #include "wine/unicode.h"
 #include "winerror.h"
 #include "wine/debug.h"
@@ -46,7 +46,7 @@
  *      Added this function to clean up the code.
  *
  *****************************************************************************/
-static void print_vffi_debug(VS_FIXEDFILEINFO *vffi)
+static void print_vffi_debug(const VS_FIXEDFILEINFO *vffi)
 {
     BOOL    versioned_printer = FALSE;
 
@@ -69,7 +69,7 @@
     {
         WORD mode = LOWORD(vffi->dwFileVersionMS);
         WORD ver_rev = HIWORD(vffi->dwFileVersionLS);
-        TRACE("fileversion=%lu.%u.%u.%u (%s.major.minor.release), ",
+        TRACE("fileversion=%u.%u.%u.%u (%s.major.minor.release), ",
             (vffi->dwFileVersionMS),
             HIBYTE(ver_rev), LOBYTE(ver_rev), LOWORD(vffi->dwFileVersionLS),
             (mode == 3) ? "Usermode" : ((mode <= 2) ? "Kernelmode" : "?") );
@@ -84,7 +84,7 @@
           HIWORD(vffi->dwProductVersionMS),LOWORD(vffi->dwProductVersionMS),
           HIWORD(vffi->dwProductVersionLS),LOWORD(vffi->dwProductVersionLS));
 
-    TRACE("flagmask=0x%lx, flags=0x%lx %s%s%s%s%s%s\n",
+    TRACE("flagmask=0x%x, flags=0x%x %s%s%s%s%s%s\n",
           vffi->dwFileFlagsMask, vffi->dwFileFlags,
           (vffi->dwFileFlags & VS_FF_DEBUG) ? "DEBUG," : "",
           (vffi->dwFileFlags & VS_FF_PRERELEASE) ? "PRERELEASE," : "",
@@ -105,7 +105,7 @@
     case VOS_NT:TRACE("NT,");break;
     case VOS_UNKNOWN:
     default:
-        TRACE("UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break;
+        TRACE("UNKNOWN(0x%x),",vffi->dwFileOS&0xFFFF0000);break;
     }
 
     switch (LOWORD(vffi->dwFileOS))
@@ -130,7 +130,7 @@
         {
             if(versioned_printer) /* NT3.x/NT4.0 or old w2k Driver  */
                 TRACE(",PRINTER");
-            TRACE(" (subtype=0x%lx)", vffi->dwFileSubtype);
+            TRACE(" (subtype=0x%x)", vffi->dwFileSubtype);
         }
         break;
     case VFT_DRV:
@@ -151,7 +151,7 @@
         case VFT2_DRV_VERSIONED_PRINTER:TRACE("VERSIONED_PRINTER");break;
         case VFT2_UNKNOWN:
         default:
-            TRACE("UNKNOWN(0x%lx)",vffi->dwFileSubtype);break;
+            TRACE("UNKNOWN(0x%x)",vffi->dwFileSubtype);break;
         }
         break;
     case VFT_FONT:
@@ -161,18 +161,18 @@
         case VFT2_FONT_RASTER:TRACE("RASTER");break;
         case VFT2_FONT_VECTOR:TRACE("VECTOR");break;
         case VFT2_FONT_TRUETYPE:TRACE("TRUETYPE");break;
-        default:TRACE("UNKNOWN(0x%lx)",vffi->dwFileSubtype);break;
+        default:TRACE("UNKNOWN(0x%x)",vffi->dwFileSubtype);break;
         }
         break;
     case VFT_VXD:TRACE("filetype=VXD");break;
     case VFT_STATIC_LIB:TRACE("filetype=STATIC_LIB");break;
     case VFT_UNKNOWN:
     default:
-        TRACE("filetype=Unknown(0x%lx)",vffi->dwFileType);break;
+        TRACE("filetype=Unknown(0x%x)",vffi->dwFileType);break;
     }
 
     TRACE("\n");
-    TRACE("filedate=0x%lx.0x%lx\n",vffi->dwFileDateMS,vffi->dwFileDateLS);
+    TRACE("filedate=0x%x.0x%x\n",vffi->dwFileDateMS,vffi->dwFileDateLS);
 }
 
 /***********************************************************************
@@ -207,7 +207,7 @@
 } VS_VERSION_INFO_STRUCT32;
 
 #define VersionInfoIs16( ver ) \
-    ( ((VS_VERSION_INFO_STRUCT16 *)ver)->szKey[0] >= ' ' )
+    ( ((const VS_VERSION_INFO_STRUCT16 *)ver)->szKey[0] >= ' ' )
 
 #define DWORD_ALIGN( base, ptr ) \
     ( (LPBYTE)(base) + ((((LPBYTE)(ptr) - (LPBYTE)(base)) + 3) & ~3) )
@@ -218,10 +218,10 @@
     DWORD_ALIGN( (ver), (ver)->szKey + strlenW((ver)->szKey) + 1 )
 
 #define VersionInfo16_Children( ver )  \
-    (VS_VERSION_INFO_STRUCT16 *)( VersionInfo16_Value( ver ) + \
+    (const VS_VERSION_INFO_STRUCT16 *)( VersionInfo16_Value( ver ) + \
                            ( ( (ver)->wValueLength + 3 ) & ~3 ) )
 #define VersionInfo32_Children( ver )  \
-    (VS_VERSION_INFO_STRUCT32 *)( VersionInfo32_Value( ver ) + \
+    (const VS_VERSION_INFO_STRUCT32 *)( VersionInfo32_Value( ver ) + \
                            ( ( (ver)->wValueLength * \
                                ((ver)->wType? 2 : 1) + 3 ) & ~3 ) )
 
@@ -238,7 +238,7 @@
  */
 static DWORD VERSION_GetFileVersionInfo_PE( LPCWSTR filename, DWORD datasize, LPVOID data )
 {
-    VS_FIXEDFILEINFO *vffi;
+    const VS_FIXEDFILEINFO *vffi;
     DWORD len;
     BYTE *buf;
     HMODULE hModule;
@@ -259,7 +259,7 @@
     }
     hRsrc = FindResourceW(hModule,
 			  MAKEINTRESOURCEW(VS_VERSION_INFO),
-			  (LPCWSTR) VS_FILE_INFO);
+			  MAKEINTRESOURCEW(VS_FILE_INFO));
     if(!hRsrc)
     {
 	WARN("Could not find VS_VERSION_INFO in %s\n", debugstr_w(filename));
@@ -280,7 +280,7 @@
 
     if ( vffi->dwSignature != VS_FFI_SIGNATURE )
     {
-        WARN("vffi->dwSignature is 0x%08lx, but not 0x%08lx!\n",
+        WARN("vffi->dwSignature is 0x%08x, but not 0x%08lx!\n",
                    vffi->dwSignature, VS_FFI_SIGNATURE );
 	len = 0xFFFFFFFF;
 	goto END;
@@ -314,7 +314,7 @@
  */
 static DWORD VERSION_GetFileVersionInfo_16( LPCSTR filename, DWORD datasize, LPVOID data )
 {
-    VS_FIXEDFILEINFO *vffi;
+    const VS_FIXEDFILEINFO *vffi;
     DWORD len, offset;
     BYTE *buf;
     HMODULE16 hModule;
@@ -415,7 +415,7 @@
 
     if ( vffi->dwSignature != VS_FFI_SIGNATURE )
     {
-        WARN("vffi->dwSignature is 0x%08lx, but not 0x%08lx!\n",
+        WARN("vffi->dwSignature is 0x%08x, but not 0x%08lx!\n",
                    vffi->dwSignature, VS_FFI_SIGNATURE );
 	len = 0xFFFFFFFF;
 	goto END;
@@ -505,7 +505,7 @@
          *
          * This extra buffer is used for ANSI to Unicode conversions in W-Calls.
          * info->wLength should be the same as len. Currently it isn't but that
-         * doesn't seem to be a problem (len is bigger then info->wLength).
+         * doesn't seem to be a problem (len is bigger than info->wLength).
          */
          len = (len - sizeof(VS_FIXEDFILEINFO)) * 4;
 #endif /* ! __REACTOS__ */
@@ -555,7 +555,7 @@
     DWORD len;
     VS_VERSION_INFO_STRUCT32* vvis = (VS_VERSION_INFO_STRUCT32*)data;
 
-    TRACE("(%s,%ld,size=%ld,data=%p)\n",
+    TRACE("(%s,%d,size=%d,data=%p)\n",
                 debugstr_w(filename), handle, datasize, data );
 
     if (!data)
@@ -627,7 +627,7 @@
     UNICODE_STRING filenameW;
     BOOL retval;
 
-    TRACE("(%s,%ld,size=%ld,data=%p)\n",
+    TRACE("(%s,%d,size=%d,data=%p)\n",
                 debugstr_a(filename), handle, datasize, data );
 
     if(filename)
@@ -645,14 +645,14 @@
 /***********************************************************************
  *           VersionInfo16_FindChild             [internal]
  */
-static VS_VERSION_INFO_STRUCT16 *VersionInfo16_FindChild( VS_VERSION_INFO_STRUCT16 *info,
+static const VS_VERSION_INFO_STRUCT16 *VersionInfo16_FindChild( const VS_VERSION_INFO_STRUCT16 *info,
                                             LPCSTR szKey, UINT cbKey )
 {
-    VS_VERSION_INFO_STRUCT16 *child = VersionInfo16_Children( info );
+    const VS_VERSION_INFO_STRUCT16 *child = VersionInfo16_Children( info );
 
     while ((char *)child < (char *)info + info->wLength )
     {
-        if ( !strncasecmp( child->szKey, szKey, cbKey ) )
+        if (!strncasecmp( child->szKey, szKey, cbKey ) && !child->szKey[cbKey])
             return child;
 
 	if (!(child->wLength)) return NULL;
@@ -665,14 +665,14 @@
 /***********************************************************************
  *           VersionInfo32_FindChild             [internal]
  */
-static VS_VERSION_INFO_STRUCT32 *VersionInfo32_FindChild( VS_VERSION_INFO_STRUCT32 *info,
+static const VS_VERSION_INFO_STRUCT32 *VersionInfo32_FindChild( const VS_VERSION_INFO_STRUCT32 *info,
                                             LPCWSTR szKey, UINT cbKey )
 {
-    VS_VERSION_INFO_STRUCT32 *child = VersionInfo32_Children( info );
+    const VS_VERSION_INFO_STRUCT32 *child = VersionInfo32_Children( info );
 
     while ((char *)child < (char *)info + info->wLength )
     {
-        if ( !strncmpiW( child->szKey, szKey, cbKey ) )
+        if (!strncmpiW( child->szKey, szKey, cbKey ) && !child->szKey[cbKey])
             return child;
 
         child = VersionInfo32_Next( child );
@@ -686,7 +686,7 @@
  *
  *    Gets a value from a 16-bit NE resource
  */
-static BOOL WINAPI VersionInfo16_QueryValue( VS_VERSION_INFO_STRUCT16 *info, LPCSTR lpSubBlock,
+static BOOL WINAPI VersionInfo16_QueryValue( const VS_VERSION_INFO_STRUCT16 *info, LPCSTR lpSubBlock,
                                LPVOID *lplpBuffer, UINT *puLen )
 {
     while ( *lpSubBlock )
@@ -706,7 +706,12 @@
 
         /* We have a non-empty component: search info for key */
         info = VersionInfo16_FindChild( info, lpSubBlock, lpNextSlash-lpSubBlock );
-        if ( !info ) return FALSE;
+        if ( !info )
+        {
+            if (puLen) *puLen = 0 ;
+            SetLastError( ERROR_RESOURCE_TYPE_NOT_FOUND );
+            return FALSE;
+        }
 
         /* Skip path component */
         lpSubBlock = lpNextSlash;
@@ -725,7 +730,7 @@
  *
  *    Gets a value from a 32-bit PE resource
  */
-static BOOL WINAPI VersionInfo32_QueryValue( VS_VERSION_INFO_STRUCT32 *info, LPCWSTR lpSubBlock,
+static BOOL WINAPI VersionInfo32_QueryValue( const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR lpSubBlock,
                                LPVOID *lplpBuffer, UINT *puLen )
 {
     TRACE("lpSubBlock : (%s)\n", debugstr_w(lpSubBlock));
@@ -747,7 +752,12 @@
 
         /* We have a non-empty component: search info for key */
         info = VersionInfo32_FindChild( info, lpSubBlock, lpNextSlash-lpSubBlock );
-        if ( !info ) return FALSE;
+        if ( !info )
+        {
+            if (puLen) *puLen = 0 ;
+            SetLastError( ERROR_RESOURCE_TYPE_NOT_FOUND );
+            return FALSE;
+        }
 
         /* Skip path component */
         lpSubBlock = lpNextSlash;
@@ -769,13 +779,10 @@
 {
     static const char rootA[] = "\\";
     static const char varfileinfoA[] = "\\VarFileInfo\\Translation";
-    VS_VERSION_INFO_STRUCT16 *info = (VS_VERSION_INFO_STRUCT16 *)pBlock;
+    const VS_VERSION_INFO_STRUCT16 *info = (const VS_VERSION_INFO_STRUCT16 *)pBlock;
 
     TRACE("(%p,%s,%p,%p)\n",
                 pBlock, debugstr_a(lpSubBlock), lplpBuffer, puLen );
-
-	if (!pBlock)
-		return FALSE;
 
     if ( !VersionInfoIs16( info ) )
     {
@@ -797,8 +804,11 @@
 
         if (ret && strcasecmp( lpSubBlock, rootA ) && strcasecmp( lpSubBlock, varfileinfoA ))
         {
+            /* Set lpBuffer so it points to the 'empty' area where we store
+             * the converted strings
+             */
             LPSTR lpBufferA = (LPSTR)pBlock + info->wLength + 4;
-            DWORD pos = (LPSTR)*lplpBuffer - (LPSTR)pBlock;
+            DWORD pos = (LPCSTR)*lplpBuffer - (LPCSTR)pBlock;
 
             len = WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)*lplpBuffer, -1,
                                       lpBufferA + pos, info->wLength - pos, NULL, NULL);
@@ -821,13 +831,10 @@
     static const WCHAR varfileinfoW[] = { '\\','V','a','r','F','i','l','e','I','n','f','o',
                                           '\\','T','r','a','n','s','l','a','t','i','o','n', 0 };
 
-    VS_VERSION_INFO_STRUCT32 *info = (VS_VERSION_INFO_STRUCT32 *)pBlock;
+    const VS_VERSION_INFO_STRUCT32 *info = (const VS_VERSION_INFO_STRUCT32 *)pBlock;
 
     TRACE("(%p,%s,%p,%p)\n",
                 pBlock, debugstr_w(lpSubBlock), lplpBuffer, puLen );
-
-	if (!pBlock)
-		return FALSE;
 
     if ( VersionInfoIs16( info ) )
     {
@@ -849,8 +856,11 @@
 
         if (ret && strcmpiW( lpSubBlock, rootW ) && strcmpiW( lpSubBlock, varfileinfoW ))
         {
+            /* Set lpBuffer so it points to the 'empty' area where we store
+             * the converted strings
+             */
             LPWSTR lpBufferW = (LPWSTR)((LPSTR)pBlock + info->wLength);
-            DWORD pos = (LPSTR)*lplpBuffer - (LPSTR)pBlock;
+            DWORD pos = (LPCSTR)*lplpBuffer - (LPCSTR)pBlock;
             DWORD max = (info->wLength - sizeof(VS_FIXEDFILEINFO)) * 4 - info->wLength;
 
             len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)*lplpBuffer, -1,

Modified: trunk/reactos/dll/win32/version/install.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/install.c?rev=27921&r1=27920&r2=27921&view=diff
==============================================================================
--- trunk/reactos/dll/win32/version/install.c (original)
+++ trunk/reactos/dll/win32/version/install.c Fri Jul 27 14:17:42 2007
@@ -16,7 +16,7 @@
  *
  * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
  * TODO
  *   o Check the installation functions.
@@ -208,7 +208,7 @@
         *lpuCurDirLen = curDirSizeReq;
     }
 
-    TRACE("ret = %lu (%s%s%s) curdir=%s destdir=%s\n", retval,
+    TRACE("ret = %u (%s%s%s) curdir=%s destdir=%s\n", retval,
           (retval & VFF_CURNEDEST) ? "VFF_CURNEDEST " : "",
           (retval & VFF_FILEINUSE) ? "VFF_FILEINUSE " : "",
           (retval & VFF_BUFFTOOSMALL) ? "VFF_BUFFTOOSMALL " : "",
@@ -299,7 +299,7 @@
         *lpuCurDirLen = curDirSizeReq;
     }
 
-    TRACE("ret = %lu (%s%s%s) curdir=%s destdir=%s\n", retval,
+    TRACE("ret = %u (%s%s%s) curdir=%s destdir=%s\n", retval,
           (retval & VFF_CURNEDEST) ? "VFF_CURNEDEST " : "",
           (retval & VFF_FILEINUSE) ? "VFF_FILEINUSE " : "",
           (retval & VFF_BUFFTOOSMALL) ? "VFF_BUFFTOOSMALL " : "",
@@ -338,7 +338,7 @@
 	    if ((*vffi)->dwSignature == 0x004f0049) /* hack to detect unicode */
 	    	*vffi = (VS_FIXEDFILEINFO*)(buf+0x28);
 	    if ((*vffi)->dwSignature != VS_FFI_SIGNATURE)
-	    	WARN("Bad VS_FIXEDFILEINFO signature 0x%08lx\n",(*vffi)->dwSignature);
+                WARN("Bad VS_FIXEDFILEINFO signature 0x%08x\n",(*vffi)->dwSignature);
 	    return buf;
 	}
     }
@@ -453,7 +453,8 @@
 	if (buf1) {
 	    buf2 = _fetch_versioninfo(tmpfn,&tmpvffi);
 	    if (buf2) {
-	    	char	*tbuf1,*tbuf2;
+		char	*tbuf1,*tbuf2;
+		static const CHAR trans_array[] = "\\VarFileInfo\\Translation";
 		UINT	len1,len2;
 
 		len1=len2=40;
@@ -470,8 +471,8 @@
 		    (destvffi->dwFileSubtype!=tmpvffi->dwFileSubtype)
 		)
 		    xret |= VIF_MISMATCH|VIF_DIFFTYPE;
-		if (VerQueryValueA(buf1,"\\VarFileInfo\\Translation",(LPVOID*)&tbuf1,&len1) &&
-		    VerQueryValueA(buf2,"\\VarFileInfo\\Translation",(LPVOID*)&tbuf2,&len2)
+		if (VerQueryValueA(buf1,trans_array,(LPVOID*)&tbuf1,&len1) &&
+		    VerQueryValueA(buf2,trans_array,(LPVOID*)&tbuf2,&len2)
 		) {
                     /* Do something with tbuf1 and tbuf2
 		     * generates DIFFLANG|MISMATCH

Modified: trunk/reactos/dll/win32/version/resource.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/resource.c?rev=27921&r1=27920&r2=27921&view=diff
==============================================================================
--- trunk/reactos/dll/win32/version/resource.c (original)
+++ trunk/reactos/dll/win32/version/resource.c Fri Jul 27 14:17:42 2007
@@ -17,7 +17,7 @@
  *
  * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
 #include "config.h"
@@ -31,7 +31,7 @@
 # include <unistd.h>
 #endif
 
-//#define NONAMELESSUNION
+#define NONAMELESSUNION
 #define NONAMELESSSTRUCT
 #include "windef.h"
 #include "winbase.h"
@@ -40,14 +40,8 @@
 #include "wine/unicode.h"
 #include "wine/winbase16.h"
 #include "wine/winuser16.h"
-#include "winver.h"
 
 #include "wine/debug.h"
-
-/*
- * Quick and dirty hacking
- * -sedwards
- */
 
 /* winnt.h */
 #define IMAGE_FILE_RESOURCE_DIRECTORY		2
@@ -73,9 +67,9 @@
     while (min <= max)
     {
         pos = (min + max) / 2;
-        if (entry[pos].Id == id)
-            return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].OffsetToDirectory);
-        if (entry[pos].Id > id) max = pos - 1;
+        if (entry[pos].u1.s2.Id == id)
+            return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s3.OffsetToDirectory);
+        if (entry[pos].u1.s2.Id > id) max = pos - 1;
         else min = pos + 1;
     }
     return NULL;
@@ -94,7 +88,7 @@
     const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
 
     entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
-    return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->OffsetToDirectory);
+    return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->u2.s3.OffsetToDirectory);
 }
 
 
@@ -132,11 +126,11 @@
         while (min <= max)
         {
             pos = (min + max) / 2;
-            str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const char *)root + entry[pos].NameOffset);
+            str = (const IMAGE_RESOURCE_DIR_STRING_U *)((const char *)root + entry[pos].u1.s1.NameOffset);
             res = strncmpiW( nameW, str->NameString, str->Length );
             if (!res && namelen == str->Length)
             {
-                ret = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].OffsetToDirectory);
+                ret = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s3.OffsetToDirectory);
                 break;
             }
             if (res < 0) max = pos - 1;
@@ -413,7 +407,7 @@
     OFSTRUCT ofs;
     DWORD reslen;
 
-    TRACE("(%s,type=0x%lx,id=0x%lx,off=%p)\n",
+    TRACE("(%s,type=0x%x,id=0x%x,off=%p)\n",
                 debugstr_a(lpszFileName), (LONG)lpszResType, (LONG)lpszResId,
                 lpszResId );
 
@@ -425,6 +419,7 @@
     case IMAGE_OS2_SIGNATURE:
 #ifdef __REACTOS__
         ERR("OS2 Images not supported under ReactOS at this time.");
+        retv = 0;
 #else
         retv = find_ne_resource( lzfd, lpszResType, lpszResId,
                                  &reslen, lpdwFileOffset );
@@ -454,7 +449,7 @@
     OFSTRUCT ofs;
     DWORD reslen = dwResLen;
 
-    TRACE("(%s,type=%p,id=%p,off=%ld,len=%ld,data=%p)\n",
+    TRACE("(%s,type=%p,id=%p,off=%d,len=%d,data=%p)\n",
 		debugstr_a(lpszFileName), lpszResType, lpszResId,
                 dwFileOffset, dwResLen, lpvData );
 
@@ -468,6 +463,7 @@
         case IMAGE_OS2_SIGNATURE:
 #ifdef __REACTOS__
             ERR("OS2 Images not supported under ReactOS at this time.");
+            retv = 0;
 #else
             retv = find_ne_resource( lzfd, lpszResType, lpszResId,
                                      &reslen, &dwFileOffset );

Added: trunk/reactos/dll/win32/version/ver.spec
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/ver.spec?rev=27921&view=auto
==============================================================================
--- trunk/reactos/dll/win32/version/ver.spec (added)
+++ trunk/reactos/dll/win32/version/ver.spec Fri Jul 27 14:17:42 2007
@@ -1,0 +1,12 @@
+#1 DLLENTRYPOINT
+2 pascal GetFileResourceSize(str str str ptr) GetFileResourceSize16
+3 pascal GetFileResource(str str str long long ptr) GetFileResource16
+6 pascal GetFileVersionInfoSize(str ptr) GetFileVersionInfoSize16
+7 pascal GetFileVersionInfo(str long long ptr) GetFileVersionInfo16
+8 pascal VerFindFile(word str str str ptr ptr ptr ptr) VerFindFile16
+9 pascal VerInstallFile(word str str str str str ptr ptr) VerInstallFile16
+10 pascal VerLanguageName(word ptr word) VerLanguageName16
+11 pascal VerQueryValue(segptr str ptr ptr) VerQueryValue16
+20 stub GETFILEVERSIONINFORAW
+#21 VERFTHK_THUNKDATA16
+#22 VERTHKSL_THUNKDATA16

Propchange: trunk/reactos/dll/win32/version/ver.spec
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/version/ver16.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/ver16.c?rev=27921&view=auto
==============================================================================
--- trunk/reactos/dll/win32/version/ver16.c (added)
+++ trunk/reactos/dll/win32/version/ver16.c Fri Jul 27 14:17:42 2007
@@ -1,0 +1,122 @@
+/*
+ * Implementation of VER.DLL
+ *
+ * Copyright 1999 Ulrich Weigand
+ *
+ * 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
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "wine/winbase16.h"
+#include "winver.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(ver);
+
+
+/*************************************************************************
+ * GetFileVersionInfoSize                  [VER.6]
+ */
+DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle )
+{
+    TRACE("(%s, %p)\n", debugstr_a(lpszFileName), lpdwHandle );
+    return GetFileVersionInfoSizeA( lpszFileName, lpdwHandle );
+}
+
+/*************************************************************************
+ * GetFileVersionInfo                      [VER.7]
+ */
+DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle,
+                                   DWORD cbBuf, LPVOID lpvData )
+{
+    TRACE("(%s, %08x, %d, %p)\n",
+                debugstr_a(lpszFileName), handle, cbBuf, lpvData );
+
+    return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData );
+}
+
+/*************************************************************************
+ * VerFindFile                             [VER.8]
+ */
+DWORD WINAPI VerFindFile16( UINT16 flags, LPSTR lpszFilename,
+                            LPSTR lpszWinDir, LPSTR lpszAppDir,
+                            LPSTR lpszCurDir, UINT16 *lpuCurDirLen,
+                            LPSTR lpszDestDir, UINT16 *lpuDestDirLen )
+{
+    UINT curDirLen, destDirLen;
+    DWORD retv = VerFindFileA( flags, lpszFilename, lpszWinDir, lpszAppDir,
+                                 lpszCurDir, &curDirLen, lpszDestDir, &destDirLen );
+
+    *lpuCurDirLen = (UINT16)curDirLen;
+    *lpuDestDirLen = (UINT16)destDirLen;
+    return retv;
+}
+
+/*************************************************************************
+ * VerInstallFile                          [VER.9]
+ */
+DWORD WINAPI VerInstallFile16( UINT16 flags,
+                               LPSTR lpszSrcFilename, LPSTR lpszDestFilename,
+                               LPSTR lpszSrcDir, LPSTR lpszDestDir, LPSTR lpszCurDir,
+                               LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
+{
+    UINT filelen;
+    DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
+                                    lpszSrcDir, lpszDestDir, lpszCurDir,
+                                    lpszTmpFile, &filelen);
+
+    *lpwTmpFileLen = (UINT16)filelen;
+    return retv;
+}
+
+/*************************************************************************
+ * VerLanguageName                        [VER.10]
+ */
+DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang )
+{
+    return VerLanguageNameA( uLang, lpszLang, cbLang );
+}
+
+/*************************************************************************
+ * VerQueryValue                          [VER.11]
+ */
+DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPSTR lpszSubBlock,
+                              SEGPTR *lpspBuffer, UINT16 *lpcb )
+{
+    LPVOID lpvBlock = MapSL( spvBlock );
+    LPVOID buffer = lpvBlock;
+    UINT buflen;
+    DWORD retv;
+
+    TRACE("(%p, %s, %p, %p)\n",
+                lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb );
+
+    retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen );
+    if ( !retv ) return FALSE;
+
+    if ( OFFSETOF( spvBlock ) + ((char *) buffer - (char *) lpvBlock) >= 0x10000 )
+    {
+        FIXME("offset %08X too large relative to %04X:%04X\n",
+               (char *) buffer - (char *) lpvBlock, SELECTOROF( spvBlock ), OFFSETOF( spvBlock ) );
+        return FALSE;
+    }
+
+    if (lpcb) *lpcb = buflen;
+    *lpspBuffer = (SEGPTR) ((char *) spvBlock + ((char *) buffer - (char *) lpvBlock));
+
+    return retv;
+}

Propchange: trunk/reactos/dll/win32/version/ver16.c
------------------------------------------------------------------------------
    svn:eol-style = native

Removed: trunk/reactos/dll/win32/version/version.def
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version.def?rev=27920&view=auto
==============================================================================
--- trunk/reactos/dll/win32/version/version.def (original)
+++ trunk/reactos/dll/win32/version/version.def (removed)
@@ -1,19 +1,0 @@
-; $Id$
-; ReactOS Operating System
-;
-LIBRARY version.dll
-EXPORTS
-GetFileVersionInfoA at 16
-GetFileVersionInfoSizeA at 8
-GetFileVersionInfoSizeW at 8
-GetFileVersionInfoW at 16
-VerFindFileA at 32
-VerFindFileW at 32
-VerInstallFileA at 32
-VerInstallFileW at 32
-VerLanguageNameA at 12=KERNEL32.VerLanguageNameA
-VerLanguageNameW at 12=KERNEL32.VerLanguageNameW
-VerQueryValueA at 16
-VerQueryValueIndexA at 24
-VerQueryValueIndexW at 24
-VerQueryValueW at 16

Modified: trunk/reactos/dll/win32/version/version.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version.rbuild?rev=27921&r1=27920&r2=27921&view=diff
==============================================================================
--- trunk/reactos/dll/win32/version/version.rbuild (original)
+++ trunk/reactos/dll/win32/version/version.rbuild Fri Jul 27 14:17:42 2007
@@ -1,21 +1,20 @@
 <module name="version" type="win32dll" baseaddress="${BASEADDRESS_VERSION}" installbase="system32" installname="version.dll" allowwarnings="true">
-	<importlibrary definition="version.def" />
+	<importlibrary definition="version.spec.def" />
+	<include base="version">.</include>
 	<include base="ReactOS">include/reactos/wine</include>
-	<define name="_DISABLE_TIDENTS" />
 	<define name="__REACTOS__" />
+	<define name="__WINESRC__" />
 	<define name="__USE_W32API" />
 	<define name="_WIN32_IE">0x600</define>
 	<define name="_WIN32_WINNT">0x501</define>
 	<define name="WINVER">0x501</define>
 	<library>wine</library>
+	<library>lz32</library>
+	<library>kernel32</library>
 	<library>ntdll</library>
-	<library>kernel32</library>
-	<directory name="misc">
-		<file>libmain.c</file>
-		<file>stubs.c</file>
-	</directory>
 	<file>info.c</file>
 	<file>install.c</file>
 	<file>resource.c</file>
 	<file>version.rc</file>
+	<file>version.spec</file>
 </module>

Modified: trunk/reactos/dll/win32/version/version.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version.rc?rev=27921&r1=27920&r2=27921&view=diff
==============================================================================
--- trunk/reactos/dll/win32/version/version.rc (original)
+++ trunk/reactos/dll/win32/version/version.rc Fri Jul 27 14:17:42 2007
@@ -1,7 +1,26 @@
-/* $Id$ */
+/*
+ * Copyright (c) 2007 Alexandre Julliard
+ *
+ * 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
+ */
 
-#define REACTOS_VERSION_DLL
-#define REACTOS_STR_FILE_DESCRIPTION	"Version checking and file installation library\0"
-#define REACTOS_STR_INTERNAL_NAME	"version\0"
-#define REACTOS_STR_ORIGINAL_FILENAME	"version.dll\0"
-#include <reactos/version.rc>
+#define WINE_FILEDESCRIPTION_STR "Wine version dll"
+#define WINE_FILENAME_STR "version.dll"
+#define WINE_FILEVERSION 5,1,2600,2180
+#define WINE_FILEVERSION_STR "5.1.2600.2180"
+#define WINE_PRODUCTVERSION 5,1,2600,2180
+#define WINE_PRODUCTVERSION_STR "5.1.2600.2180"
+
+#include "wine/wine_common_ver.rc"

Added: trunk/reactos/dll/win32/version/version.spec
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version.spec?rev=27921&view=auto
==============================================================================
--- trunk/reactos/dll/win32/version/version.spec (added)
+++ trunk/reactos/dll/win32/version/version.spec Fri Jul 27 14:17:42 2007
@@ -1,0 +1,12 @@
+@ stdcall GetFileVersionInfoA(str long long ptr)
+@ stdcall GetFileVersionInfoSizeA(str ptr)
+@ stdcall GetFileVersionInfoSizeW(wstr ptr)
+@ stdcall GetFileVersionInfoW(wstr long long ptr)
+@ stdcall VerFindFileA(long str str str ptr ptr ptr ptr)
+@ stdcall VerFindFileW(long wstr wstr wstr ptr ptr ptr ptr)
+@ stdcall VerInstallFileA(long str str str str str ptr ptr)
+@ stdcall VerInstallFileW(long wstr wstr wstr wstr wstr ptr ptr)
+@ stdcall VerLanguageNameA(long str long) kernel32.VerLanguageNameA
+@ stdcall VerLanguageNameW(long wstr long) kernel32.VerLanguageNameW
+@ stdcall VerQueryValueA(ptr str ptr ptr)
+@ stdcall VerQueryValueW(ptr wstr ptr ptr)

Propchange: trunk/reactos/dll/win32/version/version.spec
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/version/version_ros.diff
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version_ros.diff?rev=27921&view=auto
==============================================================================
--- trunk/reactos/dll/win32/version/version_ros.diff (added)
+++ trunk/reactos/dll/win32/version/version_ros.diff Fri Jul 27 14:17:42 2007
@@ -1,0 +1,164 @@
+Index: info.c
+===================================================================
+--- info.c	(revision 23123)
++++ info.c	(working copy)
+@@ -30,6 +30,7 @@
+ #include "winbase.h"
+ #include "winver.h"
+ #include "winternl.h"
++#include "winuser.h"
+ #include "wine/winuser16.h"
+ #include "wine/unicode.h"
+ #include "winerror.h"
+@@ -304,6 +305,7 @@
+     return len;
+ }
+ 
++#ifndef __REACTOS__
+ /***********************************************************************
+  *           VERSION_GetFileVersionInfo_16             [internal]
+  *
+@@ -437,6 +440,7 @@
+ 
+     return len;
+ }
++#endif /* ! __REACTOS__ */
+ 
+ /***********************************************************************
+  *           GetFileVersionInfoSizeW         [VERSION.@]
+@@ -470,6 +473,10 @@
+ 
+     if (!len)
+     {
++#ifdef __REACTOS__
++        SetLastError(ERROR_FILE_NOT_FOUND);
++        return 0;
++#else /* __REACTOS__ */
+         LPSTR filenameA;
+ 
+         len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
+@@ -501,6 +508,7 @@
+          * doesn't seem to be a problem (len is bigger than info->wLength).
+          */
+          len = (len - sizeof(VS_FIXEDFILEINFO)) * 4;
++#endif /* ! __REACTOS__ */
+     }
+     else
+     {
+@@ -565,6 +573,10 @@
+ 
+     if (!len)
+     {
++#ifdef __REACTOS__
++        SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND);
++        return FALSE;
++#else /* __REACTOS__ */
+         LPSTR filenameA;
+ 
+         len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
+@@ -580,6 +592,7 @@
+             return FALSE;
+         }
+         /* We have a 16bit resource. */
++#endif /* ! __REACTOS__ */
+     }
+     else 
+     {
+Index: install.c
+===================================================================
+--- install.c	(revision 23123)
++++ install.c	(working copy)
+@@ -122,7 +122,7 @@
+  *         Reimplementation of VerFindFile from original stub.
+  */
+ DWORD WINAPI VerFindFileA(
+-    UINT flags,
++    DWORD flags,
+     LPSTR lpszFilename,
+     LPSTR lpszWinDir,
+     LPSTR lpszAppDir,
+@@ -220,7 +220,7 @@
+ /*****************************************************************************
+  * VerFindFileW						[VERSION.@]
+  */
+-DWORD WINAPI VerFindFileW( UINT flags,LPWSTR lpszFilename,LPWSTR lpszWinDir,
++DWORD WINAPI VerFindFileW( DWORD flags,LPWSTR lpszFilename,LPWSTR lpszWinDir,
+                            LPWSTR lpszAppDir, LPWSTR lpszCurDir,UINT *lpuCurDirLen,
+                            LPWSTR lpszDestDir,UINT *lpuDestDirLen )
+ {
+@@ -361,7 +361,7 @@
+  * VerInstallFileA [VERSION.@]
+  */
+ DWORD WINAPI VerInstallFileA(
+-	UINT flags,LPSTR srcfilename,LPSTR destfilename,LPSTR srcdir,
++	DWORD flags,LPSTR srcfilename,LPSTR destfilename,LPSTR srcdir,
+  	LPSTR destdir,LPSTR curdir,LPSTR tmpfile,UINT *tmpfilelen )
+ {
+     LPCSTR pdest;
+@@ -529,7 +529,7 @@
+  * VerInstallFileW				[VERSION.@]
+  */
+ DWORD WINAPI VerInstallFileW(
+-	UINT flags,LPWSTR srcfilename,LPWSTR destfilename,LPWSTR srcdir,
++	DWORD flags,LPWSTR srcfilename,LPWSTR destfilename,LPWSTR srcdir,
+ 	LPWSTR destdir,LPWSTR curdir,LPWSTR tmpfile,UINT *tmpfilelen )
+ {
+     LPSTR wsrcf = NULL, wsrcd = NULL, wdestf = NULL, wdestd = NULL, wtmpf = NULL, wcurd = NULL;
+Index: resource.c
+===================================================================
+--- resource.c	(revision 23123)
++++ resource.c	(working copy)
+@@ -43,6 +43,9 @@
+ 
+ #include "wine/debug.h"
+ 
++/* winnt.h */
++#define IMAGE_FILE_RESOURCE_DIRECTORY		2
++
+ WINE_DEFAULT_DEBUG_CHANNEL(ver);
+ 
+ 
+@@ -169,6 +172,7 @@
+     return 0;
+ }
+ 
++#ifndef __REACTOS__
+ /***********************************************************************
+  *           load_ne_resource         [internal]
+  */
+@@ -267,6 +272,7 @@
+     HeapFree( GetProcessHeap(), 0, resTab );
+     return TRUE;
+ }
++#endif /* ! __REACTOS__ */
+ 
+ /***********************************************************************
+  *           load_pe_resource         [internal]
+@@ -412,8 +417,13 @@
+     switch ( read_xx_header( lzfd ) )
+     {
+     case IMAGE_OS2_SIGNATURE:
++#ifdef __REACTOS__
++        ERR("OS2 Images not supported under ReactOS at this time.");
++        retv = 0;
++#else
+         retv = find_ne_resource( lzfd, lpszResType, lpszResId,
+                                  &reslen, lpdwFileOffset );
++#endif
+         break;
+ 
+     case IMAGE_NT_SIGNATURE:
+@@ -451,8 +461,13 @@
+         switch ( read_xx_header( lzfd ) )
+         {
+         case IMAGE_OS2_SIGNATURE:
++#ifdef __REACTOS__
++            ERR("OS2 Images not supported under ReactOS at this time.");
++            retv = 0;
++#else
+             retv = find_ne_resource( lzfd, lpszResType, lpszResId,
+                                      &reslen, &dwFileOffset );
++#endif
+             break;
+ 
+         case IMAGE_NT_SIGNATURE:

Propchange: trunk/reactos/dll/win32/version/version_ros.diff
------------------------------------------------------------------------------
    svn:eol-style = native

Removed: trunk/reactos/dll/win32/version/version_specs
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version_specs?rev=27920&view=auto
==============================================================================
--- trunk/reactos/dll/win32/version/version_specs (original)
+++ trunk/reactos/dll/win32/version/version_specs (removed)
@@ -1,78 +1,0 @@
-*asm:
-
-
-*asm_final:
-
-
-*cpp:
--remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE}
-
-*cc1:
-%(cc1_spec) 
-
-*cc1plus:
-
-
-*endfile:
-
-
-*link:
-%{mwindows:--subsystem windows} %{mdll:--dll -e _DllMainCRTStartup at 12}
-
-*lib:
-
-
-*libgcc:
--lgcc
-
-*startfile:
-
-
-*switches_need_spaces:
-
-
-*signed_char:
-%{funsigned-char:-D__CHAR_UNSIGNED__}
-
-*predefines:
--Di386 -D_WIN32 -DWIN32 -D__WIN32__   -D__MINGW32__ -DWINNT  -D_X86_=1 -D__STDC__=1  -D__stdcall=__attribute__((__stdcall__))  -D_stdcall=__attribute__((__stdcall__))   -D__cdecl=__attribute__((__cdecl__))   -D__declspec(x)=__attribute__((x))   -Asystem(winnt) -Acpu(i386) -Amachine(i386)
-
-*cross_compile:
-1
-
-*version:
-egcs-2.91.57
-
-*multilib:
-. ;
-
-*multilib_defaults:
-
-
-*multilib_extra:
-
-
-*multilib_matches:
-
-
-*linker:
-collect2
-
-*cpp_486:
-%{!ansi:-Di486} -D__i486 -D__i486__
-
-*cpp_586:
-%{!ansi:-Di586 -Dpentium} 	-D__i586 -D__i586__ -D__pentium -D__pentium__
-
-*cpp_686:
-%{!ansi:-Di686 -Dpentiumpro} 	-D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__
-
-*cpp_cpu_default:
-%(cpp_586)
-
-*cpp_cpu:
--Acpu(i386) -Amachine(i386) %{!ansi:-Di386} -D__i386 -D__i386__ %{mcpu=i486:%(cpp_486)} %{m486:%(cpp_486)} %{mpentium:%(cpp_586)} %{mcpu=pentium:%(cpp_586)} %{mpentiumpro:%(cpp_686)} %{mcpu=pentiumpro:%(cpp_686)} %{!mcpu*:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}
-
-*cc1_cpu:
-%{!mcpu*: %{m386:-mcpu=i386 -march=i386} %{mno-486:-mcpu=i386 -march=i386} %{m486:-mcpu=i486 -march=i486} %{mno-386:-mcpu=i486 -march=i486} %{mno-pentium:-mcpu=i486 -march=i486} %{mpentium:-mcpu=pentium} %{mno-pentiumpro:-mcpu=pentium} %{mpentiumpro:-mcpu=pentiumpro}}
-




More information about the Ros-diffs mailing list