mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 07:41:51 +00:00
sync urlmon to wine 1.1.18
svn path=/trunk/; revision=40407
This commit is contained in:
parent
9e85bd53f0
commit
83beea82c7
3 changed files with 167 additions and 245 deletions
|
@ -34,54 +34,50 @@
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
|
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
const IMonikerVtbl *lpIMonikerVtbl;
|
||||||
|
|
||||||
const IMonikerVtbl* lpvtbl; /* VTable relative to the IMoniker interface.*/
|
LONG ref;
|
||||||
|
|
||||||
LONG ref; /* reference counter for this object */
|
|
||||||
|
|
||||||
LPOLESTR URLName; /* URL string identified by this URLmoniker */
|
LPOLESTR URLName; /* URL string identified by this URLmoniker */
|
||||||
} URLMonikerImpl;
|
} URLMoniker;
|
||||||
|
|
||||||
/*******************************************************************************
|
#define MONIKER_THIS(iface) DEFINE_THIS(URLMoniker, IMoniker, iface)
|
||||||
* URLMoniker_QueryInterface
|
|
||||||
*******************************************************************************/
|
static HRESULT WINAPI URLMoniker_QueryInterface(IMoniker *iface, REFIID riid, void **ppv)
|
||||||
static HRESULT WINAPI URLMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);
|
if(!ppv)
|
||||||
|
|
||||||
/* Perform a sanity check on the parameters.*/
|
|
||||||
if ( (This==0) || (ppvObject==0) )
|
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
/* Initialize the return parameter */
|
if(IsEqualIID(&IID_IUnknown, riid)) {
|
||||||
*ppvObject = 0;
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||||
|
*ppv = iface;
|
||||||
/* Compare the riid with the interface IDs implemented by this object.*/
|
}else if(IsEqualIID(&IID_IPersist, riid)) {
|
||||||
if (IsEqualIID(&IID_IUnknown, riid) ||
|
TRACE("(%p)->(IID_IPersist %p)\n", This, ppv);
|
||||||
IsEqualIID(&IID_IPersist, riid) ||
|
*ppv = iface;
|
||||||
IsEqualIID(&IID_IPersistStream,riid) ||
|
}else if(IsEqualIID(&IID_IPersistStream,riid)) {
|
||||||
IsEqualIID(&IID_IMoniker, riid)
|
TRACE("(%p)->(IID_IPersistStream %p)\n", This, ppv);
|
||||||
)
|
*ppv = iface;
|
||||||
*ppvObject = iface;
|
}else if(IsEqualIID(&IID_IMoniker, riid)) {
|
||||||
|
TRACE("(%p)->(IID_IMoniker %p)\n", This, ppv);
|
||||||
/* Check that we obtained an interface.*/
|
*ppv = iface;
|
||||||
if ((*ppvObject)==0)
|
}else if(IsEqualIID(&IID_IAsyncMoniker, riid)) {
|
||||||
|
TRACE("(%p)->(IID_IAsyncMoniker %p)\n", This, ppv);
|
||||||
|
*ppv = iface;
|
||||||
|
}else {
|
||||||
|
WARN("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv);
|
||||||
|
*ppv = NULL;
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Query Interface always increases the reference count by one when it is successful */
|
IMoniker_AddRef((IUnknown*)*ppv);
|
||||||
IMoniker_AddRef(iface);
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static ULONG WINAPI URLMoniker_AddRef(IMoniker *iface)
|
||||||
* URLMoniker_AddRef
|
|
||||||
******************************************************************************/
|
|
||||||
static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
ULONG refCount = InterlockedIncrement(&This->ref);
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref=%u\n",This, refCount);
|
TRACE("(%p) ref=%u\n",This, refCount);
|
||||||
|
@ -89,17 +85,13 @@ static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static ULONG WINAPI URLMoniker_Release(IMoniker *iface)
|
||||||
* URLMoniker_Release
|
|
||||||
******************************************************************************/
|
|
||||||
static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
ULONG refCount = InterlockedDecrement(&This->ref);
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
||||||
|
|
||||||
TRACE("(%p) ref=%u\n",This, refCount);
|
TRACE("(%p) ref=%u\n",This, refCount);
|
||||||
|
|
||||||
/* destroy the object if there's no more reference on it */
|
|
||||||
if (!refCount) {
|
if (!refCount) {
|
||||||
heap_free(This->URLName);
|
heap_free(This->URLName);
|
||||||
heap_free(This);
|
heap_free(This);
|
||||||
|
@ -110,58 +102,49 @@ static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface)
|
||||||
return refCount;
|
return refCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI URLMoniker_GetClassID(IMoniker *iface, CLSID *pClassID)
|
||||||
/******************************************************************************
|
|
||||||
* URLMoniker_GetClassID
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_GetClassID(IMoniker* iface,
|
|
||||||
CLSID *pClassID)/* Pointer to CLSID of object */
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
TRACE("(%p,%p)\n",This,pClassID);
|
TRACE("(%p,%p)\n", This, pClassID);
|
||||||
|
|
||||||
if (pClassID==NULL)
|
if(!pClassID)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
/* Windows always returns CLSID_StdURLMoniker */
|
/* Windows always returns CLSID_StdURLMoniker */
|
||||||
*pClassID = CLSID_StdURLMoniker;
|
*pClassID = CLSID_StdURLMoniker;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_IsDirty(IMoniker *iface)
|
||||||
* URLMoniker_IsDirty
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_IsDirty(IMoniker* iface)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
/* Note that the OLE-provided implementations of the IPersistStream::IsDirty
|
|
||||||
method in the OLE-provided moniker interfaces always return S_FALSE because
|
|
||||||
their internal state never changes. */
|
|
||||||
|
|
||||||
TRACE("(%p)\n",This);
|
TRACE("(%p)\n",This);
|
||||||
|
|
||||||
|
/* Note that the OLE-provided implementations of the IPersistStream::IsDirty
|
||||||
|
method in the OLE-provided moniker interfaces always return S_FALSE because
|
||||||
|
their internal state never changes. */
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_Load(IMoniker* iface,IStream* pStm)
|
||||||
* URLMoniker_Load
|
|
||||||
*
|
|
||||||
* NOTE
|
|
||||||
* Writes a ULONG containing length of unicode string, followed
|
|
||||||
* by that many unicode characters
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_Load(IMoniker* iface,IStream* pStm)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
ULONG size;
|
ULONG size;
|
||||||
ULONG got;
|
ULONG got;
|
||||||
|
|
||||||
TRACE("(%p,%p)\n",This,pStm);
|
TRACE("(%p,%p)\n",This,pStm);
|
||||||
|
|
||||||
if(!pStm)
|
if(!pStm)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE
|
||||||
|
* Writes a ULONG containing length of unicode string, followed
|
||||||
|
* by that many unicode characters
|
||||||
|
*/
|
||||||
res = IStream_Read(pStm, &size, sizeof(ULONG), &got);
|
res = IStream_Read(pStm, &size, sizeof(ULONG), &got);
|
||||||
if(SUCCEEDED(res)) {
|
if(SUCCEEDED(res)) {
|
||||||
if(got == sizeof(ULONG)) {
|
if(got == sizeof(ULONG)) {
|
||||||
|
@ -177,21 +160,17 @@ static HRESULT WINAPI URLMonikerImpl_Load(IMoniker* iface,IStream* pStm)
|
||||||
else
|
else
|
||||||
res = E_FAIL;
|
res = E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_Save(IMoniker *iface, IStream* pStm, BOOL fClearDirty)
|
||||||
* URLMoniker_Save
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_Save(IMoniker* iface,
|
|
||||||
IStream* pStm,/* pointer to the stream where the object is to be saved */
|
|
||||||
BOOL fClearDirty)/* Specifies whether to clear the dirty flag */
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
ULONG size;
|
ULONG size;
|
||||||
TRACE("(%p,%p,%d)\n",This,pStm,fClearDirty);
|
|
||||||
|
TRACE("(%p,%p,%d)\n", This, pStm, fClearDirty);
|
||||||
|
|
||||||
if(!pStm)
|
if(!pStm)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -200,17 +179,14 @@ static HRESULT WINAPI URLMonikerImpl_Save(IMoniker* iface,
|
||||||
res=IStream_Write(pStm,&size,sizeof(ULONG),NULL);
|
res=IStream_Write(pStm,&size,sizeof(ULONG),NULL);
|
||||||
if(SUCCEEDED(res))
|
if(SUCCEEDED(res))
|
||||||
res=IStream_Write(pStm,This->URLName,size,NULL);
|
res=IStream_Write(pStm,This->URLName,size,NULL);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_GetSizeMax(IMoniker* iface, ULARGE_INTEGER *pcbSize)
|
||||||
* URLMoniker_GetSizeMax
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_GetSizeMax(IMoniker* iface,
|
|
||||||
ULARGE_INTEGER* pcbSize)/* Pointer to size of stream needed to save object */
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
TRACE("(%p,%p)\n",This,pcbSize);
|
TRACE("(%p,%p)\n",This,pcbSize);
|
||||||
|
|
||||||
|
@ -221,16 +197,10 @@ static HRESULT WINAPI URLMonikerImpl_GetSizeMax(IMoniker* iface,
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_BindToObject(IMoniker *iface, IBindCtx* pbc, IMoniker *pmkToLeft,
|
||||||
* URLMoniker_BindToObject
|
REFIID riid, void **ppv)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_BindToObject(IMoniker* iface,
|
|
||||||
IBindCtx* pbc,
|
|
||||||
IMoniker* pmkToLeft,
|
|
||||||
REFIID riid,
|
|
||||||
VOID** ppv)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
IRunningObjectTable *obj_tbl;
|
IRunningObjectTable *obj_tbl;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
@ -245,16 +215,10 @@ static HRESULT WINAPI URLMonikerImpl_BindToObject(IMoniker* iface,
|
||||||
return bind_to_object(iface, This->URLName, pbc, riid, ppv);
|
return bind_to_object(iface, This->URLName, pbc, riid, ppv);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_BindToStorage(IMoniker* iface, IBindCtx* pbc,
|
||||||
* URLMoniker_BindToStorage
|
IMoniker* pmkToLeft, REFIID riid, void **ppvObject)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
|
|
||||||
IBindCtx* pbc,
|
|
||||||
IMoniker* pmkToLeft,
|
|
||||||
REFIID riid,
|
|
||||||
VOID** ppvObject)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl*)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject);
|
TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject);
|
||||||
|
|
||||||
|
@ -264,48 +228,34 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
|
||||||
return bind_to_storage(This->URLName, pbc, riid, ppvObject);
|
return bind_to_storage(This->URLName, pbc, riid, ppvObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_Reduce(IMoniker *iface, IBindCtx *pbc,
|
||||||
* URLMoniker_Reduce
|
DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_Reduce(IMoniker* iface,
|
|
||||||
IBindCtx* pbc,
|
|
||||||
DWORD dwReduceHowFar,
|
|
||||||
IMoniker** ppmkToLeft,
|
|
||||||
IMoniker** ppmkReduced)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
TRACE("(%p,%p,%d,%p,%p)\n",This,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
|
TRACE("(%p,%p,%d,%p,%p)\n", This, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced);
|
||||||
|
|
||||||
if(!ppmkReduced)
|
if(!ppmkReduced)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
URLMonikerImpl_AddRef(iface);
|
IMoniker_AddRef(iface);
|
||||||
*ppmkReduced = iface;
|
*ppmkReduced = iface;
|
||||||
return MK_S_REDUCED_TO_SELF;
|
return MK_S_REDUCED_TO_SELF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_ComposeWith(IMoniker *iface, IMoniker *pmkRight,
|
||||||
* URLMoniker_ComposeWith
|
BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_ComposeWith(IMoniker* iface,
|
|
||||||
IMoniker* pmkRight,
|
|
||||||
BOOL fOnlyIfNotGeneric,
|
|
||||||
IMoniker** ppmkComposite)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
FIXME("(%p)->(%p,%d,%p): stub\n",This,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
|
FIXME("(%p)->(%p,%d,%p): stub\n",This,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_Enum(IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
|
||||||
* URLMoniker_Enum
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
TRACE("(%p,%d,%p)\n",This,fForward,ppenumMoniker);
|
|
||||||
|
TRACE("(%p,%d,%p)\n", This, fForward, ppenumMoniker);
|
||||||
|
|
||||||
if(!ppenumMoniker)
|
if(!ppenumMoniker)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -315,18 +265,15 @@ static HRESULT WINAPI URLMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMo
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker)
|
||||||
* URLMoniker_IsEqual
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
CLSID clsid;
|
CLSID clsid;
|
||||||
LPOLESTR urlPath;
|
LPOLESTR urlPath;
|
||||||
IBindCtx* bind;
|
IBindCtx* bind;
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
|
|
||||||
TRACE("(%p,%p)\n",This,pmkOtherMoniker);
|
TRACE("(%p,%p)\n",This, pmkOtherMoniker);
|
||||||
|
|
||||||
if(pmkOtherMoniker==NULL)
|
if(pmkOtherMoniker==NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
@ -352,13 +299,9 @@ static HRESULT WINAPI URLMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_Hash(IMoniker *iface, DWORD *pdwHash)
|
||||||
* URLMoniker_Hash
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
int h = 0,i,skip,len;
|
int h = 0,i,skip,len;
|
||||||
int off = 0;
|
int off = 0;
|
||||||
LPOLESTR val;
|
LPOLESTR val;
|
||||||
|
@ -375,8 +318,7 @@ static HRESULT WINAPI URLMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
|
||||||
for(i = len ; i > 0; i--) {
|
for(i = len ; i > 0; i--) {
|
||||||
h = (h * 37) + val[off++];
|
h = (h * 37) + val[off++];
|
||||||
}
|
}
|
||||||
}
|
}else {
|
||||||
else {
|
|
||||||
/* only sample some characters */
|
/* only sample some characters */
|
||||||
skip = len / 8;
|
skip = len / 8;
|
||||||
for(i = len; i > 0; i -= skip, off += skip) {
|
for(i = len; i > 0; i -= skip, off += skip) {
|
||||||
|
@ -387,84 +329,57 @@ static HRESULT WINAPI URLMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_IsRunning(IMoniker* iface, IBindCtx* pbc,
|
||||||
* URLMoniker_IsRunning
|
IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_IsRunning(IMoniker* iface,
|
|
||||||
IBindCtx* pbc,
|
|
||||||
IMoniker* pmkToLeft,
|
|
||||||
IMoniker* pmkNewlyRunning)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
FIXME("(%p)->(%p,%p,%p): stub\n",This,pbc,pmkToLeft,pmkNewlyRunning);
|
FIXME("(%p)->(%p,%p,%p): stub\n",This,pbc,pmkToLeft,pmkNewlyRunning);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_GetTimeOfLastChange(IMoniker *iface,
|
||||||
* URLMoniker_GetTimeOfLastChange
|
IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pFileTime)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_GetTimeOfLastChange(IMoniker* iface,
|
|
||||||
IBindCtx* pbc,
|
|
||||||
IMoniker* pmkToLeft,
|
|
||||||
FILETIME* pFileTime)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
FIXME("(%p)->(%p,%p,%p): stub\n",This,pbc,pmkToLeft,pFileTime);
|
FIXME("(%p)->(%p,%p,%p): stub\n", This, pbc, pmkToLeft, pFileTime);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_Inverse(IMoniker *iface, IMoniker **ppmk)
|
||||||
* URLMoniker_Inverse
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
TRACE("(%p,%p)\n",This,ppmk);
|
TRACE("(%p,%p)\n",This,ppmk);
|
||||||
|
|
||||||
return MK_E_NOINVERSE;
|
return MK_E_NOINVERSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_CommonPrefixWith(IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
|
||||||
* URLMoniker_CommonPrefixWith
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
FIXME("(%p)->(%p,%p): stub\n",This,pmkOther,ppmkPrefix);
|
FIXME("(%p)->(%p,%p): stub\n",This,pmkOther,ppmkPrefix);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_RelativePathTo(IMoniker *iface, IMoniker *pmOther, IMoniker **ppmkRelPath)
|
||||||
* URLMoniker_RelativePathTo
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
FIXME("(%p)->(%p,%p): stub\n",This,pmOther,ppmkRelPath);
|
FIXME("(%p)->(%p,%p): stub\n",This,pmOther,ppmkRelPath);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_GetDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft,
|
||||||
* URLMoniker_GetDisplayName
|
LPOLESTR *ppszDisplayName)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_GetDisplayName(IMoniker* iface,
|
|
||||||
IBindCtx* pbc,
|
|
||||||
IMoniker* pmkToLeft,
|
|
||||||
LPOLESTR *ppszDisplayName)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
TRACE("(%p,%p,%p,%p)\n",This,pbc,pmkToLeft,ppszDisplayName);
|
TRACE("(%p,%p,%p,%p)\n", This, pbc, pmkToLeft, ppszDisplayName);
|
||||||
|
|
||||||
if(!ppszDisplayName)
|
if(!ppszDisplayName)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
if(!This->URLName)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
/* FIXME: If this is a partial URL, try and get a URL moniker from SZ_URLCONTEXT in the bind context,
|
/* FIXME: If this is a partial URL, try and get a URL moniker from SZ_URLCONTEXT in the bind context,
|
||||||
then look at pmkToLeft to try and complete the URL
|
then look at pmkToLeft to try and complete the URL
|
||||||
*/
|
*/
|
||||||
|
@ -476,28 +391,18 @@ static HRESULT WINAPI URLMonikerImpl_GetDisplayName(IMoniker* iface,
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_ParseDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft,
|
||||||
* URLMoniker_ParseDisplayName
|
LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_ParseDisplayName(IMoniker* iface,
|
|
||||||
IBindCtx* pbc,
|
|
||||||
IMoniker* pmkToLeft,
|
|
||||||
LPOLESTR pszDisplayName,
|
|
||||||
ULONG* pchEaten,
|
|
||||||
IMoniker** ppmkOut)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
FIXME("(%p)->(%p,%p,%p,%p,%p): stub\n",This,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
|
FIXME("(%p)->(%p,%p,%p,%p,%p): stub\n",This,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI URLMoniker_IsSystemMoniker(IMoniker *iface, DWORD *pwdMksys)
|
||||||
* URLMoniker_IsSystemMoniker
|
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI URLMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys)
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl *This = (URLMonikerImpl *)iface;
|
URLMoniker *This = MONIKER_THIS(iface);
|
||||||
|
|
||||||
TRACE("(%p,%p)\n",This,pwdMksys);
|
TRACE("(%p,%p)\n",This,pwdMksys);
|
||||||
|
|
||||||
if(!pwdMksys)
|
if(!pwdMksys)
|
||||||
|
@ -507,49 +412,55 @@ static HRESULT WINAPI URLMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdM
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************************/
|
static const IMonikerVtbl URLMonikerVtbl =
|
||||||
/* Virtual function table for the URLMonikerImpl class which include IPersist,*/
|
|
||||||
/* IPersistStream and IMoniker functions. */
|
|
||||||
static const IMonikerVtbl VT_URLMonikerImpl =
|
|
||||||
{
|
{
|
||||||
URLMonikerImpl_QueryInterface,
|
URLMoniker_QueryInterface,
|
||||||
URLMonikerImpl_AddRef,
|
URLMoniker_AddRef,
|
||||||
URLMonikerImpl_Release,
|
URLMoniker_Release,
|
||||||
URLMonikerImpl_GetClassID,
|
URLMoniker_GetClassID,
|
||||||
URLMonikerImpl_IsDirty,
|
URLMoniker_IsDirty,
|
||||||
URLMonikerImpl_Load,
|
URLMoniker_Load,
|
||||||
URLMonikerImpl_Save,
|
URLMoniker_Save,
|
||||||
URLMonikerImpl_GetSizeMax,
|
URLMoniker_GetSizeMax,
|
||||||
URLMonikerImpl_BindToObject,
|
URLMoniker_BindToObject,
|
||||||
URLMonikerImpl_BindToStorage,
|
URLMoniker_BindToStorage,
|
||||||
URLMonikerImpl_Reduce,
|
URLMoniker_Reduce,
|
||||||
URLMonikerImpl_ComposeWith,
|
URLMoniker_ComposeWith,
|
||||||
URLMonikerImpl_Enum,
|
URLMoniker_Enum,
|
||||||
URLMonikerImpl_IsEqual,
|
URLMoniker_IsEqual,
|
||||||
URLMonikerImpl_Hash,
|
URLMoniker_Hash,
|
||||||
URLMonikerImpl_IsRunning,
|
URLMoniker_IsRunning,
|
||||||
URLMonikerImpl_GetTimeOfLastChange,
|
URLMoniker_GetTimeOfLastChange,
|
||||||
URLMonikerImpl_Inverse,
|
URLMoniker_Inverse,
|
||||||
URLMonikerImpl_CommonPrefixWith,
|
URLMoniker_CommonPrefixWith,
|
||||||
URLMonikerImpl_RelativePathTo,
|
URLMoniker_RelativePathTo,
|
||||||
URLMonikerImpl_GetDisplayName,
|
URLMoniker_GetDisplayName,
|
||||||
URLMonikerImpl_ParseDisplayName,
|
URLMoniker_ParseDisplayName,
|
||||||
URLMonikerImpl_IsSystemMoniker
|
URLMoniker_IsSystemMoniker
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************
|
static URLMoniker *alloc_moniker(void)
|
||||||
* URLMoniker_Construct (local function)
|
{
|
||||||
*******************************************************************************/
|
URLMoniker *ret;
|
||||||
static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
|
|
||||||
|
ret = heap_alloc(sizeof(URLMoniker));
|
||||||
|
if(!ret)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ret->lpIMonikerVtbl = &URLMonikerVtbl;
|
||||||
|
ret->ref = 1;
|
||||||
|
ret->URLName = NULL;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT URLMoniker_Init(URLMoniker *This, LPCOLESTR lpszLeftURLName, LPCOLESTR lpszURLName)
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
DWORD sizeStr = 0;
|
DWORD sizeStr = 0;
|
||||||
|
|
||||||
TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
|
TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
|
||||||
|
|
||||||
This->lpvtbl = &VT_URLMonikerImpl;
|
|
||||||
This->ref = 0;
|
|
||||||
|
|
||||||
This->URLName = heap_alloc(INTERNET_MAX_URL_LENGTH*sizeof(WCHAR));
|
This->URLName = heap_alloc(INTERNET_MAX_URL_LENGTH*sizeof(WCHAR));
|
||||||
|
|
||||||
if(lpszLeftURLName)
|
if(lpszLeftURLName)
|
||||||
|
@ -574,6 +485,14 @@ static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeft
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT StdURLMoniker_Construct(IUnknown *outer, void **ppv)
|
||||||
|
{
|
||||||
|
TRACE("(%p %p)\n", outer, ppv);
|
||||||
|
|
||||||
|
*ppv = alloc_moniker();
|
||||||
|
return *ppv ? S_OK : E_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* CreateURLMonikerEx (URLMON.@)
|
* CreateURLMonikerEx (URLMON.@)
|
||||||
*
|
*
|
||||||
|
@ -592,7 +511,7 @@ static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeft
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI CreateURLMonikerEx(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk, DWORD dwFlags)
|
HRESULT WINAPI CreateURLMonikerEx(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
URLMonikerImpl *obj;
|
URLMoniker *obj;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
LPOLESTR lefturl = NULL;
|
LPOLESTR lefturl = NULL;
|
||||||
|
|
||||||
|
@ -600,7 +519,7 @@ HRESULT WINAPI CreateURLMonikerEx(IMoniker *pmkContext, LPCWSTR szURL, IMoniker
|
||||||
|
|
||||||
if (dwFlags & URL_MK_UNIFORM) FIXME("ignoring flag URL_MK_UNIFORM\n");
|
if (dwFlags & URL_MK_UNIFORM) FIXME("ignoring flag URL_MK_UNIFORM\n");
|
||||||
|
|
||||||
if(!(obj = heap_alloc(sizeof(*obj))))
|
if(!(obj = alloc_moniker()))
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
if(pmkContext) {
|
if(pmkContext) {
|
||||||
|
@ -614,12 +533,11 @@ HRESULT WINAPI CreateURLMonikerEx(IMoniker *pmkContext, LPCWSTR szURL, IMoniker
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = URLMonikerImpl_Construct(obj, lefturl, szURL);
|
hres = URLMoniker_Init(obj, lefturl, szURL);
|
||||||
CoTaskMemFree(lefturl);
|
CoTaskMemFree(lefturl);
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
hres = URLMonikerImpl_QueryInterface((IMoniker*)obj, &IID_IMoniker, (void**)ppmk);
|
hres = URLMoniker_QueryInterface((IMoniker*)obj, &IID_IMoniker, (void**)ppmk);
|
||||||
else
|
IMoniker_Release((IMoniker*)obj);
|
||||||
heap_free(obj);
|
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,8 @@ static const ClassFactory SecurityManagerCF =
|
||||||
{ &ClassFactoryVtbl, SecManagerImpl_Construct};
|
{ &ClassFactoryVtbl, SecManagerImpl_Construct};
|
||||||
static const ClassFactory ZoneManagerCF =
|
static const ClassFactory ZoneManagerCF =
|
||||||
{ &ClassFactoryVtbl, ZoneMgrImpl_Construct};
|
{ &ClassFactoryVtbl, ZoneMgrImpl_Construct};
|
||||||
|
static const ClassFactory StdURLMonikerCF =
|
||||||
|
{ &ClassFactoryVtbl, StdURLMoniker_Construct};
|
||||||
|
|
||||||
struct object_creation_info
|
struct object_creation_info
|
||||||
{
|
{
|
||||||
|
@ -209,7 +211,8 @@ static const struct object_creation_info object_creation[] =
|
||||||
{ &CLSID_HttpSProtocol, CLASSFACTORY(&HttpSProtocolCF), wszHttps },
|
{ &CLSID_HttpSProtocol, CLASSFACTORY(&HttpSProtocolCF), wszHttps },
|
||||||
{ &CLSID_MkProtocol, CLASSFACTORY(&MkProtocolCF), wszMk },
|
{ &CLSID_MkProtocol, CLASSFACTORY(&MkProtocolCF), wszMk },
|
||||||
{ &CLSID_InternetSecurityManager, CLASSFACTORY(&SecurityManagerCF), NULL },
|
{ &CLSID_InternetSecurityManager, CLASSFACTORY(&SecurityManagerCF), NULL },
|
||||||
{ &CLSID_InternetZoneManager, CLASSFACTORY(&ZoneManagerCF), NULL }
|
{ &CLSID_InternetZoneManager, CLASSFACTORY(&ZoneManagerCF), NULL },
|
||||||
|
{ &CLSID_StdURLMoniker, CLASSFACTORY(&StdURLMonikerCF), NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void init_session(BOOL init)
|
static void init_session(BOOL init)
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
extern HINSTANCE URLMON_hInstance;
|
extern HINSTANCE URLMON_hInstance;
|
||||||
extern HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
extern HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
||||||
extern HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
extern HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
||||||
|
extern HRESULT StdURLMoniker_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
||||||
extern HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
extern HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
||||||
extern HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
extern HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
||||||
extern HRESULT HttpSProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
extern HRESULT HttpSProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue