Skip to content

Commit

Permalink
Remove HKLM registry interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
gorlak committed Feb 20, 2021
1 parent 5aa29a0 commit d701c94
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 36 deletions.
1 change: 0 additions & 1 deletion Source/common/ExceptionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,6 @@ static void WriteMiniDump(LPCTSTR pszPath, PEXCEPTION_POINTERS pExceptPtrs)

void WriteRegistryDetails(LPCTSTR pszPath)
{
WriteRegistryTreeToFile(_T("HKLM\\Software\\Perforce"), pszPath);
WriteRegistryTreeToFile(_T("HKCU\\Software\\Perforce"), pszPath);
}

Expand Down
7 changes: 0 additions & 7 deletions Source/gui/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,13 +615,6 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)

MainFrameCWnd = this;

// Vista sucks and won't let us write to HKEY_LOCAL_MACHINE
// unless we have elevated privilages. But those writes
// happen in the p4api and don't return status. So write
// a dummy key for testing and report any failure.

GET_P4REGPTR()->TestRegWrite2HKLM();

// This timer is here to support auto-update and miscellaneous
// tasks. Will result in OnTimer() being called every .2 secs.
// The interval is a compromise between
Expand Down
27 changes: 0 additions & 27 deletions Source/gui/P4Registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4931,33 +4931,6 @@ void CP4Registry::WriteVirginRegistry()
RegCloseKey(key);
}

BOOL CP4Registry::TestRegWrite2HKLM()
{
HKEY hKey = NULL;
CString sKey = _T("Software\\Perforce\\environment\\");
DWORD disposition;
TCHAR test[] = _T("test");
LONG rc;
if ( (rc = RegCreateKeyEx( HKEY_LOCAL_MACHINE, sKey,
0, NULL,
REG_OPTION_NON_VOLATILE,
KEY_READ|KEY_WRITE, NULL,
&hKey, &disposition )) == ERROR_SUCCESS )
{
disposition = sizeof(test);
rc = RegSetValueEx(hKey, _T("P4Win"), NULL, REG_SZ,
(LPBYTE)test, disposition);
}

if (rc != ERROR_SUCCESS )
{
RegWriteFailed(rc);
return FALSE;
}
return TRUE;
}


void CP4Registry::RegWriteFailed(LONG rc)
{
LPVOID lpMsgBuf;
Expand Down
1 change: 0 additions & 1 deletion Source/gui/P4Registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ class CP4Registry
void ReadDiffAssocList();
void ReadMergeAssocList();
CString GetPasswordfromReg( );
BOOL TestRegWrite2HKLM();

protected:
POSITION FindAssociation(LPCTSTR extension);
Expand Down

0 comments on commit d701c94

Please sign in to comment.