reactos/lib/msi
diff -u -r1.3 -r1.4
--- action.c 7 Dec 2004 08:13:01 -0000 1.3
+++ action.c 14 Dec 2004 20:42:02 -0000 1.4
@@ -28,6 +28,7 @@
#include <stdarg.h>
#include <stdio.h>
+
#include <fcntl.h>
#define COBJMACROS
@@ -2263,7 +2264,7 @@
version = HeapAlloc(GetProcessHeap(),0,versize);
GetFileVersionInfoW(file->TargetPath, 0, versize, version);
- VerQueryValueW(version, (LPWSTR) name, (LPVOID*)&lpVer, &sz);
+ VerQueryValueW(version, name, (LPVOID*)&lpVer, &sz);
sprintfW(filever,name_fmt,
HIWORD(lpVer->dwFileVersionMS),
reactos/lib/msi
diff -u -r1.3 -r1.4
--- msi.c 7 Dec 2004 08:13:01 -0000 1.3
+++ msi.c 14 Dec 2004 20:42:02 -0000 1.4
@@ -702,7 +702,8 @@
goto end;
MultiByteToWideChar( CP_ACP, 0, szAttribute, -1, szwAttribute, len );
} else {
- return ERROR_INVALID_PARAMETER;
+ hr = ERROR_INVALID_PARAMETER;
+ goto end;
}
if( szBuffer )
@@ -1266,7 +1267,10 @@
len = MultiByteToWideChar( CP_ACP, 0, szComponent, -1, NULL, 0 );
szwComponent= HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if( !szwComponent)
+ {
+ HeapFree( GetProcessHeap(), 0, szwProduct);
return ERROR_OUTOFMEMORY;
+ }
MultiByteToWideChar( CP_ACP, 0, szComponent, -1, szwComponent, len );
}
@@ -1319,7 +1323,10 @@
len = MultiByteToWideChar( CP_ACP, 0, szFeature, -1, NULL, 0 );
szwFeature= HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if( !szwFeature)
+ {
+ HeapFree( GetProcessHeap(), 0, szwProduct);
return ERROR_OUTOFMEMORY;
+ }
MultiByteToWideChar( CP_ACP, 0, szFeature, -1, szwFeature, len );
}
@@ -1356,13 +1363,19 @@
if(lpVersionBuf && pcchVersionBuf && *pcchVersionBuf) {
lpwVersionBuff = HeapAlloc(GetProcessHeap(), 0, *pcchVersionBuf * sizeof(WCHAR));
if( !lpwVersionBuff)
- return ERROR_OUTOFMEMORY;
+ {
+ ret = ERROR_OUTOFMEMORY;
+ goto end;
+ }
}
if(lpLangBuf && pcchLangBuf && *pcchLangBuf) {
lpwLangBuff = HeapAlloc(GetProcessHeap(), 0, *pcchVersionBuf * sizeof(WCHAR));
if( !lpwLangBuff)
- return ERROR_OUTOFMEMORY;
+ {
+ ret = ERROR_OUTOFMEMORY;
+ goto end;
+ }
}
ret = MsiGetFileVersionW(szwFilePath, lpwVersionBuff, pcchVersionBuf, lpwLangBuff, pcchLangBuf);
@@ -1372,6 +1385,7 @@
if(lpwLangBuff)
WideCharToMultiByte(CP_ACP, 0, lpwLangBuff, -1, lpLangBuf, *pcchLangBuf, NULL, NULL);
+end:
if(szwFilePath) HeapFree(GetProcessHeap(), 0, szwFilePath);
if(lpwVersionBuff) HeapFree(GetProcessHeap(), 0, lpwVersionBuff);
if(lpwLangBuff) HeapFree(GetProcessHeap(), 0, lpwLangBuff);
@@ -1395,7 +1409,7 @@
lpVersionBuf, pcchVersionBuf?*pcchVersionBuf:0,
lpLangBuf, pcchLangBuf?*pcchLangBuf:0);
- dwVerLen = GetFileVersionInfoSizeW( (LPWSTR) szFilePath, NULL);
+ dwVerLen = GetFileVersionInfoSizeW(szFilePath, NULL);
if(!dwVerLen)
return GetLastError();
@@ -1405,12 +1419,12 @@
goto end;
}
- if(!GetFileVersionInfoW((LPWSTR) szFilePath, 0, dwVerLen, lpVer)) {
+ if(!GetFileVersionInfoW(szFilePath, 0, dwVerLen, lpVer)) {
ret = GetLastError();
goto end;
}
if(lpVersionBuf && pcchVersionBuf && *pcchVersionBuf) {
- if(VerQueryValueW(lpVer, (LPWSTR) szVersionResource, (LPVOID*)&ffi, &puLen) && puLen > 0) {
+ if(VerQueryValueW(lpVer, szVersionResource, (LPVOID*)&ffi, &puLen) && puLen > 0) {
wsprintfW(tmp, szVersionFormat, HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS), HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS));
lstrcpynW(lpVersionBuf, tmp, *pcchVersionBuf);
*pcchVersionBuf = strlenW(lpVersionBuf);
reactos/lib/msi
diff -u -r1.3 -r1.4
--- table.c 7 Dec 2004 22:45:09 -0000 1.3
+++ table.c 14 Dec 2004 20:42:02 -0000 1.4
@@ -466,8 +466,8 @@
t->data[i][ofs] = rawdata[ofs*t->row_count + i ];
break;
case 4:
- t->data[i][ofs] = rawdata[ofs*t->row_count + i ];
- t->data[i][ofs+1] = rawdata[ofs*t->row_count + i + 1];
+ t->data[i][ofs] = rawdata[ofs*t->row_count + i*2 ];
+ t->data[i][ofs+1] = rawdata[ofs*t->row_count + i*2 + 1];
break;
default:
ERR("oops - unknown column width %d\n", n);
@@ -1203,7 +1203,10 @@
else
p = HeapAlloc( GetProcessHeap(), 0, sz );
if( !p )
+ {
+ HeapFree( GetProcessHeap(), 0, row );
return ERROR_NOT_ENOUGH_MEMORY;
+ }
tv->table->data = p;
tv->table->data[tv->table->row_count] = row;