CMGDK r49-rc2
公有类型 | 公有成员
hgl::network::WinFireWall类参考

#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


成员枚举类型文档

枚举值:
ANY 
UDP 
TCP 

构造及析构函数文档

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_NOERROR 添加成功
FW_ERROR_CODE hgl::network::WinFireWall::CheckApplication ( const wchar_t *  lpszProcessImageFileName,
bool &  bEnable 
)

检测指定程序在Windows防火墙中的设置

参数:
lpszProcessImageFileName程序可执行文件名称(绝对路径)
bEnable“是否被允许通信”信息保存用变量
返回:
FW_NOERROR 检测成功
FW_ERROR_CODE hgl::network::WinFireWall::CheckFirewall ( bool &  bOn)

检测防火墙是否打开

参数:
bOn是否打开标识保存变量
返回:
FW_NOERROR 检测正常
FW_ERROR_CODE hgl::network::WinFireWall::CheckPort ( unsigned int  lPortNumber,
PROTOCOL  ipProtocol,
bool &  bEnable 
)

检测指定端口状态

参数:
lPortNumber端口号
ipProtocol协议(ANY:任意、TCP、UDP 三种可选)
bEnable“是否被允许通信”信息保存变量
返回:
FW_NOERROR 检测成功
FW_ERROR_CODE hgl::network::WinFireWall::Close ( )

关闭Windows防火墙访问

FW_ERROR_CODE hgl::network::WinFireWall::CloseFirewall ( )

关闭Windows防火墙

返回:
FW_NOERROR 成功
FW_ERROR_CODE hgl::network::WinFireWall::ClosePort ( unsigned int  lPortNumber,
PROTOCOL  ipProtocol 
)

将指定端口从Windows防火墙允许通信名单中移除

参数:
lPortNumber端口号
ipProtocol协议(ANY:任意、TCP、UDP 三种可选)
返回:
FW_NOERROR 移除成功
FW_ERROR_CODE hgl::network::WinFireWall::Init ( )

初始化Windows防火墙访问

返回:
FW_NOERROR 成功
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_NOERROR 成功
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_NOERROR 添加成功
FW_ERROR_CODE hgl::network::WinFireWall::RemoveApplication ( const wchar_t *  lpszProcessImageFileName)

将一个程序从Windows防火墙可通信名单中移除

参数:
lpszProcessImageFileName程序可执行文件名称(绝对路径)
返回:
FW_NOERROR 移除成功
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)

该类的文档由以下文件生成:
 全部  名字空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义