From 9c76b14469b97d5a2fccf9382aa5cade6a063d64 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Wed, 14 Jul 2004 21:43:49 +0000 Subject: [PATCH] Implement the functionality that allows one to call MsiOpenPackage with #nnn where nnn is a string representing the handle to an open database. --- dlls/msi/package.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 287209008ed..3774f98380c 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -378,9 +378,17 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) TRACE("%s %p\n",debugstr_w(szPackage), pPackage); - rc = MSI_OpenDatabaseW(szPackage, MSIDBOPEN_READONLY, &db); - if (rc != ERROR_SUCCESS) - return ERROR_FUNCTION_FAILED; + if (szPackage[0] == '#') + { + INT handle = atoiW(&szPackage[1]); + db = msihandle2msiinfo( handle , MSIHANDLETYPE_DATABASE); + } + else + { + rc = MSI_OpenDatabaseW(szPackage, MSIDBOPEN_READONLY, &db); + if (rc != ERROR_SUCCESS) + return ERROR_FUNCTION_FAILED; + } package = alloc_msiobject( MSIHANDLETYPE_PACKAGE, sizeof (MSIPACKAGE), MSI_FreePackage );