[3/3] msi: Support _Streams, _Storages tablename prefixes in SELECT
Nathan Gallaher
ngallaher at deepthought.org
Tue Nov 24 07:31:57 CST 2009
Fixes bug introduced by fix for bug 20227. Calls to get_column_info()
were not returning the table name for _Storages and _Streams. A subsequent
freeing of the pointer for the table name generated a valgrind error which
is quenched by this patch.
-------------- next part --------------
From 803991c6e1b8d683eb8ed7a433c639c5b1988eac Mon Sep 17 00:00:00 2001
From: Nathan Gallaher <ngallaher at deepthought.org>
Date: Thu, 12 Nov 2009 22:59:03 -0500
Subject: msi: Return tablename in _Streams, _Storages get_column_info() query
Fixes bug introduced by fix for bug 20227. Calls to get_column_info()
were not returning the table name for _Storages and _Streams. A subsequent
freeing of the pointer for the table name generated a valgrind error which
is quenched by this patch.
---
dlls/msi/storages.c | 11 +++++++++++
dlls/msi/streams.c | 11 +++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/dlls/msi/storages.c b/dlls/msi/storages.c
index 005bcdb..844db8d 100644
--- a/dlls/msi/storages.c
+++ b/dlls/msi/storages.c
@@ -296,6 +296,7 @@ static UINT STORAGES_get_column_info(struct tagMSIVIEW *view, UINT n,
static const WCHAR Name[] = {'N','a','m','e',0};
static const WCHAR Data[] = {'D','a','t','a',0};
+ static const WCHAR _Storages[] = {'_','S','t','o','r','a','g','e','s',0};
TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary,
table_name);
@@ -322,6 +323,16 @@ static UINT STORAGES_get_column_info(struct tagMSIVIEW *view, UINT n,
if (!*name) return ERROR_FUNCTION_FAILED;
}
+ if (table_name)
+ {
+ *table_name = strdupW(_Storages);
+ if (!*table_name)
+ {
+ msi_free(name);
+ return ERROR_FUNCTION_FAILED;
+ }
+ }
+
if (temporary)
*temporary = FALSE;
diff --git a/dlls/msi/streams.c b/dlls/msi/streams.c
index 23ae971..faa27c8 100644
--- a/dlls/msi/streams.c
+++ b/dlls/msi/streams.c
@@ -262,6 +262,7 @@ static UINT STREAMS_get_column_info(struct tagMSIVIEW *view, UINT n,
static const WCHAR Name[] = {'N','a','m','e',0};
static const WCHAR Data[] = {'D','a','t','a',0};
+ static const WCHAR _Streams[] = {'_','S','t','r','e','a','m','s',0};
TRACE("(%p, %d, %p, %p, %p, %p)\n", view, n, name, type, temporary,
table_name);
@@ -288,6 +289,16 @@ static UINT STREAMS_get_column_info(struct tagMSIVIEW *view, UINT n,
if (!*name) return ERROR_FUNCTION_FAILED;
}
+ if (table_name)
+ {
+ *table_name = strdupW(_Streams);
+ if (!*table_name)
+ {
+ msi_free(name);
+ return ERROR_FUNCTION_FAILED;
+ }
+ }
+
if (temporary)
*temporary = FALSE;
--
1.6.0.4
More information about the wine-patches
mailing list