[WINESYNC] msi: Return ERROR_INVALID_HANDLE when MsiOpenPackage() is called from a custom action.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id b2d3567c1b4846905f01612d8f499f45ed9d24ac by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
winesync 2022-03-13 01:21:42 +01:00 committed by Mark Jansen
parent df4fa37bf9
commit b720e4c0e2
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
2 changed files with 3 additions and 13 deletions

View file

@ -1471,18 +1471,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
if( szPackage[0] == '#' )
{
handle = atoiW(&szPackage[1]);
db = msihandle2msiinfo( handle, MSIHANDLETYPE_DATABASE );
if( !db )
{
MSIHANDLE remote;
if (!(remote = msi_get_remote(handle)))
return ERROR_INVALID_HANDLE;
WARN("MsiOpenPackage not allowed during a custom action!\n");
return ERROR_FUNCTION_FAILED;
}
if (!(db = msihandle2msiinfo(handle, MSIHANDLETYPE_DATABASE)))
return ERROR_INVALID_HANDLE;
}
else
{

View file

@ -1154,7 +1154,7 @@ static void test_invalid_functions(MSIHANDLE hinst)
sprintf(package_name, "#%u", db);
r = MsiOpenPackageA(package_name, &package);
todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
MsiCloseHandle(db);
}