2 * Copyright 2014 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "netlistmgr.h"
27 #include "wine/debug.h"
28 #include "netprofm_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(netprofm
);
34 IClassFactory IClassFactory_iface
;
35 HRESULT (*create_instance
)(void **);
38 static inline struct netprofm_cf
*impl_from_IClassFactory( IClassFactory
*iface
)
40 return CONTAINING_RECORD( iface
, struct netprofm_cf
, IClassFactory_iface
);
43 static HRESULT WINAPI
netprofm_cf_QueryInterface( IClassFactory
*iface
, REFIID riid
, LPVOID
*ppobj
)
45 if (IsEqualGUID( riid
, &IID_IUnknown
) || IsEqualGUID( riid
, &IID_IClassFactory
))
47 IClassFactory_AddRef( iface
);
51 FIXME( "interface %s not implemented\n", debugstr_guid(riid
) );
55 static ULONG WINAPI
netprofm_cf_AddRef( IClassFactory
*iface
)
60 static ULONG WINAPI
netprofm_cf_Release( IClassFactory
*iface
)
65 static HRESULT WINAPI
netprofm_cf_CreateInstance( IClassFactory
*iface
, LPUNKNOWN outer
,
66 REFIID riid
, LPVOID
*obj
)
68 struct netprofm_cf
*factory
= impl_from_IClassFactory( iface
);
72 TRACE( "%p %s %p\n", outer
, debugstr_guid(riid
), obj
);
75 if (outer
) return CLASS_E_NOAGGREGATION
;
77 r
= factory
->create_instance( (void **)&unk
);
81 r
= IUnknown_QueryInterface( unk
, riid
, obj
);
82 IUnknown_Release( unk
);
86 static HRESULT WINAPI
netprofm_cf_LockServer( IClassFactory
*iface
, BOOL dolock
)
88 FIXME( "%p, %d\n", iface
, dolock
);
92 static const struct IClassFactoryVtbl netprofm_cf_vtbl
=
94 netprofm_cf_QueryInterface
,
97 netprofm_cf_CreateInstance
,
98 netprofm_cf_LockServer
101 static struct netprofm_cf list_manager_cf
= { { &netprofm_cf_vtbl
}, list_manager_create
};
103 /***********************************************************************
104 * DllGetClassObject (NETPROFM.@)
106 HRESULT WINAPI
DllGetClassObject( REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
108 IClassFactory
*cf
= NULL
;
110 TRACE("%s %s %p\n", debugstr_guid(rclsid
), debugstr_guid(iid
), ppv
);
112 if (IsEqualGUID( rclsid
, &CLSID_NetworkListManager
))
114 cf
= &list_manager_cf
.IClassFactory_iface
;
116 if (!cf
) return CLASS_E_CLASSNOTAVAILABLE
;
117 return IClassFactory_QueryInterface( cf
, iid
, ppv
);