![]() |
CMGDK r49-rc2
|
#include <WinFireWall.h>
公有类型 | |
enum | PROTOCOL { ANY = 256, UDP = 17, TCP = 6 } |
公有成员 | |
WinFireWall () | |
~WinFireWall () | |
FW_ERROR_CODE | Init () |
FW_ERROR_CODE | Close () |
FW_ERROR_CODE | CheckFirewall (bool &) |
FW_ERROR_CODE | OpenFirewall () |
FW_ERROR_CODE | CloseFirewall () |
FW_ERROR_CODE | CheckApplication (const wchar_t *, bool &) |
FW_ERROR_CODE | AddApplication (const wchar_t *, const wchar_t *) |
FW_ERROR_CODE | RemoveApplication (const wchar_t *) |
FW_ERROR_CODE | CheckPort (unsigned int, PROTOCOL, bool &) |
FW_ERROR_CODE | OpenPort (unsigned int, PROTOCOL, const wchar_t *) |
FW_ERROR_CODE | ClosePort (unsigned int, PROTOCOL) |
FW_ERROR_CODE | IsExceptionNotAllowed (bool &) |
FW_ERROR_CODE | SetExceptionNotAllowed (bool) |
FW_ERROR_CODE | IsNotificationDiabled (bool &) |
FW_ERROR_CODE | SetNotificationDiabled (bool) |
FW_ERROR_CODE | IsUnicastResponsesToMulticastBroadcastDisabled (bool &) |
FW_ERROR_CODE | SetUnicastResponsesToMulticastBroadcastDisabled (bool) |
Windows 防火墙访问类
原作者:Kim Youngjin
hgl::network::WinFireWall::WinFireWall | ( | void | ) |
hgl::network::WinFireWall::~WinFireWall | ( | void | ) |
FW_ERROR_CODE hgl::network::WinFireWall::AddApplication | ( | const wchar_t * | lpszProcessImageFileName, |
const wchar_t * | lpszRegisterName | ||
) |
添加一个程序到Windows防火墙可通信名单
lpszProcessImageFileName | 程序可执行文件名称(绝对路径) |
lpszRegisterName | 在Windows防火墙名单中的程序名称 |
FW_ERROR_CODE hgl::network::WinFireWall::CheckApplication | ( | const wchar_t * | lpszProcessImageFileName, |
bool & | bEnable | ||
) |
检测指定程序在Windows防火墙中的设置
lpszProcessImageFileName | 程序可执行文件名称(绝对路径) |
bEnable | “是否被允许通信”信息保存用变量 |
FW_ERROR_CODE hgl::network::WinFireWall::CheckFirewall | ( | bool & | bOn | ) |
检测防火墙是否打开
bOn | 是否打开标识保存变量 |
FW_ERROR_CODE hgl::network::WinFireWall::CheckPort | ( | unsigned int | lPortNumber, |
PROTOCOL | ipProtocol, | ||
bool & | bEnable | ||
) |
检测指定端口状态
lPortNumber | 端口号 |
ipProtocol | 协议(ANY:任意、TCP、UDP 三种可选) |
bEnable | “是否被允许通信”信息保存变量 |
FW_ERROR_CODE hgl::network::WinFireWall::Close | ( | ) |
关闭Windows防火墙访问
FW_ERROR_CODE hgl::network::WinFireWall::CloseFirewall | ( | ) |
关闭Windows防火墙
FW_ERROR_CODE hgl::network::WinFireWall::ClosePort | ( | unsigned int | lPortNumber, |
PROTOCOL | ipProtocol | ||
) |
将指定端口从Windows防火墙允许通信名单中移除
lPortNumber | 端口号 |
ipProtocol | 协议(ANY:任意、TCP、UDP 三种可选) |
FW_ERROR_CODE hgl::network::WinFireWall::Init | ( | ) |
初始化Windows防火墙访问
FW_ERROR_CODE hgl::network::WinFireWall::IsExceptionNotAllowed | ( | bool & | bNotAllowed | ) |
FW_ERROR_CODE hgl::network::WinFireWall::IsNotificationDiabled | ( | bool & | bDisabled | ) |
FW_ERROR_CODE hgl::network::WinFireWall::IsUnicastResponsesToMulticastBroadcastDisabled | ( | bool & | bDisabled | ) |
FW_ERROR_CODE hgl::network::WinFireWall::OpenFirewall | ( | ) |
打开Windows防火墙
FW_ERROR_CODE hgl::network::WinFireWall::OpenPort | ( | unsigned int | lPortNumber, |
PROTOCOL | ipProtocol, | ||
const wchar_t * | lpszRegisterName | ||
) |
将指定端口添加到Windows防火墙允许通信名单中
lPortNumber | 端口号 |
ipProtocol | 协议(ANY:任意、TCP、UDP 三种可选) |
lpszRegisterName | 是Windows防火墙名单中所显示的名称 |
FW_ERROR_CODE hgl::network::WinFireWall::RemoveApplication | ( | const wchar_t * | lpszProcessImageFileName | ) |
将一个程序从Windows防火墙可通信名单中移除
lpszProcessImageFileName | 程序可执行文件名称(绝对路径) |
FW_ERROR_CODE hgl::network::WinFireWall::SetExceptionNotAllowed | ( | bool | bNotAllowed | ) |
FW_ERROR_CODE hgl::network::WinFireWall::SetNotificationDiabled | ( | bool | bDisabled | ) |
FW_ERROR_CODE hgl::network::WinFireWall::SetUnicastResponsesToMulticastBroadcastDisabled | ( | bool | bDisabled | ) |