Author: cwittich
Date: Sun Jan 18 03:03:44 2009
New Revision: 38876
URL:
http://svn.reactos.org/svn/reactos?rev=38876&view=rev
Log:
sync msi_winetest with wine 1.1.13
Modified:
trunk/rostests/winetests/msi/automation.c
trunk/rostests/winetests/msi/db.c
trunk/rostests/winetests/msi/format.c
trunk/rostests/winetests/msi/install.c
trunk/rostests/winetests/msi/msi.c
trunk/rostests/winetests/msi/package.c
trunk/rostests/winetests/msi/source.c
Modified: trunk/rostests/winetests/msi/automation.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/automation.…
==============================================================================
--- trunk/rostests/winetests/msi/automation.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/automation.c [iso-8859-1] Sun Jan 18 03:03:44 2009
@@ -594,7 +594,7 @@
ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n",
hr);
/* Test getting ID of a function name that does exist */
- name = (WCHAR *)szOpenPackage;
+ name = szOpenPackage;
hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1,
LOCALE_USER_DEFAULT, &dispid);
ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
@@ -638,7 +638,7 @@
ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n",
hr);
/* Test invoking a read-only property as DISPATCH_PROPERTYPUT or as a DISPATCH_METHOD
*/
- name = (WCHAR *)szProductState;
+ name = szProductState;
hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1,
LOCALE_USER_DEFAULT, &dispid);
ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
@@ -723,7 +723,7 @@
VariantInit(&vararg[2]);
V_VT(&vararg[2]) = VT_I4;
- V_I4(&vararg[2]) = (int)hkey;
+ V_I4(&vararg[2]) = (INT_PTR)hkey;
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_BSTR;
V_BSTR(&vararg[1]) = SysAllocString(szKey);
@@ -2401,7 +2401,7 @@
}
/* Installer::OpenDatabase */
- hr = Installer_OpenDatabase(szPath, (int)MSIDBOPEN_TRANSACT, &pDatabase);
+ hr = Installer_OpenDatabase(szPath, (INT_PTR)MSIDBOPEN_TRANSACT, &pDatabase);
ok(hr == S_OK, "Installer_OpenDatabase failed, hresult 0x%08x\n", hr);
if (hr == S_OK)
{
Modified: trunk/rostests/winetests/msi/db.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/db.c?rev=38…
==============================================================================
--- trunk/rostests/winetests/msi/db.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/db.c [iso-8859-1] Sun Jan 18 03:03:44 2009
@@ -2347,7 +2347,7 @@
CHAR szPackage[10];
MSIHANDLE hPackage;
- sprintf(szPackage,"#%li",hdb);
+ sprintf(szPackage,"#%i",hdb);
res = MsiOpenPackage(szPackage,&hPackage);
if (res != ERROR_SUCCESS)
return 0;
@@ -5742,14 +5742,13 @@
static void read_file_data(LPCSTR filename, LPSTR buffer)
{
- OFSTRUCT ofs;
- HFILE file;
+ HANDLE file;
DWORD read;
- file = OpenFile(filename, &ofs, OF_READ);
+ file = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0,
NULL );
ZeroMemory(buffer, MAX_PATH);
- ReadFile((HANDLE)file, buffer, MAX_PATH, &read, NULL);
- CloseHandle((HANDLE)file);
+ ReadFile(file, buffer, MAX_PATH, &read, NULL);
+ CloseHandle(file);
}
static void test_forcecodepage(void)
@@ -6175,7 +6174,7 @@
r = add_custom_action_entry(hdb, "'SetProp', 51, 'MYPROP',
'grape'");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- sprintf(package, "#%li", hdb);
+ sprintf(package, "#%i", hdb);
r = MsiOpenPackage(package, &hpkg);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
@@ -6234,7 +6233,7 @@
r = add_custom_action_entry(hdb, "'SetProp', 51, 'MYPROP',
'grape'");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- sprintf(package, "#%li", hdb);
+ sprintf(package, "#%i", hdb);
r = MsiOpenPackage(package, &hpkg);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
Modified: trunk/rostests/winetests/msi/format.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/format.c?re…
==============================================================================
--- trunk/rostests/winetests/msi/format.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/format.c [iso-8859-1] Sun Jan 18 03:03:44 2009
@@ -228,7 +228,7 @@
CHAR szPackage[10];
MSIHANDLE hPackage;
- sprintf(szPackage,"#%li",hdb);
+ sprintf(szPackage,"#%i",hdb);
res = MsiOpenPackage(szPackage,&hPackage);
ok( res == ERROR_SUCCESS , "Failed to open package\n" );
@@ -303,7 +303,7 @@
res = MsiCloseHandle( suminfo);
ok( res == ERROR_SUCCESS , "Failed to close suminfo\n" );
- sprintf(szPackage,"#%li",hdb);
+ sprintf(szPackage,"#%i",hdb);
res = MsiOpenPackage(szPackage,&hPackage);
ok( res == ERROR_SUCCESS , "Failed to open package\n" );
Modified: trunk/rostests/winetests/msi/install.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/install.c?r…
==============================================================================
--- trunk/rostests/winetests/msi/install.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/install.c [iso-8859-1] Sun Jan 18 03:03:44 2009
@@ -1211,34 +1211,34 @@
/* the FCI callbacks */
-static void *mem_alloc(ULONG cb)
+static void * CDECL mem_alloc(ULONG cb)
{
return HeapAlloc(GetProcessHeap(), 0, cb);
}
-static void mem_free(void *memory)
+static void CDECL mem_free(void *memory)
{
HeapFree(GetProcessHeap(), 0, memory);
}
-static BOOL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
+static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv)
{
sprintf(pccab->szCab, pv, pccab->iCab);
return TRUE;
}
-static long progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
+static LONG CDECL progress(UINT typeStatus, ULONG cb1, ULONG cb2, void *pv)
{
return 0;
}
-static int file_placed(PCCAB pccab, char *pszFile, long cbFile,
- BOOL fContinuation, void *pv)
+static int CDECL file_placed(PCCAB pccab, char *pszFile, LONG cbFile,
+ BOOL fContinuation, void *pv)
{
return 0;
}
-static INT_PTR fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
+static INT_PTR CDECL fci_open(char *pszFile, int oflag, int pmode, int *err, void *pv)
{
HANDLE handle;
DWORD dwAccess = 0;
@@ -1262,7 +1262,7 @@
return (INT_PTR)handle;
}
-static UINT fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
+static UINT CDECL fci_read(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
{
HANDLE handle = (HANDLE)hf;
DWORD dwRead;
@@ -1274,7 +1274,7 @@
return dwRead;
}
-static UINT fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
+static UINT CDECL fci_write(INT_PTR hf, void *memory, UINT cb, int *err, void *pv)
{
HANDLE handle = (HANDLE)hf;
DWORD dwWritten;
@@ -1286,7 +1286,7 @@
return dwWritten;
}
-static int fci_close(INT_PTR hf, int *err, void *pv)
+static int CDECL fci_close(INT_PTR hf, int *err, void *pv)
{
HANDLE handle = (HANDLE)hf;
ok(CloseHandle(handle), "Failed to CloseHandle\n");
@@ -1294,7 +1294,7 @@
return 0;
}
-static long fci_seek(INT_PTR hf, long dist, int seektype, int *err, void *pv)
+static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *pv)
{
HANDLE handle = (HANDLE)hf;
DWORD ret;
@@ -1305,7 +1305,7 @@
return ret;
}
-static int fci_delete(char *pszFile, int *err, void *pv)
+static int CDECL fci_delete(char *pszFile, int *err, void *pv)
{
BOOL ret = DeleteFileA(pszFile);
ok(ret, "Failed to DeleteFile %s\n", pszFile);
@@ -1362,7 +1362,7 @@
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
size = sizeof(buf);
- GetTokenInformation(token, TokenUser, (void *)buf, size, &size);
+ GetTokenInformation(token, TokenUser, buf, size, &size);
user = (PTOKEN_USER)buf;
pConvertSidToStringSidA(user->User.Sid, usersid);
}
@@ -1378,7 +1378,7 @@
return (r == ERROR_SUCCESS ) && !strcmp(val, buffer);
}
-static BOOL get_temp_file(char *pszTempName, int cbTempName, void *pv)
+static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv)
{
LPSTR tempname;
@@ -1397,8 +1397,8 @@
return FALSE;
}
-static INT_PTR get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
- USHORT *pattribs, int *err, void *pv)
+static INT_PTR CDECL get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
+ USHORT *pattribs, int *err, void *pv)
{
BY_HANDLE_FILE_INFORMATION finfo;
FILETIME filetime;
Modified: trunk/rostests/winetests/msi/msi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/msi.c?rev=3…
==============================================================================
--- trunk/rostests/winetests/msi/msi.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/msi.c [iso-8859-1] Sun Jan 18 03:03:44 2009
@@ -505,7 +505,7 @@
hr = CoCreateGuid(&guid);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
- size = StringFromGUID2(&guid, (LPOLESTR)guidW, MAX_PATH);
+ size = StringFromGUID2(&guid, guidW, MAX_PATH);
ok(size == 39, "Expected 39, got %d\n", hr);
WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
@@ -522,7 +522,7 @@
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
size = sizeof(buf);
- GetTokenInformation(token, TokenUser, (void *)buf, size, &size);
+ GetTokenInformation(token, TokenUser, buf, size, &size);
user = (PTOKEN_USER)buf;
pConvertSidToStringSidA(user->User.Sid, usersid);
}
@@ -794,7 +794,7 @@
hr = CoCreateGuid(&guid);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
- size = StringFromGUID2(&guid, (LPOLESTR)guidW, MAX_PATH);
+ size = StringFromGUID2(&guid, guidW, MAX_PATH);
ok(size == 39, "Expected 39, got %d\n", hr);
WideCharToMultiByte(CP_ACP, 0, guidW, size, component, MAX_PATH, NULL, NULL);
@@ -1760,7 +1760,6 @@
RegDeleteKeyA(compkey, "");
RegCloseKey(prodkey);
RegCloseKey(compkey);
- RegCloseKey(installprop);
DeleteFileA("C:\\imapath");
lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\");
@@ -1919,9 +1918,6 @@
r = MsiGetProductCodeA(component, product);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(product, prodcode), "Expected %s, got %s\n", prodcode,
product);
-
- RegDeleteKeyA(prodkey, "");
- RegCloseKey(prodkey);
RegDeleteKeyA(prodkey, "");
RegCloseKey(prodkey);
@@ -7368,9 +7364,12 @@
/* LocalPackage has just the package name */
hprod = 0xdeadbeef;
r = MsiOpenProductA(prodcode, &hprod);
- ok(r == ERROR_INSTALL_PACKAGE_OPEN_FAILED,
- "Expected ERROR_INSTALL_PACKAGE_OPEN_FAILED, got %d\n", r);
- ok(hprod == 0xdeadbeef, "Expected hprod to be unchanged\n");
+ ok(r == ERROR_INSTALL_PACKAGE_OPEN_FAILED || r == ERROR_SUCCESS,
+ "Expected ERROR_INSTALL_PACKAGE_OPEN_FAILED or ERROR_SUCCESS, got %d\n",
r);
+ if (r == ERROR_SUCCESS)
+ MsiCloseHandle(hprod);
+ else
+ ok(hprod == 0xdeadbeef, "Expected hprod to be unchanged\n");
lstrcpyA(val, path);
lstrcatA(val, "\\winetest.msi");
Modified: trunk/rostests/winetests/msi/package.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/package.c?r…
==============================================================================
--- trunk/rostests/winetests/msi/package.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/package.c [iso-8859-1] Sun Jan 18 03:03:44 2009
@@ -48,7 +48,7 @@
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
size = sizeof(buf);
- GetTokenInformation(token, TokenUser, (void *)buf, size, &size);
+ GetTokenInformation(token, TokenUser, buf, size, &size);
user = (PTOKEN_USER)buf;
pConvertSidToStringSidA(user->User.Sid, usersid);
}
@@ -160,7 +160,7 @@
hr = CoCreateGuid(&guid);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
- size = StringFromGUID2(&guid, (LPOLESTR)guidW, MAX_PATH);
+ size = StringFromGUID2(&guid, guidW, MAX_PATH);
ok(size == 39, "Expected 39, got %d\n", hr);
WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
@@ -665,7 +665,7 @@
CHAR szPackage[10];
MSIHANDLE hPackage;
- sprintf(szPackage,"#%li",hdb);
+ sprintf(szPackage,"#%i",hdb);
res = MsiOpenPackage(szPackage,&hPackage);
if (res != ERROR_SUCCESS)
return 0;
@@ -2116,7 +2116,7 @@
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* database exists, but is emtpy */
- sprintf(name, "#%ld", hdb);
+ sprintf(name, "#%d", hdb);
r = MsiOpenPackage(name, &hpack);
ok(r == ERROR_INSTALL_PACKAGE_INVALID,
"Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
@@ -2134,7 +2134,7 @@
ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
/* a few key tables exist */
- sprintf(name, "#%ld", hdb);
+ sprintf(name, "#%d", hdb);
r = MsiOpenPackage(name, &hpack);
ok(r == ERROR_INSTALL_PACKAGE_INVALID,
"Expected ERROR_INSTALL_PACKAGE_INVALID, got %d\n", r);
@@ -2146,7 +2146,7 @@
r = MsiOpenDatabase(msifile, MSIDBOPEN_CREATE, &hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- sprintf(name, "#%ld", hdb);
+ sprintf(name, "#%d", hdb);
/* The following summary information props must exist:
* - PID_REVNUMBER
@@ -8888,7 +8888,7 @@
r = add_directory_entry(hdb, "'TARGETDIR', '',
'SourceDir'");
ok(r == S_OK, "failed\n");
- sprintf(package, "#%li", hdb);
+ sprintf(package, "#%i", hdb);
r = MsiOpenPackage(package, &hpkg);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
@@ -8997,7 +8997,7 @@
MsiCloseHandle(hpkg);
/* reset the package state */
- sprintf(package, "#%li", hdb);
+ sprintf(package, "#%i", hdb);
r = MsiOpenPackage(package, &hpkg);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
@@ -9585,6 +9585,13 @@
lstrcatA(keypath, prod_squashed);
res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &userkey);
+ if (res == ERROR_ACCESS_DENIED)
+ {
+ skip("Not enough rights to perform tests\n");
+ RegDeleteKeyA(prodkey, "");
+ RegCloseKey(prodkey);
+ return;
+ }
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
res = RegCreateKeyA(userkey, "InstallProperties", &props);
Modified: trunk/rostests/winetests/msi/source.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/source.c?re…
==============================================================================
--- trunk/rostests/winetests/msi/source.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/msi/source.c [iso-8859-1] Sun Jan 18 03:03:44 2009
@@ -114,7 +114,7 @@
hr = CoCreateGuid(&guid);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
- size = StringFromGUID2(&guid, (LPOLESTR)guidW, MAX_PATH);
+ size = StringFromGUID2(&guid, guidW, MAX_PATH);
ok(size == 39, "Expected 39, got %d\n", hr);
WideCharToMultiByte(CP_ACP, 0, guidW, size, prodcode, MAX_PATH, NULL, NULL);
@@ -136,7 +136,7 @@
if (!rc && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
return 0;
size = sizeof(buf);
- GetTokenInformation(token, TokenUser, (void *)buf, size, &size);
+ GetTokenInformation(token, TokenUser, buf, size, &size);
user = (PTOKEN_USER)buf;
pConvertSidToStringSidA(user->User.Sid, usersid);
return 1;