Code cleanup and sink with WindHq CVS.

svn path=/trunk/; revision=11971
This commit is contained in:
James Tabor 2004-12-07 08:13:01 +00:00
parent 12c35f6b5a
commit 2899606a4b
5 changed files with 254 additions and 45 deletions

View file

@ -29,7 +29,6 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/stand
#include <stdarg.h>
#include <stdio.h>
#include <fcntl.h>
#define COBJMACROS
#include "windef.h"
@ -158,6 +157,12 @@ static UINT HANDLE_CustomType1(MSIPACKAGE *package, const LPWSTR source,
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 @@ static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran)
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 @@ static UINT ACTION_ProcessUISequence(MSIPACKAGE *package)
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 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
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 @@ static UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action)
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 UINT HANDLE_CustomType2(MSIPACKAGE *package, const LPWSTR source,
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 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, const LPWSTR source,
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 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
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 @@ static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package)
debugstr_w(package->files[index].TargetPath));
}
if (ptLib){
if (ptLib)
ITypeLib_Release(ptLib);
}
}
else
ERR("Failed to load type library %s\n",

View file

@ -1395,7 +1395,7 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf, DWORD* p
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 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf, DWORD* p
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);

View file

@ -118,6 +118,7 @@ UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase,
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 ) )
{

View file

@ -466,8 +466,8 @@ UINT read_table_from_storage( MSIDATABASE *db, LPCWSTR name, MSITABLE **ptable)
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);

View file

@ -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 @@ diff -u /root/wine/wine/dlls/msi/action.c ./action.c
#include "objbase.h"
#include "objidl.h"
#include "msipriv.h"
@@ -3477,7 +3478,7 @@
continue;
}
@@ -2263,7 +2263,7 @@
version = HeapAlloc(GetProcessHeap(),0,versize);
GetFileVersionInfoW(file->TargetPath, 0, versize, version);
- 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 @@
- VerQueryValueW(version, name, (LPVOID*)&lpVer, &sz);
+ VerQueryValueW(version, (LPWSTR) name, (LPVOID*)&lpVer, &sz);
resolve_folder(package,helpid,help,FALSE,FALSE,NULL);
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 @@
- 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));
}
#include "initguid.h"
- if (ptLib)
- ITypeLib_Release(ptLib);
+ if (ptLib){
+ //ITypeLib_Release(ptLib);
+ }
}
else
ERR("Failed to load type library %s\n",
+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 @@ diff -u /root/wine/wine/dlls/msi/suminfo.c ./suminfo.c
#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