diff options
Diffstat (limited to 'libmsi')
-rw-r--r-- | libmsi/database.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libmsi/database.c b/libmsi/database.c index 1ba8bf6..31419ee 100644 --- a/libmsi/database.c +++ b/libmsi/database.c @@ -175,6 +175,9 @@ unsigned msi_create_storage( LibmsiDatabase *db, const WCHAR *stname, IStream *s HRESULT hr; unsigned r; + if ( db->mode == LIBMSI_DB_OPEN_READONLY ) + return LIBMSI_RESULT_ACCESS_DENIED; + LIST_FOR_EACH_ENTRY( storage, &db->storages, LibmsiStorage, entry ) { if( !strcmpW( stname, storage->name ) ) @@ -348,6 +351,9 @@ unsigned msi_create_stream( LibmsiDatabase *db, const WCHAR *stname, IStream *st unsigned count; uint8_t *data; + if ( db->mode == LIBMSI_DB_OPEN_READONLY ) + return LIBMSI_RESULT_ACCESS_DENIED; + encname = encode_streamname(false, stname); LIST_FOR_EACH_ENTRY( stream, &db->streams, LibmsiStream, entry ) { |