mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 14:20:29 +00:00
[PDB] Get more DIA table enumerators
Rename the original function and make it a static template. llvm-svn: 328177
This commit is contained in:
parent
19a250a7ce
commit
889ee6858f
@ -327,9 +327,10 @@ std::unique_ptr<IPDBEnumTables> DIASession::getEnumTables() const {
|
||||
return llvm::make_unique<DIAEnumTables>(DiaEnumerator);
|
||||
}
|
||||
|
||||
static CComPtr<IDiaEnumInjectedSources>
|
||||
getEnumInjectedSources(IDiaSession &Session) {
|
||||
CComPtr<IDiaEnumInjectedSources> EIS;
|
||||
template <class T>
|
||||
static CComPtr<T>
|
||||
getTableEnumerator(IDiaSession &Session) {
|
||||
CComPtr<T> Enumerator;
|
||||
CComPtr<IDiaEnumTables> ET;
|
||||
CComPtr<IDiaTable> Table;
|
||||
ULONG Count = 0;
|
||||
@ -340,15 +341,16 @@ getEnumInjectedSources(IDiaSession &Session) {
|
||||
while (ET->Next(1, &Table, &Count) == S_OK && Count == 1) {
|
||||
// There is only one table that matches the given iid
|
||||
if (S_OK ==
|
||||
Table->QueryInterface(__uuidof(IDiaEnumInjectedSources), (void **)&EIS))
|
||||
Table->QueryInterface(__uuidof(T), (void **)&Enumerator))
|
||||
break;
|
||||
Table.Release();
|
||||
}
|
||||
return EIS;
|
||||
return Enumerator;
|
||||
}
|
||||
std::unique_ptr<IPDBEnumInjectedSources>
|
||||
DIASession::getInjectedSources() const {
|
||||
CComPtr<IDiaEnumInjectedSources> Files = getEnumInjectedSources(*Session);
|
||||
CComPtr<IDiaEnumInjectedSources> Files =
|
||||
getTableEnumerator<IDiaEnumInjectedSources>(*Session);
|
||||
if (!Files)
|
||||
return nullptr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user