MCPcopy Create free account
hub / github.com/Rat431/ColdAPI_Steam / ColdAPI_GetSteamInstallPath

Function ColdAPI_GetSteamInstallPath

src/ColdAPI_Steam/ColdManager.cpp:743–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741 static char SteamDir[MAX_PATH] = { 0 };
742 static char CurrentDirectory[MAX_PATH] = { 0 };
743 const char* ColdAPI_GetSteamInstallPath()
744 {
745 if (std::strcmp(SteamDir, STEAM_NOTINSTALLED) == 0)
746 return CurrentDirectory;
747 if (std::strlen(SteamDir) == NULL)
748 {
749 HKEY Registrykey;
750 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, Steamregistry, 0, KEY_QUERY_VALUE, &Registrykey) == ERROR_SUCCESS)
751 {
752 DWORD Size = MAX_PATH;
753 RegQueryValueExA(Registrykey, "InstallPath", NULL, NULL, (BYTE*)SteamDir, &Size);
754 RegCloseKey(Registrykey);
755 }
756 else
757 {
758 std::strcpy(SteamDir, STEAM_NOTINSTALLED);
759 GetCurrentDirectoryA(MAX_PATH, CurrentDirectory);
760 return CurrentDirectory;
761 }
762 }
763 return SteamDir;
764 }
765 void SetOverlayNotification(int Value)
766 {
767 FARPROC SetNotificationPositionExt = GetProcAddress(OverLayModule, "SetNotificationPosition"); // Load SetNotificationPosition from STEAMOVERLAY module

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected