2 * free threaded marshaller
4 * Copyright 2002 Juergen Schmied
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
33 #include "wine/debug.h"
35 #include "compobj_private.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
39 static HRESULT WINAPI
FTMarshalCF_QueryInterface(LPCLASSFACTORY iface
,
40 REFIID riid
, LPVOID
*ppv
)
43 if (IsEqualIID(riid
, &IID_IUnknown
) || IsEqualIID(riid
, &IID_IClassFactory
))
46 IClassFactory_AddRef(iface
);
52 static ULONG WINAPI
FTMarshalCF_AddRef(LPCLASSFACTORY iface
)
54 return 2; /* non-heap based object */
57 static ULONG WINAPI
FTMarshalCF_Release(LPCLASSFACTORY iface
)
59 return 1; /* non-heap based object */
62 static HRESULT WINAPI
FTMarshalCF_CreateInstance(LPCLASSFACTORY iface
,
63 LPUNKNOWN pUnk
, REFIID riid
, LPVOID
*ppv
)
68 TRACE("(%p, %s, %p)\n", pUnk
, debugstr_guid(riid
), ppv
);
72 hr
= CoCreateFreeThreadedMarshaler(pUnk
, &pUnknown
);
76 hr
= IUnknown_QueryInterface(pUnknown
, riid
, ppv
);
77 IUnknown_Release(pUnknown
);
83 static HRESULT WINAPI
FTMarshalCF_LockServer(LPCLASSFACTORY iface
, BOOL fLock
)
85 FIXME("(%d), stub!\n",fLock
);
89 static const IClassFactoryVtbl FTMarshalCFVtbl
=
91 FTMarshalCF_QueryInterface
,
94 FTMarshalCF_CreateInstance
,
95 FTMarshalCF_LockServer
97 static const IClassFactoryVtbl
*FTMarshalCF
= &FTMarshalCFVtbl
;
99 HRESULT
FTMarshalCF_Create(REFIID riid
, LPVOID
*ppv
)
101 return IClassFactory_QueryInterface((IClassFactory
*)&FTMarshalCF
, riid
, ppv
);