2015-04-02 22:27:58 +08:00
|
|
|
#pragma once
|
2016-01-05 23:01:17 +08:00
|
|
|
|
2015-04-02 22:27:58 +08:00
|
|
|
#include "ITH.h"
|
|
|
|
#include "utility.h" // UniqueHandle, CriticalSection
|
|
|
|
|
|
|
|
class Profile;
|
|
|
|
|
|
|
|
class ProfileManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProfileManager();
|
|
|
|
~ProfileManager();
|
2016-01-05 23:01:17 +08:00
|
|
|
Profile* CreateProfile(DWORD pid);
|
|
|
|
Profile* GetProfile(DWORD pid);
|
|
|
|
Profile* GetProfile(const std::wstring& path);
|
|
|
|
void LoadProfiles();
|
|
|
|
void SaveProfiles();
|
|
|
|
void DeleteProfile(const std::wstring& path);
|
|
|
|
void UpdateHookAddresses(DWORD pid);
|
2015-04-02 22:27:58 +08:00
|
|
|
bool HasProfile(const std::wstring& path);
|
|
|
|
private:
|
|
|
|
typedef std::unique_ptr<Profile> profile_ptr;
|
|
|
|
typedef std::map<std::wstring, profile_ptr> profile_map;
|
|
|
|
|
|
|
|
ProfileManager(const ProfileManager&);
|
|
|
|
ProfileManager operator=(const ProfileManager&);
|
|
|
|
|
2016-01-05 23:01:17 +08:00
|
|
|
DWORD CountProfiles();
|
|
|
|
bool CreateProfile(pugi::xml_node game);
|
2015-04-02 22:27:58 +08:00
|
|
|
void WriteProfileXml(const std::wstring& path, Profile& pf, pugi::xml_node doc);
|
|
|
|
// locate profile with executable path
|
|
|
|
profile_map profile_tree;
|
|
|
|
CriticalSection cs;
|
|
|
|
};
|