James Hawkins : msi: Create the _Tables table when creating a database.
Alexandre Julliard
julliard at winehq.org
Mon Nov 12 06:27:23 CST 2007
Module: wine
Branch: master
Commit: 7dffb518c08f7abd0c1a9425afa1539552906d72
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7dffb518c08f7abd0c1a9425afa1539552906d72
Author: James Hawkins <truiken at gmail.com>
Date: Sun Nov 11 18:05:56 2007 -0600
msi: Create the _Tables table when creating a database.
---
dlls/msi/database.c | 6 +++++-
dlls/msi/tests/db.c | 16 +++-------------
2 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index d0f0097..c30121a 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -82,6 +82,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
WCHAR path[MAX_PATH];
static const WCHAR backslash[] = {'\\',0};
+ static WCHAR szTables[] = { '_','T','a','b','l','e','s',0 };
TRACE("%s %s\n",debugstr_w(szDBPath),debugstr_w(szPersist) );
@@ -114,7 +115,10 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
if( r == ERROR_SUCCESS )
{
IStorage_SetClass( stg, &CLSID_MsiDatabase );
- r = msi_init_string_table( stg );
+ /* create the _Tables stream */
+ r = write_stream_data(stg, szTables, NULL, 0, TRUE);
+ if (!FAILED(r))
+ r = msi_init_string_table( stg );
}
created = TRUE;
}
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 4b747f1..c269572 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -4497,11 +4497,8 @@ void enum_stream_names(IStorage *stg)
if(FAILED(hr) || !count)
break;
- todo_wine
- {
- ok(!lstrcmpW(stat.pwcsName, database_table_data[n].name),
- "Expected table %d name to match\n", n);
- }
+ ok(!lstrcmpW(stat.pwcsName, database_table_data[n].name),
+ "Expected table %d name to match\n", n);
stm = NULL;
hr = IStorage_OpenStream(stg, stat.pwcsName, NULL,
@@ -4514,15 +4511,11 @@ void enum_stream_names(IStorage *stg)
hr = IStream_Read(stm, data, sz, &count);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
- if (n == 1) todo_wine
ok(count == database_table_data[n].size,
"Expected %d, got %d\n", database_table_data[n].size, count);
if (!database_table_data[n].size)
- {
- if (n == 1) todo_wine
ok(!memcmp(data, check, MAX_PATH), "data should not be changed\n");
- }
else
ok(!memcmp(data, database_table_data[n].data, database_table_data[n].size),
"Expected table %d data to match\n", n);
@@ -4531,10 +4524,7 @@ void enum_stream_names(IStorage *stg)
n++;
}
- todo_wine
- {
- ok(n == 3, "Expected 3, got %d\n", n);
- }
+ ok(n == 3, "Expected 3, got %d\n", n);
IEnumSTATSTG_Release(stgenum);
}
More information about the wine-cvs
mailing list