Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2b2ee9c7
Commit
2b2ee9c7
authored
Nov 30, 2006
by
Charles Blacklock
Committed by
Alexandre Julliard
Nov 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Add VarBstrCmp binary comparison for LCID==0.
parent
70ce5485
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
vartype.c
dlls/oleaut32/tests/vartype.c
+12
-0
vartype.c
dlls/oleaut32/vartype.c
+22
-4
No files found.
dlls/oleaut32/tests/vartype.c
View file @
2b2ee9c7
...
...
@@ -4911,6 +4911,8 @@ static void test_VarBstrCmp(void)
static
const
WCHAR
sz2
[]
=
{
'A'
,
0
};
static
const
WCHAR
s1
[]
=
{
'a'
,
0
};
static
const
WCHAR
s2
[]
=
{
'a'
,
0
,
'b'
};
static
const
char
sb1
[]
=
{
1
,
0
,
1
};
static
const
char
sb2
[]
=
{
1
,
0
,
2
};
BSTR
bstr
,
bstrempty
,
bstr2
;
CHECKPTR
(
VarBstrCmp
);
...
...
@@ -4948,6 +4950,16 @@ static void test_VarBstrCmp(void)
SysFreeString
(
bstr2
);
SysFreeString
(
bstr
);
/* When (LCID == 0) it should be a binary comparison
* so these two strings could not match.
*/
bstr
=
SysAllocStringByteLen
(
sb1
,
sizeof
(
sb1
));
bstr2
=
SysAllocStringByteLen
(
sb2
,
sizeof
(
sb2
));
lcid
=
0
;
VARBSTRCMP
(
bstr
,
bstr2
,
0
,
VARCMP_LT
);
SysFreeString
(
bstr2
);
SysFreeString
(
bstr
);
}
/* Get the internal representation of a BSTR */
...
...
dlls/oleaut32/vartype.c
View file @
2b2ee9c7
...
...
@@ -6630,10 +6630,12 @@ HRESULT WINAPI VarBstrCat(BSTR pbstrLeft, BSTR pbstrRight, BSTR *pbstrOut)
* NOTES
* VARCMP_NULL is NOT returned if either string is NULL unlike MSDN
* states. A NULL BSTR pointer is equivalent to an empty string.
* If LCID is equal to 0, a byte by byte comparison is performed.
*/
HRESULT
WINAPI
VarBstrCmp
(
BSTR
pbstrLeft
,
BSTR
pbstrRight
,
LCID
lcid
,
DWORD
dwFlags
)
{
HRESULT
hres
;
int
ret
;
TRACE
(
"%s,%s,%d,%08x
\n
"
,
debugstr_wn
(
pbstrLeft
,
SysStringLen
(
pbstrLeft
)),
...
...
@@ -6648,10 +6650,26 @@ HRESULT WINAPI VarBstrCmp(BSTR pbstrLeft, BSTR pbstrRight, LCID lcid, DWORD dwFl
else
if
(
!
pbstrRight
||
!*
pbstrRight
)
return
VARCMP_GT
;
hres
=
CompareStringW
(
lcid
,
dwFlags
,
pbstrLeft
,
SysStringLen
(
pbstrLeft
),
pbstrRight
,
SysStringLen
(
pbstrRight
))
-
1
;
TRACE
(
"%d
\n
"
,
hres
);
return
hres
;
if
(
lcid
==
0
)
{
ret
=
memcmp
(
pbstrLeft
,
pbstrRight
,
min
(
SysStringByteLen
(
pbstrLeft
),
SysStringByteLen
(
pbstrRight
)));
if
(
ret
<
0
)
return
VARCMP_LT
;
if
(
ret
>
0
)
return
VARCMP_GT
;
if
(
SysStringByteLen
(
pbstrLeft
)
<
SysStringByteLen
(
pbstrRight
))
return
VARCMP_LT
;
if
(
SysStringByteLen
(
pbstrLeft
)
>
SysStringByteLen
(
pbstrRight
))
return
VARCMP_GT
;
return
VARCMP_EQ
;
}
else
{
hres
=
CompareStringW
(
lcid
,
dwFlags
,
pbstrLeft
,
SysStringLen
(
pbstrLeft
),
pbstrRight
,
SysStringLen
(
pbstrRight
))
-
1
;
TRACE
(
"%d
\n
"
,
hres
);
return
hres
;
}
}
/*
...
...
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