2009-07-30 11:15:11 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2009 Hans Leidekker for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
#include "netfw.h"
|
2018-10-15 01:27:06 +02:00
|
|
|
#include "natupnp.h"
|
2009-07-30 11:15:11 +02:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "hnetcfg_private.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
|
|
|
|
|
|
|
|
typedef struct fw_app
|
|
|
|
{
|
2010-12-20 11:34:01 +01:00
|
|
|
INetFwAuthorizedApplication INetFwAuthorizedApplication_iface;
|
2009-07-30 11:15:11 +02:00
|
|
|
LONG refs;
|
2018-04-23 04:24:04 +02:00
|
|
|
BSTR filename;
|
2009-07-30 11:15:11 +02:00
|
|
|
} fw_app;
|
|
|
|
|
|
|
|
static inline fw_app *impl_from_INetFwAuthorizedApplication( INetFwAuthorizedApplication *iface )
|
|
|
|
{
|
2010-12-20 11:34:01 +01:00
|
|
|
return CONTAINING_RECORD(iface, fw_app, INetFwAuthorizedApplication_iface);
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI fw_app_AddRef(
|
|
|
|
INetFwAuthorizedApplication *iface )
|
|
|
|
{
|
|
|
|
fw_app *fw_app = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
return InterlockedIncrement( &fw_app->refs );
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI fw_app_Release(
|
|
|
|
INetFwAuthorizedApplication *iface )
|
|
|
|
{
|
|
|
|
fw_app *fw_app = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
LONG refs = InterlockedDecrement( &fw_app->refs );
|
|
|
|
if (!refs)
|
|
|
|
{
|
|
|
|
TRACE("destroying %p\n", fw_app);
|
2018-04-23 04:24:04 +02:00
|
|
|
SysFreeString( fw_app->filename );
|
2022-02-01 11:49:19 +01:00
|
|
|
free( fw_app );
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
return refs;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_QueryInterface(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
REFIID riid,
|
|
|
|
void **ppvObject )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
|
|
|
|
|
|
|
|
if ( IsEqualGUID( riid, &IID_INetFwAuthorizedApplication ) ||
|
|
|
|
IsEqualGUID( riid, &IID_IDispatch ) ||
|
|
|
|
IsEqualGUID( riid, &IID_IUnknown ) )
|
|
|
|
{
|
|
|
|
*ppvObject = iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("interface %s not implemented\n", debugstr_guid(riid));
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
INetFwAuthorizedApplication_AddRef( iface );
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_GetTypeInfoCount(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
UINT *pctinfo )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
2012-09-26 09:37:08 +02:00
|
|
|
TRACE("%p %p\n", This, pctinfo);
|
|
|
|
*pctinfo = 1;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ITypeLib *typelib;
|
|
|
|
static ITypeInfo *typeinfo[last_tid];
|
|
|
|
|
|
|
|
static REFIID tid_id[] =
|
|
|
|
{
|
|
|
|
&IID_INetFwAuthorizedApplication,
|
2012-09-26 09:37:23 +02:00
|
|
|
&IID_INetFwAuthorizedApplications,
|
|
|
|
&IID_INetFwMgr,
|
2014-09-17 07:59:35 +02:00
|
|
|
&IID_INetFwOpenPort,
|
2015-11-10 22:43:05 +01:00
|
|
|
&IID_INetFwOpenPorts,
|
2012-09-26 09:37:23 +02:00
|
|
|
&IID_INetFwPolicy,
|
2016-07-22 09:47:13 +02:00
|
|
|
&IID_INetFwPolicy2,
|
2018-10-15 01:27:06 +02:00
|
|
|
&IID_INetFwProfile,
|
2022-02-01 11:49:21 +01:00
|
|
|
&IID_IUPnPNAT,
|
|
|
|
&IID_IStaticPortMappingCollection,
|
2022-02-02 09:32:55 +01:00
|
|
|
&IID_IStaticPortMapping,
|
2012-09-26 09:37:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret )
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (!typelib)
|
|
|
|
{
|
|
|
|
ITypeLib *lib;
|
|
|
|
|
|
|
|
hr = LoadRegTypeLib( &LIBID_NetFwPublicTypeLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &lib );
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
2022-02-10 08:43:43 +01:00
|
|
|
ERR("LoadRegTypeLib failed: %08lx\n", hr);
|
2012-09-26 09:37:08 +02:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
if (InterlockedCompareExchangePointer( (void **)&typelib, lib, NULL ))
|
|
|
|
ITypeLib_Release( lib );
|
|
|
|
}
|
|
|
|
if (!typeinfo[tid])
|
|
|
|
{
|
|
|
|
ITypeInfo *info;
|
|
|
|
|
|
|
|
hr = ITypeLib_GetTypeInfoOfGuid( typelib, tid_id[tid], &info );
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
2022-02-10 08:43:43 +01:00
|
|
|
ERR("GetTypeInfoOfGuid(%s) failed: %08lx\n", debugstr_guid(tid_id[tid]), hr);
|
2012-09-26 09:37:08 +02:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
if (InterlockedCompareExchangePointer( (void **)(typeinfo + tid), info, NULL ))
|
|
|
|
ITypeInfo_Release( info );
|
|
|
|
}
|
|
|
|
*ret = typeinfo[tid];
|
2015-01-14 06:29:37 +01:00
|
|
|
ITypeInfo_AddRef(typeinfo[tid]);
|
2012-09-26 09:37:08 +02:00
|
|
|
return S_OK;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
2015-01-14 11:39:22 +01:00
|
|
|
void release_typelib(void)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
2018-08-04 22:45:41 +02:00
|
|
|
for (i = 0; i < ARRAY_SIZE(typeinfo); i++)
|
2015-01-14 11:39:22 +01:00
|
|
|
if (typeinfo[i])
|
|
|
|
ITypeInfo_Release(typeinfo[i]);
|
|
|
|
|
|
|
|
if (typelib)
|
|
|
|
ITypeLib_Release(typelib);
|
|
|
|
}
|
|
|
|
|
2009-07-30 11:15:11 +02:00
|
|
|
static HRESULT WINAPI fw_app_GetTypeInfo(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
UINT iTInfo,
|
|
|
|
LCID lcid,
|
|
|
|
ITypeInfo **ppTInfo )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
2022-02-10 08:43:43 +01:00
|
|
|
TRACE("%p %u %lu %p\n", This, iTInfo, lcid, ppTInfo);
|
2012-09-26 09:37:08 +02:00
|
|
|
return get_typeinfo( INetFwAuthorizedApplication_tid, ppTInfo );
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_GetIDsOfNames(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPOLESTR *rgszNames,
|
|
|
|
UINT cNames,
|
|
|
|
LCID lcid,
|
|
|
|
DISPID *rgDispId )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
2012-09-26 09:37:08 +02:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hr;
|
2009-07-30 11:15:11 +02:00
|
|
|
|
2022-02-10 08:43:43 +01:00
|
|
|
TRACE("%p %s %p %u %lu %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
|
2012-09-26 09:37:08 +02:00
|
|
|
|
|
|
|
hr = get_typeinfo( INetFwAuthorizedApplication_tid, &typeinfo );
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
|
|
|
|
ITypeInfo_Release( typeinfo );
|
|
|
|
}
|
|
|
|
return hr;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_Invoke(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo,
|
|
|
|
UINT *puArgErr )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
2012-09-26 09:37:08 +02:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hr;
|
2009-07-30 11:15:11 +02:00
|
|
|
|
2022-02-10 08:43:43 +01:00
|
|
|
TRACE("%p %ld %s %ld %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
|
2009-07-30 11:15:11 +02:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2012-09-26 09:37:08 +02:00
|
|
|
|
|
|
|
hr = get_typeinfo( INetFwAuthorizedApplication_tid, &typeinfo );
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = ITypeInfo_Invoke( typeinfo, &This->INetFwAuthorizedApplication_iface, dispIdMember,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
|
|
|
|
ITypeInfo_Release( typeinfo );
|
|
|
|
}
|
|
|
|
return hr;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_get_Name(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
BSTR *name )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, name);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_put_Name(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
BSTR name )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %s\n", This, debugstr_w(name));
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_get_ProcessImageFileName(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
BSTR *imageFileName )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, imageFileName);
|
2018-04-23 04:24:04 +02:00
|
|
|
|
|
|
|
if (!imageFileName)
|
|
|
|
return E_POINTER;
|
|
|
|
|
|
|
|
*imageFileName = SysAllocString( This->filename );
|
|
|
|
return *imageFileName || !This->filename ? S_OK : E_OUTOFMEMORY;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_put_ProcessImageFileName(
|
2018-06-17 18:27:47 +02:00
|
|
|
INetFwAuthorizedApplication *iface, BSTR image )
|
2009-07-30 11:15:11 +02:00
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
2018-06-17 18:27:47 +02:00
|
|
|
UNIVERSAL_NAME_INFOW *info;
|
2018-06-28 17:39:36 +02:00
|
|
|
DWORD sz, longsz;
|
2022-02-02 09:32:53 +01:00
|
|
|
WCHAR *path, *new_path;
|
2018-06-17 18:27:47 +02:00
|
|
|
DWORD res;
|
2009-07-30 11:15:11 +02:00
|
|
|
|
2018-06-17 18:27:47 +02:00
|
|
|
FIXME("%p, %s\n", This, debugstr_w(image));
|
2018-04-23 04:24:04 +02:00
|
|
|
|
2018-06-17 18:27:47 +02:00
|
|
|
if (!image || !image[0])
|
2018-04-23 04:24:04 +02:00
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2018-06-17 18:27:47 +02:00
|
|
|
sz = 0;
|
|
|
|
res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, NULL, &sz);
|
|
|
|
if (res == WN_MORE_DATA)
|
|
|
|
{
|
2022-02-01 11:49:19 +01:00
|
|
|
if (!(path = malloc(sz)))
|
2018-06-17 18:27:47 +02:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2018-06-25 22:41:14 +02:00
|
|
|
info = (UNIVERSAL_NAME_INFOW *)&path;
|
2018-06-17 18:27:47 +02:00
|
|
|
res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, &info, &sz);
|
|
|
|
if (res == NO_ERROR)
|
|
|
|
{
|
|
|
|
SysFreeString(This->filename);
|
|
|
|
This->filename = SysAllocString(info->lpUniversalName);
|
|
|
|
}
|
2022-02-01 11:49:19 +01:00
|
|
|
free(path);
|
2018-06-17 18:27:47 +02:00
|
|
|
return HRESULT_FROM_WIN32(res);
|
|
|
|
}
|
|
|
|
|
2018-06-25 22:41:14 +02:00
|
|
|
sz = GetFullPathNameW(image, 0, NULL, NULL);
|
2022-02-01 11:49:19 +01:00
|
|
|
if (!(path = malloc(++sz * sizeof(WCHAR))))
|
2018-06-25 22:41:14 +02:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
GetFullPathNameW(image, sz, path, NULL);
|
|
|
|
|
2018-06-28 17:39:36 +02:00
|
|
|
longsz = GetLongPathNameW(path, path, sz);
|
|
|
|
if (longsz > sz)
|
|
|
|
{
|
2022-02-02 09:32:53 +01:00
|
|
|
if (!(new_path = realloc(path, longsz * sizeof(WCHAR))))
|
2018-06-28 17:39:36 +02:00
|
|
|
{
|
2022-02-01 11:49:19 +01:00
|
|
|
free(path);
|
2018-06-28 17:39:36 +02:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
2022-02-02 09:32:53 +01:00
|
|
|
path = new_path;
|
2018-06-28 17:39:36 +02:00
|
|
|
GetLongPathNameW(path, path, longsz);
|
|
|
|
}
|
|
|
|
|
2018-04-23 04:24:04 +02:00
|
|
|
SysFreeString( This->filename );
|
2018-06-25 22:41:14 +02:00
|
|
|
This->filename = SysAllocString(path);
|
2022-02-01 11:49:19 +01:00
|
|
|
free(path);
|
2018-04-23 04:24:04 +02:00
|
|
|
return This->filename ? S_OK : E_OUTOFMEMORY;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_get_IpVersion(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
NET_FW_IP_VERSION *ipVersion )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
2015-01-14 06:25:56 +01:00
|
|
|
TRACE("%p, %p\n", This, ipVersion);
|
|
|
|
|
|
|
|
if (!ipVersion)
|
|
|
|
return E_POINTER;
|
|
|
|
*ipVersion = NET_FW_IP_VERSION_ANY;
|
|
|
|
return S_OK;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_put_IpVersion(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
NET_FW_IP_VERSION ipVersion )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
2015-01-14 06:25:56 +01:00
|
|
|
TRACE("%p, %u\n", This, ipVersion);
|
|
|
|
return S_OK;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_get_Scope(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
NET_FW_SCOPE *scope )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, scope);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_put_Scope(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
NET_FW_SCOPE scope )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %u\n", This, scope);
|
2012-09-26 09:37:40 +02:00
|
|
|
return S_OK;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_get_RemoteAddresses(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
BSTR *remoteAddrs )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, remoteAddrs);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_put_RemoteAddresses(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
BSTR remoteAddrs )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %s\n", This, debugstr_w(remoteAddrs));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_get_Enabled(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
VARIANT_BOOL *enabled )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, enabled);
|
|
|
|
|
|
|
|
*enabled = VARIANT_FALSE;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_app_put_Enabled(
|
|
|
|
INetFwAuthorizedApplication *iface,
|
|
|
|
VARIANT_BOOL enabled )
|
|
|
|
{
|
|
|
|
fw_app *This = impl_from_INetFwAuthorizedApplication( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %d\n", This, enabled);
|
2011-02-01 12:26:50 +01:00
|
|
|
return S_OK;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct INetFwAuthorizedApplicationVtbl fw_app_vtbl =
|
|
|
|
{
|
|
|
|
fw_app_QueryInterface,
|
|
|
|
fw_app_AddRef,
|
|
|
|
fw_app_Release,
|
|
|
|
fw_app_GetTypeInfoCount,
|
|
|
|
fw_app_GetTypeInfo,
|
|
|
|
fw_app_GetIDsOfNames,
|
|
|
|
fw_app_Invoke,
|
|
|
|
fw_app_get_Name,
|
|
|
|
fw_app_put_Name,
|
|
|
|
fw_app_get_ProcessImageFileName,
|
|
|
|
fw_app_put_ProcessImageFileName,
|
|
|
|
fw_app_get_IpVersion,
|
|
|
|
fw_app_put_IpVersion,
|
|
|
|
fw_app_get_Scope,
|
|
|
|
fw_app_put_Scope,
|
|
|
|
fw_app_get_RemoteAddresses,
|
|
|
|
fw_app_put_RemoteAddresses,
|
|
|
|
fw_app_get_Enabled,
|
|
|
|
fw_app_put_Enabled
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT NetFwAuthorizedApplication_create( IUnknown *pUnkOuter, LPVOID *ppObj )
|
|
|
|
{
|
|
|
|
fw_app *fa;
|
|
|
|
|
|
|
|
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
|
|
|
|
|
2022-02-01 11:49:19 +01:00
|
|
|
fa = malloc( sizeof(*fa) );
|
2009-07-30 11:15:11 +02:00
|
|
|
if (!fa) return E_OUTOFMEMORY;
|
|
|
|
|
2010-12-20 11:34:01 +01:00
|
|
|
fa->INetFwAuthorizedApplication_iface.lpVtbl = &fw_app_vtbl;
|
2009-07-30 11:15:11 +02:00
|
|
|
fa->refs = 1;
|
2018-04-23 04:24:04 +02:00
|
|
|
fa->filename = NULL;
|
2009-07-30 11:15:11 +02:00
|
|
|
|
2010-12-20 11:34:01 +01:00
|
|
|
*ppObj = &fa->INetFwAuthorizedApplication_iface;
|
2009-07-30 11:15:11 +02:00
|
|
|
|
|
|
|
TRACE("returning iface %p\n", *ppObj);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
typedef struct fw_apps
|
|
|
|
{
|
2010-12-20 11:34:01 +01:00
|
|
|
INetFwAuthorizedApplications INetFwAuthorizedApplications_iface;
|
2009-07-30 11:15:11 +02:00
|
|
|
LONG refs;
|
|
|
|
} fw_apps;
|
|
|
|
|
|
|
|
static inline fw_apps *impl_from_INetFwAuthorizedApplications( INetFwAuthorizedApplications *iface )
|
|
|
|
{
|
2010-12-20 11:34:01 +01:00
|
|
|
return CONTAINING_RECORD(iface, fw_apps, INetFwAuthorizedApplications_iface);
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI fw_apps_AddRef(
|
|
|
|
INetFwAuthorizedApplications *iface )
|
|
|
|
{
|
|
|
|
fw_apps *fw_apps = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
return InterlockedIncrement( &fw_apps->refs );
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI fw_apps_Release(
|
|
|
|
INetFwAuthorizedApplications *iface )
|
|
|
|
{
|
|
|
|
fw_apps *fw_apps = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
LONG refs = InterlockedDecrement( &fw_apps->refs );
|
|
|
|
if (!refs)
|
|
|
|
{
|
|
|
|
TRACE("destroying %p\n", fw_apps);
|
2022-02-01 11:49:19 +01:00
|
|
|
free( fw_apps );
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
return refs;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_QueryInterface(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
REFIID riid,
|
|
|
|
void **ppvObject )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
|
|
|
|
TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
|
|
|
|
|
|
|
|
if ( IsEqualGUID( riid, &IID_INetFwAuthorizedApplications ) ||
|
|
|
|
IsEqualGUID( riid, &IID_IDispatch ) ||
|
|
|
|
IsEqualGUID( riid, &IID_IUnknown ) )
|
|
|
|
{
|
|
|
|
*ppvObject = iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("interface %s not implemented\n", debugstr_guid(riid));
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
INetFwAuthorizedApplications_AddRef( iface );
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_GetTypeInfoCount(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
UINT *pctinfo )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
|
|
|
|
FIXME("%p %p\n", This, pctinfo);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_GetTypeInfo(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
UINT iTInfo,
|
|
|
|
LCID lcid,
|
|
|
|
ITypeInfo **ppTInfo )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
|
2022-02-10 08:43:43 +01:00
|
|
|
TRACE("%p %u %lu %p\n", This, iTInfo, lcid, ppTInfo);
|
2012-09-26 09:37:08 +02:00
|
|
|
return get_typeinfo( INetFwAuthorizedApplications_tid, ppTInfo );
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_GetIDsOfNames(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPOLESTR *rgszNames,
|
|
|
|
UINT cNames,
|
|
|
|
LCID lcid,
|
|
|
|
DISPID *rgDispId )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
2012-09-26 09:37:08 +02:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hr;
|
2009-07-30 11:15:11 +02:00
|
|
|
|
2022-02-10 08:43:43 +01:00
|
|
|
TRACE("%p %s %p %u %lu %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
|
2012-09-26 09:37:08 +02:00
|
|
|
|
|
|
|
hr = get_typeinfo( INetFwAuthorizedApplications_tid, &typeinfo );
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId );
|
|
|
|
ITypeInfo_Release( typeinfo );
|
|
|
|
}
|
|
|
|
return hr;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_Invoke(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo,
|
|
|
|
UINT *puArgErr )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
2012-09-26 09:37:08 +02:00
|
|
|
ITypeInfo *typeinfo;
|
|
|
|
HRESULT hr;
|
2009-07-30 11:15:11 +02:00
|
|
|
|
2022-02-10 08:43:43 +01:00
|
|
|
TRACE("%p %ld %s %ld %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid),
|
2009-07-30 11:15:11 +02:00
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
2012-09-26 09:37:08 +02:00
|
|
|
|
|
|
|
hr = get_typeinfo( INetFwAuthorizedApplications_tid, &typeinfo );
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
hr = ITypeInfo_Invoke( typeinfo, &This->INetFwAuthorizedApplications_iface, dispIdMember,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
|
|
|
|
ITypeInfo_Release( typeinfo );
|
|
|
|
}
|
|
|
|
return hr;
|
2009-07-30 11:15:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_get_Count(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
LONG *count )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, count);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_Add(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
INetFwAuthorizedApplication *app )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, app);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_Remove(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
BSTR imageFileName )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %s\n", This, debugstr_w(imageFileName));
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_Item(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
BSTR imageFileName,
|
|
|
|
INetFwAuthorizedApplication **app )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
|
|
|
|
TRACE("%p, %s, %p\n", This, debugstr_w(imageFileName), app);
|
|
|
|
return NetFwAuthorizedApplication_create( NULL, (void **)app );
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI fw_apps_get__NewEnum(
|
|
|
|
INetFwAuthorizedApplications *iface,
|
|
|
|
IUnknown **newEnum )
|
|
|
|
{
|
|
|
|
fw_apps *This = impl_from_INetFwAuthorizedApplications( iface );
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, newEnum);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct INetFwAuthorizedApplicationsVtbl fw_apps_vtbl =
|
|
|
|
{
|
|
|
|
fw_apps_QueryInterface,
|
|
|
|
fw_apps_AddRef,
|
|
|
|
fw_apps_Release,
|
|
|
|
fw_apps_GetTypeInfoCount,
|
|
|
|
fw_apps_GetTypeInfo,
|
|
|
|
fw_apps_GetIDsOfNames,
|
|
|
|
fw_apps_Invoke,
|
|
|
|
fw_apps_get_Count,
|
|
|
|
fw_apps_Add,
|
|
|
|
fw_apps_Remove,
|
|
|
|
fw_apps_Item,
|
|
|
|
fw_apps_get__NewEnum
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT NetFwAuthorizedApplications_create( IUnknown *pUnkOuter, LPVOID *ppObj )
|
|
|
|
{
|
|
|
|
fw_apps *fa;
|
|
|
|
|
|
|
|
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
|
|
|
|
|
2022-02-01 11:49:19 +01:00
|
|
|
fa = malloc( sizeof(*fa) );
|
2009-07-30 11:15:11 +02:00
|
|
|
if (!fa) return E_OUTOFMEMORY;
|
|
|
|
|
2010-12-20 11:34:01 +01:00
|
|
|
fa->INetFwAuthorizedApplications_iface.lpVtbl = &fw_apps_vtbl;
|
2009-07-30 11:15:11 +02:00
|
|
|
fa->refs = 1;
|
|
|
|
|
2010-12-20 11:34:01 +01:00
|
|
|
*ppObj = &fa->INetFwAuthorizedApplications_iface;
|
2009-07-30 11:15:11 +02:00
|
|
|
|
|
|
|
TRACE("returning iface %p\n", *ppObj);
|
|
|
|
return S_OK;
|
|
|
|
}
|