ReactOS 0.4.16-dev-2332-g4cba65d
ftmarshal.c
Go to the documentation of this file.
1/*
2 * free threaded marshaller
3 *
4 * Copyright 2002 Juergen Schmied
5 *
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.
10 *
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.
15 *
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
19 */
20
21#include <stdlib.h>
22#include <stdarg.h>
23#include <stdio.h>
24#include <string.h>
25#include <assert.h>
26
27#define COBJMACROS
28
29#include "windef.h"
30#include "winbase.h"
31#include "objbase.h"
32
33#include "wine/debug.h"
34
35#include "compobj_private.h"
36
38
39static HRESULT WINAPI FTMarshalCF_QueryInterface(LPCLASSFACTORY iface,
41{
42 *ppv = NULL;
44 {
45 *ppv = iface;
46 IClassFactory_AddRef(iface);
47 return S_OK;
48 }
49 return E_NOINTERFACE;
50}
51
52static ULONG WINAPI FTMarshalCF_AddRef(LPCLASSFACTORY iface)
53{
54 return 2; /* non-heap based object */
55}
56
57static ULONG WINAPI FTMarshalCF_Release(LPCLASSFACTORY iface)
58{
59 return 1; /* non-heap based object */
60}
61
62static HRESULT WINAPI FTMarshalCF_CreateInstance(LPCLASSFACTORY iface,
64{
66 HRESULT hr;
67
68 TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv);
69
70 *ppv = NULL;
71
73
74 if (SUCCEEDED(hr))
75 {
76 hr = IUnknown_QueryInterface(pUnknown, riid, ppv);
77 IUnknown_Release(pUnknown);
78 }
79
80 return hr;
81}
82
83static HRESULT WINAPI FTMarshalCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
84{
85 FIXME("(%d), stub!\n",fLock);
86 return S_OK;
87}
88
89static const IClassFactoryVtbl FTMarshalCFVtbl =
90{
96};
97static const IClassFactoryVtbl *FTMarshalCF = &FTMarshalCFVtbl;
98
100{
101 return IClassFactory_QueryInterface((IClassFactory *)&FTMarshalCF, riid, ppv);
102}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
static LPVOID LPUNKNOWN
Definition: dinput.c:53
#define NULL
Definition: types.h:112
HRESULT WINAPI CoCreateFreeThreadedMarshaler(IUnknown *outer, IUnknown **marshaler)
Definition: marshal.c:417
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
unsigned int BOOL
Definition: ntddk_ex.h:94
static ULONG WINAPI FTMarshalCF_AddRef(LPCLASSFACTORY iface)
Definition: ftmarshal.c:52
static HRESULT WINAPI FTMarshalCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
Definition: ftmarshal.c:83
HRESULT FTMarshalCF_Create(REFIID riid, LPVOID *ppv)
Definition: ftmarshal.c:99
static const IClassFactoryVtbl FTMarshalCFVtbl
Definition: ftmarshal.c:89
static HRESULT WINAPI FTMarshalCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppv)
Definition: ftmarshal.c:39
static HRESULT WINAPI FTMarshalCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
Definition: ftmarshal.c:62
static const IClassFactoryVtbl * FTMarshalCF
Definition: ftmarshal.c:97
static ULONG WINAPI FTMarshalCF_Release(LPCLASSFACTORY iface)
Definition: ftmarshal.c:57
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479