Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions Core/Libraries/Source/WWVegas/WWDownload/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <string>

#define WIN32_LEAN_AND_MEAN

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-profile+t+e

'WIN32_LEAN_AND_MEAN' : macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-profile+t+e

'WIN32_LEAN_AND_MEAN' : macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6+t+e

'WIN32_LEAN_AND_MEAN' : macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6+t+e

'WIN32_LEAN_AND_MEAN' : macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-releaselog+t+e

'WIN32_LEAN_AND_MEAN' : macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-debug+t+e

'WIN32_LEAN_AND_MEAN': macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32+t+e

'WIN32_LEAN_AND_MEAN': macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-profile+t+e

'WIN32_LEAN_AND_MEAN': macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32+t+e

'WIN32_LEAN_AND_MEAN': macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-debug+t+e

'WIN32_LEAN_AND_MEAN': macro redefinition

Check warning on line 25 in Core/Libraries/Source/WWVegas/WWDownload/registry.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-profile+t+e

'WIN32_LEAN_AND_MEAN': macro redefinition
#include <windows.h>

#include "Registry.h"
Expand Down Expand Up @@ -120,12 +120,12 @@
#endif

fullPath.append(path);
if (getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.c_str(), key.c_str(), val))
if (getStringFromRegistry(HKEY_CURRENT_USER, fullPath.c_str(), key.c_str(), val))
{
return true;
}

return getStringFromRegistry(HKEY_CURRENT_USER, fullPath.c_str(), key.c_str(), val);
return getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.c_str(), key.c_str(), val);
}

bool GetUnsignedIntFromRegistry(std::string path, std::string key, unsigned int& val)
Expand All @@ -137,12 +137,12 @@
#endif

fullPath.append(path);
if (getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.c_str(), key.c_str(), val))
if (getUnsignedIntFromRegistry(HKEY_CURRENT_USER, fullPath.c_str(), key.c_str(), val))
{
return true;
}

return getUnsignedIntFromRegistry(HKEY_CURRENT_USER, fullPath.c_str(), key.c_str(), val);
return getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.c_str(), key.c_str(), val);
}

bool SetStringInRegistry( std::string path, std::string key, std::string val)
Expand All @@ -154,9 +154,6 @@
#endif
fullPath.append(path);

if (setStringInRegistry( HKEY_LOCAL_MACHINE, fullPath, key, val))
return true;

return setStringInRegistry( HKEY_CURRENT_USER, fullPath, key, val );
}

Expand All @@ -169,9 +166,6 @@
#endif
fullPath.append(path);

if (setUnsignedIntInRegistry( HKEY_LOCAL_MACHINE, fullPath, key, val))
return true;

return setUnsignedIntInRegistry( HKEY_CURRENT_USER, fullPath, key, val );
}

8 changes: 4 additions & 4 deletions Generals/Code/GameEngine/Source/Common/System/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ Bool GetStringFromRegistry(AsciiString path, AsciiString key, AsciiString& val)

fullPath.concat(path);
DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s", fullPath.str(), key.str()));
if (getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val))
if (getStringFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val))
{
return TRUE;
}

return getStringFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val);
return getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val);
}

Bool GetUnsignedIntFromRegistry(AsciiString path, AsciiString key, UnsignedInt& val)
Expand All @@ -135,12 +135,12 @@ Bool GetUnsignedIntFromRegistry(AsciiString path, AsciiString key, UnsignedInt&

fullPath.concat(path);
DEBUG_LOG(("GetUnsignedIntFromRegistry - looking in %s for key %s", fullPath.str(), key.str()));
if (getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val))
if (getUnsignedIntFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val))
{
return TRUE;
}

return getUnsignedIntFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val);
return getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val);
}

AsciiString GetRegistryLanguage(void)
Expand Down
12 changes: 6 additions & 6 deletions GeneralsMD/Code/GameEngine/Source/Common/System/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ Bool GetStringFromGeneralsRegistry(AsciiString path, AsciiString key, AsciiStrin

fullPath.concat(path);
DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s", fullPath.str(), key.str()));
if (getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val))
if (getStringFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val))
{
return TRUE;
}

return getStringFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val);
return getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val);
}

Bool GetStringFromRegistry(AsciiString path, AsciiString key, AsciiString& val)
Expand All @@ -135,12 +135,12 @@ Bool GetStringFromRegistry(AsciiString path, AsciiString key, AsciiString& val)

fullPath.concat(path);
DEBUG_LOG(("GetStringFromRegistry - looking in %s for key %s", fullPath.str(), key.str()));
if (getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val))
if (getStringFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val))
{
return TRUE;
}

return getStringFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val);
return getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val);
}

Bool GetUnsignedIntFromRegistry(AsciiString path, AsciiString key, UnsignedInt& val)
Expand All @@ -149,12 +149,12 @@ Bool GetUnsignedIntFromRegistry(AsciiString path, AsciiString key, UnsignedInt&

fullPath.concat(path);
DEBUG_LOG(("GetUnsignedIntFromRegistry - looking in %s for key %s", fullPath.str(), key.str()));
if (getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val))
if (getUnsignedIntFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val))
{
return TRUE;
}

return getUnsignedIntFromRegistry(HKEY_CURRENT_USER, fullPath.str(), key.str(), val);
return getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.str(), key.str(), val);
}

AsciiString GetRegistryLanguage(void)
Expand Down
Loading