reactos/dll/win32/ole32/oleproxy.c

61 lines
2.3 KiB
C
Raw Normal View History

/*
* OLE32 proxy/stub handler
*
* Copyright 2002 Marcus Meissner
* Copyright 2001 Ove Kåven, TransGaming Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "precomp.h"
/***********************************************************************
* DllGetClassObject [OLE32.@]
*/
Sync to Wine-20050830: Francois Gouget <fgouget@free.fr> - Use LPSTORAGE to better match the PSDK. Document the real SEGPTR type using the standard documentation mechanisms. Fixes winapi_check warnings. Robert Shearman <rob@codeweavers.com> - Remove unused thread handle entry from the apartment structure. - Implement IMarshal on proxies so that we don't end up with proxies to proxies, causing potential deadlock issues and performance problems. - Add a test for this situation and remove the todo_wine from another test that now succeeds. - Add stub for CoAllowSetForegroundWindow. Vincent Beron <vberon@mecano.gme.usherb.ca> - Remove local declarations already in included public headers. - Correct mismatches between spec files and comments about export number. Alexandre Julliard <julliard@winehq.org> - Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of duplicate typedefs. - Use the proper WOW functions everywhere instead of the K32WOW variant. - Don't prefix the functions DllCanUnloadNow, DllGetClassObject and Dll(Un)RegisterServer with the dll name so that the compiler can check the prototypes. - Remove duplicate definition of FILE_BEGIN. - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Mike McCormack <mike@codeweavers.com> - Warning fixes for gcc 4.0. - Fix some gcc 4.0 warnings. - return a precomputed result for a NULL string - pass strlen an LPSTR to eliminate a sign warning Marcus Meissner <marcus@jet.franken.de> - Implemented ILockBytes16 (memorystream) support for the 16bit compound storage implementation. - Added ReadClassStg, OleDoAutoConvert, GetConvertStg implementations/stubs. Marcus Meissner <meissner@suse.de> - Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs. svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
{
HRESULT hr;
*ppv = NULL;
if (IsEqualIID(rclsid,&CLSID_DfMarshal)&&(
IsEqualIID(iid,&IID_IClassFactory) ||
IsEqualIID(iid,&IID_IUnknown)
)
)
return MARSHAL_GetStandardMarshalCF(ppv);
if (IsEqualIID(rclsid,&CLSID_StdGlobalInterfaceTable) && (IsEqualIID(iid,&IID_IClassFactory) || IsEqualIID(iid,&IID_IUnknown)))
return StdGlobalInterfaceTable_GetFactory(ppv);
if (IsEqualCLSID(rclsid, &CLSID_FileMoniker))
return FileMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_ItemMoniker))
return ItemMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_AntiMoniker))
return AntiMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_CompositeMoniker))
return CompositeMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_ClassMoniker))
return ClassMonikerCF_Create(iid, ppv);
if (IsEqualCLSID(rclsid, &CLSID_PointerMoniker))
return PointerMonikerCF_Create(iid, ppv);
if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr))
return ComCatCF_Create(iid, ppv);
hr = OLE32_DllGetClassObject(rclsid, iid, ppv);
if (SUCCEEDED(hr))
return hr;
return Handler_DllGetClassObject(rclsid, iid, ppv);
}