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_WINE_PREATTACH
:
39 return FALSE
; /* prefer native version */
40 case DLL_PROCESS_ATTACH
:
42 DisableThreadLibraryCalls( hinst
);
50 IClassFactory IClassFactory_iface
;
51 HRESULT (*create_instance
)(void **);
54 static inline struct netprofm_cf
*impl_from_IClassFactory( IClassFactory
*iface
)
56 return CONTAINING_RECORD( iface
, struct netprofm_cf
, IClassFactory_iface
);
59 static HRESULT WINAPI
netprofm_cf_QueryInterface( IClassFactory
*iface
, REFIID riid
, LPVOID
*ppobj
)
61 if (IsEqualGUID( riid
, &IID_IUnknown
) || IsEqualGUID( riid
, &IID_IClassFactory
))
63 IClassFactory_AddRef( iface
);
67 FIXME( "interface %s not implemented\n", debugstr_guid(riid
) );
71 static ULONG WINAPI
netprofm_cf_AddRef( IClassFactory
*iface
)
76 static ULONG WINAPI
netprofm_cf_Release( IClassFactory
*iface
)
81 static HRESULT WINAPI
netprofm_cf_CreateInstance( IClassFactory
*iface
, LPUNKNOWN outer
,
82 REFIID riid
, LPVOID
*obj
)
84 struct netprofm_cf
*factory
= impl_from_IClassFactory( iface
);
88 TRACE( "%p %s %p\n", outer
, debugstr_guid(riid
), obj
);
91 if (outer
) return CLASS_E_NOAGGREGATION
;
93 r
= factory
->create_instance( (void **)&unk
);
97 r
= IUnknown_QueryInterface( unk
, riid
, obj
);
98 IUnknown_Release( unk
);
102 static HRESULT WINAPI
netprofm_cf_LockServer( IClassFactory
*iface
, BOOL dolock
)
104 FIXME( "%p, %d\n", iface
, dolock
);
108 static const struct IClassFactoryVtbl netprofm_cf_vtbl
=
110 netprofm_cf_QueryInterface
,
113 netprofm_cf_CreateInstance
,
114 netprofm_cf_LockServer
117 static struct netprofm_cf list_manager_cf
= { { &netprofm_cf_vtbl
}, list_manager_create
};
119 /***********************************************************************
120 * DllGetClassObject (NETPROFM.@)
122 HRESULT WINAPI
DllGetClassObject( REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
124 IClassFactory
*cf
= NULL
;
126 TRACE("%s %s %p\n", debugstr_guid(rclsid
), debugstr_guid(iid
), ppv
);
128 if (IsEqualGUID( rclsid
, &CLSID_NetworkListManager
))
130 cf
= &list_manager_cf
.IClassFactory_iface
;
132 if (!cf
) return CLASS_E_CLASSNOTAVAILABLE
;
133 return IClassFactory_QueryInterface( cf
, iid
, ppv
);
136 /***********************************************************************
137 * DllCanUnloadNow (NETPROFM.@)
139 HRESULT WINAPI
DllCanUnloadNow( void )
144 /***********************************************************************
145 * DllRegisterServer (NETPROFM.@)
147 HRESULT WINAPI
DllRegisterServer( void )
149 return __wine_register_resources( instance
);
152 /***********************************************************************
153 * DllUnregisterServer (NETPROFM.@)
155 HRESULT WINAPI
DllUnregisterServer( void )
157 return __wine_unregister_resources( instance
);