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
3d38e72d
Commit
3d38e72d
authored
May 05, 2004
by
Jakob Eriksson
Committed by
Alexandre Julliard
May 05, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Windows 95 has no StrRetToBSTR, add dynamic lookup to avoid blocking
dialog.
parent
9e19e3f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
string.c
dlls/shlwapi/tests/string.c
+11
-3
No files found.
dlls/shlwapi/tests/string.c
View file @
3d38e72d
...
...
@@ -33,6 +33,8 @@
#include "shlwapi.h"
#include "shtypes.h"
static
HRESULT
(
WINAPI
*
ptr_StrRetToBSTR
)
(
STRRET
*
,
void
*
,
BSTR
*
);
static
inline
int
strcmpW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
)
{
while
(
*
str1
&&
(
*
str1
==
*
str2
))
{
str1
++
;
str2
++
;
}
...
...
@@ -596,16 +598,22 @@ static WCHAR *CoDupStrW(const char* src)
static
void
test_StrRetToBSTR
(
void
)
{
HMODULE
module
;
static
const
WCHAR
szTestW
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
'\0'
};
ITEMIDLIST
iidl
[
10
];
BSTR
bstr
;
STRRET
strret
;
HRESULT
ret
;
module
=
GetModuleHandleA
(
"shlwapi"
);
if
(
!
module
)
return
;
ptr_StrRetToBSTR
=
(
void
*
)
GetProcAddress
(
module
,
"StrRetToBSTR"
);
if
(
!
ptr_StrRetToBSTR
)
return
;
strret
.
uType
=
STRRET_WSTR
;
strret
.
u
.
pOleStr
=
CoDupStrW
(
"Test"
);
bstr
=
0
;
ret
=
StrRetToBSTR
(
&
strret
,
NULL
,
&
bstr
);
ret
=
ptr_
StrRetToBSTR
(
&
strret
,
NULL
,
&
bstr
);
ok
(
ret
==
S_OK
&&
bstr
&&
!
strcmpW
(
bstr
,
szTestW
),
"STRRET_WSTR: dup failed, ret=0x%08lx, bstr %p
\n
"
,
ret
,
bstr
);
if
(
bstr
)
...
...
@@ -613,7 +621,7 @@ static void test_StrRetToBSTR(void)
strret
.
uType
=
STRRET_CSTR
;
lstrcpyA
(
strret
.
u
.
cStr
,
"Test"
);
ret
=
StrRetToBSTR
(
&
strret
,
NULL
,
&
bstr
);
ret
=
ptr_
StrRetToBSTR
(
&
strret
,
NULL
,
&
bstr
);
ok
(
ret
==
S_OK
&&
bstr
&&
!
strcmpW
(
bstr
,
szTestW
),
"STRRET_CSTR: dup failed, ret=0x%08lx, bstr %p
\n
"
,
ret
,
bstr
);
if
(
bstr
)
...
...
@@ -622,7 +630,7 @@ static void test_StrRetToBSTR(void)
strret
.
uType
=
STRRET_OFFSET
;
strret
.
u
.
uOffset
=
1
;
strcpy
((
char
*
)
&
iidl
,
" Test"
);
ret
=
StrRetToBSTR
(
&
strret
,
iidl
,
&
bstr
);
ret
=
ptr_
StrRetToBSTR
(
&
strret
,
iidl
,
&
bstr
);
ok
(
ret
==
S_OK
&&
bstr
&&
!
strcmpW
(
bstr
,
szTestW
),
"STRRET_OFFSET: dup failed, ret=0x%08lx, bstr %p
\n
"
,
ret
,
bstr
);
if
(
bstr
)
...
...
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