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
26 #include "netlistmgr.h"
28 #include "wine/debug.h"
29 #include "netprofm_private.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(netprofm
);
33 static HINSTANCE instance
;
35 BOOL WINAPI
DllMain( HINSTANCE hinst
, DWORD reason
, LPVOID reserved
)
39 case DLL_WINE_PREATTACH
:
40 return FALSE
; /* prefer native version */
41 case DLL_PROCESS_ATTACH
:
43 DisableThreadLibraryCalls( hinst
);
51 IClassFactory IClassFactory_iface
;
52 HRESULT (*create_instance
)(void **);
55 static inline struct netprofm_cf
*impl_from_IClassFactory( IClassFactory
*iface
)
57 return CONTAINING_RECORD( iface
, struct netprofm_cf
, IClassFactory_iface
);
60 static HRESULT WINAPI
netprofm_cf_QueryInterface( IClassFactory
*iface
, REFIID riid
, LPVOID
*ppobj
)
62 if (IsEqualGUID( riid
, &IID_IUnknown
) || IsEqualGUID( riid
, &IID_IClassFactory
))
64 IClassFactory_AddRef( iface
);
68 FIXME( "interface %s not implemented\n", debugstr_guid(riid
) );
72 static ULONG WINAPI
netprofm_cf_AddRef( IClassFactory
*iface
)
77 static ULONG WINAPI
netprofm_cf_Release( IClassFactory
*iface
)
82 static HRESULT WINAPI
netprofm_cf_CreateInstance( IClassFactory
*iface
, LPUNKNOWN outer
,
83 REFIID riid
, LPVOID
*obj
)
85 struct netprofm_cf
*factory
= impl_from_IClassFactory( iface
);
89 TRACE( "%p %s %p\n", outer
, debugstr_guid(riid
), obj
);
92 if (outer
) return CLASS_E_NOAGGREGATION
;
94 r
= factory
->create_instance( (void **)&unk
);
98 r
= IUnknown_QueryInterface( unk
, riid
, obj
);
99 IUnknown_Release( unk
);
103 static HRESULT WINAPI
netprofm_cf_LockServer( IClassFactory
*iface
, BOOL dolock
)
105 FIXME( "%p, %d\n", iface
, dolock
);
109 static const struct IClassFactoryVtbl netprofm_cf_vtbl
=
111 netprofm_cf_QueryInterface
,
114 netprofm_cf_CreateInstance
,
115 netprofm_cf_LockServer
118 static struct netprofm_cf list_manager_cf
= { { &netprofm_cf_vtbl
}, list_manager_create
};
120 /***********************************************************************
121 * DllGetClassObject (NETPROFM.@)
123 HRESULT WINAPI
DllGetClassObject( REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
125 IClassFactory
*cf
= NULL
;
127 TRACE("%s %s %p\n", debugstr_guid(rclsid
), debugstr_guid(iid
), ppv
);
129 if (IsEqualGUID( rclsid
, &CLSID_NetworkListManager
))
131 cf
= &list_manager_cf
.IClassFactory_iface
;
133 if (!cf
) return CLASS_E_CLASSNOTAVAILABLE
;
134 return IClassFactory_QueryInterface( cf
, iid
, ppv
);
137 /***********************************************************************
138 * DllCanUnloadNow (NETPROFM.@)
140 HRESULT WINAPI
DllCanUnloadNow( void )
145 /***********************************************************************
146 * DllRegisterServer (NETPROFM.@)
148 HRESULT WINAPI
DllRegisterServer( void )
150 return __wine_register_resources( instance
);
153 /***********************************************************************
154 * DllUnregisterServer (NETPROFM.@)
156 HRESULT WINAPI
DllUnregisterServer( void )
158 return __wine_unregister_resources( instance
);