msidb-Implementation: Pass correct size argument to snprintfW (Thanks Amine Khaldi).

This commit is contained in:
Sebastian Lackner 2015-12-04 11:02:13 +01:00
parent ebf9db37d5
commit a605ae9359

View File

@ -1,4 +1,4 @@
From fdb59c20c2b04b0c5c405b0926f785efaaa2b174 Mon Sep 17 00:00:00 2001
From cde86309c43cf9ebd9ff1e6c12869cdf34ede607 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Fri, 18 Sep 2015 11:07:43 -0600
Subject: msi: Add support for exporting binary streams (Binary/Icon tables).
@ -9,7 +9,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@wine-staging.com>
1 file changed, 79 insertions(+), 6 deletions(-)
diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index 7c511c9..464b2d4 100644
index 7c511c9..6627fd0 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -53,6 +53,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
@ -49,7 +49,7 @@ index 7c511c9..464b2d4 100644
+ return r;
+
+ /* if the destination folder does not exist then create it (folder name = table name) */
+ snprintfW( stream_filename, sizeof(stream_filename), fmt_folder, folder, table );
+ snprintfW( stream_filename, sizeof(stream_filename)/sizeof(WCHAR), fmt_folder, folder, table );
+ if (GetFileAttributesW( stream_filename ) == INVALID_FILE_ATTRIBUTES)
+ {
+ if (!CreateDirectoryW( stream_filename, NULL ))
@ -57,7 +57,7 @@ index 7c511c9..464b2d4 100644
+ }
+
+ /* actually create the file */
+ snprintfW( stream_filename, sizeof(stream_filename), fmt_file, folder, table, stream_name );
+ snprintfW( stream_filename, sizeof(stream_filename)/sizeof(WCHAR), fmt_file, folder, table, stream_name );
+ file = CreateFileW( stream_filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
+ if (file == INVALID_HANDLE_VALUE)
@ -149,5 +149,5 @@ index 7c511c9..464b2d4 100644
}
--
2.5.1
2.6.2