[Common-dev] CR-Client: support custom display name in Windows' firewall exception list

[Common-dev] CR-Client: support custom display name in Windows' firewall exception list

Greg Wright gwright at real.com
Wed Aug 3 13:40:42 PDT 2005


Looks good.
--greg.


Henry Ping wrote:
> The current HXWinFirewallControlManager::OpenApp() ingores its 1st input
> parameter(pszAppName) and always sets "HelixDNAClient" as the display name
> shown in Windows' firewall exception list.
> 
> The change is to honor the pszAppName input as the display name if it's not
> NULL, otherwise, we still fallback to use internal "HelixDNAClient".
> 
> Branches:
> HEAD, Cayenne150 and Neptune123
> 
> Diffs:
> Index: platform/win/win_fwctlmgr.cpp
> ===================================================================
> RCS file: /cvsroot/common/netio/platform/win/win_fwctlmgr.cpp,v
> retrieving revision 1.5
> diff -u -w -4 -r1.5 win_fwctlmgr.cpp
> --- platform/win/win_fwctlmgr.cpp	2 Nov 2004 18:36:00 -0000	1.5
> +++ platform/win/win_fwctlmgr.cpp	3 Aug 2005 20:18:21 -0000
> @@ -218,8 +218,9 @@
>      HRESULT     hr = S_OK;
>      HX_RESULT   rc = HXR_OK;
>      wchar_t     pOutWideBuf[MAX_PATH];    
>      BSTR        appBstrName = NULL;
> +	BSTR		appDisplayBstrName = NULL;
>      INetFwAuthorizedApplication*    fwAuthorizedApp = NULL;
>      INetFwAuthorizedApplications*   fwAuthorizedApps = NULL;
>  
>      if (!m_bInitialized)
> @@ -252,9 +253,20 @@
>      {
>          goto exit;
>      }
>  
> +	if (pszAppName)
> +	{
> +		// convert string to unicode
> +		MultiByteToWideChar(0, 0, pszAppName, strlen(pszAppName) +
> 1, pOutWideBuf, MAX_PATH);
> +		appDisplayBstrName = SysAllocString((const unsigned
> short*)pOutWideBuf);
> +		hr = fwAuthorizedApp->put_Name(appDisplayBstrName);
> +	}
> +	else
> +	{
>      hr = fwAuthorizedApp->put_Name(m_fwBstrName);
> +	}
> +
>      if (FAILED(hr))
>      {
>          goto exit;
>      }
> @@ -278,8 +290,9 @@
>  
>  exit:
>  
>      SysFreeString(appBstrName);
> +    SysFreeString(appDisplayBstrName);
>      HX_RELEASE(fwAuthorizedApp);
>      HX_RELEASE(fwAuthorizedApps);
>  
>      if (S_OK != hr && E_UNEXPECTED != hr)
> 
> 
> -->Henry
> 
> 
> _______________________________________________
> Common-dev mailing list
> Common-dev at helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/common-dev
> 



More information about the Common-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.