Update of /cvsroot/decaldev/source/DenAgent
In directory sc8-pr-cvs1:/tmp/cvs-serv26092
Modified Files:
TrayWnd.cpp StdAfx.h OptionsDlg.cpp DenAgentDlg.cpp
DenAgent.cpp ChangePluginDirectory.cpp AddRemoveDlg.cpp
Log Message:
regkey updates
Index: TrayWnd.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DenAgent/TrayWnd.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** TrayWnd.cpp 21 May 2003 16:25:08 -0000 1.10
--- TrayWnd.cpp 29 May 2003 21:30:15 -0000 1.11
***************
*** 133,137 ****
*( strProcessName + 1 ) = _T( '\0' );
! CRegKey key;
key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" ) );
key.SetValue( szImagePath, _T( "AgentPath" ) );
--- 133,137 ----
*( strProcessName + 1 ) = _T( '\0' );
! RegKey key;
key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" ) );
key.SetValue( szImagePath, _T( "AgentPath" ) );
***************
*** 203,207 ****
}
! CRegKey key;
TCHAR szDllPath[ MAX_PATH ];
--- 203,207 ----
}
! RegKey key;
TCHAR szDllPath[ MAX_PATH ];
Index: StdAfx.h
===================================================================
RCS file: /cvsroot/decaldev/source/DenAgent/StdAfx.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** StdAfx.h 23 May 2003 02:20:47 -0000 1.9
--- StdAfx.h 29 May 2003 21:30:15 -0000 1.10
***************
*** 49,52 ****
--- 49,54 ----
#include <string>
+ #include "../include/Helpers.h"
+
extern LONG g_fAbortDownload;
Index: OptionsDlg.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DenAgent/OptionsDlg.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** OptionsDlg.cpp 30 Mar 2003 08:51:19 -0000 1.15
--- OptionsDlg.cpp 29 May 2003 21:30:15 -0000 1.16
***************
*** 74,78 ****
// TODO: Add extra initialization here
! CRegKey key;
if( key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" )) != ERROR_SUCCESS )
return TRUE;
--- 74,78 ----
// TODO: Add extra initialization here
! RegKey key;
if( key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" )) != ERROR_SUCCESS )
return TRUE;
***************
*** 188,192 ****
}
! CRegKey k;
k.Create(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"));
--- 188,192 ----
}
! RegKey k;
k.Create(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"));
***************
*** 222,226 ****
UpdateData(TRUE);
! CRegKey key;
key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) );
--- 222,226 ----
UpdateData(TRUE);
! RegKey key;
key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) );
***************
*** 295,299 ****
// Auto-Start on Bootup
! CRegKey k;
k.Create(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"));
--- 295,299 ----
// Auto-Start on Bootup
! RegKey k;
k.Create(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Run"));
***************
*** 324,328 ****
if(cpddlg.DoModal() == IDOK )
{
! CRegKey keyAgent;
if( keyAgent.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" ), KEY_READ ) == ERROR_SUCCESS )
{
--- 324,328 ----
if(cpddlg.DoModal() == IDOK )
{
! RegKey keyAgent;
if( keyAgent.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" ), KEY_READ ) == ERROR_SUCCESS )
{
***************
*** 337,341 ****
void cOptionsDlg::OnReset()
{
! CRegKey key;
if( key.Create( HKEY_LOCAL_MACHINE, "Software\\Decal", REG_NONE, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS ) != ERROR_SUCCESS )
return;
--- 337,341 ----
void cOptionsDlg::OnReset()
{
! RegKey key;
if( key.Create( HKEY_LOCAL_MACHINE, "Software\\Decal", REG_NONE, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS ) != ERROR_SUCCESS )
return;
Index: DenAgentDlg.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DenAgent/DenAgentDlg.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** DenAgentDlg.cpp 13 May 2003 03:41:43 -0000 1.31
--- DenAgentDlg.cpp 29 May 2003 21:30:15 -0000 1.32
***************
*** 126,130 ****
CFileStatus cfs;
! CRegKey key;
CString strDecalPlugins("decalplugins.xml");
--- 126,130 ----
CFileStatus cfs;
! RegKey key;
CString strDecalPlugins("decalplugins.xml");
***************
*** 318,322 ****
{
USES_CONVERSION;
! CRegKey key;
cDownloaderDlg dlg;
--- 318,322 ----
{
USES_CONVERSION;
! RegKey key;
cDownloaderDlg dlg;
***************
*** 409,413 ****
convertVersion( OLE2T( vVersion.bstrVal ), dwMajor, dwMinor );
! CRegKey keyPlugin;
if( keyPlugin.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Plugins\\" ), KEY_READ ) == ERROR_SUCCESS )
--- 409,413 ----
convertVersion( OLE2T( vVersion.bstrVal ), dwMajor, dwMinor );
! RegKey keyPlugin;
if( keyPlugin.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Plugins\\" ), KEY_READ ) == ERROR_SUCCESS )
***************
*** 540,544 ****
USES_CONVERSION;
! CRegKey key;
TCHAR szVal[MAX_PATH+1];
DWORD dwSize = MAX_PATH;
--- 540,544 ----
USES_CONVERSION;
! RegKey key;
TCHAR szVal[MAX_PATH+1];
DWORD dwSize = MAX_PATH;
***************
*** 752,756 ****
//load up the decal registry and remove this entry
! CRegKey keyPlugin;
CString decalPluginKey;
BSTR sClsid;
--- 752,756 ----
//load up the decal registry and remove this entry
! RegKey keyPlugin;
CString decalPluginKey;
BSTR sClsid;
***************
*** 763,767 ****
if (keyPlugin.Open(HKEY_LOCAL_MACHINE, _T(decalPluginKey), KEY_ALL_ACCESS) == ERROR_SUCCESS)
{
! CRegKey keySub;
if (keySub.Open(keyPlugin.m_hKey, OLE2T(sClsid), KEY_READ) == ERROR_SUCCESS)
{
--- 763,767 ----
if (keyPlugin.Open(HKEY_LOCAL_MACHINE, _T(decalPluginKey), KEY_ALL_ACCESS) == ERROR_SUCCESS)
{
! RegKey keySub;
if (keySub.Open(keyPlugin.m_hKey, OLE2T(sClsid), KEY_READ) == ERROR_SUCCESS)
{
***************
*** 772,776 ****
if (keySub.QueryValue(sUninstall, _T("Uninstaller"), &dwSize) == ERROR_SUCCESS)
{
! CRegKey keyUninstall;
CString sUninstallKey;
--- 772,776 ----
if (keySub.QueryValue(sUninstall, _T("Uninstaller"), &dwSize) == ERROR_SUCCESS)
{
! RegKey keyUninstall;
CString sUninstallKey;
Index: DenAgent.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DenAgent/DenAgent.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** DenAgent.cpp 30 Dec 2002 21:12:50 -0000 1.17
--- DenAgent.cpp 29 May 2003 21:30:16 -0000 1.18
***************
*** 50,54 ****
bool CheckForHardwareMode ()
{
! CRegKey key;
if (key.Open (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Microsoft Games\\Asheron's Call\\1.00", KEY_READ) != ERROR_SUCCESS)
--- 50,54 ----
bool CheckForHardwareMode ()
{
! RegKey key;
if (key.Open (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Microsoft Games\\Asheron's Call\\1.00", KEY_READ) != ERROR_SUCCESS)
***************
*** 59,63 ****
DWORD dwValue = 0;
! if (key.QueryValue (dwValue, "UseHardware") != ERROR_SUCCESS)
{
return false;
--- 59,63 ----
DWORD dwValue = 0;
! if (key.QueryDWORDValue ("UseHardware", dwValue) != ERROR_SUCCESS)
{
return false;
***************
*** 69,73 ****
bool CheckForIE5OrLater ()
{
! CRegKey key;
if (key.Open (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer", KEY_READ) != ERROR_SUCCESS)
--- 69,73 ----
bool CheckForIE5OrLater ()
{
! RegKey key;
if (key.Open (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer", KEY_READ) != ERROR_SUCCESS)
***************
*** 79,83 ****
DWORD dwSize = sizeof (szVersionBuffer);
! if (key.QueryValue (szVersionBuffer, "Version", &dwSize) != ERROR_SUCCESS)
return false;
--- 79,83 ----
DWORD dwSize = sizeof (szVersionBuffer);
! if (key.QueryStringValue("Version", szVersionBuffer, &dwSize) != ERROR_SUCCESS)
return false;
***************
*** 142,146 ****
bool CDenAgentApp::getACVersionString ( CString &strVersion )
{
! CRegKey rk;
if ( rk.Open ( HKEY_LOCAL_MACHINE, _T( "Software\\Microsoft\\Microsoft Games\\Asheron's Call\\1.00" ) ) != ERROR_SUCCESS )
{
--- 142,146 ----
bool CDenAgentApp::getACVersionString ( CString &strVersion )
{
! RegKey rk;
if ( rk.Open ( HKEY_LOCAL_MACHINE, _T( "Software\\Microsoft\\Microsoft Games\\Asheron's Call\\1.00" ) ) != ERROR_SUCCESS )
{
***************
*** 151,155 ****
TCHAR szClientPath[ MAX_PATH ];
DWORD dwPathLength = MAX_PATH;
! if ( rk.QueryValue ( szClientPath, _T( "path" ), &dwPathLength ) != ERROR_SUCCESS )
{
::AfxMessageBox ( IDE_NOCLIENTEXE, MB_ICONWARNING );
--- 151,155 ----
TCHAR szClientPath[ MAX_PATH ];
DWORD dwPathLength = MAX_PATH;
! if ( rk.QueryStringValue ( _T( "path" ), szClientPath, &dwPathLength ) != ERROR_SUCCESS )
{
::AfxMessageBox ( IDE_NOCLIENTEXE, MB_ICONWARNING );
***************
*** 180,184 ****
::_stprintf ( keyName, _T( "CLSID\\%s\\InprocServer32" ), clsidName );
! CRegKey rk;
if ( rk.Open ( HKEY_CLASSES_ROOT, keyName ) != ERROR_SUCCESS )
return false;
--- 180,184 ----
::_stprintf ( keyName, _T( "CLSID\\%s\\InprocServer32" ), clsidName );
! RegKey rk;
if ( rk.Open ( HKEY_CLASSES_ROOT, keyName ) != ERROR_SUCCESS )
return false;
***************
*** 186,190 ****
DWORD dwPathSize = MAX_PATH;
! long regResult = rk.QueryValue ( strFilename.GetBuffer ( MAX_PATH ), NULL, &dwPathSize );
strFilename.ReleaseBuffer();
--- 186,190 ----
DWORD dwPathSize = MAX_PATH;
! long regResult = rk.QueryStringValue ( NULL, strFilename.GetBuffer ( MAX_PATH ), &dwPathSize );
strFilename.ReleaseBuffer();
***************
*** 202,207 ****
// Get CodeBase KeyValue - Should point to the Plugin DLL
dwPathSize = MAX_PATH;
! if (rk.QueryValue ( strFilename.GetBuffer ( MAX_PATH ), "CodeBase", &dwPathSize ) == ERROR_SUCCESS)
! {
// Release extra buffer (Not doing this seem to cause the Left() and Delete() funcs to fail)
strFilename.ReleaseBuffer();
--- 202,207 ----
// Get CodeBase KeyValue - Should point to the Plugin DLL
dwPathSize = MAX_PATH;
! if (rk.QueryStringValue ( "CodeBase", strFilename.GetBuffer ( MAX_PATH ), &dwPathSize ) == ERROR_SUCCESS)
! {
// Release extra buffer (Not doing this seem to cause the Left() and Delete() funcs to fail)
strFilename.ReleaseBuffer();
***************
*** 211,225 ****
}
else
! {
// CodeBase isn't accessable - Possible that plugin is in GAC
// Return Path to MS.NET core DLL
dwPathSize = MAX_PATH;
! if (rk.QueryValue ( strFilename.GetBuffer ( MAX_PATH ), NULL, &dwPathSize ) != ERROR_SUCCESS)
{
strFilename.ReleaseBuffer();
! return false;
}
! }
}
return true;
}
--- 211,227 ----
}
else
! {
// CodeBase isn't accessable - Possible that plugin is in GAC
// Return Path to MS.NET core DLL
dwPathSize = MAX_PATH;
! if (rk.QueryStringValue ( NULL, strFilename.GetBuffer ( MAX_PATH ), &dwPathSize ) != ERROR_SUCCESS)
{
+ rk.Close();
strFilename.ReleaseBuffer();
! return false;
}
! }
}
+ rk.Close();
return true;
}
***************
*** 496,500 ****
USES_CONVERSION;
! CRegKey hkGroup;
if ( hkGroup.Open ( HKEY_LOCAL_MACHINE, _T ( "Software\\Decal\\Plugins" ) ) != ERROR_SUCCESS )
// No plugins - no problem
--- 498,502 ----
USES_CONVERSION;
! RegKey hkGroup;
if ( hkGroup.Open ( HKEY_LOCAL_MACHINE, _T ( "Software\\Decal\\Plugins" ) ) != ERROR_SUCCESS )
// No plugins - no problem
***************
*** 538,551 ****
// Create the Real registry key
// Key configuration copied from Decal/cActiveXSurrogate::Register
! CRegKey hkeyItem;
if ( hkeyItem.Create ( hkGroup, szCLSID ) != ERROR_SUCCESS )
continue;
// Friendly name
! hkeyItem.SetValue( OLE2T( strName ) );
// Enabled by default
! hkeyItem.SetValue( dwEnabled, _T( "Enabled" ) );
// The V1 surrogate
! hkeyItem.SetValue( _T( "{3D837F6E-B5CA-4604-885F-7AB45FCFA62A}" ), _T( "Surrogate" ) );
}
}
--- 540,554 ----
// Create the Real registry key
// Key configuration copied from Decal/cActiveXSurrogate::Register
! RegKey hkeyItem;
if ( hkeyItem.Create ( hkGroup, szCLSID ) != ERROR_SUCCESS )
continue;
// Friendly name
! hkeyItem.SetStringValue( NULL, OLE2T( strName ) );
// Enabled by default
! hkeyItem.SetDWORDValue( _T( "Enabled" ), dwEnabled );
// The V1 surrogate
! hkeyItem.SetStringValue( _T( "Surrogate" ), _T( "{3D837F6E-B5CA-4604-885F-7AB45FCFA62A}" ) );
! hkeyItem.Close();
}
}
Index: ChangePluginDirectory.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DenAgent/ChangePluginDirectory.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ChangePluginDirectory.cpp 23 Aug 2001 21:01:04 -0000 1.2
--- ChangePluginDirectory.cpp 29 May 2003 21:30:16 -0000 1.3
***************
*** 46,55 ****
// TODO: Add extra validation here
! CRegKey keyAgent;
if( keyAgent.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" )) == ERROR_SUCCESS )
{
CString csu;
m_NewUrl.GetWindowText(csu);
! keyAgent.SetValue(csu, "DecalDirectory");
}
CDialog::OnOK();
--- 46,56 ----
// TODO: Add extra validation here
! RegKey keyAgent;
if( keyAgent.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" )) == ERROR_SUCCESS )
{
CString csu;
m_NewUrl.GetWindowText(csu);
! keyAgent.SetStringValue("DecalDirectory", csu);
! keyAgent.Close();
}
CDialog::OnOK();
***************
*** 60,76 ****
CDialog::OnInitDialog();
! CRegKey keyAgent;
! if( keyAgent.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" )) != ERROR_SUCCESS )
! {
! ::AfxMessageBox( _T( "Critical registry keys are missing, this installation is broken.\r\nRepair the installation." ), MB_ICONERROR | MB_OK, 0 );
! EndDialog( IDCANCEL );
! return FALSE;
! }
TCHAR szUrl[ 1024 ];
! DWORD dwSize = 1024;
! keyAgent.QueryValue(szUrl, _T("DecalDirectory"), &dwSize);
! m_NewUrl.SetWindowText(szUrl);
// TODO: Add extra initialization here
--- 61,78 ----
CDialog::OnInitDialog();
! RegKey keyAgent;
! if( keyAgent.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" )) != ERROR_SUCCESS )
! {
! ::AfxMessageBox( _T( "Critical registry keys are missing, this installation is broken.\r\nRepair the installation." ), MB_ICONERROR | MB_OK, 0 );
! EndDialog( IDCANCEL );
! return FALSE;
! }
TCHAR szUrl[ 1024 ];
! DWORD dwSize = 1024;
! keyAgent.QueryStringValue(_T("DecalDirectory"), szUrl, &dwSize);
! m_NewUrl.SetWindowText(szUrl);
! keyAgent.Close();
// TODO: Add extra initialization here
Index: AddRemoveDlg.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DenAgent/AddRemoveDlg.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AddRemoveDlg.cpp 23 May 2003 02:20:47 -0000 1.15
--- AddRemoveDlg.cpp 29 May 2003 21:30:16 -0000 1.16
***************
*** 80,84 ****
// Now get matching info from the registry - if available
! CRegKey keyPlugin;
CString csVersion;
CString decalPluginKey;
--- 80,84 ----
// Now get matching info from the registry - if available
! RegKey keyPlugin;
CString csVersion;
CString decalPluginKey;
***************
*** 253,257 ****
// Load the string
! CRegKey keyAgent;
if( keyAgent.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" )) != ERROR_SUCCESS )
{
--- 253,257 ----
// Load the string
! RegKey keyAgent;
if( keyAgent.Open( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Agent" )) != ERROR_SUCCESS )
{
***************
*** 436,442 ****
StringFromCLSID(pTypeAttr->guid, &pwszClassID);
! CRegKey key;
if( key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Plugins" )) == ERROR_SUCCESS )
! if(key.SetValue(0x1, OLE2A(pwszClassID)) == ERROR_SUCCESS)
bSuccess = true;
--- 436,442 ----
StringFromCLSID(pTypeAttr->guid, &pwszClassID);
! RegKey key;
if( key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal\\Plugins" )) == ERROR_SUCCESS )
! if(key.SetDWORDValue(OLE2A(pwszClassID), (DWORD)0x1) == ERROR_SUCCESS)
bSuccess = true;
|