mfplat: Read queue subscriber within the critical section.
[wine/zf.git] / dlls / netprofm / main.c
blob1763080ec3f73c5673e32c55c08faba7180fefad
1 /*
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
19 #include <stdarg.h>
20 #include "windef.h"
21 #include "winbase.h"
22 #define COBJMACROS
23 #include "objbase.h"
24 #include "rpcproxy.h"
25 #include "netlistmgr.h"
27 #include "wine/debug.h"
28 #include "netprofm_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(netprofm);
32 static HINSTANCE instance;
34 BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
36 switch (reason)
38 case DLL_PROCESS_ATTACH:
39 instance = hinst;
40 DisableThreadLibraryCalls( hinst );
41 break;
43 return TRUE;
46 struct netprofm_cf
48 IClassFactory IClassFactory_iface;
49 HRESULT (*create_instance)(void **);
52 static inline struct netprofm_cf *impl_from_IClassFactory( IClassFactory *iface )
54 return CONTAINING_RECORD( iface, struct netprofm_cf, IClassFactory_iface );
57 static HRESULT WINAPI netprofm_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj )
59 if (IsEqualGUID( riid, &IID_IUnknown ) || IsEqualGUID( riid, &IID_IClassFactory ))
61 IClassFactory_AddRef( iface );
62 *ppobj = iface;
63 return S_OK;
65 FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
66 return E_NOINTERFACE;
69 static ULONG WINAPI netprofm_cf_AddRef( IClassFactory *iface )
71 return 2;
74 static ULONG WINAPI netprofm_cf_Release( IClassFactory *iface )
76 return 1;
79 static HRESULT WINAPI netprofm_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN outer,
80 REFIID riid, LPVOID *obj )
82 struct netprofm_cf *factory = impl_from_IClassFactory( iface );
83 IUnknown *unk;
84 HRESULT r;
86 TRACE( "%p %s %p\n", outer, debugstr_guid(riid), obj );
88 *obj = NULL;
89 if (outer) return CLASS_E_NOAGGREGATION;
91 r = factory->create_instance( (void **)&unk );
92 if (FAILED( r ))
93 return r;
95 r = IUnknown_QueryInterface( unk, riid, obj );
96 IUnknown_Release( unk );
97 return r;
100 static HRESULT WINAPI netprofm_cf_LockServer( IClassFactory *iface, BOOL dolock )
102 FIXME( "%p, %d\n", iface, dolock );
103 return S_OK;
106 static const struct IClassFactoryVtbl netprofm_cf_vtbl =
108 netprofm_cf_QueryInterface,
109 netprofm_cf_AddRef,
110 netprofm_cf_Release,
111 netprofm_cf_CreateInstance,
112 netprofm_cf_LockServer
115 static struct netprofm_cf list_manager_cf = { { &netprofm_cf_vtbl }, list_manager_create };
117 /***********************************************************************
118 * DllGetClassObject (NETPROFM.@)
120 HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv )
122 IClassFactory *cf = NULL;
124 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
126 if (IsEqualGUID( rclsid, &CLSID_NetworkListManager ))
128 cf = &list_manager_cf.IClassFactory_iface;
130 if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
131 return IClassFactory_QueryInterface( cf, iid, ppv );
134 /***********************************************************************
135 * DllCanUnloadNow (NETPROFM.@)
137 HRESULT WINAPI DllCanUnloadNow( void )
139 return S_FALSE;
142 /***********************************************************************
143 * DllRegisterServer (NETPROFM.@)
145 HRESULT WINAPI DllRegisterServer( void )
147 return __wine_register_resources( instance );
150 /***********************************************************************
151 * DllUnregisterServer (NETPROFM.@)
153 HRESULT WINAPI DllUnregisterServer( void )
155 return __wine_unregister_resources( instance );