Author: akhaldi Date: Sat Apr 26 18:15:32 2014 New Revision: 63002
URL: http://svn.reactos.org/svn/reactos?rev=63002&view=rev Log: [VERSION] * Sync with Wine 1.7.17. CORE-8080
Modified: trunk/reactos/dll/win32/version/version.c trunk/reactos/include/psdk/winnt.h trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/version/version.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version.c... ============================================================================== --- trunk/reactos/dll/win32/version/version.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/version/version.c [iso-8859-1] Sat Apr 26 18:15:32 2014 @@ -84,9 +84,9 @@ while (min <= max) { pos = (min + max) / 2; - if (entry[pos].u1.Id == id) + if (entry[pos].u.Id == id) return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s2.OffsetToDirectory); - if (entry[pos].u1.Id > id) max = pos - 1; + if (entry[pos].u.Id > id) max = pos - 1; else min = pos + 1; } return NULL; @@ -106,6 +106,46 @@
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1); return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->u2.s2.OffsetToDirectory); +} + + +/********************************************************************** + * push_language + * + * push a language onto the list of languages to try + */ +static inline int push_language( WORD *list, int pos, WORD lang ) +{ + int i; + for (i = 0; i < pos; i++) if (list[i] == lang) return pos; + list[pos++] = lang; + return pos; +} + + +/********************************************************************** + * find_entry_language + */ +static const IMAGE_RESOURCE_DIRECTORY *find_entry_language( const IMAGE_RESOURCE_DIRECTORY *dir, + const void *root ) +{ + const IMAGE_RESOURCE_DIRECTORY *ret; + WORD list[9]; + int i, pos = 0; + + /* cf. LdrFindResource_U */ + pos = push_language( list, pos, MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ) ); + pos = push_language( list, pos, LANGIDFROMLCID( NtCurrentTeb()->CurrentLocale ) ); + pos = push_language( list, pos, GetUserDefaultLangID() ); + pos = push_language( list, pos, MAKELANGID( PRIMARYLANGID(GetUserDefaultLangID()), SUBLANG_NEUTRAL )); + pos = push_language( list, pos, MAKELANGID( PRIMARYLANGID(GetUserDefaultLangID()), SUBLANG_DEFAULT )); + pos = push_language( list, pos, GetSystemDefaultLangID() ); + pos = push_language( list, pos, MAKELANGID( PRIMARYLANGID(GetSystemDefaultLangID()), SUBLANG_NEUTRAL )); + pos = push_language( list, pos, MAKELANGID( PRIMARYLANGID(GetSystemDefaultLangID()), SUBLANG_DEFAULT )); + pos = push_language( list, pos, MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ) ); + + for (i = 0; i < pos; i++) if ((ret = find_entry_by_id( dir, list[i], root ))) return ret; + return find_entry_default( dir, root ); }
@@ -160,7 +200,7 @@
/* Read in NE header */ nehdoffset = LZSeek( lzfd, 0, SEEK_CUR ); - if ( sizeof(nehd) != LZRead( lzfd, (LPSTR)&nehd, sizeof(nehd) ) ) return 0; + if ( sizeof(nehd) != LZRead( lzfd, (LPSTR)&nehd, sizeof(nehd) ) ) return FALSE;
resTabSize = nehd.ne_restab - nehd.ne_rsrctab; if ( !resTabSize ) @@ -235,7 +275,7 @@ /* Read in PE header */ pehdoffset = LZSeek( lzfd, 0, SEEK_CUR ); len = LZRead( lzfd, (LPSTR)&pehd, sizeof(pehd) ); - if (len < sizeof(pehd.nt32.FileHeader)) return 0; + if (len < sizeof(pehd.nt32.FileHeader)) return FALSE; if (len < sizeof(pehd)) memset( (char *)&pehd + len, 0, sizeof(pehd) - len );
switch (pehd.nt32.OptionalHeader.Magic) @@ -247,7 +287,7 @@ resDataDir = pehd.nt64.OptionalHeader.DataDirectory + IMAGE_DIRECTORY_ENTRY_RESOURCE; break; default: - return 0; + return FALSE; }
if ( !resDataDir->Size ) @@ -316,7 +356,7 @@ TRACE("No resid entry found\n" ); goto done; } - resPtr = find_entry_default( resPtr, resDir ); + resPtr = find_entry_language( resPtr, resDir ); if ( !resPtr ) { TRACE("No default language entry found\n" ); @@ -527,7 +567,7 @@ { WORD wLength; WORD wValueLength; - WORD wType; + WORD wType; /* 1:Text, 0:Binary */ WCHAR szKey[1]; #if 0 /* variable length structure */ /* DWORD aligned */ @@ -847,7 +887,7 @@ * Gets a value from a 32-bit PE resource */ static BOOL VersionInfo32_QueryValue( const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR lpSubBlock, - LPVOID *lplpBuffer, UINT *puLen ) + LPVOID *lplpBuffer, UINT *puLen, BOOL *pbText ) { TRACE("lpSubBlock : (%s)\n", debugstr_w(lpSubBlock));
@@ -883,6 +923,8 @@ *lplpBuffer = VersionInfo32_Value( info ); if (puLen) *puLen = info->wValueLength; + if (pbText) + *pbText = info->wType;
return TRUE; } @@ -894,7 +936,6 @@ LPVOID *lplpBuffer, PUINT puLen ) { static const char rootA[] = "\"; - static const char varfileinfoA[] = "\VarFileInfo\Translation"; const VS_VERSION_INFO_STRUCT16 *info = pBlock;
TRACE("(%p,%s,%p,%p)\n", @@ -908,7 +949,7 @@
if ( !VersionInfoIs16( info ) ) { - BOOL ret; + BOOL ret, isText; INT len; LPWSTR lpSubBlockW;
@@ -920,11 +961,11 @@
MultiByteToWideChar(CP_ACP, 0, lpSubBlock, -1, lpSubBlockW, len);
- ret = VersionInfo32_QueryValue(pBlock, lpSubBlockW, lplpBuffer, puLen); + ret = VersionInfo32_QueryValue(pBlock, lpSubBlockW, lplpBuffer, puLen, &isText);
HeapFree(GetProcessHeap(), 0, lpSubBlockW);
- if (ret && strcasecmp( lpSubBlock, rootA ) && strcasecmp( lpSubBlock, varfileinfoA )) + if (ret && isText) { /* Set lpBuffer so it points to the 'empty' area where we store * the converted strings @@ -1000,7 +1041,7 @@ return ret; }
- return VersionInfo32_QueryValue(info, lpSubBlock, lplpBuffer, puLen); + return VersionInfo32_QueryValue(info, lpSubBlock, lplpBuffer, puLen, NULL); }
Modified: trunk/reactos/include/psdk/winnt.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=63... ============================================================================== --- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Sat Apr 26 18:15:32 2014 @@ -4672,10 +4672,10 @@ _ANONYMOUS_STRUCT struct { DWORD NameOffset:31; DWORD NameIsString:1; - } DUMMYSTRUCTNAME1; + } DUMMYSTRUCTNAME; DWORD Name; WORD Id; - } DUMMYUNIONNAME1; + } DUMMYUNIONNAME; _ANONYMOUS_UNION union { DWORD OffsetToData; _ANONYMOUS_STRUCT struct {
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=6... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Apr 26 18:15:32 2014 @@ -199,7 +199,7 @@ reactos/dll/win32/usp10 # Synced to Wine-1.7.17 reactos/dll/win32/uxtheme # Forked reactos/dll/win32/vbscript # Synced to Wine-1.7.17 -reactos/dll/win32/version # Synced to Wine-1.7.1 +reactos/dll/win32/version # Synced to Wine-1.7.17 reactos/dll/win32/wbemdisp # Synced to Wine-1.7.17 reactos/dll/win32/wbemprox # Synced to Wine-1.7.17 reactos/dll/win32/wer # Autosync