Added a stub implementation for FileMoniker, ItemMoniker and BindCtx

classes.
This commit is contained in:
Noomen Hamza 1999-01-28 17:56:14 +00:00 committed by Alexandre Julliard
parent 2c3d07fa0e
commit 3fb3da29a1
9 changed files with 1291 additions and 76 deletions

View File

@ -30,7 +30,30 @@ typedef struct IMultiQI IMultiQI,*LPMULTIQI;
/*****************************************************************************
* IEnumString interface
*/
/* FIXME: not implemented */
#define ICOM_INTERFACE IEnumString
ICOM_BEGIN(IEnumString,IUnknown)
ICOM_METHOD3 (HRESULT, Next, ULONG, celt, LPOLESTR32, rgelt, ULONG*, pceltFetched);
ICOM_METHOD1 (HRESULT, Skip, ULONG, celt);
ICOM_METHOD (HRESULT, Reset);
ICOM_METHOD1 (HRESULT, Clone, IEnumString**, ppenum);
ICOM_END(IEnumString)
#undef ICOM_INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IEnumString_QueryInterface(p,a,b) ICOM_ICALL2(IUnknown,QueryInterface,p,a,b)
#define IEnumString_AddRef(p) ICOM_ICALL (IUnknown,AddRef,p)
#define IEnumString_Release(p) ICOM_ICALL (IUnknown,Release,p)
/* IBindCtx methods*/
#define IEnumString_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c);
#define IEnumString_Skip(p,a) ICOM_CALL1(Skip,p,a);
#define IEnumString_Reset(p,a) ICOM_CALL(Reset,p);
#define IEnumString_Clone(p,a) ICOM_CALL1(Clone,p,a);
#endif
#define CreateEnumString WINELIB_NAME(CreateEnumString)
/*****************************************************************************

View File

@ -5,10 +5,11 @@
*/
#include "wine/obj_misc.h"
#ifndef __WINE_WINE_OBJ_MONIKER_H
#define __WINE_WINE_OBJ_MONIKER_H
/*****************************************************************************
* Predeclare the interfaces
*/
@ -34,35 +35,137 @@ typedef struct IRunnableObject IRunnableObject,*LPRUNNABLEOBJECT;
DEFINE_OLEGUID(IID_IRunningObjectTable, 0x00000010L, 0, 0);
typedef struct IRunningObjectTable IRunningObjectTable,*LPRUNNINGOBJECTTABLE;
typedef struct COSERVERINFO COSERVERINFO; // must be defined !
/*********************************************************************************
* BIND_OPTS and BIND_OPTS2 structures definition
* Thes structures contain parameters used during a moniker-binding operation.
*********************************************************************************/
typedef struct tagBIND_OPTS{
DWORD cbStruct;
DWORD grfFlags;
DWORD grfMode;
DWORD dwTickCountDeadline;
} BIND_OPTS, * LPBIND_OPTS;
typedef struct tagBIND_OPTS2{
DWORD cbStruct;
DWORD grfFlags;
DWORD grfMode;
DWORD dwTickCountDeadline;
DWORD dwTrackFlags;
DWORD dwClassContext;
LCID locale;
COSERVERINFO* pServerInfo;
} BIND_OPTS2, * LPBIND_OPTS2;
/*****************************************************************************
* IBindCtx interface
*/
/* FIXME: not implemented */
#define ICOM_INTERFACE IBindCtx
ICOM_BEGIN(IBindCtx,IUnknown)
ICOM_METHOD1 (HRESULT, RegisterObjectBound,IUnknown*,punk);
ICOM_METHOD1 (HRESULT, RevokeObjectBound,IUnknown*,punk);
ICOM_METHOD (HRESULT, ReleaseObjects);
ICOM_METHOD1 (HRESULT, SetBindOptions,LPBIND_OPTS2,pbindopts);
ICOM_METHOD1 (HRESULT, GetBindOptions,LPBIND_OPTS2,pbindopts);
ICOM_METHOD1 (HRESULT, GetRunningObjectTable,IRunningObjectTable**,pprot);
ICOM_METHOD2 (HRESULT, RegisterObjectParam,LPOLESTR32,pszkey,IUnknown*,punk);
ICOM_METHOD2 (HRESULT, GetObjectParam,LPOLESTR32,pszkey,IUnknown*,punk);
ICOM_METHOD1 (HRESULT, EnumObjectParam,IEnumString**,ppenum);
ICOM_METHOD1 (HRESULT, RevokeObjectParam,LPOLESTR32,pszkey);
ICOM_END(IBindCtx)
#undef ICOM_INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IBindCtx_QueryInterface(p,a,b) ICOM_ICALL2(IUnknown,QueryInterface,p,a,b)
#define IBindCtxr_AddRef(p) ICOM_ICALL (IUnknown,AddRef,p)
#define IBindCtx_Release(p) ICOM_ICALL (IUnknown,Release,p)
/* IBindCtx methods*/
#define IBindCtx_RegisterObjectBound(p,a) ICOM_CALL1 (RegisterObjectBound,p,a);
#define IBindCtx_RevokeObjectBound(p,a) ICOM_CALL1 (RevokeObjectBound,p,a);
#define IBindCtx_ReleaseObjects(p) ICOM_CALL (ReleaseObjects,p);
#define IBindCtx_SetBindOptions(p,a) ICOM_CALL1 (SetBindOptions,p,a);
#define IBindCtx_GetBindOptions(p,a) ICOM_CALL1 (GetBindOptions,p,a);
#define IBindCtx_GetRunningObjectTable(p,a) ICOM_CALL1 (GetRunningObjectTable,p,a);
#define IBindCtx_RegisterObjectParam(p,a,b) ICOM_CALL2 (RegisterObjectParam,p,a,b);
#define IBindCtx_GetObjectParam(p,a,b) ICOM_CALL2 (GetObjectParam,p,a,b);
#define IBindCtx_EnumObjectParam(p,a) ICOM_CALL1 (EnumObjectParam,p,a);
#define IBindCtx_RevokeObjectParam(p,a) ICOM_CALL1 (RevokeObjectParam,p,a);
#endif
#define CreateBindCtx WINELIB_NAME(CreateBindCtx)
/*****************************************************************************
* IClassActivator interface
*/
/* FIXME: not implemented */
/*****************************************************************************
* IEnumMoniker interface
*/
/* FIXME: not implemented */
/*****************************************************************************
* IMoniker interface
*/
/* FIXME: not implemented */
#define ICOM_INTERFACE IMoniker
ICOM_BEGIN(IMoniker,IPersistStream)
ICOM_METHOD4 (HRESULT,BindToObject,IBindCtx*,pbc,IMoniker*,pmkToLeft,REFIID,riid,VOID**,ppvResult);
ICOM_METHOD4 (HRESULT,BindToStorage,IBindCtx*,pbc,IMoniker*,pmkToLeft,REFIID,riid,VOID**,ppvResult);
ICOM_METHOD4 (HRESULT,Reduce,IBindCtx*,pbc,DWORD,dwReduceHowFar,IMoniker**,ppmkToLeft,IMoniker**,ppmkReduced);
ICOM_METHOD3 (HRESULT,ComposeWith,IMoniker*,pmkRight,BOOL32,fOnlyIfNotGeneric,IMoniker**,ppmkComposite);
ICOM_METHOD2 (HRESULT,Enum,BOOL32,fForward,IEnumMoniker**,ppenumMoniker);
ICOM_METHOD1 (HRESULT,IsEqual,IMoniker*, pmkOtherMoniker);
ICOM_METHOD1 (HRESULT,Hash,DWORD*,pdwHash);
ICOM_METHOD3 (HRESULT,IsRunning,IBindCtx*,pbc,IMoniker*,pmkToLeft,IMoniker*,pmkNewlyRunning);
ICOM_METHOD3 (HRESULT,GetTimeOfLastChange,IBindCtx*,pbc,IMoniker*,pmkToLeft,FILETIME*,pFileTime);
ICOM_METHOD1 (HRESULT,Inverse,IMoniker**,ppmk);
ICOM_METHOD2 (HRESULT,CommonPrefixWith,IMoniker*,pmkOther,IMoniker**,ppmkPrefix);
ICOM_METHOD2 (HRESULT,RelativePathTo,IMoniker*,pmOther,IMoniker**,ppmkRelPath);
ICOM_METHOD3 (HRESULT,GetDisplayName,IBindCtx*,pbc,IMoniker*,pmkToLeft,LPOLESTR32,*ppszDisplayName);
ICOM_METHOD5 (HRESULT,ParseDisplayName,IBindCtx*,pbc,IMoniker*,pmkToLeft,LPOLESTR32,pszDisplayName,ULONG*,pchEaten,IMoniker**,ppmkOut);
ICOM_METHOD1 (HRESULT,IsSystemMoniker,DWORD*,pwdMksys);
ICOM_END(IMoniker)
#undef ICOM_INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IMoniker_QueryInterface(p,a,b) ICOM_ICALL2(IUnknown,QueryInterface,p,a,b)
#define IMoniker_AddRef(p) ICOM_ICALL (IUnknown,AddRef,p)
#define IMoniker_Release(p) ICOM_ICALL (IUnknown,Release,p)
/*** IPersist methods ***/
#define IMoniker_GetClassID(p,a) ICOM_ICALL1(IPersist,GetClassID,p,a)
/*** IPersistStream ***/
#define IMoniker_Stream_IsDirty(p) ICOM_ICALL(IPersistStream,IsDirty,p)
#define IMoniker_Stream_Load(p,a) ICOM_ICALL1(IPersistStream,Load,p,a)
#define IMoniker_Stream_Save(p,a,b) ICOM_ICALL2(IPersistStream,Save,p,a,b)
#define IMoniker_Stream_GetSizeMax(p,a) ICOM_ICALL1(IPersistStream,GetSizeMax,p,a)
/* IMonker methods*/
#define IMoniker_BindToObject(p,a,b,c,d) ICOM_CALL4(BindToObject,p,a,b,c,d)
#define IMoniker_BindToStorage(p,a,b,c,d) ICOM_CALL4(BindToStorage,p,a,b,c,d)
#define IMoniker_Reduce(p,a,b,c,d) ICOM_CALL4(Reduce,p,a,b,c,d)
#define IMoniker_ComposeWith(p,a,b,c) ICOM_CALL3(ComposeWith,p,a,b,c)
#define IMoniker_Enum(p,a,b) ICOM_CALL2(Enum,p,a,b)
#define IMoniker_IsEqual(p,a) ICOM_CALL1(IsEqual,p,a)
#define IMoniker_Hash(p,a) ICOM_CALL1(Hash,p,a)
#define IMoniker_IsRunning(p,a,b,c) ICOM_CALL3(IsRunning,p,a,b,c)
#define IMoniker_GetTimeOfLastChange(p,a,b,c) ICOM_CALL3(GetTimeOfLastChange,p,a,b,c)
#define IMoniker_Inverse(p,a) ICOM_CALL1(Inverse,p,a)
#define IMoniker_CommonPrefixWith(p,a,b) ICOM_CALL2(CommonPrefixWith,p,a,b)
#define IMoniker_RelativePathTo(p,a,b) ICOM_CALL2(RelativePathTo,p,a,b)
#define IMoniker_GetDisplayName(p,a,b,c) ICOM_CALL3(GetDisplayName,p,a,b,c)
#define IMoniker_ParseDisplayName(p,a,b,c,d,e) ICOM_CALL5(ParseDisplayName,p,a,b,c,d,e)
#define IMoniker_IsSystemMoniker(p,a) ICOM_CALL1(IsSystemMonker,p,a)
#endif
HRESULT WINAPI CreateFileMoniker16(LPCOLESTR16 lpszPathName,LPMONIKER* ppmk);
HRESULT WINAPI CreateFileMoniker32(LPCOLESTR32 lpszPathName,LPMONIKER* ppmk);
#define CreateFileMoniker WINELIB_NAME(CreateFileMoniker)
HRESULT WINAPI CreateItemMoniker32(LPCOLESTR32 lpszDelim,LPCOLESTR32 lpszItem,LPMONIKER* ppmk);
#define CreateItemMoniker WINELIB_NAME(CreateItemMoniker)

View File

@ -177,10 +177,10 @@ ICOM_END(IPersistFile)
#define IPersistFile_GetClassID(p,a) ICOM_ICALL1(IPersist,GetClassID,p,a)
/*** IPersistFile methods ***/
#define IPersistFile_IsDirty(p) ICOM_CALL(IsDirty,p)
#define IPersistFile_Load(p,a,b) ICOM_CALL(Load,p,a,b)
#define IPersistFile_Save(p,a,b) ICOM_CALL(Save,p,a,b)
#define IPersistFile_SaveCompleted(p,a) ICOM_CALL(SaveCompleted,p,a)
#define IPersistFile_GetCurFile(p,a) ICOM_CALL(GetCurFile,p,a)
#define IPersistFile_Load(p,a,b) ICOM_CALL2(Load,p,a,b)
#define IPersistFile_Save(p,a,b) ICOM_CALL2(Save,p,a,b)
#define IPersistFile_SaveCompleted(p,a) ICOM_CALL1(SaveCompleted,p,a)
#define IPersistFile_GetCurFile(p,a) ICOM_CALL1(GetCurFile,p,a)
#endif
@ -193,7 +193,28 @@ ICOM_END(IPersistFile)
/*****************************************************************************
* IPersistStream interface
*/
/* FIXME: not implemented */
#define ICOM_INTERFACE IPersistStream
ICOM_BEGIN(IPersistStream,IPersist);
ICOM_METHOD(HRESULT, IsDirty);
ICOM_METHOD1(HRESULT, Load, IStream32*, pStm);
ICOM_METHOD2(HRESULT, Save, IStream32*, pStm, BOOL32, fClearDirty);
ICOM_METHOD1(HRESULT, GetSizeMax, ULARGE_INTEGER*, pcbSize);
ICOM_END(IPersistStream)
#undef ICOM_INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IPersistStream_QueryInterface(p,a,b) ICOM_ICALL2(IUnknown,QueryInterface,p,a,b)
#define IPersistStream_AddRef(p) ICOM_ICALL(IUnknown,AddRef,p)
#define IPersistStream_Release(p) ICOM_ICALL(IUnknown,Release,p)
/*** IPersist methods ***/
#define IPersistStream_GetClassID(p,a) ICOM_ICALL1(IPersist,GetClassID,p,a)
/*** IPersistStream ***/
#define IPersist_Stream_IsDirty(p) ICOM_CALL(IsDirty,p)
#define IPersist_Stream_Load(p,a) ICOM_CALL1(Load,p,a)
#define IPersist_Stream_Save(p,a,b) ICOM_CALL2(Save,p,a,b)
#define IPersist_Stream_GetSizeMax(p,a) ICOM_CALL(GetSizeMax,p)
#endif
/*****************************************************************************

View File

@ -6,9 +6,12 @@ VPATH = @srcdir@
MODULE = ole
C_SRCS = \
bindctx.c \
compobj.c \
filemoniker.c \
guid.c \
ifs.c \
itemmoniker.c \
moniker.c \
ole2.c \
ole2disp.c \

283
ole/bindctx.c Normal file
View File

@ -0,0 +1,283 @@
/***************************************************************************************
* BindCtx implementation
*
* Copyright 1999 Noomen Hamza
***************************************************************************************/
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_storage.h"
#include "wine/obj_moniker.h"
#include "debug.h"
#include "heap.h"
typedef struct BindCtxImpl{
ICOM_VTABLE(IBindCtx)* lpvtbl;
ULONG ref;
} BindCtxImpl;
HRESULT WINAPI BindCtxImpl_QueryInterface(BindCtxImpl* This,REFIID riid,void** ppvObject);
ULONG WINAPI BindCtxImpl_AddRef(BindCtxImpl* This);
ULONG WINAPI BindCtxImpl_Release(BindCtxImpl* This);
HRESULT WINAPI BindCtxImpl_Construct(BindCtxImpl* This);
HRESULT WINAPI BindCtxImpl_destroy(BindCtxImpl* This);
HRESULT WINAPI BindCtxImpl_RegisterObjectBound(BindCtxImpl* This,IUnknown* punk);
HRESULT WINAPI BindCtxImpl_RevokeObjectBound(BindCtxImpl* This, IUnknown* punk);
HRESULT WINAPI BindCtxImpl_ReleaseObjects(BindCtxImpl* This);
HRESULT WINAPI BindCtxImpl_SetBindOptions(BindCtxImpl* This,LPBIND_OPTS2 pbindopts);
HRESULT WINAPI BindCtxImpl_GetBindOptions(BindCtxImpl* This,LPBIND_OPTS2 pbindopts);
HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(BindCtxImpl* This,IRunningObjectTable** pprot);
HRESULT WINAPI BindCtxImpl_RegisterObjectParam(BindCtxImpl* This,LPOLESTR32 pszkey, IUnknown* punk);
HRESULT WINAPI BindCtxImpl_GetObjectParam(BindCtxImpl* This,LPOLESTR32 pszkey, IUnknown* punk);
HRESULT WINAPI BindCtxImpl_EnumObjectParam(BindCtxImpl* This,IEnumString** ppenum);
HRESULT WINAPI BindCtxImpl_RevokeObjectParam(BindCtxImpl* This,LPOLESTR32 pszkey);
HRESULT WINAPI CreateBindCtx16(DWORD reserved, LPBC * ppbc);
HRESULT WINAPI CreateBindCtx32(DWORD reserved, LPBC * ppbc);
#define VTABLE_FUNC(a) (void*)(a)
// Virtual function table for the BindCtx class.
static ICOM_VTABLE(IBindCtx) VT_BindCtxImpl =
{
{
VTABLE_FUNC(BindCtxImpl_QueryInterface),
VTABLE_FUNC(BindCtxImpl_AddRef),
VTABLE_FUNC(BindCtxImpl_Release)
},
VTABLE_FUNC(BindCtxImpl_RegisterObjectBound),
VTABLE_FUNC(BindCtxImpl_RevokeObjectBound),
VTABLE_FUNC(BindCtxImpl_ReleaseObjects),
VTABLE_FUNC(BindCtxImpl_SetBindOptions),
VTABLE_FUNC(BindCtxImpl_GetBindOptions),
VTABLE_FUNC(BindCtxImpl_GetRunningObjectTable),
VTABLE_FUNC(BindCtxImpl_RegisterObjectParam),
VTABLE_FUNC(BindCtxImpl_GetObjectParam),
VTABLE_FUNC(BindCtxImpl_EnumObjectParam),
VTABLE_FUNC(BindCtxImpl_RevokeObjectParam)
};
/*******************************************************************************
* BindCtx_QueryInterface
*******************************************************************************/
HRESULT WINAPI BindCtxImpl_QueryInterface(BindCtxImpl* This,REFIID riid,void** ppvObject){
TRACE(ole,"(%p,%p,%p)\n",This,riid,ppvObject);
// Perform a sanity check on the parameters.
if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG;
// Initialize the return parameter.
*ppvObject = 0;
// Compare the riid with the interface IDs implemented by this object.
if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
*ppvObject = (IBindCtx*)This;
else
if (memcmp(&IID_IBindCtx, riid, sizeof(IID_IBindCtx)) == 0)
*ppvObject = (IBindCtx*)This;
// Check that we obtained an interface.
if ((*ppvObject)==0) return E_NOINTERFACE;
// Query Interface always increases the reference count by one when it is successful
BindCtxImpl_AddRef(This);
return S_OK;
}
/******************************************************************************
* BindCtx_ _AddRef
******************************************************************************/
ULONG WINAPI BindCtxImpl_AddRef(BindCtxImpl* This){
TRACE(ole,"(%p)\n",This);
return ++(This->ref);
}
/******************************************************************************
* BindCtx_Release
******************************************************************************/
ULONG WINAPI BindCtxImpl_Release(BindCtxImpl* This){
TRACE(ole,"(%p)\n",This);
This->ref--;
if (This->ref==0){
BindCtxImpl_destroy(This);
return 0;
}
return This->ref;;
}
/******************************************************************************
* BindCtx_Constructor
*******************************************************************************/
HRESULT WINAPI BindCtxImpl_Construct(BindCtxImpl* This){
FIXME(ole,"(%p),stub!\n",This);
memset(This, 0, sizeof(BindCtxImpl));
//Initialize the virtual fgunction table.
This->lpvtbl = &VT_BindCtxImpl;
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_destructor
*******************************************************************************/
HRESULT WINAPI BindCtxImpl_destroy(BindCtxImpl* This){
FIXME(ole,"(%p),stub!\n",This);
SEGPTR_FREE(This);
return S_OK;
}
/******************************************************************************
* BindCtx_RegisterObjectBound
******************************************************************************/
HRESULT WINAPI BindCtxImpl_RegisterObjectBound(BindCtxImpl* This,IUnknown* punk){
FIXME(ole,"(%p,%p),stub!\n",This,punk);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_RevokeObjectBound
******************************************************************************/
HRESULT WINAPI BindCtxImpl_RevokeObjectBound(BindCtxImpl* This, IUnknown* punk){
FIXME(ole,"(%p,%p),stub!\n",This,punk);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_ReleaseObjects
******************************************************************************/
HRESULT WINAPI BindCtxImpl_ReleaseObjects(BindCtxImpl* This){
FIXME(ole,"(%p),stub!\n",This);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_SetBindOptions
******************************************************************************/
HRESULT WINAPI BindCtxImpl_SetBindOptions(BindCtxImpl* This,LPBIND_OPTS2 pbindopts){
FIXME(ole,"(%p,%p),stub!\n",This,pbindopts);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_GetBindOptions
******************************************************************************/
HRESULT WINAPI BindCtxImpl_GetBindOptions(BindCtxImpl* This,LPBIND_OPTS2 pbindopts){
FIXME(ole,"(%p,%p),stub!\n",This,pbindopts);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_GetRunningObjectTable
******************************************************************************/
HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(BindCtxImpl* This,IRunningObjectTable** pprot){
FIXME(ole,"(%p,%p),stub!\n",This,pprot);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_RegisterObjectParam
******************************************************************************/
HRESULT WINAPI BindCtxImpl_RegisterObjectParam(BindCtxImpl* This,LPOLESTR32 pszkey, IUnknown* punk){
FIXME(ole,"(%p,%p,%p),stub!\n",This,pszkey,punk);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_GetObjectParam
******************************************************************************/
HRESULT WINAPI BindCtxImpl_GetObjectParam(BindCtxImpl* This,LPOLESTR32 pszkey, IUnknown* punk){
FIXME(ole,"(%p,%p,%p),stub!\n",This,pszkey,punk);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_EnumObjectParam
******************************************************************************/
HRESULT WINAPI BindCtxImpl_EnumObjectParam(BindCtxImpl* This,IEnumString** ppenum){
FIXME(ole,"(%p,%p),stub!\n",This,ppenum);
return E_NOTIMPL;
}
/******************************************************************************
* BindCtx_RevokeObjectParam
******************************************************************************/
HRESULT WINAPI BindCtxImpl_RevokeObjectParam(BindCtxImpl* This,LPOLESTR32 pszkey){
FIXME(ole,"(%p,%p),stub!\n",This,pszkey);
return E_NOTIMPL;
}
/******************************************************************************
* CreateBindCtx16
******************************************************************************/
HRESULT WINAPI CreateBindCtx16(DWORD reserved, LPBC * ppbc){
FIXME(ole,"(%ld,%p),stub!\n",reserved,ppbc);
return E_NOTIMPL;
}
/******************************************************************************
* CreateBindCtx32
******************************************************************************/
HRESULT WINAPI CreateBindCtx32(DWORD reserved, LPBC * ppbc){
BindCtxImpl* newBindCtx = 0;
HRESULT hr = S_OK;
TRACE(ole,"(%ld,%p)\n",reserved,ppbc);
newBindCtx = HeapAlloc(GetProcessHeap(), 0, sizeof(BindCtxImpl));
if (newBindCtx == 0)
return STG_E_INSUFFICIENTMEMORY;
hr = BindCtxImpl_Construct(newBindCtx);
if (FAILED(hr))
return hr;
hr = BindCtxImpl_QueryInterface(newBindCtx,&IID_IBindCtx,(void**)ppbc);
return hr;
}

427
ole/filemoniker.c Normal file
View File

@ -0,0 +1,427 @@
/***************************************************************************************
* FileMonikers implementation
*
* Copyright 1999 Noomen Hamza
***************************************************************************************/
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_storage.h"
#include "wine/obj_moniker.h"
#include "debug.h"
#include "heap.h"
typedef struct FileMonikerImpl{
ICOM_VTABLE(IMoniker)* lpvtbl;
ULONG ref;
} FileMonikerImpl;
HRESULT WINAPI FileMonikerImpl_QueryInterface(FileMonikerImpl* This,REFIID riid,void** ppvObject);
ULONG WINAPI FileMonikerImpl_AddRef(FileMonikerImpl* This);
ULONG WINAPI FileMonikerImpl_Release(FileMonikerImpl* This);
HRESULT WINAPI FileMonikerImpl_GetClassID(FileMonikerImpl* This, CLSID *pClassID);
HRESULT WINAPI FileMonikerImpl_IsDirty(FileMonikerImpl* This);
HRESULT WINAPI FileMonikerImpl_Load(FileMonikerImpl* This,LPCOLESTR32 pszFileName,DWORD dwMode);
HRESULT WINAPI FileMonikerImpl_Save(FileMonikerImpl* This,LPCOLESTR32 pszFileName,BOOL32 fRemember);
HRESULT WINAPI FileMonikerImpl_GetSizeMax(FileMonikerImpl* This,LPOLESTR32 *ppszFileName);
HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR32 lpszPathName);
HRESULT WINAPI FileMonikerImpl_destroy(FileMonikerImpl* This);
HRESULT WINAPI FileMonikerImpl_BindToObject(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
HRESULT WINAPI FileMonikerImpl_BindToStorage(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
HRESULT WINAPI FileMonikerImpl_Reduce(FileMonikerImpl* This,IBindCtx* pbc, DWORD dwReduceHowFar,IMoniker** ppmkToLeft, IMoniker** ppmkReduced);
HRESULT WINAPI FileMonikerImpl_ComposeWith(FileMonikerImpl* This,IMoniker* pmkRight,BOOL32 fOnlyIfNotGeneric, IMoniker** ppmkComposite);
HRESULT WINAPI FileMonikerImpl_Enum(FileMonikerImpl* This,BOOL32 fForward, IEnumMoniker** ppenumMoniker);
HRESULT WINAPI FileMonikerImpl_IsEqual(FileMonikerImpl* This,IMoniker* pmkOtherMoniker);
HRESULT WINAPI FileMonikerImpl_Hash(FileMonikerImpl* This,DWORD* pdwHash);
HRESULT WINAPI FileMonikerImpl_IsRunning(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, IMoniker* pmkNewlyRunning);
HRESULT WINAPI FileMonikerImpl_GetTimeOfLastChange(FileMonikerImpl* This, IBindCtx* pbc, IMoniker* pmkToLeft, FILETIME* pFileTime);
HRESULT WINAPI FileMonikerImpl_Inverse(FileMonikerImpl* This,IMoniker** ppmk);
HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(FileMonikerImpl* This,IMoniker* pmkOther, IMoniker** ppmkPrefix);
HRESULT WINAPI FileMonikerImpl_RelativePathTo(FileMonikerImpl* This,IMoniker* pmOther, IMoniker** ppmkRelPath);
HRESULT WINAPI FileMonikerImpl_GetDisplayName(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR32 *ppszDisplayName);
HRESULT WINAPI FileMonikerImpl_ParseDisplayName(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR32 pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut);
HRESULT WINAPI FileMonikerImpl_IsSystemMoniker(FileMonikerImpl* This,DWORD* pwdMksys);
HRESULT WINAPI CreateFileMoniker16(LPCOLESTR16 lpszPathName,LPMONIKER * ppmk);
HRESULT WINAPI CreateFileMoniker32( LPCOLESTR32 lpszPathName, LPMONIKER * ppmk);
#define VTABLE_FUNC(a) (void*)(a)
// Virtual function table for the FileMonikerImpl class.
static ICOM_VTABLE(IMoniker) VT_FileMonikerImpl =
{
{
{
{
VTABLE_FUNC(FileMonikerImpl_QueryInterface),
VTABLE_FUNC(FileMonikerImpl_AddRef),
VTABLE_FUNC(FileMonikerImpl_Release)
},
VTABLE_FUNC(FileMonikerImpl_GetClassID)
},
VTABLE_FUNC(FileMonikerImpl_IsDirty),
VTABLE_FUNC(FileMonikerImpl_Load),
VTABLE_FUNC(FileMonikerImpl_Save),
VTABLE_FUNC(FileMonikerImpl_GetSizeMax)
},
VTABLE_FUNC(FileMonikerImpl_BindToObject),
VTABLE_FUNC(FileMonikerImpl_BindToStorage),
VTABLE_FUNC(FileMonikerImpl_Reduce),
VTABLE_FUNC(FileMonikerImpl_ComposeWith),
VTABLE_FUNC(FileMonikerImpl_Enum),
VTABLE_FUNC(FileMonikerImpl_IsEqual),
VTABLE_FUNC(FileMonikerImpl_Hash),
VTABLE_FUNC(FileMonikerImpl_IsRunning),
VTABLE_FUNC(FileMonikerImpl_GetTimeOfLastChange),
VTABLE_FUNC(FileMonikerImpl_Inverse),
VTABLE_FUNC(FileMonikerImpl_CommonPrefixWith),
VTABLE_FUNC(FileMonikerImpl_RelativePathTo),
VTABLE_FUNC(FileMonikerImpl_GetDisplayName),
VTABLE_FUNC(FileMonikerImpl_ParseDisplayName),
VTABLE_FUNC(FileMonikerImpl_IsSystemMoniker)
};
/*******************************************************************************
* FileMoniker_QueryInterface
*******************************************************************************/
HRESULT WINAPI FileMonikerImpl_QueryInterface(FileMonikerImpl* This,REFIID riid,void** ppvObject){
TRACE(ole,"(%p,%p,%p)\n",This,riid,ppvObject);
// Perform a sanity check on the parameters.
if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG;
// Initialize the return parameter.
*ppvObject = 0;
// Compare the riid with the interface IDs implemented by this object.
if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
*ppvObject = (IMoniker*)This;
else
if (memcmp(&IID_IPersist, riid, sizeof(IID_IPersist)) == 0)
*ppvObject = (IMoniker*)This;
else
if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0)
*ppvObject = (IMoniker*)This;
else
if (memcmp(&IID_IMoniker, riid, sizeof(IID_IMoniker)) == 0)
*ppvObject = (IMoniker*)This;
// Check that we obtained an interface.
if ((*ppvObject)==0) return E_NOINTERFACE;
// Query Interface always increases the reference count by one when it is successful
FileMonikerImpl_AddRef(This);
return S_OK;;
}
/******************************************************************************
* FileMoniker_AddRef
******************************************************************************/
ULONG WINAPI FileMonikerImpl_AddRef(FileMonikerImpl* This){
TRACE(ole,"(%p)\n",This);
return ++(This->ref);
}
/******************************************************************************
* FileMoniker_Release
******************************************************************************/
ULONG WINAPI FileMonikerImpl_Release(FileMonikerImpl* This){
TRACE(ole,"(%p)\n",This);
This->ref--;
if (This->ref==0){
FileMonikerImpl_destroy(This);
return 0;
}
return This->ref;;
}
/******************************************************************************
* FileMoniker_GetClassID
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_GetClassID(FileMonikerImpl* This, CLSID *pClassID){//Pointer to CLSID of object
FIXME(ole,"(%p,%p),stub!\n",This,pClassID);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_IsDirty
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_IsDirty(FileMonikerImpl* This)
{
FIXME(ole,"(%p),stub!\n",This);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_Load
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_Load(
FileMonikerImpl* This,
LPCOLESTR32 pszFileName,//Pointer to absolute path of the file to open
DWORD dwMode) //Specifies the access mode from the STGM enumeration
{
FIXME(ole,"(%p,%p,%ld),stub!\n",This,pszFileName,dwMode);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_save
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_Save(
FileMonikerImpl* This,
LPCOLESTR32 pszFileName, //Pointer to absolute path of the file where the object is saved
BOOL32 fRemember) //Specifies whether the file is to be the current working file or not
{
FIXME(ole,"(%p,%p,%d),stub!\n",This,pszFileName,fRemember);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_GetSizeMax
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_GetSizeMax(
FileMonikerImpl* This,
LPOLESTR32 *ppszFileName) //Pointer to the path for the current file or the default save prompt
{
FIXME(ole,"(%p,%p),stub!\n",This,ppszFileName);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_Constructor
*******************************************************************************/
HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR32 lpszPathName){
FIXME(ole,"(%p,%p),stub!\n",This,lpszPathName);
memset(This, 0, sizeof(FileMonikerImpl));
//Initialize the virtual fgunction table.
This->lpvtbl = &VT_FileMonikerImpl;
return S_OK;
}
/******************************************************************************
* FileMoniker_destructor
*******************************************************************************/
HRESULT WINAPI FileMonikerImpl_destroy(FileMonikerImpl* This){
FIXME(ole,"(%p),stub!\n",This);
SEGPTR_FREE(This);
return S_OK;
}
/******************************************************************************
* FileMoniker_BindToObject
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_BindToObject(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
REFIID riid, VOID** ppvResult){
FIXME(ole,"(%p,%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,riid,ppvResult);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_BindToStorage
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_BindToStorage(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
REFIID riid, VOID** ppvResult){
FIXME(ole,"(%p,%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,riid,ppvResult);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_Reduce
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_Reduce(FileMonikerImpl* This,IBindCtx* pbc, DWORD dwReduceHowFar,
IMoniker** ppmkToLeft, IMoniker** ppmkReduced){
FIXME(ole,"(%p,%p,%ld,%p,%p),stub!\n",This,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_ComposeWith
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_ComposeWith(FileMonikerImpl* This,IMoniker* pmkRight,BOOL32 fOnlyIfNotGeneric,
IMoniker** ppmkComposite){
FIXME(ole,"(%p,%p,%d,%p),stub!\n",This,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_Enum
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_Enum(FileMonikerImpl* This,BOOL32 fForward, IEnumMoniker** ppenumMoniker){
FIXME(ole,"(%p,%d,%p),stub!\n",This,fForward,ppenumMoniker);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_IsEqual
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_IsEqual(FileMonikerImpl* This,IMoniker* pmkOtherMoniker){
FIXME(ole,"(%p,%p),stub!\n",This,pmkOtherMoniker);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_Hash
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_Hash(FileMonikerImpl* This,DWORD* pdwHash){
FIXME(ole,"(%p,%p),stub!\n",This,pdwHash);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_IsRunning
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_IsRunning(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
IMoniker* pmkNewlyRunning){
FIXME(ole,"(%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,pmkNewlyRunning);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_GetTimeOfLastChange
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_GetTimeOfLastChange(FileMonikerImpl* This, IBindCtx* pbc, IMoniker* pmkToLeft,
FILETIME* pFileTime){
FIXME(ole,"(%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,pFileTime);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_Inverse
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_Inverse(FileMonikerImpl* This,IMoniker** ppmk){
FIXME(ole,"(%p,%p),stub!\n",This,ppmk);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_CommonPrefixWith
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(FileMonikerImpl* This,IMoniker* pmkOther,
IMoniker** ppmkPrefix){
FIXME(ole,"(%p,%p,%p),stub!\n",This,pmkOther,ppmkPrefix);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_RelativePathTo
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_RelativePathTo(FileMonikerImpl* This,IMoniker* pmOther, IMoniker** ppmkRelPath){
FIXME(ole,"(%p,%p,%p),stub!\n",This,pmOther,ppmkRelPath);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_GetDisplayName
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_GetDisplayName(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
LPOLESTR32 *ppszDisplayName){
FIXME(ole,"(%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,ppszDisplayName);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_ParseDisplayName
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_ParseDisplayName(FileMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
LPOLESTR32 pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut){
FIXME(ole,"(%p,%p,%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_IsSystemMonker
******************************************************************************/
HRESULT WINAPI FileMonikerImpl_IsSystemMoniker(FileMonikerImpl* This,DWORD* pwdMksys){
FIXME(ole,"(%p,%p),stub!\n",This,pwdMksys);
return E_NOTIMPL;
}
/******************************************************************************
* CreateFileMoniker16
******************************************************************************/
HRESULT WINAPI CreateFileMoniker16(LPCOLESTR16 lpszPathName,LPMONIKER* ppmk){
FIXME(ole,"(%s,%p),stub!\n",lpszPathName,ppmk);
return E_NOTIMPL;
}
/******************************************************************************
* CreateFileMoniker32
******************************************************************************/
HRESULT WINAPI CreateFileMoniker32(LPCOLESTR32 lpszPathName, LPMONIKER * ppmk)
{
FileMonikerImpl* newFileMoniker = 0;
HRESULT hr = S_OK;
TRACE(ole,"(%p,%p)\n",lpszPathName,ppmk);
newFileMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(FileMonikerImpl));
if (newFileMoniker == 0)
return STG_E_INSUFFICIENTMEMORY;
hr = FileMonikerImpl_Construct(newFileMoniker,lpszPathName);
if (FAILED(hr))
return hr;
hr = FileMonikerImpl_QueryInterface(newFileMoniker,&IID_IMoniker,(void**)ppmk);
return hr;
}

408
ole/itemmoniker.c Normal file
View File

@ -0,0 +1,408 @@
/***************************************************************************************
* ItemMonikers implementation
*
* Copyright 1999 Noomen Hamza
***************************************************************************************/
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "winerror.h"
#include "wine/obj_base.h"
#include "wine/obj_storage.h"
#include "wine/obj_moniker.h"
#include "debug.h"
#include "heap.h"
typedef struct ItemMonikerImpl{
ICOM_VTABLE(IMoniker)* lpvtbl;
ULONG ref;
} ItemMonikerImpl;
HRESULT WINAPI ItemMonikerImpl_QueryInterface(ItemMonikerImpl* This,REFIID riid,void** ppvObject);
ULONG WINAPI ItemMonikerImpl_AddRef(ItemMonikerImpl* This);
ULONG WINAPI ItemMonikerImpl_Release(ItemMonikerImpl* This);
HRESULT WINAPI ItemMonikerImpl_GetClassID(ItemMonikerImpl* This, CLSID *pClassID);
HRESULT WINAPI ItemMonikerImpl_IsDirty(ItemMonikerImpl* This);
HRESULT WINAPI ItemMonikerImpl_Load(ItemMonikerImpl* This,LPCOLESTR32 pszItemName,DWORD dwMode);
HRESULT WINAPI ItemMonikerImpl_Save(ItemMonikerImpl* This,LPCOLESTR32 pszItemName,BOOL32 fRemember);
HRESULT WINAPI ItemMonikerImpl_GetSizeMax(ItemMonikerImpl* This,LPOLESTR32 *ppszItemName);
HRESULT WINAPI ItemMonikerImpl_Construct(ItemMonikerImpl* This, LPCOLESTR32 lpszDelim,LPCOLESTR32 lpszItem);
HRESULT WINAPI ItemMonikerImpl_destroy(ItemMonikerImpl* This);
HRESULT WINAPI ItemMonikerImpl_BindToObject(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
HRESULT WINAPI ItemMonikerImpl_BindToStorage(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult);
HRESULT WINAPI ItemMonikerImpl_Reduce(ItemMonikerImpl* This,IBindCtx* pbc, DWORD dwReduceHowFar,IMoniker** ppmkToLeft, IMoniker** ppmkReduced);
HRESULT WINAPI ItemMonikerImpl_ComposeWith(ItemMonikerImpl* This,IMoniker* pmkRight,BOOL32 fOnlyIfNotGeneric, IMoniker** ppmkComposite);
HRESULT WINAPI ItemMonikerImpl_Enum(ItemMonikerImpl* This,BOOL32 fForward, IEnumMoniker** ppenumMoniker);
HRESULT WINAPI ItemMonikerImpl_IsEqual(ItemMonikerImpl* This,IMoniker* pmkOtherMoniker);
HRESULT WINAPI ItemMonikerImpl_Hash(ItemMonikerImpl* This,DWORD* pdwHash);
HRESULT WINAPI ItemMonikerImpl_IsRunning(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, IMoniker* pmkNewlyRunning);
HRESULT WINAPI ItemMonikerImpl_GetTimeOfLastChange(ItemMonikerImpl* This, IBindCtx* pbc, IMoniker* pmkToLeft, FILETIME* pItemTime);
HRESULT WINAPI ItemMonikerImpl_Inverse(ItemMonikerImpl* This,IMoniker** ppmk);
HRESULT WINAPI ItemMonikerImpl_CommonPrefixWith(ItemMonikerImpl* This,IMoniker* pmkOther, IMoniker** ppmkPrefix);
HRESULT WINAPI ItemMonikerImpl_RelativePathTo(ItemMonikerImpl* This,IMoniker* pmOther, IMoniker** ppmkRelPath);
HRESULT WINAPI ItemMonikerImpl_GetDisplayName(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR32 *ppszDisplayName);
HRESULT WINAPI ItemMonikerImpl_ParseDisplayName(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR32 pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut);
HRESULT WINAPI ItemMonikerImpl_IsSystemMoniker(ItemMonikerImpl* This,DWORD* pwdMksys);
HRESULT WINAPI CreateItemMoniker16(LPCOLESTR16 lpszDelim,LPCOLESTR32 lpszItem,LPMONIKER * ppmk);
HRESULT WINAPI CreateItemMoniker32(LPCOLESTR32 lpszDelim,LPCOLESTR32 lpszItem,LPMONIKER * ppmk);
#define VTABLE_FUNC(a) (void*)(a)
// Virtual function table for the ItemMonikerImpl class.
static ICOM_VTABLE(IMoniker) VT_ItemMonikerImpl =
{
{
{
{
VTABLE_FUNC(ItemMonikerImpl_QueryInterface),
VTABLE_FUNC(ItemMonikerImpl_AddRef),
VTABLE_FUNC(ItemMonikerImpl_Release)
},
VTABLE_FUNC(ItemMonikerImpl_GetClassID)
},
VTABLE_FUNC(ItemMonikerImpl_IsDirty),
VTABLE_FUNC(ItemMonikerImpl_Load),
VTABLE_FUNC(ItemMonikerImpl_Save),
VTABLE_FUNC(ItemMonikerImpl_GetSizeMax)
},
VTABLE_FUNC(ItemMonikerImpl_BindToObject),
VTABLE_FUNC(ItemMonikerImpl_BindToStorage),
VTABLE_FUNC(ItemMonikerImpl_Reduce),
VTABLE_FUNC(ItemMonikerImpl_ComposeWith),
VTABLE_FUNC(ItemMonikerImpl_Enum),
VTABLE_FUNC(ItemMonikerImpl_IsEqual),
VTABLE_FUNC(ItemMonikerImpl_Hash),
VTABLE_FUNC(ItemMonikerImpl_IsRunning),
VTABLE_FUNC(ItemMonikerImpl_GetTimeOfLastChange),
VTABLE_FUNC(ItemMonikerImpl_Inverse),
VTABLE_FUNC(ItemMonikerImpl_CommonPrefixWith),
VTABLE_FUNC(ItemMonikerImpl_RelativePathTo),
VTABLE_FUNC(ItemMonikerImpl_GetDisplayName),
VTABLE_FUNC(ItemMonikerImpl_ParseDisplayName),
VTABLE_FUNC(ItemMonikerImpl_IsSystemMoniker)
};
/*******************************************************************************
* ItemMoniker_QueryInterface
*******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_QueryInterface(ItemMonikerImpl* This,REFIID riid,void** ppvObject){
TRACE(ole,"(%p,%p,%p)\n",This,riid,ppvObject);
// Perform a sanity check on the parameters.
if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG;
// Initialize the return parameter.
*ppvObject = 0;
// Compare the riid with the interface IDs implemented by this object.
if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
*ppvObject = (IMoniker*)This;
else
if (memcmp(&IID_IPersist, riid, sizeof(IID_IPersist)) == 0)
*ppvObject = (IMoniker*)This;
else
if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0)
*ppvObject = (IMoniker*)This;
else
if (memcmp(&IID_IMoniker, riid, sizeof(IID_IMoniker)) == 0)
*ppvObject = (IMoniker*)This;
// Check that we obtained an interface.
if ((*ppvObject)==0) return E_NOINTERFACE;
// Query Interface always increases the reference count by one when it is successful
ItemMonikerImpl_AddRef(This);
return S_OK;;
}
/******************************************************************************
* ItemMoniker_AddRef
******************************************************************************/
ULONG WINAPI ItemMonikerImpl_AddRef(ItemMonikerImpl* This){
TRACE(ole,"(%p)\n",This);
return ++(This->ref);
}
/******************************************************************************
* ItemMoniker_Release
******************************************************************************/
ULONG WINAPI ItemMonikerImpl_Release(ItemMonikerImpl* This){
TRACE(ole,"(%p),stub!\n",This);
This->ref--;
if (This->ref==0){
ItemMonikerImpl_destroy(This);
return 0;
}
return This->ref;;
}
/******************************************************************************
* ItemMoniker_GetClassID
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_GetClassID(ItemMonikerImpl* This, CLSID *pClassID){//Pointer to CLSID of object
FIXME(ole,"(%p),stub!\n",pClassID);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_IsDirty
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_IsDirty(ItemMonikerImpl* This)
{
FIXME(ole,"(%p),stub!\n",This);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_Load
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_Load(
ItemMonikerImpl* This,
LPCOLESTR32 pszFileName,//Pointer to absolute path of the file to open
DWORD dwMode) //Specifies the access mode from the STGM enumeration
{
FIXME(ole,"(%p,%ld),stub!\n",pszFileName,dwMode);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_save
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_Save(
ItemMonikerImpl* This,
LPCOLESTR32 pszFileName, //Pointer to absolute path of the file where the object is saved
BOOL32 fRemember) //Specifies whether the file is to be the current working file or not
{
FIXME(ole,"(%p,%d),stub!\n",pszFileName,fRemember);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_GetSizeMax
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_GetSizeMax(
ItemMonikerImpl* This,
LPOLESTR32 *ppszFileName) //Pointer to the path for the current file or the default save prompt
{
FIXME(ole,"(%p),stub!\n",ppszFileName);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_Constructor
*******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_Construct(ItemMonikerImpl* This, LPCOLESTR32 lpszDelim,LPCOLESTR32 lpszItem){
FIXME(ole,"(%p,%p,%p),stub!\n",This,lpszDelim,lpszItem);
memset(This, 0, sizeof(ItemMonikerImpl));
//Initialize the virtual fgunction table.
This->lpvtbl = &VT_ItemMonikerImpl;
return S_OK;
}
/******************************************************************************
* ItemMoniker_destructor
*******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_destroy(ItemMonikerImpl* This){
FIXME(ole,"(%p),stub!\n",This);
SEGPTR_FREE(This);
return S_OK;
}
/******************************************************************************
* ItemMoniker_BindToObject
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_BindToObject(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
REFIID riid, VOID** ppvResult){
FIXME(ole,"(%p,%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,riid,ppvResult);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_BindToStorage
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_BindToStorage(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
REFIID riid, VOID** ppvResult){
FIXME(ole,"(%p,%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,riid,ppvResult);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_Reduce
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_Reduce(ItemMonikerImpl* This,IBindCtx* pbc, DWORD dwReduceHowFar,
IMoniker** ppmkToLeft, IMoniker** ppmkReduced){
FIXME(ole,"(%p,%p,%ld,%p,%p),stub!\n",This,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_ComposeWith
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_ComposeWith(ItemMonikerImpl* This,IMoniker* pmkRight,BOOL32 fOnlyIfNotGeneric,
IMoniker** ppmkComposite){
FIXME(ole,"(%p,%p,%d,%p),stub!\n",This,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_Enum
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_Enum(ItemMonikerImpl* This,BOOL32 fForward, IEnumMoniker** ppenumMoniker){
FIXME(ole,"(%p,%d,%p),stub!\n",This,fForward,ppenumMoniker);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_IsEqual
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_IsEqual(ItemMonikerImpl* This,IMoniker* pmkOtherMoniker){
FIXME(ole,"(%p,%p),stub!\n",This,pmkOtherMoniker);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_Hash
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_Hash(ItemMonikerImpl* This,DWORD* pdwHash){
FIXME(ole,"(%p,%p),stub!\n",This,pdwHash);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_IsRunning
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_IsRunning(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
IMoniker* pmkNewlyRunning){
FIXME(ole,"(%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,pmkNewlyRunning);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_GetTimeOfLastChange
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_GetTimeOfLastChange(ItemMonikerImpl* This, IBindCtx* pbc, IMoniker* pmkToLeft,
FILETIME* pFileTime){
FIXME(ole,"(%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,pFileTime);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_Inverse
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_Inverse(ItemMonikerImpl* This,IMoniker** ppmk){
FIXME(ole,"(%p,%p),stub!\n",This,ppmk);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_CommonPrefixWith
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_CommonPrefixWith(ItemMonikerImpl* This,IMoniker* pmkOther,
IMoniker** ppmkPrefix){
FIXME(ole,"(%p,%p,%p),stub!\n",This,pmkOther,ppmkPrefix);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_RelativePathTo
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_RelativePathTo(ItemMonikerImpl* This,IMoniker* pmOther, IMoniker** ppmkRelPath){
FIXME(ole,"(%p,%p,%p),stub!\n",This,pmOther,ppmkRelPath);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_GetDisplayName
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_GetDisplayName(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
LPOLESTR32 *ppszDisplayName){
FIXME(ole,"(%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,ppszDisplayName);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_ParseDisplayName
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_ParseDisplayName(ItemMonikerImpl* This,IBindCtx* pbc, IMoniker* pmkToLeft,
LPOLESTR32 pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut){
FIXME(ole,"(%p,%p,%p,%p,%p,%p),stub!\n",This,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
return E_NOTIMPL;
}
/******************************************************************************
* ItemMoniker_IsSystemMonker
******************************************************************************/
HRESULT WINAPI ItemMonikerImpl_IsSystemMoniker(ItemMonikerImpl* This,DWORD* pwdMksys){
FIXME(ole,"(%p,%p),stub!\n",This,pwdMksys);
return E_NOTIMPL;
}
/******************************************************************************
* CreateItemMoniker16 [OLE2.28]
******************************************************************************/
HRESULT WINAPI CreateItemMoniker16(LPCOLESTR16 lpszDelim,LPCOLESTR32 lpszItem,LPMONIKER* ppmk){// [in] pathname [out] new moniker object
FIXME(ole,"(%s,%p),stub!\n",lpszDelim,ppmk);
*ppmk = NULL;
return E_NOTIMPL;
}
/******************************************************************************
* CreateItemMoniker32 [OLE32.55]
******************************************************************************/
HRESULT WINAPI CreateItemMoniker32(LPCOLESTR32 lpszDelim,LPCOLESTR32 lpszItem, LPMONIKER * ppmk)
{
ItemMonikerImpl* newItemMoniker = 0;
HRESULT hr = S_OK;
TRACE(ole,"(%p,%p,%p)\n",lpszDelim,lpszItem,ppmk);
newItemMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(ItemMonikerImpl));
if (newItemMoniker == 0)
return STG_E_INSUFFICIENTMEMORY;
hr = ItemMonikerImpl_Construct(newItemMoniker,lpszDelim,lpszItem);
if (FAILED(hr))
return hr;
hr = ItemMonikerImpl_QueryInterface(newItemMoniker,&IID_IMoniker,(void**)ppmk);
return hr;
}

View File

@ -2,6 +2,7 @@
* Monikers
*
* Copyright 1998 Marcus Meissner
* Copyright 1999 Noomen Hamza
*/
#include <ctype.h>
@ -15,43 +16,18 @@
#include "debug.h"
/******************************************************************************
* CreateFileMoniker16 [OLE2.28]
* GetRunningObjectTable16 [OLE2.30]
*/
HRESULT WINAPI
CreateFileMoniker16(
LPCOLESTR16 lpszPathName, /* [in] pathname */
LPMONIKER * ppmk /* [out] new moniker object */
) {
FIXME(ole,"(%s,%p),stub!\n",lpszPathName,ppmk);
*ppmk = NULL;
HRESULT WINAPI GetRunningObjectTable16(DWORD reserved, LPVOID *pprot) {
FIXME(ole,"(%ld,%p),stub!\n",reserved,pprot);
return E_FAIL;
}
/******************************************************************************
* CreateFileMoniker32 [OLE32.55]
/***********************************************************************
* GetRunningObjectTable32 (OLE2.73)
*/
HRESULT WINAPI
CreateFileMoniker32(
LPCOLESTR32 lpszPathName, /* [in] pathname */
LPMONIKER * ppmk /* [out] new moniker object */
) {
FIXME(ole,"(%s,%p),stub!\n",debugstr_w(lpszPathName),ppmk);
*ppmk = NULL;
HRESULT WINAPI GetRunningObjectTable32(DWORD reserved, LPVOID *pprot) {
FIXME(ole,"(%ld,%p),stub!\n",reserved,pprot);
return E_FAIL;
}
/******************************************************************************
* CreateItemMoniker32 [OLE32.58]
*/
HRESULT WINAPI
CreateItemMoniker32(
LPCOLESTR32 lpszDelim, /* [in] */
LPCOLESTR32 lpszItem, /* [in] */
LPMONIKER * ppmk /* [out] new moniker object */
)
{
FIXME (ole,"(%s %s %p),stub!\n",
debugstr_w(lpszDelim), debugstr_w(lpszItem), ppmk);
return E_FAIL;
}

View File

@ -90,23 +90,6 @@ HRESULT WINAPI OleInitializeWOW(DWORD x) {
return 0;
}
/******************************************************************************
* GetRunningObjectTable16 [OLE2.30]
*/
HRESULT WINAPI GetRunningObjectTable16(DWORD reserved, LPVOID *pprot) {
FIXME(ole,"(%ld,%p),stub!\n",reserved,pprot);
return E_FAIL;
}
/***********************************************************************
* GetRunningObjectTable32 (OLE2.73)
*/
HRESULT WINAPI GetRunningObjectTable32(DWORD reserved, LPVOID *pprot) {
FIXME(ole,"(%ld,%p),stub!\n",reserved,pprot);
return E_FAIL;
}
/***********************************************************************
* RegisterDragDrop16 (OLE2.35)
*/
@ -161,17 +144,6 @@ HRESULT WINAPI OleRegGetUserType32(
return S_OK;
}
/***********************************************************************
* CreateBindCtx32 [OLE32.52]
*/
HRESULT WINAPI CreateBindCtx32 (DWORD reserved, LPVOID *ppbc)
{
FIXME(ole,"(0x%08lx %p): stub!\n", reserved, ppbc);
*ppbc = 0;
/* return S_OK; */
return E_OUTOFMEMORY;
}
/***********************************************************************
* DoDragDrop32 [OLE32.65]
*/
@ -184,4 +156,3 @@ HRESULT WINAPI DoDragDrop32 (
FIXME(ole,"(DataObject %p, DropSource %p): stub!\n", pDataObject, pDropSource);
return DRAGDROP_S_DROP;
}