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

policy.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 "ole2.h"
00029 #include "netfw.h"
00030 
00031 #include "wine/debug.h"
00032 #include "wine/unicode.h"
00033 #include "hnetcfg_private.h"
00034 
00035 WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
00036 
00037 typedef struct fw_policy
00038 {
00039     INetFwPolicy INetFwPolicy_iface;
00040     LONG refs;
00041 } fw_policy;
00042 
00043 static inline fw_policy *impl_from_INetFwPolicy( INetFwPolicy *iface )
00044 {
00045     return CONTAINING_RECORD(iface, fw_policy, INetFwPolicy_iface);
00046 }
00047 
00048 static ULONG WINAPI fw_policy_AddRef(
00049     INetFwPolicy *iface )
00050 {
00051     fw_policy *fw_policy = impl_from_INetFwPolicy( iface );
00052     return InterlockedIncrement( &fw_policy->refs );
00053 }
00054 
00055 static ULONG WINAPI fw_policy_Release(
00056     INetFwPolicy *iface )
00057 {
00058     fw_policy *fw_policy = impl_from_INetFwPolicy( iface );
00059     LONG refs = InterlockedDecrement( &fw_policy->refs );
00060     if (!refs)
00061     {
00062         TRACE("destroying %p\n", fw_policy);
00063         HeapFree( GetProcessHeap(), 0, fw_policy );
00064     }
00065     return refs;
00066 }
00067 
00068 static HRESULT WINAPI fw_policy_QueryInterface(
00069     INetFwPolicy *iface,
00070     REFIID riid,
00071     void **ppvObject )
00072 {
00073     fw_policy *This = impl_from_INetFwPolicy( iface );
00074 
00075     TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
00076 
00077     if ( IsEqualGUID( riid, &IID_INetFwPolicy ) ||
00078          IsEqualGUID( riid, &IID_IDispatch ) ||
00079          IsEqualGUID( riid, &IID_IUnknown ) )
00080     {
00081         *ppvObject = iface;
00082     }
00083     else
00084     {
00085         FIXME("interface %s not implemented\n", debugstr_guid(riid));
00086         return E_NOINTERFACE;
00087     }
00088     INetFwPolicy_AddRef( iface );
00089     return S_OK;
00090 }
00091 
00092 static HRESULT WINAPI fw_policy_GetTypeInfoCount(
00093     INetFwPolicy *iface,
00094     UINT *pctinfo )
00095 {
00096     fw_policy *This = impl_from_INetFwPolicy( iface );
00097 
00098     FIXME("%p %p\n", This, pctinfo);
00099     return E_NOTIMPL;
00100 }
00101 
00102 static HRESULT WINAPI fw_policy_GetTypeInfo(
00103     INetFwPolicy *iface,
00104     UINT iTInfo,
00105     LCID lcid,
00106     ITypeInfo **ppTInfo )
00107 {
00108     fw_policy *This = impl_from_INetFwPolicy( iface );
00109 
00110     FIXME("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo);
00111     return E_NOTIMPL;
00112 }
00113 
00114 static HRESULT WINAPI fw_policy_GetIDsOfNames(
00115     INetFwPolicy *iface,
00116     REFIID riid,
00117     LPOLESTR *rgszNames,
00118     UINT cNames,
00119     LCID lcid,
00120     DISPID *rgDispId )
00121 {
00122     fw_policy *This = impl_from_INetFwPolicy( iface );
00123 
00124     FIXME("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
00125     return E_NOTIMPL;
00126 }
00127 
00128 static HRESULT WINAPI fw_policy_Invoke(
00129     INetFwPolicy *iface,
00130     DISPID dispIdMember,
00131     REFIID riid,
00132     LCID lcid,
00133     WORD wFlags,
00134     DISPPARAMS *pDispParams,
00135     VARIANT *pVarResult,
00136     EXCEPINFO *pExcepInfo,
00137     UINT *puArgErr )
00138 {
00139     fw_policy *This = impl_from_INetFwPolicy( iface );
00140 
00141     FIXME("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
00142           lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
00143     return E_NOTIMPL;
00144 }
00145 
00146 static HRESULT WINAPI fw_policy_get_CurrentProfile(
00147     INetFwPolicy *iface,
00148     INetFwProfile **profile )
00149 {
00150     fw_policy *This = impl_from_INetFwPolicy( iface );
00151 
00152     TRACE("%p, %p\n", This, profile);
00153     return NetFwProfile_create( NULL, (void **)profile );
00154 }
00155 
00156 static HRESULT WINAPI fw_policy_GetProfileByType(
00157     INetFwPolicy *iface,
00158     NET_FW_PROFILE_TYPE profileType,
00159     INetFwProfile **profile )
00160 {
00161     fw_policy *This = impl_from_INetFwPolicy( iface );
00162 
00163     FIXME("%p, %u, %p\n", This, profileType, profile);
00164     return E_NOTIMPL;
00165 }
00166 
00167 static const struct INetFwPolicyVtbl fw_policy_vtbl =
00168 {
00169     fw_policy_QueryInterface,
00170     fw_policy_AddRef,
00171     fw_policy_Release,
00172     fw_policy_GetTypeInfoCount,
00173     fw_policy_GetTypeInfo,
00174     fw_policy_GetIDsOfNames,
00175     fw_policy_Invoke,
00176     fw_policy_get_CurrentProfile,
00177     fw_policy_GetProfileByType
00178 };
00179 
00180 HRESULT NetFwPolicy_create( IUnknown *pUnkOuter, LPVOID *ppObj )
00181 {
00182     fw_policy *fp;
00183 
00184     TRACE("(%p,%p)\n", pUnkOuter, ppObj);
00185 
00186     fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
00187     if (!fp) return E_OUTOFMEMORY;
00188 
00189     fp->INetFwPolicy_iface.lpVtbl = &fw_policy_vtbl;
00190     fp->refs = 1;
00191 
00192     *ppObj = &fp->INetFwPolicy_iface;
00193 
00194     TRACE("returning iface %p\n", *ppObj);
00195     return S_OK;
00196 }

Generated on Sun May 27 2012 04:23:53 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.