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
a4b5ccfc
Commit
a4b5ccfc
authored
Oct 20, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Oct 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlink: Use HLINKSETF flags in Hlink::fnSetMonikerReference.
parent
258fd75b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
16 deletions
+123
-16
hlink_main.c
dlls/hlink/hlink_main.c
+2
-2
link.c
dlls/hlink/link.c
+22
-13
hlink.c
dlls/hlink/tests/hlink.c
+98
-0
navigate.c
dlls/mshtml/navigate.c
+1
-1
No files found.
dlls/hlink/hlink_main.c
View file @
a4b5ccfc
...
...
@@ -84,7 +84,7 @@ HRESULT WINAPI HlinkCreateFromMoniker( IMoniker *pimkTrgt, LPCWSTR pwzLocation,
if
(
pihlsite
)
IHlink_SetHlinkSite
(
hl
,
pihlsite
,
dwSiteData
);
if
(
pimkTrgt
)
IHlink_SetMonikerReference
(
hl
,
0
,
pimkTrgt
,
pwzLocation
);
IHlink_SetMonikerReference
(
hl
,
HLINKSETF_LOCATION
|
HLINKSETF_TARGET
,
pimkTrgt
,
pwzLocation
);
*
ppvObj
=
hl
;
...
...
@@ -140,7 +140,7 @@ HRESULT WINAPI HlinkCreateFromString( LPCWSTR pwzTarget, LPCWSTR pwzLocation,
return
r
;
}
IHlink_SetMonikerReference
(
hl
,
0
,
pTgtMk
,
pwzLocation
);
IHlink_SetMonikerReference
(
hl
,
HLINKSETF_TARGET
|
HLINKSETF_LOCATION
,
pTgtMk
,
pwzLocation
);
IMoniker_Release
(
pTgtMk
);
IHlink_SetStringReference
(
hl
,
HLINKSETF_TARGET
,
pwzTarget
,
NULL
);
...
...
dlls/hlink/link.c
View file @
a4b5ccfc
...
...
@@ -206,24 +206,33 @@ static HRESULT WINAPI IHlink_fnSetMonikerReference( IHlink* iface,
{
HlinkImpl
*
This
=
(
HlinkImpl
*
)
iface
;
FIXM
E
(
"(%p)->(%i %p %s)
\n
"
,
This
,
rfHLSETF
,
pmkTarget
,
TRAC
E
(
"(%p)->(%i %p %s)
\n
"
,
This
,
rfHLSETF
,
pmkTarget
,
debugstr_w
(
pwzLocation
));
if
(
This
->
Moniker
)
IMoniker_Release
(
This
->
Moniker
);
if
(
rfHLSETF
==
0
)
return
E_INVALIDARG
;
if
(
!
(
rfHLSETF
&
(
HLINKSETF_TARGET
|
HLINKSETF_LOCATION
)))
return
rfHLSETF
;
This
->
Moniker
=
pmkTarget
;
if
(
This
->
Moniker
)
{
LPOLESTR
display_name
;
IMoniker_AddRef
(
This
->
Moniker
);
IMoniker_GetDisplayName
(
This
->
Moniker
,
NULL
,
NULL
,
&
display_name
);
This
->
absolute
=
display_name
&&
strchrW
(
display_name
,
':'
);
CoTaskMemFree
(
display_name
);
if
(
rfHLSETF
&
HLINKSETF_TARGET
){
if
(
This
->
Moniker
)
IMoniker_Release
(
This
->
Moniker
);
This
->
Moniker
=
pmkTarget
;
if
(
This
->
Moniker
)
{
LPOLESTR
display_name
;
IMoniker_AddRef
(
This
->
Moniker
);
IMoniker_GetDisplayName
(
This
->
Moniker
,
NULL
,
NULL
,
&
display_name
);
This
->
absolute
=
display_name
&&
strchrW
(
display_name
,
':'
);
CoTaskMemFree
(
display_name
);
}
}
heap_free
(
This
->
Location
);
This
->
Location
=
hlink_strdupW
(
pwzLocation
);
if
(
rfHLSETF
&
HLINKSETF_LOCATION
){
heap_free
(
This
->
Location
);
This
->
Location
=
hlink_strdupW
(
pwzLocation
);
}
return
S_OK
;
}
...
...
dlls/hlink/tests/hlink.c
View file @
a4b5ccfc
...
...
@@ -1016,6 +1016,103 @@ static void test_HlinkResolveMonikerForData(void)
IBindCtx_Release
(
bctx
);
}
static
void
test_HlinkGetSetMonikerReference
(
void
)
{
IMoniker
*
found_trgt
,
*
dummy
,
*
dummy2
;
IHlink
*
hlink
;
HRESULT
hres
;
const
WCHAR
one
[]
=
{
'1'
,
0
};
const
WCHAR
two
[]
=
{
'2'
,
0
};
const
WCHAR
name
[]
=
{
'a'
,
0
};
WCHAR
*
found_loc
;
/* create two dummy monikers to use as targets */
hres
=
CreateItemMoniker
(
one
,
one
,
&
dummy
);
ok
(
hres
==
S_OK
,
"CreateItemMoniker failed: 0x%08x
\n
"
,
hres
);
hres
=
CreateItemMoniker
(
two
,
two
,
&
dummy2
);
ok
(
hres
==
S_OK
,
"CreateItemMoniker failed: 0x%08x
\n
"
,
hres
);
/* create a new hlink: target => dummy, location => one */
hres
=
HlinkCreateFromMoniker
(
dummy
,
one
,
name
,
NULL
,
0
,
NULL
,
&
IID_IHlink
,
(
void
**
)
&
hlink
);
ok
(
hres
==
S_OK
,
"HlinkCreateFromMoniker failed: 0x%08x
\n
"
,
hres
);
/* validate the target and location */
hres
=
IHlink_GetMonikerReference
(
hlink
,
HLINKGETREF_DEFAULT
,
&
found_trgt
,
&
found_loc
);
ok
(
hres
==
S_OK
,
"IHlink_GetMonikerReference failed: 0x%08x
\n
"
,
hres
);
ok
(
found_trgt
==
dummy
,
"Found target should've been %p, was: %p
\n
"
,
dummy
,
found_trgt
);
ok
(
lstrcmpW
(
found_loc
,
one
)
==
0
,
"Found location should've been %s, was: %s
\n
"
,
wine_dbgstr_w
(
one
),
wine_dbgstr_w
(
found_loc
));
IMoniker_Release
(
found_trgt
);
/* set location => two */
hres
=
IHlink_SetMonikerReference
(
hlink
,
HLINKSETF_LOCATION
,
dummy2
,
two
);
ok
(
hres
==
S_OK
,
"IHlink_SetMonikerReference failed: 0x%08x
\n
"
,
hres
);
hres
=
IHlink_GetMonikerReference
(
hlink
,
HLINKGETREF_DEFAULT
,
&
found_trgt
,
&
found_loc
);
ok
(
found_trgt
==
dummy
,
"Found target should've been %p, was: %p
\n
"
,
dummy
,
found_trgt
);
ok
(
lstrcmpW
(
found_loc
,
two
)
==
0
,
"Found location should've been %s, was: %s
\n
"
,
wine_dbgstr_w
(
two
),
wine_dbgstr_w
(
found_loc
));
IMoniker_Release
(
found_trgt
);
/* set target => dummy2 */
hres
=
IHlink_SetMonikerReference
(
hlink
,
HLINKSETF_TARGET
,
dummy2
,
one
);
ok
(
hres
==
S_OK
,
"IHlink_SetMonikerReference failed: 0x%08x
\n
"
,
hres
);
hres
=
IHlink_GetMonikerReference
(
hlink
,
HLINKGETREF_DEFAULT
,
&
found_trgt
,
&
found_loc
);
ok
(
found_trgt
==
dummy2
,
"Found target should've been %p, was: %p
\n
"
,
dummy2
,
found_trgt
);
ok
(
lstrcmpW
(
found_loc
,
two
)
==
0
,
"Found location should've been %s, was: %s
\n
"
,
wine_dbgstr_w
(
two
),
wine_dbgstr_w
(
found_loc
));
IMoniker_Release
(
found_trgt
);
/* set target => dummy, location => one */
hres
=
IHlink_SetMonikerReference
(
hlink
,
HLINKSETF_TARGET
|
HLINKSETF_LOCATION
,
dummy
,
one
);
ok
(
hres
==
S_OK
,
"IHlink_SetMonikerReference failed: 0x%08x
\n
"
,
hres
);
hres
=
IHlink_GetMonikerReference
(
hlink
,
HLINKGETREF_DEFAULT
,
&
found_trgt
,
&
found_loc
);
ok
(
found_trgt
==
dummy
,
"Found target should've been %p, was: %p
\n
"
,
dummy
,
found_trgt
);
ok
(
lstrcmpW
(
found_loc
,
one
)
==
0
,
"Found location should've been %s, was: %s
\n
"
,
wine_dbgstr_w
(
one
),
wine_dbgstr_w
(
found_loc
));
IMoniker_Release
(
found_trgt
);
/* no HLINKSETF flags */
hres
=
IHlink_SetMonikerReference
(
hlink
,
0
,
dummy2
,
two
);
ok
(
hres
==
E_INVALIDARG
,
"IHlink_SetMonikerReference should've failed with E_INVALIDARG (0x%08x), failed with 0x%08x
\n
"
,
E_INVALIDARG
,
hres
);
hres
=
IHlink_GetMonikerReference
(
hlink
,
HLINKGETREF_DEFAULT
,
&
found_trgt
,
&
found_loc
);
ok
(
found_trgt
==
dummy
,
"Found target should've been %p, was: %p
\n
"
,
dummy
,
found_trgt
);
ok
(
lstrcmpW
(
found_loc
,
one
)
==
0
,
"Found location should've been %s, was: %s
\n
"
,
wine_dbgstr_w
(
one
),
wine_dbgstr_w
(
found_loc
));
IMoniker_Release
(
found_trgt
);
/* invalid HLINKSETF flags */
hres
=
IHlink_SetMonikerReference
(
hlink
,
12
,
dummy2
,
two
);
ok
(
hres
==
12
,
"IHlink_SetMonikerReference should've failed with 0x%08x, failed with 0x%08x
\n
"
,
12
,
hres
);
hres
=
IHlink_GetMonikerReference
(
hlink
,
HLINKGETREF_DEFAULT
,
&
found_trgt
,
&
found_loc
);
ok
(
found_trgt
==
dummy
,
"Found target should've been %p, was: %p
\n
"
,
dummy
,
found_trgt
);
ok
(
lstrcmpW
(
found_loc
,
one
)
==
0
,
"Found location should've been %s, was: %s
\n
"
,
wine_dbgstr_w
(
one
),
wine_dbgstr_w
(
found_loc
));
IMoniker_Release
(
found_trgt
);
/* valid & invalid HLINKSETF flags */
hres
=
IHlink_SetMonikerReference
(
hlink
,
12
|
HLINKSETF_TARGET
,
dummy2
,
two
);
ok
(
hres
==
S_OK
,
"IHlink_SetMonikerReference failed: 0x%08x
\n
"
,
hres
);
hres
=
IHlink_GetMonikerReference
(
hlink
,
HLINKGETREF_DEFAULT
,
&
found_trgt
,
&
found_loc
);
ok
(
found_trgt
==
dummy2
,
"Found target should've been %p, was: %p
\n
"
,
dummy2
,
found_trgt
);
ok
(
lstrcmpW
(
found_loc
,
one
)
==
0
,
"Found location should've been %s, was: %s
\n
"
,
wine_dbgstr_w
(
one
),
wine_dbgstr_w
(
found_loc
));
IMoniker_Release
(
found_trgt
);
/* NULL args */
hres
=
IHlink_SetMonikerReference
(
hlink
,
HLINKSETF_TARGET
|
HLINKSETF_LOCATION
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"IHlink_SetMonikerReference failed: 0x%08x
\n
"
,
hres
);
hres
=
IHlink_GetMonikerReference
(
hlink
,
HLINKGETREF_DEFAULT
,
&
found_trgt
,
&
found_loc
);
ok
(
found_trgt
==
NULL
,
"Found target should've been %p, was: %p
\n
"
,
NULL
,
found_trgt
);
ok
(
found_loc
==
NULL
,
"Found location should've been %s, was: %s
\n
"
,
wine_dbgstr_w
(
NULL
),
wine_dbgstr_w
(
found_loc
));
if
(
found_trgt
)
IMoniker_Release
(
found_trgt
);
IHlink_Release
(
hlink
);
IMoniker_Release
(
dummy2
);
IMoniker_Release
(
dummy
);
}
START_TEST
(
hlink
)
{
CoInitialize
(
NULL
);
...
...
@@ -1027,6 +1124,7 @@ START_TEST(hlink)
test_HlinkCreateExtensionServices
();
test_HlinkParseDisplayName
();
test_HlinkResolveMonikerForData
();
test_HlinkGetSetMonikerReference
();
CoUninitialize
();
}
dlls/mshtml/navigate.c
View file @
a4b5ccfc
...
...
@@ -1202,7 +1202,7 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url,
hres
=
CreateURLMoniker
(
NULL
,
url
,
&
mon
);
if
(
SUCCEEDED
(
hres
))
{
IHlink_SetMonikerReference
(
hlink
,
0
,
mon
,
NULL
);
IHlink_SetMonikerReference
(
hlink
,
HLINKSETF_TARGET
,
mon
,
NULL
);
if
(
hlnf
&
HLNF_OPENINNEWWINDOW
)
{
static
const
WCHAR
wszBlank
[]
=
{
'_'
,
'b'
,
'l'
,
'a'
,
'n'
,
'k'
,
0
};
...
...
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