callout properties dialog

minor tweaks
This commit is contained in:
Pavel Yosifovich
2022-12-27 13:55:52 -05:00
parent e1fbbc0009
commit f7138c5f00
14 changed files with 288 additions and 51 deletions
+10
View File
@@ -84,6 +84,16 @@ WFPObject<FWPM_LAYER> WFPEngine::GetLayerById(UINT16 id) const {
return WFPObject(layer);
}
bool WFPEngine::DeleteCallout(GUID const& key) {
m_LastError = ::FwpmCalloutDeleteByKey(m_hEngine, &key);
return m_LastError == ERROR_SUCCESS;
}
bool WFPEngine::DeleteCallout(UINT32 id) {
m_LastError = ::FwpmCalloutDeleteById(m_hEngine, id);
return m_LastError == ERROR_SUCCESS;
}
WFPObject<FWPM_SUBLAYER> WFPEngine::GetSublayerByKey(GUID const& key) const {
FWPM_SUBLAYER* sublayer = nullptr;
m_LastError = ::FwpmSubLayerGetByKey(m_hEngine, &key, &sublayer);
+6 -1
View File
@@ -59,11 +59,16 @@ public:
WFPObject<FWPM_LAYER> GetLayerByKey(GUID const& key) const;
WFPObject<FWPM_LAYER> GetLayerById(UINT16 id) const;
//
// Callout API
//
bool DeleteCallout(GUID const& key);
bool DeleteCallout(UINT32 id);
//
// sublayer API
//
WFPObject<FWPM_SUBLAYER> GetSublayerByKey(GUID const& key) const;
WFPObject<FWPM_CALLOUT> GetCalloutByKey(GUID const& key) const;
WFPObject<FWPM_CALLOUT> GetCalloutById(UINT32 id) const;
+66
View File
@@ -0,0 +1,66 @@
#include "pch.h"
#include "resource.h"
#include "CalloutDlg.h"
#include "StringHelper.h"
#include <WFPEngine.h>
#include "WFPHelper.h"
CCalloutDlg::CCalloutDlg(WFPEngine& engine, FWPM_CALLOUT* callout) : m_Engine(engine), m_Callout(callout) {
}
LRESULT CCalloutDlg::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) {
SetWindowText(L"Callout: " + WFPHelper::GetCalloutName(m_Engine, m_Callout->calloutKey));
SetDialogIcon(IDI_CALLOUT);
SetDlgItemText(IDC_KEY, StringHelper::GuidToString(m_Callout->calloutKey));
SetDlgItemText(IDC_NAME, StringHelper::ParseMUIString(m_Callout->displayData.name));
SetDlgItemText(IDC_DESC, StringHelper::ParseMUIString(m_Callout->displayData.description));
SetDlgItemInt(IDC_ID, m_Callout->calloutId);
SetDlgItemText(IDC_LAYER, WFPHelper::GetLayerName(m_Engine, m_Callout->applicableLayer));
AddIconToButton(IDC_LAYER_PROP, IDI_LAYERS);
if (m_Callout->providerKey) {
SetDlgItemText(IDC_PROVIDER, WFPHelper::GetProviderName(m_Engine, *m_Callout->providerKey));
AddIconToButton(IDC_PROVIDER_PROP, IDI_PROVIDER);
}
else {
GetDlgItem(IDC_PROVIDER_PROP).ShowWindow(SW_HIDE);
}
if (m_Callout->flags & FWPM_CALLOUT_FLAG_PERSISTENT)
CheckDlgButton(IDC_PERSISTENT, BST_CHECKED);
if (m_Callout->flags & FWPM_CALLOUT_FLAG_REGISTERED)
CheckDlgButton(IDC_REGISTERED, BST_CHECKED);
if (m_Callout->flags & FWPM_CALLOUT_FLAG_USES_PROVIDER_CONTEXT)
CheckDlgButton(IDC_PROVIDER_CONTEXT, BST_CHECKED);
auto layer = m_Engine.GetLayerByKey(m_Callout->applicableLayer);
if (m_Callout->providerData.size) {
SetDlgItemText(IDC_DATASIZE, std::format(L"Provider data size: {} bytes", m_Callout->providerData.size).c_str());
SetDlgItemText(IDC_PROVIDERDATA, StringHelper::FormatBinary(m_Callout->providerData.data, m_Callout->providerData.size, 16, true));
}
else {
GetDlgItem(IDC_PROVIDERDATA).ShowWindow(SW_HIDE);
}
return 0;
}
LRESULT CCalloutDlg::OnCloseCmd(WORD, WORD wID, HWND, BOOL&) {
EndDialog(wID);
return 0;
}
LRESULT CCalloutDlg::OnShowProvider(WORD, WORD, HWND, BOOL&) {
auto provider = m_Engine.GetProviderByKey(*m_Callout->providerKey);
WFPHelper::ShowProviderProperties(m_Engine, *provider);
return 0;
}
LRESULT CCalloutDlg::OnShowLayer(WORD, WORD, HWND, BOOL&) {
auto layer = m_Engine.GetLayerByKey(m_Callout->applicableLayer);
WFPHelper::ShowLayerProperties(m_Engine, *layer);
return 0;
}
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include <DialogHelper.h>
class WFPEngine;
class CCalloutDlg :
public CDialogImpl<CCalloutDlg>,
public CDialogHelper<CCalloutDlg> {
public:
enum { IDD = IDD_CALLOUT };
explicit CCalloutDlg(WFPEngine& engine, FWPM_CALLOUT* callout);
BEGIN_MSG_MAP(CCalloutDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
COMMAND_ID_HANDLER(IDC_PROVIDER_PROP, OnShowProvider)
COMMAND_ID_HANDLER(IDC_LAYER_PROP, OnShowLayer)
END_MSG_MAP()
// Handler prototypes (uncomment arguments if needed):
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
private:
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnShowProvider(WORD /*wNotifyCode*/, WORD, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnShowLayer(WORD /*wNotifyCode*/, WORD, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
FWPM_CALLOUT* m_Callout;
WFPEngine& m_Engine;
};
+73 -30
View File
@@ -5,10 +5,24 @@
#include "resource.h"
#include <ranges>
#include <ClipboardHelper.h>
#include "WFPHelper.h"
CCalloutsView::CCalloutsView(IMainFrame* frame, WFPEngine& engine) : CGenericListViewBase(frame), m_Engine(engine) {
}
CString const& CCalloutsView::GetCalloutLayer(CalloutInfo& info) const {
if (info.Layer.IsEmpty()) {
auto layer = m_Engine.GetLayerByKey(info.Data->applicableLayer);
if (layer && layer->displayData.name) {
info.Layer = layer->displayData.name;
}
else {
info.Layer = StringHelper::GuidToString(info.Data->applicableLayer);
}
}
return info.Layer;
}
LRESULT CCalloutsView::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
m_hWndClient = m_List.Create(m_hWnd, rcDefault, nullptr,
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | LVS_OWNERDATA | LVS_REPORT | LVS_SHOWSELALWAYS);
@@ -58,32 +72,11 @@ CString CCalloutsView::GetColumnText(HWND, int row, int col) {
auto& info = m_Callouts[row];
switch (GetColumnManager(m_List)->GetColumnTag<ColumnType>(col)) {
case ColumnType::Key: return StringHelper::GuidToString(info.Data->calloutKey);
case ColumnType::Layer:
if (info.Layer.IsEmpty()) {
auto layer = m_Engine.GetLayerByKey(info.Data->applicableLayer);
if (layer && layer->displayData.name) {
info.Layer = layer->displayData.name;
}
else {
info.Layer = StringHelper::GuidToString(info.Data->applicableLayer);
}
}
return info.Layer;
case ColumnType::Layer: return GetCalloutLayer(info);
case ColumnType::Provider: return GetCalloutProvider(info);
case ColumnType::Provider:
if (info.Provider.IsEmpty()) {
if (info.Data->providerKey) {
auto sl = m_Engine.GetProviderByKey(*info.Data->providerKey);
if (sl && sl->displayData.name && sl->displayData.name[0] != L'@')
info.Provider = sl->displayData.name;
else
info.Provider = StringHelper::GuidToString(*info.Data->providerKey);
}
}
return info.Provider;
case ColumnType::Name: return info.Data->displayData.name;
case ColumnType::Desc: return info.Data->displayData.description;
case ColumnType::Name: return GetCalloutName(info);
case ColumnType::Desc: return GetCalloutDesc(info);
case ColumnType::ProviderData:
return info.Data->providerData.size == 0 ? L"" : std::format(L"{} Bytes", info.Data->providerData.size).c_str();
@@ -106,11 +99,11 @@ void CCalloutsView::DoSort(SortInfo const* si) {
auto d1 = c1.Data, d2 = c2.Data;
switch (col) {
case ColumnType::Key: return SortHelper::Sort(StringHelper::GuidToString(d1->calloutKey), StringHelper::GuidToString(d2->calloutKey), asc);
case ColumnType::Layer: return SortHelper::Sort(c1.Layer, c2.Layer, asc);
case ColumnType::Name: return SortHelper::Sort(d1->displayData.name, d2->displayData.name, asc);
case ColumnType::Desc: return SortHelper::Sort(d1->displayData.description, d2->displayData.description, asc);
case ColumnType::Layer: return SortHelper::Sort(GetCalloutLayer(c1), GetCalloutLayer(c2), asc);
case ColumnType::Name: return SortHelper::Sort(GetCalloutName(c1), GetCalloutName(c2), asc);
case ColumnType::Desc: return SortHelper::Sort(GetCalloutDesc(c2), GetCalloutDesc(c2), asc);
case ColumnType::Flags: return SortHelper::Sort(d1->flags, d2->flags, asc);
case ColumnType::Provider: return SortHelper::Sort(c1.Provider, c2.Provider, asc);
case ColumnType::Provider: return SortHelper::Sort(GetCalloutProvider(c1), GetCalloutProvider(c2), asc);
case ColumnType::Id: return SortHelper::Sort(d1->calloutId, d2->calloutId, asc);
}
return false;
@@ -133,6 +126,26 @@ LRESULT CCalloutsView::OnCopy(WORD, WORD, HWND, BOOL&) {
return 0;
}
LRESULT CCalloutsView::OnDelete(WORD, WORD, HWND, BOOL&) {
auto selected = m_List.GetSelectedCount();
ATLASSERT(selected == 1);
auto& co = m_Callouts[m_List.GetNextItem(-1, LVNI_SELECTED)];
if (!m_Engine.DeleteCallout(co.Data->calloutKey))
AtlMessageBox(m_hWnd, L"Failed to delete callout", IDS_TITLE, MB_ICONERROR);
else
Refresh();
return 0;
}
LRESULT CCalloutsView::OnProperties(WORD, WORD, HWND, BOOL&) {
auto selected = m_List.GetSelectedCount();
ATLASSERT(selected == 1);
auto& co = m_Callouts[m_List.GetNextItem(-1, LVNI_SELECTED)];
WFPHelper::ShowCalloutProperties(m_Engine, co.Data);
return 0;
}
LRESULT CCalloutsView::OnActivate(UINT, WPARAM active, LPARAM, BOOL&) const {
if (active)
UpdateUI();
@@ -148,6 +161,36 @@ void CCalloutsView::UpdateUI() const {
auto& ui = Frame()->UI();
auto selected = m_List.GetSelectedCount();
ui.UIEnable(ID_EDIT_COPY, selected > 0);
ui.UIEnable(ID_EDIT_DELETE, selected == 1);
ui.UIEnable(ID_EDIT_PROPERTIES, selected == 1);
}
bool CCalloutsView::OnDoubleClickList(HWND, int row, int col, POINT const& pt) {
LRESULT result;
return ProcessWindowMessage(m_hWnd, WM_COMMAND, ID_EDIT_PROPERTIES, 0, result, 1);
}
CString const& CCalloutsView::GetCalloutProvider(CalloutInfo& info) const {
if (info.Provider.IsEmpty() && info.Data->providerKey) {
auto sl = m_Engine.GetProviderByKey(*info.Data->providerKey);
if (sl)
info.Provider = StringHelper::ParseMUIString(sl->displayData.name);
else
info.Provider = StringHelper::GuidToString(*info.Data->providerKey);
}
return info.Provider;
}
CString const& CCalloutsView::GetCalloutName(CalloutInfo& info) const {
if (info.Name.IsEmpty())
info.Name = StringHelper::ParseMUIString(info.Data->displayData.name);
return info.Name;
}
CString const& CCalloutsView::GetCalloutDesc(CalloutInfo& info) const {
if (info.Desc.IsEmpty())
info.Desc = StringHelper::ParseMUIString(info.Data->displayData.description);
return info.Desc;
}
bool CCalloutsView::OnRightClickList(HWND, int row, int col, POINT const& pt) const {
@@ -157,5 +200,5 @@ bool CCalloutsView::OnRightClickList(HWND, int row, int col, POINT const& pt) co
CMenu menu;
menu.LoadMenu(IDR_CONTEXT);
return Frame()->TrackPopupMenu(menu.GetSubMenu(1), 0, pt.x, pt.y);
return Frame()->TrackPopupMenu(menu.GetSubMenu(0), 0, pt.x, pt.y);
}
+13 -2
View File
@@ -20,6 +20,7 @@ public:
int GetRowImage(HWND, int row, int col) const;
void OnStateChanged(HWND, int from, int to, UINT oldState, UINT newState) const;
bool OnRightClickList(HWND, int row, int col, POINT const& pt) const;
bool OnDoubleClickList(HWND, int row, int col, POINT const& pt);
BEGIN_MSG_MAP(CCalloutsView)
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
@@ -27,6 +28,8 @@ public:
CHAIN_MSG_MAP(CGenericListViewBase<CCalloutsView>)
ALT_MSG_MAP(1)
COMMAND_ID_HANDLER(ID_VIEW_REFRESH, OnRefresh)
COMMAND_ID_HANDLER(ID_EDIT_DELETE, OnDelete)
COMMAND_ID_HANDLER(ID_EDIT_PROPERTIES, OnProperties)
COMMAND_ID_HANDLER(ID_EDIT_COPY, OnCopy)
CHAIN_MSG_MAP_ALT(CGenericListViewBase<CCalloutsView>, 1)
END_MSG_MAP()
@@ -45,14 +48,22 @@ private:
struct CalloutInfo {
FWPM_CALLOUT* Data;
CString Provider;
CString Layer;
mutable CString Provider;
mutable CString Layer;
mutable CString Name, Desc;
};
CString const& GetCalloutProvider(CalloutInfo& info) const;
CString const& GetCalloutName(CalloutInfo& info) const;
CString const& GetCalloutDesc(CalloutInfo& info) const;
CString const& GetCalloutLayer(CalloutInfo& info) const;
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) const;
LRESULT OnRefresh(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnCopy(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnDelete(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnProperties(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
WFPEngine& m_Engine;
+8
View File
@@ -69,3 +69,11 @@ LRESULT CFilterGeneralPage::OnShowProvider(WORD, WORD, HWND, BOOL&) {
LRESULT CFilterGeneralPage::OnShowSublayer(WORD, WORD, HWND, BOOL&) {
return LRESULT();
}
LRESULT CFilterGeneralPage::OnShowCallout(WORD, WORD, HWND, BOOL&) {
auto callout = m_Engine.GetCalloutByKey(m_Filter->action.calloutKey);
ATLASSERT(callout);
WFPHelper::ShowCalloutProperties(m_Engine, *callout);
return 0;
}
+2
View File
@@ -17,6 +17,7 @@ public:
BEGIN_MSG_MAP(CFilterGeneralPage)
COMMAND_ID_HANDLER(IDC_LAYER_PROP, OnShowLayer)
COMMAND_ID_HANDLER(IDC_PROVIDER_PROP, OnShowProvider)
COMMAND_ID_HANDLER(IDC_CALLOUT_PROP, OnShowCallout)
COMMAND_ID_HANDLER(IDC_SUBLAYER_PROP, OnShowSublayer)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
END_MSG_MAP()
@@ -31,6 +32,7 @@ private:
LRESULT OnShowLayer(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnShowProvider(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnShowSublayer(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnShowCallout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
private:
WFPEngine& m_Engine;
+47 -6
View File
@@ -345,8 +345,36 @@ BEGIN
CHECKBOX "Disabled",IDC_DISABLED,339,73,43,10
LTEXT "Service:",IDC_STATIC,20,73,27,8
EDITTEXT IDC_SERVICENAME,52,72,162,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
LTEXT "Provider Data:",IDC_DATASIZE,7,89,48,8
EDITTEXT IDC_PROVIDERDATA,52,104,330,40,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
LTEXT "Provider Data:",IDC_DATASIZE,9,93,48,8
EDITTEXT IDC_PROVIDERDATA,7,107,375,37,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
END
IDD_CALLOUT DIALOGEX 0, 0, 393, 205
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Callout"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,138,184,50,14
PUSHBUTTON "Cancel",IDCANCEL,204,184,50,14
LTEXT "Key:",IDC_STATIC,31,11,16,8
EDITTEXT IDC_KEY,52,10,240,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
LTEXT "Name:",IDC_STATIC,25,31,22,8
EDITTEXT IDC_NAME,52,30,327,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
LTEXT "Description:",IDC_STATIC,8,52,39,8
EDITTEXT IDC_DESC,52,51,327,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
LTEXT "ID:",IDC_STATIC,297,11,12,8
EDITTEXT IDC_ID,314,9,65,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
CHECKBOX "Persistent",IDC_PERSISTENT,55,72,48,10
CHECKBOX "Provider Context",IDC_PROVIDER_CONTEXT,116,72,71,10
CHECKBOX "Registered",IDC_REGISTERED,205,72,51,10
LTEXT "Provider:",IDC_STATIC,16,91,30,8
EDITTEXT IDC_PROVIDER,51,90,269,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
PUSHBUTTON "Provider...",IDC_PROVIDER_PROP,327,88,59,14
LTEXT "Layer:",IDC_STATIC,24,111,22,8
EDITTEXT IDC_LAYER,51,110,269,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
PUSHBUTTON "Layer...",IDC_LAYER_PROP,327,108,59,14
LTEXT "Provider Data:",IDC_DATASIZE,9,128,48,8
EDITTEXT IDC_PROVIDERDATA,7,140,375,30,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_STATICEDGE
END
@@ -421,6 +449,14 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 177
END
IDD_CALLOUT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 386
TOPMARGIN, 7
BOTTOMMARGIN, 198
END
END
#endif // APSTUDIO_INVOKED
@@ -460,8 +496,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,5,2,0
PRODUCTVERSION 0,5,2,0
FILEVERSION 0,5,3,0
PRODUCTVERSION 0,5,3,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -478,12 +514,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Scorpio Software"
VALUE "FileDescription", "Windows Filtering Platform Explorer"
VALUE "FileVersion", "0.5.2.0"
VALUE "FileVersion", "0.5.3.0"
VALUE "InternalName", "WFPExplorer"
VALUE "LegalCopyright", "©2022 Pavel Yosifovich"
VALUE "OriginalFilename", "WFPExplorer.exe"
VALUE "ProductName", "WFP Explorer"
VALUE "ProductVersion", "0.5.2.0"
VALUE "ProductVersion", "0.5.3.0"
END
END
BLOCK "VarFileInfo"
@@ -541,6 +577,11 @@ BEGIN
0
END
IDD_CALLOUT AFX_DIALOG_LAYOUT
BEGIN
0
END
/////////////////////////////////////////////////////////////////////////////
//
+2
View File
@@ -229,6 +229,7 @@
<ItemGroup>
<ClCompile Include="AboutDlg.cpp" />
<ClCompile Include="AppSettings.cpp" />
<ClCompile Include="CalloutDlg.cpp" />
<ClCompile Include="CalloutsView.cpp" />
<ClCompile Include="FilterConditionsPage.cpp" />
<ClCompile Include="FilterGeneralPage.cpp" />
@@ -258,6 +259,7 @@
<ItemGroup>
<ClInclude Include="AboutDlg.h" />
<ClInclude Include="AppSettings.h" />
<ClInclude Include="CalloutDlg.h" />
<ClInclude Include="CalloutsView.h" />
<ClInclude Include="FilterConditionsPage.h" />
<ClInclude Include="FilterGeneralPage.h" />
+6
View File
@@ -96,6 +96,9 @@
<ClCompile Include="ProviderDlg.cpp">
<Filter>Dialogs</Filter>
</ClCompile>
<ClCompile Include="CalloutDlg.cpp">
<Filter>Dialogs</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h">
@@ -170,6 +173,9 @@
<ClInclude Include="GenericListViewBase.h">
<Filter>Views</Filter>
</ClInclude>
<ClInclude Include="CalloutDlg.h">
<Filter>Dialogs</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="WFPExplorer.rc">
+7 -3
View File
@@ -8,6 +8,7 @@
#include "FilterConditionsPage.h"
#include "LayersView.h"
#include "ProviderDlg.h"
#include "CalloutDlg.h"
CString WFPHelper::GetProviderName(WFPEngine const& engine, GUID const& key) {
auto provider = engine.GetProviderByKey(key);
@@ -92,7 +93,10 @@ int WFPHelper::ShowSublayerProperties(WFPEngine& engine, FWPM_SUBLAYER* sublayer
int WFPHelper::ShowProviderProperties(WFPEngine& engine, FWPM_PROVIDER* provider) {
CProviderDlg dlg(provider);
dlg.DoModal();
return 0;
return (int)dlg.DoModal();
}
int WFPHelper::ShowCalloutProperties(WFPEngine& engine, FWPM_CALLOUT* callout) {
CCalloutDlg dlg(engine, callout);
return (int)dlg.DoModal();
}
+1
View File
@@ -12,5 +12,6 @@ struct WFPHelper abstract final {
static int ShowFilterProperties(WFPEngine& engine, FWPM_FILTER* filter);
static int ShowSublayerProperties(WFPEngine& engine, FWPM_SUBLAYER* sublayer);
static int ShowProviderProperties(WFPEngine& engine, FWPM_PROVIDER* provider);
static int ShowCalloutProperties(WFPEngine& engine, FWPM_CALLOUT* callout);
};
+11 -9
View File
@@ -45,6 +45,7 @@
#define IDI_FIND_NEXT 241
#define IDI_FIND_PREV 242
#define IDD_PROVIDER 243
#define IDD_CALLOUT 245
#define IDC_VERSION 1000
#define IDC_COPYRIGHT 1001
#define IDC_KEY 1001
@@ -53,11 +54,12 @@
#define IDC_PROVIDER 1004
#define IDC_SERVICENAME 1004
#define IDC_PROVIDER_PROP 1005
#define IDC_PROVIDERDATA 1005
#define IDC_PROVIDERDATA 1027
#define IDC_LAYER 1006
#define IDC_LAYER_PROP 1007
#define IDC_ACTIONTYPE 1008
#define IDC_FIELDS 1008
#define IDC_PROVIDERDATA2 1008
#define IDC_CALLOUT_OR_FILTER 1009
#define IDC_LIST 1009
#define IDC_FILTERS 1009
@@ -67,7 +69,6 @@
#define IDC_EFFECTIVEWEIGHT 1012
#define IDC_SUBLAYER 1013
#define IDC_SUBLAYER_PROP 1014
#define IDC_LAYER_PROP2 1015
#define IDC_CALLOUT_PROP 1015
#define IDC_VALUE 1016
#define IDC_FLAGS 1017
@@ -76,8 +77,10 @@
#define IDC_COPYFROM 1021
#define IDC_PERSISTENT 1022
#define IDC_DISABLED 1023
#define IDC_PROVIDER_CONTEXT 1023
#define IDC_DATASIZE 1024
#define IDC_COFI 1025
#define IDC_REGISTERED 1025
#define IDC_COFI 1026
#define ID_WINDOW_CLOSE 32772
#define ID_WINDOW_CLOSE_ALL 32773
#define ID_OPTIONS_ALWAYSONTOP 32775
@@ -99,17 +102,16 @@
#define ID_NEW_FILTER 32791
#define ID_NEW_SIMPLEFILTER 32795
#define ID_NEW_PROVIDER 32796
#define ID_EDIT_FIND32797 32797
#define ID_EDIT_FINDNEXT 32798
#define ID_VIEW_STATISTICS 32801
#define ID_EDIT_FINDNEXT 32797
#define ID_VIEW_STATISTICS 32798
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 245
#define _APS_NEXT_COMMAND_VALUE 32802
#define _APS_NEXT_CONTROL_VALUE 1026
#define _APS_NEXT_RESOURCE_VALUE 247
#define _APS_NEXT_COMMAND_VALUE 32799
#define _APS_NEXT_CONTROL_VALUE 1028
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif