ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

manager.c
Go to the documentation of this file.
00001 /*
00002  * Copyright 2009 Hans Leidekker for CodeWeavers
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00017  */
00018 
00019 #include "config.h"
00020 #include <stdarg.h>
00021 #include <stdio.h>
00022 
00023 #define COBJMACROS
00024 
00025 #include "windef.h"
00026 #include "winbase.h"
00027 #include "winuser.h"
00028 #include "initguid.h"
00029 #include "ole2.h"
00030 #include "netfw.h"
00031 
00032 #include "wine/debug.h"
00033 #include "wine/unicode.h"
00034 #include "hnetcfg_private.h"
00035 
00036 WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
00037 
00038 typedef struct fw_manager
00039 {
00040     INetFwMgr INetFwMgr_iface;
00041     LONG refs;
00042 } fw_manager;
00043 
00044 static inline fw_manager *impl_from_INetFwMgr( INetFwMgr *iface )
00045 {
00046     return CONTAINING_RECORD(iface, fw_manager, INetFwMgr_iface);
00047 }
00048 
00049 static ULONG WINAPI fw_manager_AddRef(
00050     INetFwMgr *iface )
00051 {
00052     fw_manager *fw_manager = impl_from_INetFwMgr( iface );
00053     return InterlockedIncrement( &fw_manager->refs );
00054 }
00055 
00056 static ULONG WINAPI fw_manager_Release(
00057     INetFwMgr *iface )
00058 {
00059     fw_manager *fw_manager = impl_from_INetFwMgr( iface );
00060     LONG refs = InterlockedDecrement( &fw_manager->refs );
00061     if (!refs)
00062     {
00063         TRACE("destroying %p\n", fw_manager);
00064         HeapFree( GetProcessHeap(), 0, fw_manager );
00065     }
00066     return refs;
00067 }
00068 
00069 static HRESULT WINAPI fw_manager_QueryInterface(
00070     INetFwMgr *iface,
00071     REFIID riid,
00072     void **ppvObject )
00073 {
00074     fw_manager *This = impl_from_INetFwMgr( iface );
00075 
00076     TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
00077 
00078     if ( IsEqualGUID( riid, &IID_INetFwMgr ) ||
00079          IsEqualGUID( riid, &IID_IDispatch ) ||
00080          IsEqualGUID( riid, &IID_IUnknown ) )
00081     {
00082         *ppvObject = iface;
00083     }
00084     else
00085     {
00086         FIXME("interface %s not implemented\n", debugstr_guid(riid));
00087         return E_NOINTERFACE;
00088     }
00089     INetFwMgr_AddRef( iface );
00090     return S_OK;
00091 }
00092 
00093 static HRESULT WINAPI fw_manager_GetTypeInfoCount(
00094     INetFwMgr *iface,
00095     UINT *pctinfo )
00096 {
00097     fw_manager *This = impl_from_INetFwMgr( iface );
00098 
00099     FIXME("%p %p\n", This, pctinfo);
00100     return E_NOTIMPL;
00101 }
00102 
00103 static HRESULT WINAPI fw_manager_GetTypeInfo(
00104     INetFwMgr *iface,
00105     UINT iTInfo,
00106     LCID lcid,
00107     ITypeInfo **ppTInfo )
00108 {
00109     fw_manager *This = impl_from_INetFwMgr( iface );
00110 
00111     FIXME("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
00112     return E_NOTIMPL;
00113 }
00114 
00115 static HRESULT WINAPI fw_manager_GetIDsOfNames(
00116     INetFwMgr *iface,
00117     REFIID riid,
00118     LPOLESTR *rgszNames,
00119     UINT cNames,
00120     LCID lcid,
00121     DISPID *rgDispId )
00122 {
00123     fw_manager *This = impl_from_INetFwMgr( iface );
00124 
00125     FIXME("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
00126     return E_NOTIMPL;
00127 }
00128 
00129 static HRESULT WINAPI fw_manager_Invoke(
00130     INetFwMgr *iface,
00131     DISPID dispIdMember,
00132     REFIID riid,
00133     LCID lcid,
00134     WORD wFlags,
00135     DISPPARAMS *pDispParams,
00136     VARIANT *pVarResult,
00137     EXCEPINFO *pExcepInfo,
00138     UINT *puArgErr )
00139 {
00140     fw_manager *This = impl_from_INetFwMgr( iface );
00141 
00142     FIXME("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
00143           lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
00144     return E_NOTIMPL;
00145 }
00146 
00147 static HRESULT WINAPI fw_manager_get_LocalPolicy(
00148     INetFwMgr *iface,
00149     INetFwPolicy **localPolicy )
00150 {
00151     fw_manager *This = impl_from_INetFwMgr( iface );
00152 
00153     TRACE("%p, %p\n", This, localPolicy);
00154     return NetFwPolicy_create( NULL, (void **)localPolicy );
00155 }
00156 
00157 static HRESULT WINAPI fw_manager_get_CurrentProfileType(
00158     INetFwMgr *iface,
00159     NET_FW_PROFILE_TYPE *profileType )
00160 {
00161     fw_manager *This = impl_from_INetFwMgr( iface );
00162 
00163     FIXME("%p, %p\n", This, profileType);
00164     return E_NOTIMPL;
00165 }
00166 
00167 static HRESULT WINAPI fw_manager_RestoreDefaults(
00168     INetFwMgr *iface )
00169 {
00170     fw_manager *This = impl_from_INetFwMgr( iface );
00171 
00172     FIXME("%p\n", This);
00173     return E_NOTIMPL;
00174 }
00175 
00176 static HRESULT WINAPI fw_manager_IsPortAllowed(
00177     INetFwMgr *iface,
00178     BSTR imageFileName,
00179     NET_FW_IP_VERSION ipVersion,
00180     LONG portNumber,
00181     BSTR localAddress,
00182     NET_FW_IP_PROTOCOL ipProtocol,
00183     VARIANT *allowed,
00184     VARIANT *restricted )
00185 {
00186     fw_manager *This = impl_from_INetFwMgr( iface );
00187 
00188     FIXME("%p, %s, %u, %d, %s, %u, %p, %p\n", This, debugstr_w(imageFileName),
00189           ipVersion, portNumber, debugstr_w(localAddress), ipProtocol, allowed, restricted);
00190     return E_NOTIMPL;
00191 }
00192 
00193 static HRESULT WINAPI fw_manager_IsIcmpTypeAllowed(
00194     INetFwMgr *iface,
00195     NET_FW_IP_VERSION ipVersion,
00196     BSTR localAddress,
00197     BYTE type,
00198     VARIANT *allowed,
00199     VARIANT *restricted )
00200 {
00201     fw_manager *This = impl_from_INetFwMgr( iface );
00202 
00203     FIXME("%p, %u, %s, %u, %p, %p\n", This, ipVersion, debugstr_w(localAddress),
00204           type, allowed, restricted);
00205     return E_NOTIMPL;
00206 }
00207 
00208 static const struct INetFwMgrVtbl fw_manager_vtbl =
00209 {
00210     fw_manager_QueryInterface,
00211     fw_manager_AddRef,
00212     fw_manager_Release,
00213     fw_manager_GetTypeInfoCount,
00214     fw_manager_GetTypeInfo,
00215     fw_manager_GetIDsOfNames,
00216     fw_manager_Invoke,
00217     fw_manager_get_LocalPolicy,
00218     fw_manager_get_CurrentProfileType,
00219     fw_manager_RestoreDefaults,
00220     fw_manager_IsPortAllowed,
00221     fw_manager_IsIcmpTypeAllowed
00222 };
00223 
00224 HRESULT NetFwMgr_create( IUnknown *pUnkOuter, LPVOID *ppObj )
00225 {
00226     fw_manager *fm;
00227 
00228     TRACE("(%p,%p)\n", pUnkOuter, ppObj);
00229 
00230     fm = HeapAlloc( GetProcessHeap(), 0, sizeof(*fm) );
00231     if (!fm) return E_OUTOFMEMORY;
00232 
00233     fm->INetFwMgr_iface.lpVtbl = &fw_manager_vtbl;
00234     fm->refs = 1;
00235 
00236     *ppObj = &fm->INetFwMgr_iface;
00237 
00238     TRACE("returning iface %p\n", *ppObj);
00239     return S_OK;
00240 }

Generated on Sat May 26 2012 04:22:36 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.