Autosyncing with Wine HEAD

svn path=/trunk/; revision=30890
This commit is contained in:
The Wine Synchronizer 2007-11-29 11:26:23 +00:00
parent a1e248d5f0
commit 2ffe4fd798
5 changed files with 35 additions and 99 deletions

View file

@ -247,11 +247,9 @@ static DWORD VERSION_GetFileVersionInfo_PE( LPCWSTR filename, DWORD datasize, LP
TRACE("%s\n", debugstr_w(filename));
hModule = GetModuleHandleW(filename);
if(!hModule)
if (!GetModuleHandleExW(0, filename, &hModule))
hModule = LoadLibraryExW(filename, 0, LOAD_LIBRARY_AS_DATAFILE);
else
hModule = LoadLibraryExW(filename, 0, 0);
if(!hModule)
{
WARN("Could not load %s\n", debugstr_w(filename));
@ -594,12 +592,12 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
/* We have a 16bit resource. */
#endif /* ! __REACTOS__ */
}
else
else
{
static const char signature[] = "FE2X";
DWORD bufsize = vvis->wLength + strlen(signature);
DWORD convbuf;
/* We have a 32bit resource.
*
* XP/W2K/W2K3 uses a buffer which is 2 times the actual needed space + 4 bytes "FE2X"
@ -775,7 +773,7 @@ static BOOL WINAPI VersionInfo32_QueryValue( const VS_VERSION_INFO_STRUCT32 *inf
* VerQueryValueA [VERSION.@]
*/
BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
LPVOID *lplpBuffer, UINT *puLen )
LPVOID *lplpBuffer, PUINT puLen )
{
static const char rootA[] = "\\";
static const char varfileinfoA[] = "\\VarFileInfo\\Translation";
@ -784,7 +782,7 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
TRACE("(%p,%s,%p,%p)\n",
pBlock, debugstr_a(lpSubBlock), lplpBuffer, puLen );
if (!pBlock)
if (!pBlock)
return FALSE;
if ( !VersionInfoIs16( info ) )
@ -828,7 +826,7 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
* VerQueryValueW [VERSION.@]
*/
BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock,
LPVOID *lplpBuffer, UINT *puLen )
LPVOID *lplpBuffer, PUINT puLen )
{
static const WCHAR rootW[] = { '\\', 0 };
static const WCHAR varfileinfoW[] = { '\\','V','a','r','F','i','l','e','I','n','f','o',

View file

@ -123,13 +123,13 @@ static int testFileExistenceW( const WCHAR *path, const WCHAR *file, BOOL excl )
*/
DWORD WINAPI VerFindFileA(
DWORD flags,
LPSTR lpszFilename,
LPSTR lpszWinDir,
LPSTR lpszAppDir,
LPCSTR lpszFilename,
LPCSTR lpszWinDir,
LPCSTR lpszAppDir,
LPSTR lpszCurDir,
UINT *lpuCurDirLen,
PUINT lpuCurDirLen,
LPSTR lpszDestDir,
UINT *lpuDestDirLen )
PUINT lpuDestDirLen )
{
DWORD retval = 0;
const char *curDir;
@ -220,9 +220,9 @@ DWORD WINAPI VerFindFileA(
/*****************************************************************************
* VerFindFileW [VERSION.@]
*/
DWORD WINAPI VerFindFileW( DWORD flags,LPWSTR lpszFilename,LPWSTR lpszWinDir,
LPWSTR lpszAppDir, LPWSTR lpszCurDir,UINT *lpuCurDirLen,
LPWSTR lpszDestDir,UINT *lpuDestDirLen )
DWORD WINAPI VerFindFileW( DWORD flags,LPCWSTR lpszFilename,LPCWSTR lpszWinDir,
LPCWSTR lpszAppDir, LPWSTR lpszCurDir,PUINT lpuCurDirLen,
LPWSTR lpszDestDir,PUINT lpuDestDirLen )
{
static const WCHAR emptyW;
DWORD retval = 0;
@ -361,8 +361,8 @@ _error2vif(DWORD error) {
* VerInstallFileA [VERSION.@]
*/
DWORD WINAPI VerInstallFileA(
DWORD flags,LPSTR srcfilename,LPSTR destfilename,LPSTR srcdir,
LPSTR destdir,LPSTR curdir,LPSTR tmpfile,UINT *tmpfilelen )
DWORD flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPCSTR curdir,LPSTR tmpfile,PUINT tmpfilelen )
{
LPCSTR pdest;
char destfn[260],tmpfn[260],srcfn[260];
@ -529,8 +529,8 @@ DWORD WINAPI VerInstallFileA(
* VerInstallFileW [VERSION.@]
*/
DWORD WINAPI VerInstallFileW(
DWORD flags,LPWSTR srcfilename,LPWSTR destfilename,LPWSTR srcdir,
LPWSTR destdir,LPWSTR curdir,LPWSTR tmpfile,UINT *tmpfilelen )
DWORD flags,LPCWSTR srcfilename,LPCWSTR destfilename,LPCWSTR srcdir,
LPCWSTR destdir,LPCWSTR curdir,LPWSTR tmpfile,PUINT tmpfilelen )
{
LPSTR wsrcf = NULL, wsrcd = NULL, wdestf = NULL, wdestd = NULL, wtmpf = NULL, wcurd = NULL;
DWORD ret;

View file

@ -39,7 +39,6 @@
#include "wine/unicode.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wine/debug.h"
@ -295,7 +294,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
pehdoffset = LZSeek( lzfd, 0, SEEK_CUR );
if ( sizeof(pehd) != LZRead( lzfd, (LPSTR)&pehd, sizeof(pehd) ) ) return 0;
resDataDir = pehd.OptionalHeader.DataDirectory+IMAGE_FILE_RESOURCE_DIRECTORY;
resDataDir = pehd.OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_RESOURCE;
if ( !resDataDir->Size )
{
TRACE("No resources in PE dll\n" );

View file

@ -1,13 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="version" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_VERSION}" installbase="system32" installname="version.dll" allowwarnings="true">
<importlibrary definition="version.spec.def" />
<include base="version">.</include>
<include base="ReactOS">include/reactos/wine</include>
<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>
<define name="WINVER">0x600</define>
<define name="_WIN32_WINNT">0x600</define>
<library>wine</library>
<library>lz32</library>
<library>kernel32</library>

View file

@ -10,7 +10,7 @@ Index: info.c
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "winerror.h"
@@ -304,6 +305,7 @@
@@ -302,6 +303,7 @@
return len;
}
@ -18,7 +18,7 @@ Index: info.c
/***********************************************************************
* VERSION_GetFileVersionInfo_16 [internal]
*
@@ -437,6 +440,7 @@
@@ -435,6 +438,7 @@
return len;
}
@ -26,7 +26,7 @@ Index: info.c
/***********************************************************************
* GetFileVersionInfoSizeW [VERSION.@]
@@ -470,6 +473,10 @@
@@ -468,6 +471,10 @@
if (!len)
{
@ -37,7 +37,7 @@ Index: info.c
LPSTR filenameA;
len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
@@ -501,6 +508,7 @@
@@ -499,6 +506,7 @@
* doesn't seem to be a problem (len is bigger than info->wLength).
*/
len = (len - sizeof(VS_FIXEDFILEINFO)) * 4;
@ -45,7 +45,7 @@ Index: info.c
}
else
{
@@ -565,6 +573,10 @@
@@ -563,6 +571,10 @@
if (!len)
{
@ -56,7 +56,7 @@ Index: info.c
LPSTR filenameA;
len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
@@ -580,6 +592,7 @@
@@ -578,6 +590,7 @@
return FALSE;
}
/* We have a 16bit resource. */
@ -64,71 +64,11 @@ Index: info.c
}
else
{
@@ -784,6 +784,9 @@
TRACE("(%p,%s,%p,%p)\n",
pBlock, debugstr_a(lpSubBlock), lplpBuffer, puLen );
+ if (!pBlock)
+ return FALSE;
+
if ( !VersionInfoIs16( info ) )
{
BOOL ret;
@@ -836,6 +839,9 @@
TRACE("(%p,%s,%p,%p)\n",
pBlock, debugstr_w(lpSubBlock), lplpBuffer, puLen );
+ if (!pBlock)
+ return FALSE;
+
if ( VersionInfoIs16( info ) )
{
BOOL ret;
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 @@
@@ -42,6 +42,9 @@
#include "wine/debug.h"
@ -138,7 +78,7 @@ Index: resource.c
WINE_DEFAULT_DEBUG_CHANNEL(ver);
@@ -169,6 +172,7 @@
@@ -168,6 +171,7 @@
return 0;
}
@ -146,7 +86,7 @@ Index: resource.c
/***********************************************************************
* load_ne_resource [internal]
*/
@@ -267,6 +272,7 @@
@@ -266,6 +271,7 @@
HeapFree( GetProcessHeap(), 0, resTab );
return TRUE;
}
@ -154,7 +94,7 @@ Index: resource.c
/***********************************************************************
* load_pe_resource [internal]
@@ -412,8 +417,13 @@
@@ -411,8 +416,13 @@
switch ( read_xx_header( lzfd ) )
{
case IMAGE_OS2_SIGNATURE:
@ -168,7 +108,7 @@ Index: resource.c
break;
case IMAGE_NT_SIGNATURE:
@@ -451,8 +461,13 @@
@@ -450,8 +460,13 @@
switch ( read_xx_header( lzfd ) )
{
case IMAGE_OS2_SIGNATURE: