More optimization.

This commit is contained in:
momo5502
2016-01-24 21:08:14 +01:00
parent 388d5836cd
commit ba3187ce9e
12 changed files with 22 additions and 32 deletions

View File

@ -51,7 +51,7 @@ namespace Steam
unsigned __int64 Matchmaking::CreateLobby(int eLobbyType, int cMaxMembers)
{
uint64_t result = Callbacks::RegisterCall();
LobbyCreated* retvals = new LobbyCreated;
LobbyCreated* retvals = ::Utils::Memory::AllocateArray<LobbyCreated>();
SteamID id;
id.AccountID = 1337132;
@ -72,7 +72,7 @@ namespace Steam
unsigned __int64 Matchmaking::JoinLobby(SteamID steamIDLobby)
{
uint64_t result = Callbacks::RegisterCall();
LobbyEnter* retvals = new LobbyEnter;
LobbyEnter* retvals = ::Utils::Memory::AllocateArray<LobbyEnter>();
retvals->m_bLocked = false;
retvals->m_EChatRoomEnterResponse = 1;
retvals->m_rgfChatPermissions = 0xFFFFFFFF;

View File

@ -61,7 +61,7 @@ namespace Steam
if (result.data)
{
delete[] result.data;
::Utils::Memory::Free(result.data);
}
}
@ -77,9 +77,9 @@ namespace Steam
if (!Overlay)
{
HKEY hRegKey;
char steamPath[MAX_PATH] = { 0 };
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Valve\\Steam", 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS)
{
char steamPath[MAX_PATH] = { 0 };
DWORD dwLength = sizeof(steamPath);
RegQueryValueExA(hRegKey, "InstallPath", NULL, NULL, reinterpret_cast<BYTE*>(steamPath), &dwLength);
RegCloseKey(hRegKey);