winedbg: Add the Polish translation.
[wine/multimedia.git] / dlls / hnetcfg / hnetcfg.c
blob3ecc8c23219edc8e5b8ca6e587d0b46f8ceb9ef9
1 /*
2 * Copyright (C) 2007 Jeff Latimer
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>
21 #define COBJMACROS
23 #include "windef.h"
24 #include "winbase.h"
25 #include "objbase.h"
26 #include "netfw.h"
28 #include "wine/debug.h"
29 #include "hnetcfg_private.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
33 typedef HRESULT (*fnCreateInstance)( IUnknown *pUnkOuter, LPVOID *ppObj );
35 typedef struct
37 const struct IClassFactoryVtbl *vtbl;
38 fnCreateInstance pfnCreateInstance;
39 } hnetcfg_cf;
41 static inline hnetcfg_cf *impl_from_IClassFactory( IClassFactory *iface )
43 return (hnetcfg_cf *)((char *)iface - FIELD_OFFSET( hnetcfg_cf, vtbl ));
46 static HRESULT WINAPI hnetcfg_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj )
48 if (IsEqualGUID(riid, &IID_IUnknown) ||
49 IsEqualGUID(riid, &IID_IClassFactory))
51 IClassFactory_AddRef( iface );
52 *ppobj = iface;
53 return S_OK;
55 FIXME("interface %s not implemented\n", debugstr_guid(riid));
56 return E_NOINTERFACE;
59 static ULONG WINAPI hnetcfg_cf_AddRef( IClassFactory *iface )
61 return 2;
64 static ULONG WINAPI hnetcfg_cf_Release( IClassFactory *iface )
66 return 1;
69 static HRESULT WINAPI hnetcfg_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOuter,
70 REFIID riid, LPVOID *ppobj )
72 hnetcfg_cf *This = impl_from_IClassFactory( iface );
73 HRESULT r;
74 IUnknown *punk;
76 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
78 *ppobj = NULL;
80 if (pOuter)
81 return CLASS_E_NOAGGREGATION;
83 r = This->pfnCreateInstance( pOuter, (LPVOID *)&punk );
84 if (FAILED(r))
85 return r;
87 r = IUnknown_QueryInterface( punk, riid, ppobj );
88 if (FAILED(r))
89 return r;
91 IUnknown_Release( punk );
92 return r;
95 static HRESULT WINAPI hnetcfg_cf_LockServer( IClassFactory *iface, BOOL dolock )
97 FIXME("(%p)->(%d)\n", iface, dolock);
98 return S_OK;
101 static const struct IClassFactoryVtbl hnetcfg_cf_vtbl =
103 hnetcfg_cf_QueryInterface,
104 hnetcfg_cf_AddRef,
105 hnetcfg_cf_Release,
106 hnetcfg_cf_CreateInstance,
107 hnetcfg_cf_LockServer
110 static hnetcfg_cf fw_manager_cf = { &hnetcfg_cf_vtbl, NetFwMgr_create };
111 static hnetcfg_cf fw_app_cf = { &hnetcfg_cf_vtbl, NetFwAuthorizedApplication_create };
113 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
115 TRACE("(0x%p, %d, %p)\n",hInstDLL,fdwReason,lpvReserved);
117 switch(fdwReason) {
118 case DLL_WINE_PREATTACH:
119 return FALSE;
120 case DLL_PROCESS_ATTACH:
121 DisableThreadLibraryCalls(hInstDLL);
122 break;
123 case DLL_PROCESS_DETACH:
124 break;
126 return TRUE;
129 HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv )
131 IClassFactory *cf = NULL;
133 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
135 if (IsEqualGUID( rclsid, &CLSID_NetFwMgr ))
137 cf = (IClassFactory *)&fw_manager_cf.vtbl;
139 else if (IsEqualGUID( rclsid, &CLSID_NetFwAuthorizedApplication ))
141 cf = (IClassFactory *)&fw_app_cf.vtbl;
144 if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
145 return IClassFactory_QueryInterface( cf, iid, ppv );
148 HRESULT WINAPI DllCanUnloadNow( void )
150 return S_FALSE;