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
a083415d
Commit
a083415d
authored
Mar 23, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlink: Add link stack to browser context.
parent
3e302776
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
15 deletions
+44
-15
browse_ctx.c
dlls/hlink/browse_ctx.c
+38
-15
browse_ctx.c
dlls/hlink/tests/browse_ctx.c
+6
-0
No files found.
dlls/hlink/browse_ctx.c
View file @
a083415d
...
...
@@ -21,15 +21,23 @@
#include "hlink_private.h"
#include "wine/debug.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
hlink
);
struct
link_entry
{
struct
list
entry
;
IHlink
*
link
;
};
typedef
struct
{
IHlinkBrowseContext
IHlinkBrowseContext_iface
;
LONG
ref
;
HLBWINFO
*
BrowseWindowInfo
;
IHlink
*
CurrentPage
;
struct
link_entry
*
current
;
struct
list
links
;
}
HlinkBCImpl
;
static
inline
HlinkBCImpl
*
impl_from_IHlinkBrowseContext
(
IHlinkBrowseContext
*
iface
)
...
...
@@ -68,18 +76,26 @@ static ULONG WINAPI IHlinkBC_fnAddRef (IHlinkBrowseContext* iface)
static
ULONG
WINAPI
IHlinkBC_fnRelease
(
IHlinkBrowseContext
*
iface
)
{
HlinkBCImpl
*
This
=
impl_from_IHlinkBrowseContext
(
iface
);
ULONG
ref
Count
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(count=%u)
\n
"
,
This
,
refCount
+
1
);
if
(
refCount
)
return
refCount
;
TRACE
(
"(%p)->(count=%u)
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
)
{
struct
link_entry
*
link
,
*
link2
;
LIST_FOR_EACH_ENTRY_SAFE
(
link
,
link2
,
&
This
->
links
,
struct
link_entry
,
entry
)
{
list_remove
(
&
link
->
entry
);
IHlink_Release
(
link
->
link
);
heap_free
(
link
);
}
TRACE
(
"-- destroying IHlinkBrowseContext (%p)
\n
"
,
This
);
heap_free
(
This
->
BrowseWindowInfo
);
if
(
This
->
CurrentPage
)
IHlink_Release
(
This
->
CurrentPage
);
heap_free
(
This
);
return
0
;
}
return
ref
;
}
static
HRESULT
WINAPI
IHlinkBC_Register
(
IHlinkBrowseContext
*
iface
,
...
...
@@ -166,16 +182,21 @@ static HRESULT WINAPI IHlinkBC_SetInitialHlink(IHlinkBrowseContext* iface,
IMoniker
*
pimkTarget
,
LPCWSTR
pwzLocation
,
LPCWSTR
pwzFriendlyName
)
{
HlinkBCImpl
*
This
=
impl_from_IHlinkBrowseContext
(
iface
);
struct
link_entry
*
link
;
TRACE
(
"(%p)->(%p %s %s)
\n
"
,
This
,
pimkTarget
,
debugstr_w
(
pwzLocation
),
debugstr_w
(
pwzFriendlyName
));
FIXME
(
"(%p)->(%p %s %s)
\n
"
,
This
,
pimkTarget
,
debugstr_w
(
pwzLocation
),
debugstr_w
(
pwzFriendlyName
))
;
if
(
!
list_empty
(
&
This
->
links
))
return
CO_E_ALREADYINITIALIZED
;
if
(
This
->
CurrentPage
)
IHlink_Release
(
This
->
CurrentPage
)
;
link
=
heap_alloc
(
sizeof
(
struct
link_entry
));
if
(
!
link
)
return
E_OUTOFMEMORY
;
HlinkCreateFromMoniker
(
pimkTarget
,
pwzLocation
,
pwzFriendlyName
,
NULL
,
0
,
NULL
,
&
IID_IHlink
,
(
LPVOID
*
)
&
This
->
CurrentPage
);
0
,
NULL
,
&
IID_IHlink
,
(
void
**
)
&
link
->
link
);
list_add_head
(
&
This
->
links
,
&
link
->
entry
);
This
->
current
=
LIST_ENTRY
(
list_head
(
&
This
->
links
),
struct
link_entry
,
entry
);
return
S_OK
;
}
...
...
@@ -225,7 +246,7 @@ static HRESULT WINAPI IHlinkBC_GetHlink( IHlinkBrowseContext* iface,
return
E_NOTIMPL
;
}
*
ppihl
=
This
->
CurrentPage
;
*
ppihl
=
This
->
current
->
link
;
IHlink_AddRef
(
*
ppihl
);
return
S_OK
;
...
...
@@ -289,6 +310,8 @@ HRESULT HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid, void **
hl
->
ref
=
1
;
hl
->
IHlinkBrowseContext_iface
.
lpVtbl
=
&
hlvt
;
list_init
(
&
hl
->
links
);
hl
->
current
=
NULL
;
*
ppv
=
hl
;
return
S_OK
;
...
...
dlls/hlink/tests/browse_ctx.c
View file @
a083415d
...
...
@@ -50,6 +50,12 @@ static void test_SetInitialHlink(void)
hres
=
IHlinkBrowseContext_SetInitialHlink
(
bc
,
dummy
,
one
,
NULL
);
ok
(
hres
==
S_OK
,
"SetInitialHlink failed: 0x%08x
\n
"
,
hres
);
hres
=
IHlinkBrowseContext_SetInitialHlink
(
bc
,
dummy
,
one
,
NULL
);
ok
(
hres
==
CO_E_ALREADYINITIALIZED
,
"got 0x%08x
\n
"
,
hres
);
hres
=
IHlinkBrowseContext_SetInitialHlink
(
bc
,
dummy
,
five
,
NULL
);
ok
(
hres
==
CO_E_ALREADYINITIALIZED
,
"got 0x%08x
\n
"
,
hres
);
hres
=
IHlinkBrowseContext_GetHlink
(
bc
,
HLID_CURRENT
,
&
found_hlink
);
ok
(
hres
==
S_OK
,
"GetHlink failed: 0x%08x
\n
"
,
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