mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-01 08:43:01 +05:00
Added proper comments to ModuleList
This commit is contained in:
parent
614354ec8a
commit
abbf99a79d
1 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,8 @@
|
||||||
class ModuleList
|
class ModuleList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// Initializes module list
|
||||||
|
// Needs to be called before any calls to Get or GetAll
|
||||||
void Enumerate()
|
void Enumerate()
|
||||||
{
|
{
|
||||||
constexpr size_t INITIAL_SIZE = sizeof(HMODULE) * 256;
|
constexpr size_t INITIAL_SIZE = sizeof(HMODULE) * 256;
|
||||||
|
@ -66,17 +68,20 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recreates module list
|
||||||
void ReEnumerate()
|
void ReEnumerate()
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
Enumerate();
|
Enumerate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clears module list
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
m_moduleList.clear();
|
m_moduleList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gets handle of a loaded module with given name, NULL otherwise
|
||||||
HMODULE Get( const wchar_t* moduleName ) const
|
HMODULE Get( const wchar_t* moduleName ) const
|
||||||
{
|
{
|
||||||
// If vector is empty then we're trying to call it without calling Enumerate first
|
// If vector is empty then we're trying to call it without calling Enumerate first
|
||||||
|
@ -88,6 +93,7 @@ public:
|
||||||
return it != m_moduleList.end() ? it->first : nullptr;
|
return it != m_moduleList.end() ? it->first : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gets handles to all loaded modules with given name
|
||||||
std::vector<HMODULE> GetAll( const wchar_t* moduleName ) const
|
std::vector<HMODULE> GetAll( const wchar_t* moduleName ) const
|
||||||
{
|
{
|
||||||
// If vector is empty then we're trying to call it without calling Enumerate first
|
// If vector is empty then we're trying to call it without calling Enumerate first
|
||||||
|
@ -142,7 +148,7 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_moduleList.emplace_back( *modules, nameBegin );
|
m_moduleList.emplace_back( *modules, nameBegin );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modules++;
|
modules++;
|
||||||
|
|
Loading…
Reference in a new issue