diff --git a/dlls/msi/database.c b/dlls/msi/database.c index 4da53381cf..9d3f7d6d77 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -344,3 +344,20 @@ end: return r; } + +MSIDBSTATE WINAPI MsiGetDatabaseState( MSIHANDLE handle ) +{ + MSIDBSTATE ret = MSIDBSTATE_READ; + MSIDATABASE *db; + + TRACE("%ld\n", handle); + + db = msihandle2msiinfo( handle, MSIHANDLETYPE_DATABASE ); + if (!db) + return MSIDBSTATE_ERROR; + if (db->mode != MSIDBOPEN_READONLY ) + ret = MSIDBSTATE_WRITE; + msiobj_release( &db->hdr ); + + return ret; +} diff --git a/dlls/msi/msi.spec b/dlls/msi/msi.spec index 802adefa6b..7c0ea819b4 100644 --- a/dlls/msi/msi.spec +++ b/dlls/msi/msi.spec @@ -45,7 +45,7 @@ 49 stdcall MsiGetActiveDatabase(long) 50 stdcall MsiGetComponentStateA(long str ptr ptr) 51 stdcall MsiGetComponentStateW(long wstr ptr ptr) -52 stub MsiGetDatabaseState +52 stdcall MsiGetDatabaseState(long) 53 stub MsiGetFeatureCostA 54 stub MsiGetFeatureCostW 55 stub MsiGetFeatureInfoA diff --git a/include/msiquery.h b/include/msiquery.h index 09e5c16e3d..c85ca1c50a 100644 --- a/include/msiquery.h +++ b/include/msiquery.h @@ -127,6 +127,13 @@ typedef enum tagMSIDBERROR MSIDBERROR_BADLOCALIZEATTRIB = 29 } MSIDBERROR; +typedef enum tagMSIDBSTATE +{ + MSIDBSTATE_ERROR = -1, + MSIDBSTATE_READ = 0, + MSIDBSTATE_WRITE = 1 +} MSIDBSTATE; + /* view manipulation */ UINT WINAPI MsiViewFetch(MSIHANDLE,MSIHANDLE*); UINT WINAPI MsiViewExecute(MSIHANDLE,MSIHANDLE); @@ -138,6 +145,8 @@ MSIDBERROR WINAPI MsiViewGetErrorA(MSIHANDLE,LPSTR,DWORD*); MSIDBERROR WINAPI MsiViewGetErrorW(MSIHANDLE,LPWSTR,DWORD*); #define MsiViewGetError WINELIB_NAME_AW(MsiViewGetError) +MSIDBSTATE WINAPI MsiGetDatabaseState(MSIHANDLE); + /* record manipulation */ MSIHANDLE WINAPI MsiCreateRecord(unsigned int); UINT WINAPI MsiRecordClearData(MSIHANDLE);