https://git.reactos.org/?p=reactos.git;a=commitdiff;h=73921e94128290a08598e…
commit 73921e94128290a08598ef479ce5cd7d997e2b34
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Fri Jan 19 00:23:23 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Fri Jan 19 00:23:23 2018 +0100
[HLINK] Sync with Wine 3.0. CORE-14225
---
dll/win32/hlink/browse_ctx.c | 27 +++++++++++++++++++++++----
dll/win32/hlink/link.c | 43 ++++++++++++++++++++++++-------------------
media/doc/README.WINE | 2 +-
3 files changed, 48 insertions(+), 24 deletions(-)
diff --git a/dll/win32/hlink/browse_ctx.c b/dll/win32/hlink/browse_ctx.c
index 0e76284544..00007f6b52 100644
--- a/dll/win32/hlink/browse_ctx.c
+++ b/dll/win32/hlink/browse_ctx.c
@@ -95,10 +95,11 @@ static ULONG WINAPI IHlinkBC_fnRelease (IHlinkBrowseContext* iface)
return ref;
}
+static const WCHAR szIdent[] =
{'W','I','N','E','H','L','I','N','K',0};
+
static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface,
DWORD dwReserved, IUnknown *piunk, IMoniker *pimk, DWORD *pdwRegister)
{
- static const WCHAR szIdent[] =
{'W','I','N','E','H','L','I','N','K',0};
HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
IMoniker *mon;
IMoniker *composite;
@@ -122,11 +123,29 @@ static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface,
return S_OK;
}
-static HRESULT WINAPI IHlinkBC_GetObject(IHlinkBrowseContext* face,
+static HRESULT WINAPI IHlinkBC_GetObject(IHlinkBrowseContext* iface,
IMoniker *pimk, BOOL fBindifRootRegistered, IUnknown **ppiunk)
{
- FIXME("\n");
- return E_NOTIMPL;
+ HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
+ IMoniker *mon;
+ IMoniker *composite;
+ IRunningObjectTable *ROT;
+ HRESULT hr;
+
+ TRACE("(%p)->(%p, %d, %p)\n", This, pimk, fBindifRootRegistered,
ppiunk);
+
+ hr = CreateItemMoniker(NULL, szIdent, &mon);
+ if (FAILED(hr)) return hr;
+ CreateGenericComposite(mon, pimk, &composite);
+
+ GetRunningObjectTable(0, &ROT);
+ hr = IRunningObjectTable_GetObject(ROT, composite, ppiunk);
+
+ IRunningObjectTable_Release(ROT);
+ IMoniker_Release(composite);
+ IMoniker_Release(mon);
+
+ return hr;
}
static HRESULT WINAPI IHlinkBC_Revoke(IHlinkBrowseContext* iface,
diff --git a/dll/win32/hlink/link.c b/dll/win32/hlink/link.c
index c240fccd36..88b7093c32 100644
--- a/dll/win32/hlink/link.c
+++ b/dll/win32/hlink/link.c
@@ -481,25 +481,33 @@ static HRESULT WINAPI IHlink_fnNavigate(IHlink* iface, DWORD
grfHLNF, LPBC pbc,
if (SUCCEEDED(r))
{
- IBindCtx *bcxt;
+ IBindCtx *bcxt = NULL;
IUnknown *unk = NULL;
IHlinkTarget *target;
- CreateBindCtx(0, &bcxt);
-
- RegisterBindStatusCallback(bcxt, pbsc, NULL, 0);
-
- r = IMoniker_BindToObject(mon, bcxt, NULL, &IID_IUnknown, (void**)&unk);
- if (r == S_OK)
- {
- r = IUnknown_QueryInterface(unk, &IID_IHlinkTarget,
(void**)&target);
- IUnknown_Release(unk);
- }
- if (r == S_OK)
+ if (phbc)
{
- IHlinkTarget_SetBrowseContext(target, phbc);
- r = IHlinkTarget_Navigate(target, grfHLNF, This->Location);
- IHlinkTarget_Release(target);
+ r = IHlinkBrowseContext_GetObject(phbc, mon, TRUE, &unk);
+ if (r == S_FALSE)
+ {
+ CreateBindCtx(0, &bcxt);
+ RegisterBindStatusCallback(bcxt, pbsc, NULL, 0);
+ r = IMoniker_BindToObject(mon, bcxt, NULL, &IID_IUnknown,
(void**)&unk);
+ }
+ if (r == S_OK)
+ {
+ r = IUnknown_QueryInterface(unk, &IID_IHlinkTarget, (void
**)&target);
+ IUnknown_Release(unk);
+ }
+ if (r == S_OK)
+ {
+ if (bcxt) IHlinkTarget_SetBrowseContext(target, phbc);
+ r = IHlinkTarget_Navigate(target, grfHLNF, This->Location);
+ IHlinkTarget_Release(target);
+ }
+
+ RevokeBindStatusCallback(bcxt, pbsc);
+ if (bcxt) IBindCtx_Release(bcxt);
}
else
{
@@ -511,12 +519,9 @@ static HRESULT WINAPI IHlink_fnNavigate(IHlink* iface, DWORD grfHLNF,
LPBC pbc,
{
ShellExecuteW(NULL, szOpen, target, NULL, NULL, SW_SHOW);
CoTaskMemFree(target);
+ r = DRAGDROP_S_DROP;
}
}
-
- RevokeBindStatusCallback(bcxt, pbsc);
-
- IBindCtx_Release(bcxt);
IMoniker_Release(mon);
}
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index d6031a54b7..e67bc01b74 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -70,7 +70,7 @@ reactos/dll/win32/fontsub # Synced to WineStaging-2.9
reactos/dll/win32/fusion # Synced to Wine-3.0
reactos/dll/win32/gdiplus # Synced to Wine-3.0
reactos/dll/win32/hhctrl.ocx # Synced to Wine-3.0
-reactos/dll/win32/hlink # Synced to WineStaging-2.9
+reactos/dll/win32/hlink # Synced to Wine-3.0
reactos/dll/win32/hnetcfg # Synced to WineStaging-2.9
reactos/dll/win32/httpapi # Synced to WineStaging-2.9
reactos/dll/win32/iccvid # Synced to WineStaging-2.9