年前写的一个程序。目的程序在打开端口的时候,系统自带的防火墙不能有提示 GetCurrentAppPath(m_strPath);
SetContent_S = LPBYTE(m_ExeRegeValue.GetBuffer()); / //函数名:SetValue //作用:修改注册表键值 // int XXXX::SetValue_S (struct HKEY__*ReRootKey,TCHAR *ReSubKey,TCHAR *ReValueName,LPBYTE ReSetContent_S) if(RegOpenKeyEx(ReRootKey,ReSubKey,0,KEY_WRITE,&hKey)==ERROR_SUCCESS) if(RegSetValueEx(hKey,ReValueName,NULL,REG_SZ,ReSetContent_S,m_nExeRegeValueLength)!=ERROR_SUCCESS) 防火墙的注册表位置 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/SharedAccess/Parameters/FirewallPolicy/StandardProfile/AuthorizedApplications/List HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/SharedAccess/Parameters/FirewallPolicy/StandardProfile/AuthorizedApplications/List |