mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 5baadda536172d6713fa6fef1196dc2baa773904
This commit is contained in:
parent
01adefa75c
commit
3d08d08fda
@ -1,202 +0,0 @@
|
||||
From 1ef6c34bd97f4cb0bb9c2c8a0ac5e8f3f05460c7 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
|
||||
Date: Tue, 15 Sep 2015 17:44:33 -0600
|
||||
Subject: [PATCH] msidb: Add stub tool for manipulating MSI databases.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@wine-staging.com>
|
||||
---
|
||||
configure.ac | 1 +
|
||||
programs/msidb/Makefile.in | 8 +++
|
||||
programs/msidb/main.c | 153 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 162 insertions(+)
|
||||
create mode 100644 programs/msidb/Makefile.in
|
||||
create mode 100644 programs/msidb/main.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 1f8ad92..9013441 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3878,6 +3878,7 @@ WINE_CONFIG_MAKEFILE(programs/ipconfig)
|
||||
WINE_CONFIG_MAKEFILE(programs/lodctr)
|
||||
WINE_CONFIG_MAKEFILE(programs/mofcomp)
|
||||
WINE_CONFIG_MAKEFILE(programs/mshta)
|
||||
+WINE_CONFIG_MAKEFILE(programs/msidb)
|
||||
WINE_CONFIG_MAKEFILE(programs/msiexec)
|
||||
WINE_CONFIG_MAKEFILE(programs/msinfo32)
|
||||
WINE_CONFIG_MAKEFILE(programs/net)
|
||||
diff --git a/programs/msidb/Makefile.in b/programs/msidb/Makefile.in
|
||||
new file mode 100644
|
||||
index 0000000..dae699c
|
||||
--- /dev/null
|
||||
+++ b/programs/msidb/Makefile.in
|
||||
@@ -0,0 +1,8 @@
|
||||
+MODULE = msidb.exe
|
||||
+APPMODE = -mconsole -municode
|
||||
+IMPORTS = msi
|
||||
+
|
||||
+C_SRCS = \
|
||||
+ main.c
|
||||
+
|
||||
+INSTALL_LIB = msidb.exe msidb
|
||||
diff --git a/programs/msidb/main.c b/programs/msidb/main.c
|
||||
new file mode 100644
|
||||
index 0000000..43cc519
|
||||
--- /dev/null
|
||||
+++ b/programs/msidb/main.c
|
||||
@@ -0,0 +1,153 @@
|
||||
+/*
|
||||
+ * msidb - command line tool for assembling MSI packages
|
||||
+ *
|
||||
+ * Copyright 2015 Erich E. Hoover
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#define WIN32_LEAN_AND_MEAN
|
||||
+
|
||||
+#include <stdlib.h>
|
||||
+#include <windows.h>
|
||||
+#include <msi.h>
|
||||
+#include <msiquery.h>
|
||||
+
|
||||
+#include "wine/debug.h"
|
||||
+#include "wine/unicode.h"
|
||||
+
|
||||
+WINE_DEFAULT_DEBUG_CHANNEL(msidb);
|
||||
+
|
||||
+struct msidb_state
|
||||
+{
|
||||
+ WCHAR *database_file;
|
||||
+ WCHAR *table_folder;
|
||||
+ MSIHANDLE database_handle;
|
||||
+ BOOL create_database;
|
||||
+};
|
||||
+
|
||||
+static void show_usage( void )
|
||||
+{
|
||||
+ WINE_MESSAGE(
|
||||
+ "Usage: msidb [OPTION]...[OPTION]...\n"
|
||||
+ "Options:\n"
|
||||
+ " -? Show this usage message and exit.\n"
|
||||
+ " -c Create database file (instead of opening existing file).\n"
|
||||
+ " -d package.msi Path to the database file.\n"
|
||||
+ " -f folder Folder in which to open/save the tables.\n"
|
||||
+ );
|
||||
+}
|
||||
+
|
||||
+static int valid_state( struct msidb_state *state )
|
||||
+{
|
||||
+ if (state->database_file == NULL)
|
||||
+ {
|
||||
+ FIXME( "GUI operation is not currently supported.\n" );
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (state->table_folder == NULL)
|
||||
+ {
|
||||
+ ERR( "No table folder specified (-f option).\n" );
|
||||
+ show_usage();
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int process_argument( struct msidb_state *state, int i, int argc, WCHAR *argv[] )
|
||||
+{
|
||||
+ /* msidb accepts either "-" or "/" style flags */
|
||||
+ if (strlenW(argv[i]) != 2 || (argv[i][0] != '-' && argv[i][0] != '/'))
|
||||
+ {
|
||||
+ WINE_FIXME( "Table names are not currently supported.\n" );
|
||||
+ show_usage();
|
||||
+ exit( 1 );
|
||||
+ }
|
||||
+ switch( argv[i][1] )
|
||||
+ {
|
||||
+ case '?':
|
||||
+ show_usage();
|
||||
+ exit( 0 );
|
||||
+ case 'c':
|
||||
+ state->create_database = TRUE;
|
||||
+ return 1;
|
||||
+ case 'd':
|
||||
+ if (i + 1 >= argc) return 0;
|
||||
+ state->database_file = argv[i + 1];
|
||||
+ return 2;
|
||||
+ case 'f':
|
||||
+ if (i + 1 >= argc) return 0;
|
||||
+ state->table_folder = argv[i + 1];
|
||||
+ return 2;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ show_usage();
|
||||
+ exit( 1 );
|
||||
+}
|
||||
+
|
||||
+static int open_database( struct msidb_state *state )
|
||||
+{
|
||||
+ LPCWSTR db_mode = state->create_database ? MSIDBOPEN_CREATEDIRECT : MSIDBOPEN_DIRECT;
|
||||
+ UINT ret;
|
||||
+
|
||||
+ ret = MsiOpenDatabaseW( state->database_file, db_mode, &state->database_handle );
|
||||
+ if (ret != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ ERR( "Failed to open database '%s', error %d\n", wine_dbgstr_w(state->database_file), ret );
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static void close_database( struct msidb_state *state )
|
||||
+{
|
||||
+ UINT ret;
|
||||
+
|
||||
+ ret = MsiDatabaseCommit( state->database_handle );
|
||||
+ if (ret != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ ERR( "Failed to commit changes to database.\n" );
|
||||
+ return;
|
||||
+ }
|
||||
+ ret = MsiCloseHandle( state->database_handle );
|
||||
+ if (ret != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ WARN( "Failed to close database handle.\n" );
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int wmain( int argc, WCHAR *argv[] )
|
||||
+{
|
||||
+ struct msidb_state state;
|
||||
+ int i, n = 1;
|
||||
+
|
||||
+ memset( &state, 0x0, sizeof(state) );
|
||||
+ /* process and validate all the command line flags */
|
||||
+ for (i = 1; n && i < argc; i += n)
|
||||
+ n = process_argument( &state, i, argc, argv );
|
||||
+ if (!valid_state( &state ))
|
||||
+ return 1;
|
||||
+
|
||||
+ /* perform the requested operations */
|
||||
+ if (!open_database( &state ))
|
||||
+ {
|
||||
+ ERR( "Failed to open database '%s'.\n", wine_dbgstr_w(state.database_file) );
|
||||
+ return 1;
|
||||
+ }
|
||||
+ close_database( &state );
|
||||
+ return 0;
|
||||
+}
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,207 +0,0 @@
|
||||
From 293961de18ee7e91396cb0eae1728d82b837f38f Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
|
||||
Date: Wed, 16 Sep 2015 11:58:50 -0600
|
||||
Subject: msidb: Add support for importing database tables.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@wine-staging.com>
|
||||
---
|
||||
programs/msidb/main.c | 113 ++++++++++++++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 100 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/programs/msidb/main.c b/programs/msidb/main.c
|
||||
index 43cc519..c23e333 100644
|
||||
--- a/programs/msidb/main.c
|
||||
+++ b/programs/msidb/main.c
|
||||
@@ -27,26 +27,61 @@
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
+#include "wine/list.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msidb);
|
||||
|
||||
+struct msidb_listentry
|
||||
+{
|
||||
+ struct list entry;
|
||||
+ WCHAR *name;
|
||||
+};
|
||||
+
|
||||
struct msidb_state
|
||||
{
|
||||
WCHAR *database_file;
|
||||
WCHAR *table_folder;
|
||||
MSIHANDLE database_handle;
|
||||
BOOL create_database;
|
||||
+ BOOL import_tables;
|
||||
+ struct list table_list;
|
||||
};
|
||||
|
||||
+static void list_free( struct list *list )
|
||||
+{
|
||||
+ struct msidb_listentry *data, *next;
|
||||
+
|
||||
+ LIST_FOR_EACH_ENTRY_SAFE( data, next, list, struct msidb_listentry, entry )
|
||||
+ {
|
||||
+ list_remove( &data->entry );
|
||||
+ HeapFree( GetProcessHeap(), 0, data );
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void list_append( struct list *list, WCHAR *name )
|
||||
+{
|
||||
+ struct msidb_listentry *data;
|
||||
+
|
||||
+ data = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct msidb_listentry) );
|
||||
+ if (!data)
|
||||
+ {
|
||||
+ ERR( "Out of memory for list.\n" );
|
||||
+ exit( 1 );
|
||||
+ }
|
||||
+ data->name = name;
|
||||
+ list_add_tail( list, &data->entry );
|
||||
+}
|
||||
+
|
||||
static void show_usage( void )
|
||||
{
|
||||
WINE_MESSAGE(
|
||||
- "Usage: msidb [OPTION]...[OPTION]...\n"
|
||||
+ "Usage: msidb [OPTION]...[OPTION]... [TABLE]...[TABLE]\n"
|
||||
"Options:\n"
|
||||
" -? Show this usage message and exit.\n"
|
||||
" -c Create database file (instead of opening existing file).\n"
|
||||
" -d package.msi Path to the database file.\n"
|
||||
" -f folder Folder in which to open/save the tables.\n"
|
||||
+ " -i Import tables into database.\n"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -63,6 +98,17 @@ static int valid_state( struct msidb_state *state )
|
||||
show_usage();
|
||||
return 0;
|
||||
}
|
||||
+ if (!state->create_database && !state->import_tables)
|
||||
+ {
|
||||
+ ERR( "No mode flag specified (-c, -i).\n" );
|
||||
+ show_usage();
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (list_empty( &state->table_list ))
|
||||
+ {
|
||||
+ ERR( "No tables specified.\n" );
|
||||
+ return 0;
|
||||
+ }
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -70,11 +116,7 @@ static int process_argument( struct msidb_state *state, int i, int argc, WCHAR *
|
||||
{
|
||||
/* msidb accepts either "-" or "/" style flags */
|
||||
if (strlenW(argv[i]) != 2 || (argv[i][0] != '-' && argv[i][0] != '/'))
|
||||
- {
|
||||
- WINE_FIXME( "Table names are not currently supported.\n" );
|
||||
- show_usage();
|
||||
- exit( 1 );
|
||||
- }
|
||||
+ return 0;
|
||||
switch( argv[i][1] )
|
||||
{
|
||||
case '?':
|
||||
@@ -91,6 +133,9 @@ static int process_argument( struct msidb_state *state, int i, int argc, WCHAR *
|
||||
if (i + 1 >= argc) return 0;
|
||||
state->table_folder = argv[i + 1];
|
||||
return 2;
|
||||
+ case 'i':
|
||||
+ state->import_tables = TRUE;
|
||||
+ return 1;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -112,11 +157,14 @@ static int open_database( struct msidb_state *state )
|
||||
return 1;
|
||||
}
|
||||
|
||||
-static void close_database( struct msidb_state *state )
|
||||
+static void close_database( struct msidb_state *state, BOOL commit_changes )
|
||||
{
|
||||
- UINT ret;
|
||||
+ UINT ret = ERROR_SUCCESS;
|
||||
|
||||
- ret = MsiDatabaseCommit( state->database_handle );
|
||||
+ if (state->database_handle == 0)
|
||||
+ return;
|
||||
+ if (commit_changes)
|
||||
+ ret = MsiDatabaseCommit( state->database_handle );
|
||||
if (ret != ERROR_SUCCESS)
|
||||
{
|
||||
ERR( "Failed to commit changes to database.\n" );
|
||||
@@ -130,24 +178,63 @@ static void close_database( struct msidb_state *state )
|
||||
}
|
||||
}
|
||||
|
||||
+static int import_table( struct msidb_state *state, const WCHAR *table_name )
|
||||
+{
|
||||
+ const WCHAR format[] = { '%','.','8','s','.','i','d','t',0 }; /* truncate to 8 characters */
|
||||
+ WCHAR table_path[MAX_PATH];
|
||||
+ UINT ret;
|
||||
+
|
||||
+ snprintfW( table_path, sizeof(table_path)/sizeof(WCHAR), format, table_name );
|
||||
+ ret = MsiDatabaseImportW( state->database_handle, state->table_folder, table_path );
|
||||
+ if (ret != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ ERR( "Failed to import table '%s', error %d.\n", wine_dbgstr_w(table_name), ret );
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int import_tables( struct msidb_state *state )
|
||||
+{
|
||||
+ struct msidb_listentry *data;
|
||||
+
|
||||
+ LIST_FOR_EACH_ENTRY( data, &state->table_list, struct msidb_listentry, entry )
|
||||
+ {
|
||||
+ if (!import_table( state, data->name ))
|
||||
+ return 0; /* failed, do not commit changes */
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
int wmain( int argc, WCHAR *argv[] )
|
||||
{
|
||||
struct msidb_state state;
|
||||
int i, n = 1;
|
||||
+ int ret = 1;
|
||||
|
||||
memset( &state, 0x0, sizeof(state) );
|
||||
+ list_init( &state.table_list );
|
||||
/* process and validate all the command line flags */
|
||||
for (i = 1; n && i < argc; i += n)
|
||||
n = process_argument( &state, i, argc, argv );
|
||||
+ /* process all remaining arguments as table names */
|
||||
+ for (; i < argc; i++)
|
||||
+ list_append( &state.table_list, argv[i] );
|
||||
if (!valid_state( &state ))
|
||||
- return 1;
|
||||
+ goto cleanup;
|
||||
|
||||
/* perform the requested operations */
|
||||
if (!open_database( &state ))
|
||||
{
|
||||
ERR( "Failed to open database '%s'.\n", wine_dbgstr_w(state.database_file) );
|
||||
- return 1;
|
||||
+ goto cleanup;
|
||||
}
|
||||
- close_database( &state );
|
||||
- return 0;
|
||||
+ if (state.import_tables && !import_tables( &state ))
|
||||
+ goto cleanup; /* failed, do not commit changes */
|
||||
+ ret = 0;
|
||||
+
|
||||
+cleanup:
|
||||
+ close_database( &state, ret == 0 );
|
||||
+ list_free( &state.table_list );
|
||||
+ return ret;
|
||||
}
|
||||
--
|
||||
2.5.1
|
||||
|
@ -1,173 +0,0 @@
|
||||
From 0131987212f94916816d77e10b8825e61de64ee4 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
|
||||
Date: Wed, 16 Sep 2015 14:43:18 -0600
|
||||
Subject: msidb: Add support for adding stream/cabinet files to MSI databases.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@wine-staging.com>
|
||||
---
|
||||
programs/msidb/main.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 86 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/programs/msidb/main.c b/programs/msidb/main.c
|
||||
index c23e333..b287484 100644
|
||||
--- a/programs/msidb/main.c
|
||||
+++ b/programs/msidb/main.c
|
||||
@@ -42,8 +42,10 @@ struct msidb_state
|
||||
WCHAR *database_file;
|
||||
WCHAR *table_folder;
|
||||
MSIHANDLE database_handle;
|
||||
+ BOOL add_streams;
|
||||
BOOL create_database;
|
||||
BOOL import_tables;
|
||||
+ struct list add_stream_list;
|
||||
struct list table_list;
|
||||
};
|
||||
|
||||
@@ -78,6 +80,7 @@ static void show_usage( void )
|
||||
"Usage: msidb [OPTION]...[OPTION]... [TABLE]...[TABLE]\n"
|
||||
"Options:\n"
|
||||
" -? Show this usage message and exit.\n"
|
||||
+ " -a file.cab Add stream/cabinet file to _Streams table.\n"
|
||||
" -c Create database file (instead of opening existing file).\n"
|
||||
" -d package.msi Path to the database file.\n"
|
||||
" -f folder Folder in which to open/save the tables.\n"
|
||||
@@ -92,19 +95,19 @@ static int valid_state( struct msidb_state *state )
|
||||
FIXME( "GUI operation is not currently supported.\n" );
|
||||
return 0;
|
||||
}
|
||||
- if (state->table_folder == NULL)
|
||||
+ if (state->table_folder == NULL && !state->add_streams)
|
||||
{
|
||||
ERR( "No table folder specified (-f option).\n" );
|
||||
show_usage();
|
||||
return 0;
|
||||
}
|
||||
- if (!state->create_database && !state->import_tables)
|
||||
+ if (!state->create_database && !state->import_tables && !state->add_streams)
|
||||
{
|
||||
- ERR( "No mode flag specified (-c, -i).\n" );
|
||||
+ ERR( "No mode flag specified (-a, -c, -i).\n" );
|
||||
show_usage();
|
||||
return 0;
|
||||
}
|
||||
- if (list_empty( &state->table_list ))
|
||||
+ if (list_empty( &state->table_list ) && !state->add_streams)
|
||||
{
|
||||
ERR( "No tables specified.\n" );
|
||||
return 0;
|
||||
@@ -122,6 +125,11 @@ static int process_argument( struct msidb_state *state, int i, int argc, WCHAR *
|
||||
case '?':
|
||||
show_usage();
|
||||
exit( 0 );
|
||||
+ case 'a':
|
||||
+ if (i + 1 >= argc) return 0;
|
||||
+ state->add_streams = TRUE;
|
||||
+ list_append( &state->add_stream_list, argv[i + 1] );
|
||||
+ return 2;
|
||||
case 'c':
|
||||
state->create_database = TRUE;
|
||||
return 1;
|
||||
@@ -178,6 +186,76 @@ static void close_database( struct msidb_state *state, BOOL commit_changes )
|
||||
}
|
||||
}
|
||||
|
||||
+static const WCHAR *basenameW( const WCHAR *filename )
|
||||
+{
|
||||
+ const WCHAR *dir_end;
|
||||
+
|
||||
+ dir_end = strrchrW( filename, '/' );
|
||||
+ if (dir_end) return dir_end + 1;
|
||||
+ dir_end = strrchrW( filename, '\\' );
|
||||
+ if (dir_end) return dir_end + 1;
|
||||
+ return filename;
|
||||
+}
|
||||
+
|
||||
+static int add_stream( struct msidb_state *state, const WCHAR *stream_filename )
|
||||
+{
|
||||
+ static const char insert_command[] = "INSERT INTO _Streams (Name, Data) VALUES (?, ?)";
|
||||
+ MSIHANDLE view = 0, record = 0;
|
||||
+ UINT ret;
|
||||
+
|
||||
+ ret = MsiDatabaseOpenViewA( state->database_handle, insert_command, &view );
|
||||
+ if (ret != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ ERR( "Failed to open _Streams table.\n" );
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ record = MsiCreateRecord( 2 );
|
||||
+ if (record == 0)
|
||||
+ {
|
||||
+ ERR( "Failed to create MSI record.\n" );
|
||||
+ ret = ERROR_OUTOFMEMORY;
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ ret = MsiRecordSetStringW( record, 1, basenameW( stream_filename ) );
|
||||
+ if (ret != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ ERR( "Failed to add stream filename to MSI record.\n" );
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ ret = MsiRecordSetStreamW( record, 2, stream_filename );
|
||||
+ if (ret != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ ERR( "Failed to add stream to MSI record.\n" );
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ ret = MsiViewExecute( view, record );
|
||||
+ if (ret != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ ERR( "Failed to add stream to _Streams table.\n" );
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
+cleanup:
|
||||
+ if (record)
|
||||
+ MsiCloseHandle( record );
|
||||
+ if (view)
|
||||
+ MsiViewClose( view );
|
||||
+
|
||||
+ return (ret == ERROR_SUCCESS);
|
||||
+}
|
||||
+
|
||||
+static int add_streams( struct msidb_state *state )
|
||||
+{
|
||||
+ struct msidb_listentry *data;
|
||||
+
|
||||
+ LIST_FOR_EACH_ENTRY( data, &state->add_stream_list, struct msidb_listentry, entry )
|
||||
+ {
|
||||
+ if (!add_stream( state, data->name ))
|
||||
+ return 0; /* failed, do not commit changes */
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
static int import_table( struct msidb_state *state, const WCHAR *table_name )
|
||||
{
|
||||
const WCHAR format[] = { '%','.','8','s','.','i','d','t',0 }; /* truncate to 8 characters */
|
||||
@@ -213,6 +291,7 @@ int wmain( int argc, WCHAR *argv[] )
|
||||
int ret = 1;
|
||||
|
||||
memset( &state, 0x0, sizeof(state) );
|
||||
+ list_init( &state.add_stream_list );
|
||||
list_init( &state.table_list );
|
||||
/* process and validate all the command line flags */
|
||||
for (i = 1; n && i < argc; i += n)
|
||||
@@ -229,12 +308,15 @@ int wmain( int argc, WCHAR *argv[] )
|
||||
ERR( "Failed to open database '%s'.\n", wine_dbgstr_w(state.database_file) );
|
||||
goto cleanup;
|
||||
}
|
||||
+ if (state.add_streams && !add_streams( &state ))
|
||||
+ goto cleanup; /* failed, do not commit changes */
|
||||
if (state.import_tables && !import_tables( &state ))
|
||||
goto cleanup; /* failed, do not commit changes */
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
close_database( &state, ret == 0 );
|
||||
+ list_free( &state.add_stream_list );
|
||||
list_free( &state.table_list );
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.5.1
|
||||
|
@ -1,25 +1,23 @@
|
||||
From 25b736d558aba82da91d004b8976471df6ef0a64 Mon Sep 17 00:00:00 2001
|
||||
From 3342ffc67dd4df100c164335a024c072a784256b Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Tue, 29 Jan 2019 21:41:46 -0600
|
||||
Subject: [PATCH 06/13] ntoskrnl.exe: Implement
|
||||
ExReleaseResourceForThreadLite().
|
||||
Subject: [PATCH] ntoskrnl.exe: Implement ExReleaseResourceForThreadLite().
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/ntoskrnl.exe/ntoskrnl.c | 8 -----
|
||||
dlls/ntoskrnl.exe/sync.c | 61 ++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntoskrnl.exe/ntoskrnl.c | 8 ------
|
||||
dlls/ntoskrnl.exe/sync.c | 61 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
include/ddk/wdm.h | 1 +
|
||||
3 files changed, 62 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
index d6c35d1c..5ab4db12 100644
|
||||
index 887fdb1..9fbfed2 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
|
||||
@@ -3047,14 +3047,6 @@ NTSTATUS WINAPI ExDeleteResourceLite(PERESOURCE resource)
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
@@ -3256,14 +3256,6 @@ NTSTATUS WINAPI ExDeleteResourceLite(PERESOURCE resource)
|
||||
}
|
||||
|
||||
-/***********************************************************************
|
||||
/***********************************************************************
|
||||
- * ExReleaseResourceForThreadLite (NTOSKRNL.EXE.@)
|
||||
- */
|
||||
-void WINAPI ExReleaseResourceForThreadLite( PERESOURCE resource, ERESOURCE_THREAD tid )
|
||||
@ -27,14 +25,15 @@ index d6c35d1c..5ab4db12 100644
|
||||
- FIXME( "stub: %p %lu\n", resource, tid );
|
||||
-}
|
||||
-
|
||||
/***********************************************************************
|
||||
-/***********************************************************************
|
||||
* KeEnterCriticalRegion (NTOSKRNL.EXE.@)
|
||||
*/
|
||||
void WINAPI KeEnterCriticalRegion(void)
|
||||
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
|
||||
index 2fd7f903..450e4417 100644
|
||||
index 8644562..540093d 100644
|
||||
--- a/dlls/ntoskrnl.exe/sync.c
|
||||
+++ b/dlls/ntoskrnl.exe/sync.c
|
||||
@@ -945,3 +945,64 @@ BOOLEAN WINAPI ExAcquireSharedWaitForExclusive( ERESOURCE *resource, BOOLEAN wai
|
||||
@@ -925,3 +925,64 @@ BOOLEAN WINAPI ExAcquireSharedWaitForExclusive( ERESOURCE *resource, BOOLEAN wai
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -100,7 +99,7 @@ index 2fd7f903..450e4417 100644
|
||||
+ KeReleaseSpinLock( &resource->SpinLock, irql );
|
||||
+}
|
||||
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
||||
index 010c1ee4..e95458bf 100644
|
||||
index 4dada66..58e60d2 100644
|
||||
--- a/include/ddk/wdm.h
|
||||
+++ b/include/ddk/wdm.h
|
||||
@@ -1529,6 +1529,7 @@ PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK);
|
||||
@ -108,9 +107,9 @@ index 010c1ee4..e95458bf 100644
|
||||
LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList(LIST_ENTRY*,KSPIN_LOCK*);
|
||||
void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX);
|
||||
+void WINAPI ExReleaseResourceForThreadLite(ERESOURCE*,ERESOURCE_THREAD);
|
||||
ULONG WINAPI ExSetTimerResolution(ULONG,BOOLEAN);
|
||||
|
||||
void WINAPI IoAcquireCancelSpinLock(KIRQL*);
|
||||
NTSTATUS WINAPI IoAllocateDriverObjectExtension(PDRIVER_OBJECT,PVOID,ULONG,PVOID*);
|
||||
--
|
||||
2.20.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
From 7a4285a1f926b9a1caba1f815b9b781857a0997e Mon Sep 17 00:00:00 2001
|
||||
From 29d57097b8a1915d1fdbd8822117c096bb9e8dae Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Tue, 29 Jan 2019 21:50:37 -0600
|
||||
Subject: [PATCH 11/13] ntoskrnl.exe: Implement
|
||||
ExIsResourceAcquiredExclusiveLite().
|
||||
Subject: [PATCH] ntoskrnl.exe: Implement ExIsResourceAcquiredExclusiveLite().
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
@ -12,7 +11,7 @@ Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
3 files changed, 21 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
index 45553e06..66f0b7d9 100644
|
||||
index 51ba575..8892b7c 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
@@ -165,7 +165,7 @@
|
||||
@ -25,10 +24,10 @@ index 45553e06..66f0b7d9 100644
|
||||
@ stdcall ExLocalTimeToSystemTime(ptr ptr) RtlLocalTimeToSystemTime
|
||||
@ stub ExNotifyCallback
|
||||
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
|
||||
index ad68e7ea..cee15605 100644
|
||||
index c63d739..0f71902 100644
|
||||
--- a/dlls/ntoskrnl.exe/sync.c
|
||||
+++ b/dlls/ntoskrnl.exe/sync.c
|
||||
@@ -1069,3 +1069,22 @@ ULONG WINAPI ExGetSharedWaiterCount( ERESOURCE *resource )
|
||||
@@ -1045,3 +1045,22 @@ ULONG WINAPI ExGetSharedWaiterCount( ERESOURCE *resource )
|
||||
|
||||
return count;
|
||||
}
|
||||
@ -52,7 +51,7 @@ index ad68e7ea..cee15605 100644
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
||||
index 7a4be723..76eb6117 100644
|
||||
index 1c58ab9..80a82b0 100644
|
||||
--- a/include/ddk/wdm.h
|
||||
+++ b/include/ddk/wdm.h
|
||||
@@ -1531,6 +1531,7 @@ NTSTATUS WINAPI ExInitializeResourceLite(ERESOURCE*);
|
||||
@ -62,7 +61,7 @@ index 7a4be723..76eb6117 100644
|
||||
+BOOLEAN WINAPI ExIsResourceAcquiredExclusiveLite(ERESOURCE*);
|
||||
void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX);
|
||||
void WINAPI ExReleaseResourceForThreadLite(ERESOURCE*,ERESOURCE_THREAD);
|
||||
|
||||
ULONG WINAPI ExSetTimerResolution(ULONG,BOOLEAN);
|
||||
--
|
||||
2.20.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
From 5203c63e18a2461b1909996ec1ffbcc662d57865 Mon Sep 17 00:00:00 2001
|
||||
From d121e866eaf9e480749b7a1faf863e77e67595a4 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Tue, 29 Jan 2019 21:51:08 -0600
|
||||
Subject: [PATCH 12/13] ntoskrnl.exe: Implement
|
||||
ExIsResourceAcquiredSharedLite().
|
||||
Subject: [PATCH] ntoskrnl.exe: Implement ExIsResourceAcquiredSharedLite().
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
@ -12,7 +11,7 @@ Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
3 files changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
index 66f0b7d9..127c5ef3 100644
|
||||
index 8892b7c..f0d6da6 100644
|
||||
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
|
||||
@@ -166,7 +166,7 @@
|
||||
@ -25,10 +24,10 @@ index 66f0b7d9..127c5ef3 100644
|
||||
@ stub ExNotifyCallback
|
||||
@ stub ExQueryPoolBlockSize
|
||||
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
|
||||
index cee15605..5154ea5c 100644
|
||||
index 0f71902..cfdc6d1 100644
|
||||
--- a/dlls/ntoskrnl.exe/sync.c
|
||||
+++ b/dlls/ntoskrnl.exe/sync.c
|
||||
@@ -1088,3 +1088,28 @@ BOOLEAN WINAPI ExIsResourceAcquiredExclusiveLite( ERESOURCE *resource )
|
||||
@@ -1064,3 +1064,28 @@ BOOLEAN WINAPI ExIsResourceAcquiredExclusiveLite( ERESOURCE *resource )
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -58,7 +57,7 @@ index cee15605..5154ea5c 100644
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
|
||||
index 76eb6117..e5a2906f 100644
|
||||
index 80a82b0..3600bcd 100644
|
||||
--- a/include/ddk/wdm.h
|
||||
+++ b/include/ddk/wdm.h
|
||||
@@ -1532,6 +1532,7 @@ PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK);
|
||||
@ -68,7 +67,7 @@ index 76eb6117..e5a2906f 100644
|
||||
+ULONG WINAPI ExIsResourceAcquiredSharedLite(ERESOURCE*);
|
||||
void WINAPI ExReleaseFastMutexUnsafe(PFAST_MUTEX);
|
||||
void WINAPI ExReleaseResourceForThreadLite(ERESOURCE*,ERESOURCE_THREAD);
|
||||
|
||||
ULONG WINAPI ExSetTimerResolution(ULONG,BOOLEAN);
|
||||
--
|
||||
2.20.1
|
||||
1.9.1
|
||||
|
||||
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "ab7756619c1b16c761618a68d1b6a06ad437cbe8"
|
||||
echo "5baadda536172d6713fa6fef1196dc2baa773904"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -4176,13 +4176,9 @@ fi
|
||||
# Patchset msidb-Implementation
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * configure.ac, dlls/msi/database.c, dlls/msi/msipriv.h, dlls/msi/streams.c, dlls/msi/suminfo.c,
|
||||
# | programs/msidb/Makefile.in, programs/msidb/main.c
|
||||
# | * dlls/msi/database.c, dlls/msi/msipriv.h, dlls/msi/streams.c, dlls/msi/suminfo.c, programs/msidb/main.c
|
||||
# |
|
||||
if test "$enable_msidb_Implementation" -eq 1; then
|
||||
patch_apply msidb-Implementation/0001-msidb-Add-stub-tool-for-manipulating-MSI-databases.patch
|
||||
patch_apply msidb-Implementation/0003-msidb-Add-support-for-importing-database-tables.patch
|
||||
patch_apply msidb-Implementation/0004-msidb-Add-support-for-adding-stream-cabinet-files-to.patch
|
||||
patch_apply msidb-Implementation/0005-msi-Add-support-for-deleting-streams-from-an-MSI-dat.patch
|
||||
patch_apply msidb-Implementation/0006-msidb-Add-support-for-removing-stream-cabinet-files-.patch
|
||||
patch_apply msidb-Implementation/0007-msidb-Add-support-for-extracting-stream-cabinet-file.patch
|
||||
@ -4193,9 +4189,6 @@ if test "$enable_msidb_Implementation" -eq 1; then
|
||||
patch_apply msidb-Implementation/0012-msi-Add-support-for-exporting-binary-streams-Binary-.patch
|
||||
patch_apply msidb-Implementation/0013-msidb-Add-support-for-wildcard-full-database-export.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "msidb: Add stub tool for manipulating MSI databases.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "msidb: Add support for importing database tables.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "msidb: Add support for adding stream/cabinet files to MSI databases.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "msi: Add support for deleting streams from an MSI database.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "msidb: Add support for removing stream/cabinet files from MSI databases.", 1 },';
|
||||
printf '%s\n' '+ { "Erich E. Hoover", "msidb: Add support for extracting stream/cabinet files from MSI databases.", 1 },';
|
||||
|
Loading…
x
Reference in New Issue
Block a user