d3dx10: Add support for ID3DX10ThreadPump parameter in D3DX10CreateTextureFromFileW.
[wine.git] / dlls / netcfgx / main.c
blobd3dcf4a73e33a2dd2f1837a1cf5217336e8feaba
1 /*
2 * Network Configuration Objects implementation
4 * Copyright 2013 Austin English
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <stdarg.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "ole2.h"
27 #include "rpcproxy.h"
28 #include "wine/debug.h"
30 #include "netcfgx.h"
31 #include "netcfg_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(netcfgx);
35 typedef HRESULT (*ClassFactoryCreateInstanceFunc)(IUnknown **);
37 typedef struct netcfgcf
39 IClassFactory IClassFactory_iface;
40 ClassFactoryCreateInstanceFunc fnCreateInstance;
41 } netcfgcf;
43 static inline netcfgcf *impl_from_IClassFactory( IClassFactory *iface )
45 return CONTAINING_RECORD(iface, netcfgcf, IClassFactory_iface);
48 static HRESULT WINAPI netcfgcf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj )
50 TRACE("%s %p\n", debugstr_guid(riid), ppobj);
52 if (IsEqualGUID(riid, &IID_IUnknown) ||
53 IsEqualGUID(riid, &IID_IClassFactory))
55 IClassFactory_AddRef( iface );
56 *ppobj = iface;
57 return S_OK;
60 ERR("interface %s not implemented\n", debugstr_guid(riid));
61 return E_NOINTERFACE;
64 static ULONG WINAPI netcfgcf_AddRef(IClassFactory *iface )
66 TRACE("%p\n", iface);
68 return 2;
71 static ULONG WINAPI netcfgcf_Release(IClassFactory *iface )
73 TRACE("%p\n", iface);
75 return 1;
78 static HRESULT WINAPI netcfgcf_CreateInstance(IClassFactory *iface,LPUNKNOWN pOuter,
79 REFIID riid, LPVOID *ppobj )
81 netcfgcf *This = impl_from_IClassFactory( iface );
82 HRESULT hr;
83 IUnknown *punk;
85 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj );
87 *ppobj = NULL;
89 if (pOuter)
90 return CLASS_E_NOAGGREGATION;
92 hr = This->fnCreateInstance( &punk );
93 if (SUCCEEDED(hr))
95 hr = IUnknown_QueryInterface( punk, riid, ppobj );
97 IUnknown_Release( punk );
99 else
101 WARN("Cannot create an instance object. 0x%08lx\n", hr);
103 return hr;
106 static HRESULT WINAPI netcfgcf_LockServer(IClassFactory *iface, BOOL dolock)
108 FIXME("(%p)->(%d),stub!\n",iface,dolock);
109 return S_OK;
112 static const struct IClassFactoryVtbl netcfgcf_vtbl =
114 netcfgcf_QueryInterface,
115 netcfgcf_AddRef,
116 netcfgcf_Release,
117 netcfgcf_CreateInstance,
118 netcfgcf_LockServer
121 static netcfgcf netconfigcf = { {&netcfgcf_vtbl}, INetCfg_CreateInstance };
123 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
125 IClassFactory *cf = NULL;
127 TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
129 if(IsEqualCLSID(rclsid, &CLSID_CNetCfg))
131 cf = &netconfigcf.IClassFactory_iface;
134 if(!cf)
135 return CLASS_E_CLASSNOTAVAILABLE;
137 return IClassFactory_QueryInterface(cf, riid, ppv);