Commit in reactos/lib/msi on MAIN
action.c+2-11.3 -> 1.4
msi.c+20-61.3 -> 1.4
msiquery.c+11.1 -> 1.2
record.c+31.1 -> 1.2
sql.tab.c+1-11.1 -> 1.2
sql.y+1-11.1 -> 1.2
suminfo.c-11.2 -> 1.3
table.c+5-21.3 -> 1.4
+33-12
8 modified files
Update files from WineHq.

reactos/lib/msi
action.c 1.3 -> 1.4
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
msi.c 1.3 -> 1.4
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
msiquery.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- msiquery.c	30 Nov 2004 19:10:50 -0000	1.1
+++ msiquery.c	14 Dec 2004 20:42:02 -0000	1.2
@@ -121,6 +121,7 @@
 
     r = MsiDatabaseOpenViewW( hdb, szwQuery, phView);
 
+    HeapFree( GetProcessHeap(), 0, szwQuery );
     return r;
 }
 

reactos/lib/msi
record.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- record.c	30 Nov 2004 19:10:50 -0000	1.1
+++ record.c	14 Dec 2004 20:42:02 -0000	1.2
@@ -534,7 +534,10 @@
     count = 0;
     r = IStream_Read( stm, buf, *sz, &count );
     if( FAILED( r ) )
+    {
+        *sz = 0;
         return ERROR_FUNCTION_FAILED;
+    }
 
     *sz = count;
 

reactos/lib/msi
sql.tab.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- sql.tab.c	3 Dec 2004 06:21:44 -0000	1.1
+++ sql.tab.c	14 Dec 2004 20:42:02 -0000	1.2
@@ -221,7 +221,7 @@
 static struct expr * EXPR_column( LPWSTR );
 static struct expr * EXPR_ival( struct sql_str *);
 static struct expr * EXPR_sval( struct sql_str *);
-static struct expr * EXPR_wildcard();
+static struct expr * EXPR_wildcard(void);
 
 
 #line 73 "./sql.y"

reactos/lib/msi
sql.y 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- sql.y	30 Nov 2004 19:10:50 -0000	1.1
+++ sql.y	14 Dec 2004 20:42:02 -0000	1.2
@@ -64,7 +64,7 @@
 static struct expr * EXPR_column( LPWSTR );
 static struct expr * EXPR_ival( struct sql_str *);
 static struct expr * EXPR_sval( struct sql_str *);
-static struct expr * EXPR_wildcard();
+static struct expr * EXPR_wildcard(void);
 
 %}
 

reactos/lib/msi
suminfo.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- suminfo.c	7 Dec 2004 08:13:01 -0000	1.2
+++ suminfo.c	14 Dec 2004 20:42:02 -0000	1.3
@@ -118,7 +118,6 @@
     ERR("storage = %p propertysetstorage = %p\n", db->storage, psstg);
 
     grfMode = STGM_READ | STGM_SHARE_EXCLUSIVE;
-
     r = IPropertySetStorage_Open( psstg, &FMTID_SummaryInformation, grfMode, &ps );
     if( FAILED( r ) )
     {

reactos/lib/msi
table.c 1.3 -> 1.4
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;
CVSspam 0.2.8