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
049f08f4
Commit
049f08f4
authored
Mar 04, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlink: Improve file protocol handling in HlinkParseDisplayName.
parent
595fb40e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
hlink_main.c
dlls/hlink/hlink_main.c
+13
-1
hlink.c
dlls/hlink/tests/hlink.c
+18
-0
No files found.
dlls/hlink/hlink_main.c
View file @
049f08f4
...
...
@@ -380,6 +380,8 @@ HRESULT WINAPI HlinkUpdateStackItem(IHlinkFrame *frame, IHlinkBrowseContext *bc,
HRESULT
WINAPI
HlinkParseDisplayName
(
LPBC
pibc
,
LPCWSTR
pwzDisplayName
,
BOOL
fNoForceAbs
,
ULONG
*
pcchEaten
,
IMoniker
**
ppimk
)
{
static
const
WCHAR
file_colonW
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
};
ULONG
eaten
=
0
;
HRESULT
hres
;
TRACE
(
"(%p %s %x %p %p)
\n
"
,
pibc
,
debugstr_w
(
pwzDisplayName
),
fNoForceAbs
,
pcchEaten
,
ppimk
);
...
...
@@ -387,6 +389,15 @@ HRESULT WINAPI HlinkParseDisplayName(LPBC pibc, LPCWSTR pwzDisplayName, BOOL fNo
if
(
fNoForceAbs
)
FIXME
(
"Unsupported fNoForceAbs
\n
"
);
if
(
!
strncmpiW
(
pwzDisplayName
,
file_colonW
,
sizeof
(
file_colonW
)
/
sizeof
(
WCHAR
)))
{
pwzDisplayName
+=
sizeof
(
file_colonW
)
/
sizeof
(
WCHAR
);
eaten
+=
sizeof
(
file_colonW
)
/
sizeof
(
WCHAR
);
while
(
*
pwzDisplayName
==
'/'
)
{
pwzDisplayName
++
;
eaten
++
;
}
}
else
{
hres
=
MkParseDisplayNameEx
(
pibc
,
pwzDisplayName
,
pcchEaten
,
ppimk
);
if
(
SUCCEEDED
(
hres
))
return
hres
;
...
...
@@ -394,10 +405,11 @@ HRESULT WINAPI HlinkParseDisplayName(LPBC pibc, LPCWSTR pwzDisplayName, BOOL fNo
hres
=
MkParseDisplayName
(
pibc
,
pwzDisplayName
,
pcchEaten
,
ppimk
);
if
(
SUCCEEDED
(
hres
))
return
hres
;
}
hres
=
CreateFileMoniker
(
pwzDisplayName
,
ppimk
);
if
(
SUCCEEDED
(
hres
))
*
pcchEaten
=
strlenW
(
pwzDisplayName
);
*
pcchEaten
=
eaten
+
strlenW
(
pwzDisplayName
);
return
hres
;
}
...
...
dlls/hlink/tests/hlink.c
View file @
049f08f4
...
...
@@ -626,6 +626,8 @@ static void test_HlinkParseDisplayName(void)
static
const
WCHAR
clsid_nameW
[]
=
{
'c'
,
'l'
,
's'
,
'i'
,
'd'
,
':'
,
'2'
,
'0'
,
'D'
,
'0'
,
'4'
,
'F'
,
'E'
,
'0'
,
'-'
,
'3'
,
'A'
,
'E'
,
'A'
,
'-'
,
'1'
,
'0'
,
'6'
,
'9'
,
'-'
,
'A'
,
'2'
,
'D'
,
'8'
,
'-'
,
'0'
,
'8'
,
'0'
,
'0'
,
'2'
,
'B'
,
'3'
,
'0'
,
'3'
,
'0'
,
'9'
,
'D'
,
':'
,
0
};
static
const
WCHAR
file_urlW
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
,
'c'
,
':'
,
'\\'
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
't'
,
'x'
,
't'
,
0
};
CreateBindCtx
(
0
,
&
bctx
);
...
...
@@ -671,6 +673,22 @@ static void test_HlinkParseDisplayName(void)
ok
(
issys
==
MKSYS_FILEMONIKER
,
"issys=%x
\n
"
,
issys
);
IMoniker_Release
(
mon
);
hres
=
HlinkParseDisplayName
(
bctx
,
file_urlW
,
FALSE
,
&
eaten
,
&
mon
);
ok
(
hres
==
S_OK
,
"HlinkParseDisplayName failed: %08x
\n
"
,
hres
);
ok
(
eaten
==
sizeof
(
file_urlW
)
/
sizeof
(
WCHAR
)
-
1
,
"eaten=%d
\n
"
,
eaten
);
ok
(
mon
!=
NULL
,
"mon == NULL
\n
"
);
hres
=
IMoniker_GetDisplayName
(
mon
,
bctx
,
0
,
&
name
);
ok
(
hres
==
S_OK
,
"GetDiasplayName failed: %08x
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
name
,
file_urlW
+
8
),
"wrong display name %s
\n
"
,
wine_dbgstr_w
(
name
));
CoTaskMemFree
(
name
);
hres
=
IMoniker_IsSystemMoniker
(
mon
,
&
issys
);
ok
(
hres
==
S_OK
,
"IsSystemMoniker failed: %08x
\n
"
,
hres
);
ok
(
issys
==
MKSYS_FILEMONIKER
,
"issys=%x
\n
"
,
issys
);
IMoniker_Release
(
mon
);
IBindCtx_Release
(
bctx
);
}
...
...
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