Commit in reactos/lib/msi on MAIN
action.c+150-61.2 -> 1.3
msi.c+3-31.2 -> 1.3
suminfo.c+11.1 -> 1.2
table.c+2-21.1 -> 1.2
winehq2ros.patch+102-381.1 -> 1.2
+258-49
5 modified files
Code cleanup and sink with WindHq CVS.

reactos/lib/msi
action.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- action.c	3 Dec 2004 06:21:44 -0000	1.2
+++ action.c	7 Dec 2004 08:13:01 -0000	1.3
@@ -29,7 +29,6 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <fcntl.h>
-
 #define COBJMACROS
 
 #include "windef.h"
@@ -158,6 +157,12 @@
                                 const LPWSTR target, const INT type);
 static UINT HANDLE_CustomType2(MSIPACKAGE *package, const LPWSTR source, 
                                 const LPWSTR target, const INT type);
+static UINT HANDLE_CustomType18(MSIPACKAGE *package, const LPWSTR source, 
+                                const LPWSTR target, const INT type);
+static UINT HANDLE_CustomType50(MSIPACKAGE *package, const LPWSTR source, 
+                                const LPWSTR target, const INT type);
+static UINT HANDLE_CustomType34(MSIPACKAGE *package, const LPWSTR source, 
+                                const LPWSTR target, const INT type);
 
 static DWORD deformat_string(MSIPACKAGE *package, WCHAR* ptr,WCHAR** data);
 static UINT resolve_folder(MSIPACKAGE *package, LPCWSTR name, LPWSTR path, 
@@ -761,6 +766,9 @@
 
             rc = ACTION_PerformAction(package,buffer);
 
+            if (rc == ERROR_FUNCTION_NOT_CALLED)
+                rc = ERROR_SUCCESS;
+
             if (rc != ERROR_SUCCESS)
             {
                 ERR("Execution halted due to error (%i)\n",rc);
@@ -851,6 +859,9 @@
 
             rc = ACTION_PerformAction(package,buffer);
 
+            if (rc == ERROR_FUNCTION_NOT_CALLED)
+                rc = ERROR_SUCCESS;
+
             if (rc != ERROR_SUCCESS)
             {
                 ERR("Execution halted due to error (%i)\n",rc);
@@ -936,7 +947,7 @@
      else if ((rc = ACTION_CustomAction(package,action)) != ERROR_SUCCESS)
      {
         FIXME("UNHANDLED MSI ACTION %s\n",debugstr_w(action));
-        rc = ERROR_SUCCESS;
+        rc = ERROR_FUNCTION_NOT_CALLED;
      }
 
     ui_actioninfo(package, action, FALSE, rc);
@@ -1000,6 +1011,15 @@
         case 2: /* EXE file stored in a Binary table strem */
             rc = HANDLE_CustomType2(package,source,target,type);
             break;
+        case 18: /*EXE file installed with package */
+            rc = HANDLE_CustomType18(package,source,target,type);
+            break;
+        case 50: /*EXE file specified by a property value */
+            rc = HANDLE_CustomType50(package,source,target,type);
+            break;
+        case 34: /*EXE to be run in specified directory */
+            rc = HANDLE_CustomType34(package,source,target,type);
+            break;
         case 35: /* Directory set with formatted text. */
         case 51: /* Property set with formatted text. */
             deformat_string(package,target,&deformated);
@@ -1234,7 +1254,6 @@
     static const WCHAR spc[] = {' ',0};
 
     memset(&si,0,sizeof(STARTUPINFOW));
-    memset(&info,0,sizeof(PROCESS_INFORMATION));
 
     store_binary_to_temp(package, source, tmp_file);
 
@@ -1258,6 +1277,132 @@
     if (!(type & 0xc0))
         WaitForSingleObject(info.hProcess,INFINITE);
 
+    CloseHandle( info.hProcess );
+    CloseHandle( info.hThread );
+    return ERROR_SUCCESS;
+}
+
+static UINT HANDLE_CustomType18(MSIPACKAGE *package, const LPWSTR source, 
+                                const LPWSTR target, const INT type)
+{
+    WCHAR filename[MAX_PATH*2];
+    STARTUPINFOW si;
+    PROCESS_INFORMATION info;
+    BOOL rc;
+    WCHAR *deformated;
+    static const WCHAR spc[] = {' ',0};
+    int index;
+
+    memset(&si,0,sizeof(STARTUPINFOW));
+
+    index = get_loaded_file(package,source);
+    strcpyW(filename,package->files[index].TargetPath);
+
+    strcatW(filename,spc);
+    deformat_string(package,target,&deformated);
+    strcatW(filename,deformated);
+
+    HeapFree(GetProcessHeap(),0,deformated);
+
+    TRACE("executing exe %s \n",debugstr_w(filename));
+
+    rc = CreateProcessW(NULL, filename, NULL, NULL, FALSE, 0, NULL,
+                  c_collen, &si, &info);
+
+    if ( !rc )
+    {
+        ERR("Unable to execute command\n");
+        return ERROR_SUCCESS;
+    }
+
+    if (!(type & 0xc0))
+        WaitForSingleObject(info.hProcess,INFINITE);
+
+    CloseHandle( info.hProcess );
+    CloseHandle( info.hThread );
+    return ERROR_SUCCESS;
+}
+
+static UINT HANDLE_CustomType50(MSIPACKAGE *package, const LPWSTR source, 
+                                const LPWSTR target, const INT type)
+{
+    WCHAR filename[MAX_PATH*2];
+    STARTUPINFOW si;
+    PROCESS_INFORMATION info;
+    BOOL rc;
+    WCHAR *deformated;
+    static const WCHAR spc[] = {' ',0};
+    DWORD sz;
+
+    memset(&si,0,sizeof(STARTUPINFOW));
+
+    sz = MAX_PATH*2;
+    if (MSI_GetPropertyW(package,source,filename,&sz) != ERROR_SUCCESS)
+        return ERROR_FUNCTION_FAILED;
+
+    strcatW(filename,spc);
+    deformat_string(package,target,&deformated);
+    strcatW(filename,deformated);
+
+    HeapFree(GetProcessHeap(),0,deformated);
+
+    TRACE("executing exe %s \n",debugstr_w(filename));
+
+    rc = CreateProcessW(NULL, filename, NULL, NULL, FALSE, 0, NULL,
+                  c_collen, &si, &info);
+
+    if ( !rc )
+    {
+        ERR("Unable to execute command\n");
+        return ERROR_SUCCESS;
+    }
+
+    if (!(type & 0xc0))
+        WaitForSingleObject(info.hProcess,INFINITE);
+
+    CloseHandle( info.hProcess );
+    CloseHandle( info.hThread );
+    return ERROR_SUCCESS;
+}
+
+static UINT HANDLE_CustomType34(MSIPACKAGE *package, const LPWSTR source, 
+                                const LPWSTR target, const INT type)
+{
+    WCHAR filename[MAX_PATH*2];
+    STARTUPINFOW si;
+    PROCESS_INFORMATION info;
+    BOOL rc;
+    WCHAR *deformated;
+
+    memset(&si,0,sizeof(STARTUPINFOW));
+
+    rc = resolve_folder(package, source, filename, FALSE, FALSE, NULL);
+    if (rc != ERROR_SUCCESS)
+        return rc;
+
+    SetCurrentDirectoryW(filename);
+
+    deformat_string(package,target,&deformated);
+    strcpyW(filename,deformated);
+
+    HeapFree(GetProcessHeap(),0,deformated);
+
+    TRACE("executing exe %s \n",debugstr_w(filename));
+
+    rc = CreateProcessW(NULL, filename, NULL, NULL, FALSE, 0, NULL,
+                  c_collen, &si, &info);
+
+    if ( !rc )
+    {
+        ERR("Unable to execute command\n");
+        return ERROR_SUCCESS;
+    }
+
+    if (!(type & 0xc0))
+        WaitForSingleObject(info.hProcess,INFINITE);
+
+    CloseHandle( info.hProcess );
+    CloseHandle( info.hThread );
     return ERROR_SUCCESS;
 }
 
@@ -2118,7 +2263,7 @@
                     version = HeapAlloc(GetProcessHeap(),0,versize);
                     GetFileVersionInfoW(file->TargetPath, 0, versize, version);
 
-                    VerQueryValueW(version, name, (LPVOID*)&lpVer, &sz);
+                    VerQueryValueW(version, (LPWSTR) name, (LPVOID*)&lpVer, &sz);
 
                     sprintfW(filever,name_fmt,
                         HIWORD(lpVer->dwFileVersionMS),
@@ -3504,9 +3649,8 @@
                        debugstr_w(package->files[index].TargetPath));
             }
 
-            if (ptLib){
+            if (ptLib)
                 ITypeLib_Release(ptLib);
-                }
         }
         else
             ERR("Failed to load type library %s\n",

reactos/lib/msi
msi.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- msi.c	3 Dec 2004 06:21:44 -0000	1.2
+++ msi.c	7 Dec 2004 08:13:01 -0000	1.3
@@ -1395,7 +1395,7 @@
           lpVersionBuf, pcchVersionBuf?*pcchVersionBuf:0,
           lpLangBuf, pcchLangBuf?*pcchLangBuf:0);
 
-    dwVerLen = GetFileVersionInfoSizeW(szFilePath, NULL);
+    dwVerLen = GetFileVersionInfoSizeW( (LPWSTR) szFilePath, NULL);
     if(!dwVerLen)
         return GetLastError();
 
@@ -1405,12 +1405,12 @@
         goto end;
     }
 
-    if(!GetFileVersionInfoW(szFilePath, 0, dwVerLen, lpVer)) {
+    if(!GetFileVersionInfoW((LPWSTR) szFilePath, 0, dwVerLen, lpVer)) {
         ret = GetLastError();
         goto end;
     }
     if(lpVersionBuf && pcchVersionBuf && *pcchVersionBuf) {
-        if(VerQueryValueW(lpVer, szVersionResource, (LPVOID*)&ffi, &puLen) && puLen > 0) {
+        if(VerQueryValueW(lpVer, (LPWSTR) 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
suminfo.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- suminfo.c	30 Nov 2004 19:10:50 -0000	1.1
+++ suminfo.c	7 Dec 2004 08:13:01 -0000	1.2
@@ -118,6 +118,7 @@
     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.1 -> 1.2
diff -u -r1.1 -r1.2
--- table.c	30 Nov 2004 19:10:50 -0000	1.1
+++ table.c	7 Dec 2004 08:13:01 -0000	1.2
@@ -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);

reactos/lib/msi
winehq2ros.patch 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- winehq2ros.patch	30 Nov 2004 19:10:50 -0000	1.1
+++ winehq2ros.patch	7 Dec 2004 08:13:01 -0000	1.2
@@ -1,19 +1,44 @@
-Only in /root/wine/wine/dlls/msi: .cvsignore
-Only in /root/wine/wine/dlls/msi: CVS
+Only in ./: ,
+Only in /root/wine/wine/dlls/msi/: .#action.c.1.39
+diff -u /root/wine/wine/dlls/msi/.cvsignore ./.cvsignore
+--- /root/wine/wine/dlls/msi/.cvsignore	2004-05-18 15:41:47.000000000 -0500
++++ ./.cvsignore	2004-12-02 14:11:19.000000000 -0600
+@@ -1,8 +1,11 @@
+-Makefile
+-cond.tab.c
+-cond.tab.h
+-msi.dll.dbg.c
++*.coff
++*.dll
++*.d
++*.a
++*.o
++*.sym
++*.map
++*.tmp
++Makefile.ros
+ msi.spec.def
+-sql.tab.c
+-sql.tab.h
+-version.res
++msi.stubs.c
+Only in ./: .cvsignore~
+Common subdirectories: /root/wine/wine/dlls/msi/CVS and ./CVS
 Only in ./: Makefile
 Only in ./: Makefile.ros-template
 diff -u /root/wine/wine/dlls/msi/action.c ./action.c
---- /root/wine/wine/dlls/msi/action.c	2004-10-27 20:43:05.000000000 -0500
-+++ ./action.c	2004-10-30 12:14:17.000000000 -0500
-@@ -28,6 +28,7 @@
+--- /root/wine/wine/dlls/msi/action.c	2004-12-06 00:10:02.000000000 -0600
++++ ./action.c	2004-12-07 01:19:47.000000000 -0600
+@@ -28,7 +28,7 @@
  
  #include <stdarg.h>
  #include <stdio.h>
+-
 +#include <fcntl.h>
- 
  #define COBJMACROS
  
-@@ -39,7 +40,7 @@
+ #include "windef.h"
+@@ -39,7 +39,7 @@
  #include "fdi.h"
  #include "msi.h"
  #include "msiquery.h"
@@ -22,40 +47,70 @@
  #include "objbase.h"
  #include "objidl.h"
  #include "msipriv.h"
-@@ -3477,7 +3478,7 @@
-             continue;
-         }
- 
--        res = LoadTypeLib(package->files[index].TargetPath,&ptLib);
-+//        res = LoadTypeLib(package->files[index].TargetPath,&ptLib);
-         if (SUCCEEDED(res))
-         {
-             WCHAR help[MAX_PATH];
-@@ -3488,7 +3489,7 @@
- 
-             resolve_folder(package,helpid,help,FALSE,FALSE,NULL);
- 
--            res = RegisterTypeLib(ptLib,package->files[index].TargetPath,help);
-+//            res = RegisterTypeLib(ptLib,package->files[index].TargetPath,help);
-             if (!SUCCEEDED(res))
-                 ERR("Failed to register type library %s\n",
-                      debugstr_w(package->files[index].TargetPath));
-@@ -3503,8 +3504,9 @@
-                        debugstr_w(package->files[index].TargetPath));
-             }
- 
--            if (ptLib)
--                ITypeLib_Release(ptLib);
-+            if (ptLib){
-+                //ITypeLib_Release(ptLib);
-+                }
-         }
-         else
-             ERR("Failed to load type library %s\n",
+@@ -2263,7 +2263,7 @@
+                     version = HeapAlloc(GetProcessHeap(),0,versize);
+                     GetFileVersionInfoW(file->TargetPath, 0, versize, version);
+ 
+-                    VerQueryValueW(version, name, (LPVOID*)&lpVer, &sz);
++                    VerQueryValueW(version, (LPWSTR) name, (LPVOID*)&lpVer, &sz);
+ 
+                     sprintfW(filever,name_fmt,
+                         HIWORD(lpVer->dwFileVersionMS),
+diff -u /root/wine/wine/dlls/msi/msi.c ./msi.c
+--- /root/wine/wine/dlls/msi/msi.c	2004-10-18 13:20:12.000000000 -0500
++++ ./msi.c	2004-12-07 00:24:30.000000000 -0600
+@@ -40,6 +40,9 @@
+ 
+ #include "initguid.h"
+ 
++UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf, DWORD* pcchVersionBuf, LPWSTR lpLangBuf, DWORD* pcchLangBuf);
++
++
+ WINE_DEFAULT_DEBUG_CHANNEL(msi);
+ 
+ /*
+@@ -1392,7 +1395,7 @@
+           lpVersionBuf, pcchVersionBuf?*pcchVersionBuf:0,
+           lpLangBuf, pcchLangBuf?*pcchLangBuf:0);
+ 
+-    dwVerLen = GetFileVersionInfoSizeW(szFilePath, NULL);
++    dwVerLen = GetFileVersionInfoSizeW( (LPWSTR) szFilePath, NULL);
+     if(!dwVerLen)
+         return GetLastError();
+ 
+@@ -1402,12 +1405,12 @@
+         goto end;
+     }
+ 
+-    if(!GetFileVersionInfoW(szFilePath, 0, dwVerLen, lpVer)) {
++    if(!GetFileVersionInfoW((LPWSTR) szFilePath, 0, dwVerLen, lpVer)) {
+         ret = GetLastError();
+         goto end;
+     }
+     if(lpVersionBuf && pcchVersionBuf && *pcchVersionBuf) {
+-        if(VerQueryValueW(lpVer, szVersionResource, (LPVOID*)&ffi, &puLen) && puLen > 0) {
++        if(VerQueryValueW(lpVer, (LPWSTR) 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);
 Only in ./: patch.diff
+diff -u /root/wine/wine/dlls/msi/record.c ./record.c
+--- /root/wine/wine/dlls/msi/record.c	2004-12-07 00:09:28.000000000 -0600
++++ ./record.c	2004-10-21 16:00:54.000000000 -0500
+@@ -534,10 +534,7 @@
+     count = 0;
+     r = IStream_Read( stm, buf, *sz, &count );
+     if( FAILED( r ) )
+-    {
+-        *sz = 0;
+         return ERROR_FUNCTION_FAILED;
+-    }
+ 
+     *sz = count;
+ 
 diff -u /root/wine/wine/dlls/msi/suminfo.c ./suminfo.c
 --- /root/wine/wine/dlls/msi/suminfo.c	2004-10-18 13:20:12.000000000 -0500
-+++ ./suminfo.c	2004-10-30 00:09:12.000000000 -0500
++++ ./suminfo.c	2004-12-07 00:58:14.000000000 -0600
 @@ -23,6 +23,8 @@
  #define COBJMACROS
  #define NONAMELESSUNION
@@ -65,3 +120,12 @@
  #include "windef.h"
  #include "winbase.h"
  #include "winreg.h"
+@@ -116,6 +118,7 @@
+     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 ) )
+     {
+Only in ./: winehq2ros.patch
CVSspam 0.2.8