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
19957240
Commit
19957240
authored
Nov 17, 2023
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Quote values containing semicolons.
parent
9c05824f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
6 deletions
+36
-6
datainit.c
dlls/oledb32/datainit.c
+36
-6
No files found.
dlls/oledb32/datainit.c
View file @
19957240
...
@@ -780,18 +780,30 @@ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *o
...
@@ -780,18 +780,30 @@ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *o
/* returns character length of string representation */
/* returns character length of string representation */
static
int
get_propvalue_length
(
DBPROP
*
prop
)
static
int
get_propvalue_length
(
DBPROP
*
prop
)
{
{
VARIANT
*
v
=
&
prop
->
vValue
;
VARIANT
str
;
VARIANT
str
;
HRESULT
hr
;
HRESULT
hr
;
int
length
;
if
(
V_VT
(
&
prop
->
vValue
)
==
VT_BSTR
)
return
SysStringLen
(
V_BSTR
(
&
prop
->
vValue
));
if
(
V_VT
(
v
)
==
VT_BSTR
)
{
length
=
SysStringLen
(
V_BSTR
(
v
));
/* Quotes values with '\"' if the value contains semicolons */
if
(
wcsstr
(
V_BSTR
(
v
),
L";"
))
length
+=
2
;
return
length
;
}
VariantInit
(
&
str
);
VariantInit
(
&
str
);
hr
=
VariantChangeType
(
&
str
,
&
prop
->
vValue
,
0
,
VT_BSTR
);
hr
=
VariantChangeType
(
&
str
,
v
,
0
,
VT_BSTR
);
if
(
hr
==
S_OK
)
if
(
hr
==
S_OK
)
{
{
int
len
=
SysStringLen
(
V_BSTR
(
&
str
));
length
=
SysStringLen
(
V_BSTR
(
&
str
));
/* Quotes values with '\"' if the value contains semicolons */
if
(
wcsstr
(
V_BSTR
(
&
str
),
L";"
))
length
+=
2
;
VariantClear
(
&
str
);
VariantClear
(
&
str
);
return
len
;
return
len
gth
;
}
}
return
0
;
return
0
;
...
@@ -805,7 +817,16 @@ static void write_propvalue_str(WCHAR *str, DBPROP *prop)
...
@@ -805,7 +817,16 @@ static void write_propvalue_str(WCHAR *str, DBPROP *prop)
if
(
V_VT
(
v
)
==
VT_BSTR
)
if
(
V_VT
(
v
)
==
VT_BSTR
)
{
{
lstrcatW
(
str
,
V_BSTR
(
v
));
if
(
wcsstr
(
V_BSTR
(
v
),
L";"
))
{
lstrcatW
(
str
,
L"
\"
"
);
lstrcatW
(
str
,
V_BSTR
(
v
));
lstrcatW
(
str
,
L"
\"
"
);
}
else
{
lstrcatW
(
str
,
V_BSTR
(
v
));
}
return
;
return
;
}
}
...
@@ -813,7 +834,16 @@ static void write_propvalue_str(WCHAR *str, DBPROP *prop)
...
@@ -813,7 +834,16 @@ static void write_propvalue_str(WCHAR *str, DBPROP *prop)
hr
=
VariantChangeType
(
&
vstr
,
v
,
VARIANT_ALPHABOOL
,
VT_BSTR
);
hr
=
VariantChangeType
(
&
vstr
,
v
,
VARIANT_ALPHABOOL
,
VT_BSTR
);
if
(
hr
==
S_OK
)
if
(
hr
==
S_OK
)
{
{
lstrcatW
(
str
,
V_BSTR
(
&
vstr
));
if
(
wcsstr
(
V_BSTR
(
&
vstr
),
L";"
))
{
lstrcatW
(
str
,
L"
\"
"
);
lstrcatW
(
str
,
V_BSTR
(
&
vstr
));
lstrcatW
(
str
,
L"
\"
"
);
}
else
{
lstrcatW
(
str
,
V_BSTR
(
&
vstr
));
}
VariantClear
(
&
vstr
);
VariantClear
(
&
vstr
);
}
}
}
}
...
...
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