diff --git a/reactos/dll/win32/version/info.c b/reactos/dll/win32/version/info.c index c91a8a2c384..f3aea87bb01 100644 --- a/reactos/dll/win32/version/info.c +++ b/reactos/dll/win32/version/info.c @@ -253,6 +253,7 @@ static DWORD VERSION_GetFileVersionInfo_PE( LPCWSTR filename, DWORD datasize, LP if(!hModule) { WARN("Could not load %s\n", debugstr_w(filename)); + return 0; } hRsrc = FindResourceW(hModule, @@ -382,7 +383,10 @@ static DWORD VERSION_GetFileVersionInfo_16( LPCSTR filename, DWORD datasize, LPV if(hModule < 32) { WARN("Could not load %s\n", debugstr_a(filename)); - return 0; + if (hModule == ERROR_BAD_FORMAT) + return 0xFFFFFFFF; + else + return 0x0; } hRsrc = FindResource16(hModule, MAKEINTRESOURCEA(VS_VERSION_INFO), diff --git a/reactos/dll/win32/version/install.c b/reactos/dll/win32/version/install.c index 5ff25e7b38f..d3170e33939 100644 --- a/reactos/dll/win32/version/install.c +++ b/reactos/dll/win32/version/install.c @@ -367,7 +367,8 @@ DWORD WINAPI VerInstallFileA( LPCSTR pdest; char destfn[260],tmpfn[260],srcfn[260]; HFILE hfsrc,hfdst; - DWORD attr,ret,xret,tmplast; + DWORD attr,xret,tmplast; + LONG ret; LPBYTE buf1,buf2; OFSTRUCT ofs; @@ -419,30 +420,31 @@ DWORD WINAPI VerInstallFileA( } ret = LZCopy(hfsrc,hfdst); _lclose(hfdst); - if (((LONG)ret) < 0) { + if (ret < 0) { /* translate LZ errors into VIF_xxx */ switch (ret) { case LZERROR_BADINHANDLE: case LZERROR_READ: case LZERROR_BADVALUE: case LZERROR_UNKNOWNALG: - ret = VIF_CANNOTREADSRC; + xret = VIF_CANNOTREADSRC; break; case LZERROR_BADOUTHANDLE: case LZERROR_WRITE: - ret = VIF_OUTOFSPACE; + xret = VIF_OUTOFSPACE; break; case LZERROR_GLOBALLOC: case LZERROR_GLOBLOCK: - ret = VIF_OUTOFMEMORY; + xret = VIF_OUTOFMEMORY; break; default: /* unknown error, should not happen */ - ret = 0; + FIXME("Unknown LZCopy error %d, ignoring.\n", ret); + xret = 0; break; } - if (ret) { + if (xret) { LZClose(hfsrc); - return ret; + return xret; } } } diff --git a/reactos/dll/win32/version/version.rbuild b/reactos/dll/win32/version/version.rbuild index 57bbe5c78f7..5ed46283e03 100644 --- a/reactos/dll/win32/version/version.rbuild +++ b/reactos/dll/win32/version/version.rbuild @@ -1,19 +1,21 @@ - + + . include/reactos/wine 0x600 0x600 - wine - lz32 - kernel32 - ntdll info.c install.c resource.c version.rc version.spec + wine + lz32 + kernel32 + ntdll + diff --git a/reactos/dll/win32/version/version_ros.diff b/reactos/dll/win32/version/version_ros.diff index 8aa61131a5a..20e89e533dd 100644 --- a/reactos/dll/win32/version/version_ros.diff +++ b/reactos/dll/win32/version/version_ros.diff @@ -10,7 +10,7 @@ Index: info.c #include "wine/winuser16.h" #include "wine/unicode.h" #include "winerror.h" -@@ -302,6 +303,7 @@ +@@ -303,6 +304,7 @@ return len; } @@ -18,7 +18,7 @@ Index: info.c /*********************************************************************** * VERSION_GetFileVersionInfo_16 [internal] * -@@ -435,6 +438,7 @@ +@@ -439,6 +442,7 @@ return len; } @@ -26,7 +26,7 @@ Index: info.c /*********************************************************************** * GetFileVersionInfoSizeW [VERSION.@] -@@ -468,6 +471,10 @@ +@@ -472,6 +475,10 @@ if (!len) { @@ -37,7 +37,7 @@ Index: info.c LPSTR filenameA; len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL ); -@@ -499,6 +506,7 @@ +@@ -503,6 +510,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 { -@@ -563,6 +571,10 @@ +@@ -567,6 +575,10 @@ if (!len) { @@ -56,7 +56,7 @@ Index: info.c LPSTR filenameA; len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL ); -@@ -578,6 +590,7 @@ +@@ -582,6 +594,7 @@ return FALSE; } /* We have a 16bit resource. */