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
);
32 static HINSTANCE instance
;
34 BOOL WINAPI
DllMain( HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
38 case DLL_PROCESS_ATTACH
:
40 DisableThreadLibraryCalls( hinst
);
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
);
65 FIXME( "interface %s not implemented\n", debugstr_guid(riid
) );
69 static ULONG WINAPI
netprofm_cf_AddRef( IClassFactory
*iface
)
74 static ULONG WINAPI
netprofm_cf_Release( IClassFactory
*iface
)
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
);
86 TRACE( "%p %s %p\n", outer
, debugstr_guid(riid
), obj
);
89 if (outer
) return CLASS_E_NOAGGREGATION
;
91 r
= factory
->create_instance( (void **)&unk
);
95 r
= IUnknown_QueryInterface( unk
, riid
, obj
);
96 IUnknown_Release( unk
);
100 static HRESULT WINAPI
netprofm_cf_LockServer( IClassFactory
*iface
, BOOL dolock
)
102 FIXME( "%p, %d\n", iface
, dolock
);
106 static const struct IClassFactoryVtbl netprofm_cf_vtbl
=
108 netprofm_cf_QueryInterface
,
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 )
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
);