From 3b0a5d0a066232bf5e38c3ee9f698d3ab2c396e4 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Wed, 1 Dec 2004 15:33:34 +0000 Subject: [PATCH] - Add some function declarations to objbase.h. - Add stubs for server ref counting. - Implement HRESULT marshaling. --- dlls/ole32/compobj.c | 18 ++++++++++++++++++ dlls/ole32/marshal.c | 44 +++++++++++++++++++++++++++++++++++++++++++ dlls/ole32/ole32.spec | 8 ++++---- include/objbase.h | 31 +++++++++++++----------------- 4 files changed, 79 insertions(+), 22 deletions(-) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 046242f75d6..c2f4fe4d56c 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -2249,3 +2249,21 @@ HRESULT WINAPI CoSuspendClassObjects(void) FIXME("\n"); return S_OK; } + +/*********************************************************************** + * CoAddRefServerProcess [OLE32.@] + */ +ULONG WINAPI CoAddRefServerProcess(void) +{ + FIXME("\n"); + return 2; +} + +/*********************************************************************** + * CoReleaseServerProcess [OLE32.@] + */ +ULONG WINAPI CoReleaseServerProcess(void) +{ + FIXME("\n"); + return 1; +} diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index 975380956b6..b7330284cf4 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -763,3 +763,47 @@ MARSHAL_GetStandardMarshalCF(LPVOID *ppv) { *ppv = &pdfmarshalcfvtbl; return S_OK; } + +/*********************************************************************** + * CoMarshalHresult [OLE32.@] + * + * Marshals an HRESULT value into a stream. + * + * PARAMS + * pStm [I] Stream that hresult will be marshaled into. + * hresult [I] HRESULT to be marshaled. + * + * RETURNS + * Success: S_OK + * Failure: A COM error code + * + * SEE + * CoUnmarshalHresult(). + */ +HRESULT WINAPI +CoMarshalHresult(LPSTREAM pStm, HRESULT hresult) +{ + return IStream_Write(pStm, &hresult, sizeof(hresult), NULL); +} + +/*********************************************************************** + * CoUnmarshalHresult [OLE32.@] + * + * Unmarshals an HRESULT value from a stream. + * + * PARAMS + * pStm [I] Stream that hresult will be unmarshaled from. + * phresult [I] Pointer to HRESULT where the value will be unmarshaled to. + * + * RETURNS + * Success: S_OK + * Failure: A COM error code + * + * SEE + * CoMarshalHresult(). + */ +HRESULT WINAPI +CoUnmarshalHresult(LPSTREAM pStm, HRESULT * phresult) +{ + return IStream_Read(pStm, phresult, sizeof(*phresult), NULL); +} diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index eeff473d788..2dcb5cb2f4d 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -5,7 +5,7 @@ @ stub CLIPFORMAT_UserUnmarshal @ stdcall CLSIDFromProgID(wstr ptr) @ stdcall CLSIDFromString(wstr ptr) -@ stub CoAddRefServerProcess +@ stdcall CoAddRefServerProcess() @ stdcall CoBuildVersion() @ stub CoCopyProxy #@ stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED @ stdcall CoCreateFreeThreadedMarshaler(ptr ptr) @@ -44,7 +44,7 @@ @ stdcall CoIsOle1Class (ptr) @ stdcall CoLoadLibrary(wstr long) @ stdcall CoLockObjectExternal(ptr long long) -@ stub CoMarshalHresult #@ stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED +@ stdcall CoMarshalHresult(ptr long) @ stdcall CoMarshalInterThreadInterfaceInStream(ptr ptr ptr) @ stdcall CoMarshalInterface(ptr ptr ptr long ptr long) @ stub CoQueryAuthenticationServices @@ -58,7 +58,7 @@ @ stub CoRegisterPSClsid #@ stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED @ stub CoRegisterSurrogate @ stdcall CoReleaseMarshalData(ptr) -@ stub CoReleaseServerProcess #@ stdcall () return 0,ERR_NOTIMPLEMENTED +@ stdcall CoReleaseServerProcess() @ stdcall CoResumeClassObjects() @ stub CoRevertToSelf #@ stdcall () return 0,ERR_NOTIMPLEMENTED @ stdcall CoRevokeClassObject(long) @@ -73,7 +73,7 @@ @ stdcall CoTreatAsClass(ptr ptr) @ stdcall CoUninitialize() @ stub CoUnloadingWOW -@ stub CoUnmarshalHresult #@ stdcall (ptr ptr) return 0,ERR_NOTIMPLEMENTED +@ stdcall CoUnmarshalHresult(ptr ptr) @ stdcall CoUnmarshalInterface(ptr ptr ptr) @ stdcall CreateAntiMoniker(ptr) @ stdcall CreateBindCtx(long ptr) diff --git a/include/objbase.h b/include/objbase.h index e5171e3ae6b..f46374d12cc 100644 --- a/include/objbase.h +++ b/include/objbase.h @@ -350,7 +350,7 @@ HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid); HRESULT WINAPI CoSuspendClassObjects(void); HRESULT WINAPI CoResumeClassObjects(void); ULONG WINAPI CoAddRefServerProcess(void); -HRESULT WINAPI CoReleaseServerProcess(void); +ULONG WINAPI CoReleaseServerProcess(void); /* marshalling */ HRESULT WINAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal); @@ -417,27 +417,22 @@ HRESULT WINAPI CreateDataCache(LPUNKNOWN pUnkOuter, REFCLSID rclsid, REFIID iid, /***************************************************************************** * Moniker API */ -HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid); - -HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC* ppbc); - -HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER* ppmk); - -HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, LPMONIKER* ppmk); - -HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk); - -HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite); - HRESULT WINAPI BindMoniker(LPMONIKER pmk, DWORD grfOpt, REFIID iidResult, LPVOID* ppvResult); - +HRESULT WINAPI CoGetObject(LPCWSTR pszName, BIND_OPTS *pBindOptions, REFIID riid, void **ppv); +HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk); +HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC* ppbc); HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, LPMONIKER* ppmk); - +HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER* ppmk); +HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPMONIKER* ppmkComposite); +HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim, LPCOLESTR lpszItem, LPMONIKER* ppmk); +HRESULT WINAPI CreateObjrefMoniker(LPUNKNOWN punk, LPMONIKER * ppmk); +HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER * ppmk); HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER* ppmk); - -HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon); - +HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid); HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot); +HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szUserName, ULONG * pchEaten, LPMONIKER * ppmk); +HRESULT WINAPI MonikerCommonPrefixWith(IMoniker* pmkThis,IMoniker* pmkOther,IMoniker** ppmkCommon); +HRESULT WINAPI MonikerRelativePathTo(LPMONIKER pmkSrc, LPMONIKER pmkDest, LPMONIKER * ppmkRelPath, BOOL dwReserved); /***************************************************************************** * Storage API