MsiOpenDatabase's szPersist parameter may be a string or a bitmask.

This commit is contained in:
Mike McCormack 2003-11-05 01:50:19 +00:00 committed by Alexandre Julliard
parent 16ff6689df
commit bd9d8a32e4

View File

@ -149,7 +149,7 @@ UINT WINAPI MsiOpenDatabaseA(
MultiByteToWideChar( CP_ACP, 0, szDBPath, -1, szwDBPath, len ); MultiByteToWideChar( CP_ACP, 0, szDBPath, -1, szwDBPath, len );
} }
if( szPersist ) if( HIWORD(szPersist) )
{ {
len = MultiByteToWideChar( CP_ACP, 0, szPersist, -1, NULL, 0 ); len = MultiByteToWideChar( CP_ACP, 0, szPersist, -1, NULL, 0 );
szwPersist = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); szwPersist = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
@ -157,6 +157,8 @@ UINT WINAPI MsiOpenDatabaseA(
goto end; goto end;
MultiByteToWideChar( CP_ACP, 0, szPersist, -1, szwPersist, len ); MultiByteToWideChar( CP_ACP, 0, szPersist, -1, szwPersist, len );
} }
else
szwPersist = (LPWSTR) szPersist;
r = MsiOpenDatabaseW( szwDBPath, szwPersist, phDB ); r = MsiOpenDatabaseW( szwDBPath, szwPersist, phDB );