Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f0bad1ec
Commit
f0bad1ec
authored
Nov 20, 2023
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msdasql: Return all initialization properties if no property ID is specified in…
msdasql: Return all initialization properties if no property ID is specified in dbprops_GetProperties().
parent
fd2a2d38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
msdasql_main.c
dlls/msdasql/msdasql_main.c
+31
-3
provider.c
dlls/msdasql/tests/provider.c
+0
-4
No files found.
dlls/msdasql/msdasql_main.c
View file @
f0bad1ec
...
...
@@ -357,18 +357,19 @@ static HRESULT WINAPI dbprops_GetProperties(IDBProperties *iface, ULONG cPropert
struct
msdasql
*
provider
=
impl_from_IDBProperties
(
iface
);
int
i
,
j
,
k
;
DBPROPSET
*
propset
;
BOOL
no_prop_id
;
TRACE
(
"(%p)->(%ld %p %p %p)
\n
"
,
provider
,
cPropertyIDSets
,
rgPropertyIDSets
,
pcPropertySets
,
prgPropertySets
);
*
pcPropertySets
=
1
;
if
(
cPropertyIDSets
!=
1
)
if
(
cPropertyIDSets
>
1
)
{
FIXME
(
"Currently only
1 property set
supported.
\n
"
);
FIXME
(
"Currently only
0 or 1 property set are
supported.
\n
"
);
cPropertyIDSets
=
1
;
}
propset
=
CoTaskMemAlloc
(
cPropertyIDSets
*
sizeof
(
DBPROPSET
));
propset
=
CoTaskMemAlloc
(
max
(
cPropertyIDSets
,
1
)
*
sizeof
(
DBPROPSET
));
if
(
IsEqualGUID
(
&
rgPropertyIDSets
[
0
].
guidPropertySet
,
&
DBPROPSET_DATASOURCEINFO
))
{
...
...
@@ -391,6 +392,33 @@ static HRESULT WINAPI dbprops_GetProperties(IDBProperties *iface, ULONG cPropert
propset
->
guidPropertySet
=
DBPROPSET_DBINIT
;
no_prop_id
=
TRUE
;
for
(
i
=
0
;
i
<
cPropertyIDSets
;
i
++
)
{
if
(
rgPropertyIDSets
[
i
].
cPropertyIDs
)
{
no_prop_id
=
FALSE
;
break
;
}
}
/* If no property ID is specified then return all currently set properties */
if
(
no_prop_id
)
{
propset
->
cProperties
=
ARRAY_SIZE
(
provider
->
properties
);
propset
->
rgProperties
=
CoTaskMemAlloc
(
propset
->
cProperties
*
sizeof
(
DBPROP
));
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
provider
->
properties
);
i
++
)
{
propset
->
rgProperties
[
i
].
dwPropertyID
=
provider
->
properties
[
i
].
id
;
V_VT
(
&
propset
->
rgProperties
[
i
].
vValue
)
=
VT_EMPTY
;
VariantCopy
(
&
propset
->
rgProperties
[
i
].
vValue
,
&
provider
->
properties
[
i
].
value
);
}
*
prgPropertySets
=
propset
;
return
S_OK
;
}
/* Return property info for properties in the specified property ID sets */
for
(
i
=
0
;
i
<
cPropertyIDSets
;
i
++
)
{
TRACE
(
"Property id %d (count %ld, set %s)
\n
"
,
i
,
rgPropertyIDSets
[
i
].
cPropertyIDs
,
...
...
dlls/msdasql/tests/provider.c
View file @
f0bad1ec
...
...
@@ -201,10 +201,8 @@ static void test_Properties(void)
/* Test when cPropertyIDSets is zero, all initialization properties should be returned */
hr
=
IDBProperties_GetProperties
(
props
,
0
,
&
propidlist
,
&
propcnt
,
&
propset
);
ok
(
hr
==
S_OK
,
"got 0x%08lx
\n
"
,
hr
);
todo_wine
ok
(
propset
->
cProperties
==
ARRAY_SIZE
(
properties
),
"got %lu
\n
"
,
propset
->
cProperties
);
for
(
i
=
0
;
i
<
propset
->
cProperties
;
i
++
)
todo_wine_if
(
i
>
0
)
ok
(
propset
->
rgProperties
[
i
].
dwPropertyID
==
properties
[
i
],
"%ld %ld, got %ld
\n
"
,
i
,
properties
[
i
],
propset
->
rgProperties
[
i
].
dwPropertyID
);
free_dbpropset
(
propcnt
,
propset
);
...
...
@@ -217,9 +215,7 @@ static void test_Properties(void)
hr
=
IDBProperties_GetProperties
(
props
,
1
,
&
propidlist
,
&
propcnt
,
&
propset
);
ok
(
hr
==
S_OK
,
"got 0x%08lx
\n
"
,
hr
);
todo_wine
ok
(
propset
->
cProperties
==
ARRAY_SIZE
(
properties
),
"got %lu
\n
"
,
propset
->
cProperties
);
todo_wine
for
(
i
=
0
;
i
<
propset
->
cProperties
;
i
++
)
ok
(
propset
->
rgProperties
[
i
].
dwPropertyID
==
properties
[
i
],
"%ld %ld, got %ld
\n
"
,
i
,
properties
[
i
],
propset
->
rgProperties
[
i
].
dwPropertyID
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment