Checking the Effective Firewall Status The firewall status is determined by a combination of two levels of control. To find the effective status, first check the global operation mode then the mode on the interface of interest.To check the global operation mode, use the InternetFirewallEnabled property of the INetSharingConfiguration object. To check the interface operation mode, use an INetFwProfile object to access the FirewallEnabled property and the ExceptionsNotAllowed property to find out if the firewall is enabled and whether exceptions are allowed.
The firewall status is determined by a combination of two levels of control. To find the effective status, first check the global operation mode then the mode on the interface of interest.To check the global operation mode, use the InternetFirewallEnabled property of the INetSharingConfiguration object. To check the interface operation mode, use an INetFwProfile object to access the FirewallEnabled property and the ExceptionsNotAllowed property to find out if the firewall is enabled and whether exceptions are allowed.
TCHAR szUser[MAX_LOADSTRING]=TEXT("");dwUser=sizeof(szUser); //必须指定缓冲区大小
GetUserName(szUser, &dwUser);