oleproxy.c 2.61 KB
Newer Older
1 2 3 4
/*
 *	OLE32 proxy/stub handler
 *
 *  Copyright 2002  Marcus Meissner
5
 *  Copyright 2001  Ove Kåven, TransGaming Technologies
6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * 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
19
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 21 22 23 24
 */

#include "config.h"

#include <stdlib.h>
25
#include <stdarg.h>
26 27 28
#include <stdio.h>
#include <string.h>

29
#define COBJMACROS
30 31
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
32

33
#include "windef.h"
34
#include "winbase.h"
35
#include "winuser.h"
36 37 38 39 40
#include "objbase.h"
#include "ole2.h"
#include "rpc.h"

#include "compobj_private.h"
41
#include "moniker.h"
42
#include "comcat.h"
43 44

/***********************************************************************
45
 *           DllGetClassObject [OLE32.@]
46
 */
47
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv)
48
{
49 50
    HRESULT hr;

51
    *ppv = NULL;
52 53 54 55 56
    if (IsEqualIID(rclsid,&CLSID_DfMarshal)&&(
		IsEqualIID(iid,&IID_IClassFactory) ||
		IsEqualIID(iid,&IID_IUnknown)
	)
    )
57
	return MARSHAL_GetStandardMarshalCF(ppv);
58 59
    if (IsEqualIID(rclsid,&CLSID_StdGlobalInterfaceTable) && (IsEqualIID(iid,&IID_IClassFactory) || IsEqualIID(iid,&IID_IUnknown)))
        return StdGlobalInterfaceTable_GetFactory(ppv);
60 61 62 63
    if (IsEqualCLSID(rclsid, &CLSID_FileMoniker))
        return FileMonikerCF_Create(iid, ppv);
    if (IsEqualCLSID(rclsid, &CLSID_ItemMoniker))
        return ItemMonikerCF_Create(iid, ppv);
64 65
    if (IsEqualCLSID(rclsid, &CLSID_AntiMoniker))
        return AntiMonikerCF_Create(iid, ppv);
66 67
    if (IsEqualCLSID(rclsid, &CLSID_CompositeMoniker))
        return CompositeMonikerCF_Create(iid, ppv);
68 69
    if (IsEqualCLSID(rclsid, &CLSID_ClassMoniker))
        return ClassMonikerCF_Create(iid, ppv);
70 71
    if (IsEqualCLSID(rclsid, &CLSID_PointerMoniker))
        return PointerMonikerCF_Create(iid, ppv);
72 73
    if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr))
        return ComCatCF_Create(iid, ppv);
74

75 76 77 78 79
    hr = OLE32_DllGetClassObject(rclsid, iid, ppv);
    if (SUCCEEDED(hr))
        return hr;

    return Handler_DllGetClassObject(rclsid, iid, ppv);
80
}