2000-04-11 22:07:00 +02:00
|
|
|
/*
|
|
|
|
* UrlMon
|
|
|
|
*
|
|
|
|
* Copyright 1999 Corel Corporation
|
|
|
|
*
|
|
|
|
* Ulrich Czekalla
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2000-11-30 02:31:28 +01:00
|
|
|
#include "windef.h"
|
2000-04-11 22:07:00 +02:00
|
|
|
#include "objbase.h"
|
|
|
|
#include "debugtools.h"
|
|
|
|
|
|
|
|
#include "urlmon.h"
|
|
|
|
|
2001-05-31 23:38:38 +02:00
|
|
|
DEFAULT_DEBUG_CHANNEL(urlmon);
|
|
|
|
|
|
|
|
/* native urlmon.dll uses this key, too */
|
|
|
|
static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2001-12-24 21:24:36 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CreateAsyncBindCtxEx (URLMON.@)
|
|
|
|
*
|
|
|
|
* not implemented
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options,
|
|
|
|
IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx** pbind,
|
|
|
|
DWORD reserved)
|
|
|
|
{
|
|
|
|
FIXME("stub, returns failure\n");
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-04-11 22:07:00 +02:00
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* CreateURLMoniker (URLMON.@)
|
2000-04-11 22:07:00 +02:00
|
|
|
*
|
|
|
|
* Create a url moniker
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* S_OK success
|
|
|
|
* E_OUTOFMEMORY out of memory
|
|
|
|
* MK_E_SYNTAX not a valid url
|
|
|
|
*
|
|
|
|
*/
|
2001-10-08 22:27:01 +02:00
|
|
|
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
|
2000-04-11 22:07:00 +02:00
|
|
|
{
|
|
|
|
TRACE("\n");
|
|
|
|
|
|
|
|
if (NULL != pmkContext)
|
|
|
|
FIXME("Non-null pmkContext not implemented\n");
|
|
|
|
|
|
|
|
return CreateFileMoniker(szURL, ppmk);
|
|
|
|
}
|
2001-05-31 23:38:38 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* RegisterBindStatusCallback (URLMON.@)
|
2001-05-31 23:38:38 +02:00
|
|
|
*
|
|
|
|
* Register a bind status callback
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* S_OK success
|
|
|
|
* E_INVALIDARG invalid argument(s)
|
|
|
|
* E_OUTOFMEMORY out of memory
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI RegisterBindStatusCallback(
|
|
|
|
IBindCtx *pbc,
|
|
|
|
IBindStatusCallback *pbsc,
|
|
|
|
IBindStatusCallback **ppbscPrevious,
|
|
|
|
DWORD dwReserved)
|
|
|
|
{
|
|
|
|
IBindStatusCallback *prev;
|
|
|
|
|
|
|
|
TRACE("(%p,%p,%p,%lu)\n", pbc, pbsc, ppbscPrevious, dwReserved);
|
|
|
|
|
|
|
|
if (pbc == NULL || pbsc == NULL)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&prev)))
|
|
|
|
{
|
|
|
|
IBindCtx_RevokeObjectParam(pbc, BSCBHolder);
|
|
|
|
if (ppbscPrevious)
|
|
|
|
*ppbscPrevious = prev;
|
|
|
|
else
|
|
|
|
IBindStatusCallback_Release(prev);
|
|
|
|
}
|
|
|
|
|
|
|
|
return IBindCtx_RegisterObjectParam(pbc, BSCBHolder, (IUnknown *)pbsc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* RevokeBindStatusCallback (URLMON.@)
|
2001-05-31 23:38:38 +02:00
|
|
|
*
|
|
|
|
* Unregister a bind status callback
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* S_OK success
|
|
|
|
* E_INVALIDARG invalid argument(s)
|
|
|
|
* E_FAIL pbsc wasn't registered with pbc
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI RevokeBindStatusCallback(
|
|
|
|
IBindCtx *pbc,
|
|
|
|
IBindStatusCallback *pbsc)
|
|
|
|
{
|
|
|
|
IBindStatusCallback *callback;
|
|
|
|
HRESULT hr = E_FAIL;
|
|
|
|
|
|
|
|
TRACE("(%p,%p)\n", pbc, pbsc);
|
|
|
|
|
|
|
|
if (pbc == NULL || pbsc == NULL)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, BSCBHolder, (IUnknown **)&callback)))
|
|
|
|
{
|
|
|
|
if (callback == pbsc)
|
|
|
|
{
|
|
|
|
IBindCtx_RevokeObjectParam(pbc, BSCBHolder);
|
|
|
|
hr = S_OK;
|
|
|
|
}
|
|
|
|
IBindStatusCallback_Release(pbsc);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|