Commit 9c05824f authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

oledb32: Fix property count in datainit_GetInitializationString().

count was assigned to the property set count, not the count of properties in each property set. Fix a Power Pivot for Excel 2010 connection error when opening a Power Pivot window.
parent c2571f23
...@@ -853,7 +853,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I ...@@ -853,7 +853,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I
DBPROPINFOSET *propinfoset; DBPROPINFOSET *propinfoset;
IDBProperties *props; IDBProperties *props;
DBPROPIDSET propidset; DBPROPIDSET propidset;
ULONG count, infocount; ULONG propset_count, infocount;
WCHAR *progid, *desc; WCHAR *progid, *desc;
DBPROPSET *propset; DBPROPSET *propset;
IPersist *persist; IPersist *persist;
...@@ -889,8 +889,8 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I ...@@ -889,8 +889,8 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I
propidset.cPropertyIDs = 0; propidset.cPropertyIDs = 0;
propidset.guidPropertySet = DBPROPSET_DBINIT; propidset.guidPropertySet = DBPROPSET_DBINIT;
propset = NULL; propset = NULL;
count = 0; propset_count = 0;
hr = IDBProperties_GetProperties(props, 1, &propidset, &count, &propset); hr = IDBProperties_GetProperties(props, 1, &propidset, &propset_count, &propset);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("failed to get data source properties, 0x%08lx\n", hr); WARN("failed to get data source properties, 0x%08lx\n", hr);
...@@ -904,7 +904,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I ...@@ -904,7 +904,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I
/* check if we need to skip password */ /* check if we need to skip password */
len = lstrlenW(progid) + lstrlenW(providerW) + 1; /* including '\0' */ len = lstrlenW(progid) + lstrlenW(providerW) + 1; /* including '\0' */
for (i = 0; i < count; i++) for (i = 0; i < propset->cProperties; i++)
{ {
WCHAR *descr = get_propinfo_descr(&propset->rgProperties[i], propinfoset); WCHAR *descr = get_propinfo_descr(&propset->rgProperties[i], propinfoset);
if (descr) if (descr)
...@@ -928,7 +928,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I ...@@ -928,7 +928,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I
lstrcatW(*init_string, progid); lstrcatW(*init_string, progid);
CoTaskMemFree(progid); CoTaskMemFree(progid);
for (i = 0; i < count; i++) for (i = 0; i < propset->cProperties; i++)
{ {
WCHAR *descr; WCHAR *descr;
...@@ -944,7 +944,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I ...@@ -944,7 +944,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I
} }
} }
free_dbpropset(count, propset); free_dbpropset(propset_count, propset);
free_dbpropinfoset(infocount, propinfoset); free_dbpropinfoset(infocount, propinfoset);
CoTaskMemFree(desc); CoTaskMemFree(desc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment