The "Mode" can be a mix of any of the flags.
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
The "Mode" can be a mix of any of the flags. --- dlls/oledb32/datainit.c | 40 ++++++++++++++++++++++++++++++----- dlls/oledb32/tests/database.c | 14 ++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c index 38ed5ce0e53..16f1cde4d1b 100644 --- a/dlls/oledb32/datainit.c +++ b/dlls/oledb32/datainit.c @@ -335,16 +335,46 @@ static HRESULT convert_dbproperty_mode(const WCHAR *src, VARIANT *dest) { L"Write", DB_MODE_WRITE }, }; struct mode_propval *prop; + WCHAR mode[64]; + WCHAR *pos = NULL, *lastpos = NULL;
- if ((prop = bsearch(src, mode_propvals, ARRAY_SIZE(mode_propvals), - sizeof(struct mode_propval), dbmodeprop_compare))) + V_VT(dest) = VT_I4; + V_I4(dest) = 0; + + pos = wcsstr( src, L"|" ); + while(pos != NULL) { - V_VT(dest) = VT_I4; - V_I4(dest) = prop->value; - TRACE("%s = %#lx\n", debugstr_w(src), prop->value); + WCHAR *next = wcsstr(pos + 1, L"|" ); + if (next) + lstrcpynW(mode, src, next - pos); + else + lstrcpynW(mode, src, pos - src + 1); + + if ((prop = bsearch(mode, mode_propvals, ARRAY_SIZE(mode_propvals), + sizeof(struct mode_propval), dbmodeprop_compare))) + { + V_I4(dest) |= prop->value; + TRACE("%s = %#lx\n", debugstr_w(mode), prop->value); + } + else + goto done; + + lastpos = pos + 1; + pos = next; + } + + lstrcpyW(mode, lastpos); + if ((prop = bsearch(mode, mode_propvals, ARRAY_SIZE(mode_propvals), + sizeof(struct mode_propval), dbmodeprop_compare))) + { + V_I4(dest) |= prop->value; + TRACE("%s = %#lx\n", debugstr_w(mode), V_I4(dest)); return S_OK; }
+done: + FIXME("Failed to parse Mode (%s)\n", debugstr_w(src)); + return E_FAIL; }
diff --git a/dlls/oledb32/tests/database.c b/dlls/oledb32/tests/database.c index 6296ecfe1ef..bcee13017a7 100644 --- a/dlls/oledb32/tests/database.c +++ b/dlls/oledb32/tests/database.c @@ -557,6 +557,8 @@ static void test_initializationstring(void) static const WCHAR *initstring_mode = L"Provider=MSDASQL.1;Data Source=dummy;Mode=invalid"; static const WCHAR *initstring_mode2 = L"Provider=MSDASQL.1;Data Source=dummy;Mode=WriteRead"; static const WCHAR *initstring_mode3 = L"Provider=MSDASQL.1;Data Source=dummy;Mode=ReadWRITE"; + static const WCHAR *initstring_mode4 = L"Provider=MSDASQL.1;Data Source=dummy;Mode=ReadWrite|Share Deny None"; + static const WCHAR *initstring_mode5 = L"Provider=MSDASQL.1;Data Source=dummy;Mode=ReadWrite|Share Deny None|Share Exclusive"; static const WCHAR *initstring_quote_semicolon = L"Provider=MSDASQL.1;" "Data Source=dummy;" "Extended Properties="ConnectTo=11.0;Cell Error Mode=TextValue;Optimize Response=3;""; @@ -625,6 +627,18 @@ static void test_initializationstring(void) &IID_IDBInitialize, (IUnknown **)&dbinit); ok(hr == S_OK, "got 0x%08lx\n", hr); IDBInitialize_Release(dbinit); + + dbinit = NULL; + hr = IDataInitialize_GetDataSource(datainit, NULL, CLSCTX_INPROC_SERVER, (WCHAR *)initstring_mode4, + &IID_IDBInitialize, (IUnknown **)&dbinit); + ok(hr == S_OK, "got 0x%08lx\n", hr); + IDBInitialize_Release(dbinit); + + dbinit = NULL; + hr = IDataInitialize_GetDataSource(datainit, NULL, CLSCTX_INPROC_SERVER, (WCHAR *)initstring_mode5, + &IID_IDBInitialize, (IUnknown **)&dbinit); + ok(hr == S_OK, "got 0x%08lx\n", hr); + IDBInitialize_Release(dbinit); } else ok(dbinit == NULL, "got %p\n", dbinit);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=146190
Your paranoid android.
=== debian11 (32 bit report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11 (32 bit ar:MA report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11 (32 bit de report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11 (32 bit fr report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11 (32 bit he:IL report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11 (32 bit hi:IN report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11 (32 bit ja:JP report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11 (32 bit zh:CN report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11b (32 bit WoW report) ===
Report validation errors: oledb32:database crashed (c0000005)
=== debian11b (64 bit WoW report) ===
Report validation errors: oledb32:database crashed (c0000005)