[PATCH 4/4] hnetcfg: Add stubbed INetFwPolicy2 interface

Nikolay Sivov bunglehead at gmail.com
Thu Jul 21 10:36:19 CDT 2016


On 21.07.2016 12:09, Alistair Leslie-Hughes wrote:
> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
>  dlls/hnetcfg/apps.c            |   1 +
>  dlls/hnetcfg/hnetcfg.c         |   5 +
>  dlls/hnetcfg/hnetcfg_private.h |   2 +
>  dlls/hnetcfg/policy.c          | 332 +++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 340 insertions(+)
> 
> diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c
> index ea6d411..2b8d78c 100644
> --- a/dlls/hnetcfg/apps.c
> +++ b/dlls/hnetcfg/apps.c
> @@ -111,6 +111,7 @@ static REFIID tid_id[] =
>      &IID_INetFwOpenPort,
>      &IID_INetFwOpenPorts,
>      &IID_INetFwPolicy,
> +    &IID_INetFwPolicy2,
>      &IID_INetFwProfile
>  };
>  
> diff --git a/dlls/hnetcfg/hnetcfg.c b/dlls/hnetcfg/hnetcfg.c
> index fadd367..e56dbab 100644
> --- a/dlls/hnetcfg/hnetcfg.c
> +++ b/dlls/hnetcfg/hnetcfg.c
> @@ -113,6 +113,7 @@ static const struct IClassFactoryVtbl hnetcfg_cf_vtbl =
>  static hnetcfg_cf fw_manager_cf = { { &hnetcfg_cf_vtbl }, NetFwMgr_create };
>  static hnetcfg_cf fw_app_cf = { { &hnetcfg_cf_vtbl }, NetFwAuthorizedApplication_create };
>  static hnetcfg_cf fw_openport_cf = { { &hnetcfg_cf_vtbl }, NetFwOpenPort_create };
> +static hnetcfg_cf fw_policy2_cf = { { &hnetcfg_cf_vtbl }, NetFwPolicy2_create };
>  
>  BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID reserved)
>  {
> @@ -151,6 +152,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv )
>      {
>         cf = &fw_openport_cf.IClassFactory_iface;
>      }
> +    else if (IsEqualGUID( rclsid, &CLSID_NetFwPolicy2 ))
> +    {
> +       cf = &fw_policy2_cf.IClassFactory_iface;
> +    }
>  
>      if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
>      return IClassFactory_QueryInterface( cf, iid, ppv );
> diff --git a/dlls/hnetcfg/hnetcfg_private.h b/dlls/hnetcfg/hnetcfg_private.h
> index bb3f3aa..812d970 100644
> --- a/dlls/hnetcfg/hnetcfg_private.h
> +++ b/dlls/hnetcfg/hnetcfg_private.h
> @@ -24,6 +24,7 @@ enum type_id
>      INetFwOpenPort_tid,
>      INetFwOpenPorts_tid,
>      INetFwPolicy_tid,
> +    INetFwPolicy2_tid,
>      INetFwProfile_tid,
>      last_tid
>  };
> @@ -33,6 +34,7 @@ void release_typelib(void) DECLSPEC_HIDDEN;
>  
>  HRESULT NetFwMgr_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
>  HRESULT NetFwPolicy_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
> +HRESULT NetFwPolicy2_create(IUnknown *, void **) DECLSPEC_HIDDEN;

It makes sense to test first if those two both support INetFwPolicy and
INetFwPolicy2.




More information about the wine-devel mailing list