Anmerkung
Der Zugriff auf diese Seite erfordert eine Genehmigung. Du kannst versuchen, dich anzumelden oder die Verzeichnisse zu wechseln.
Der Zugriff auf diese Seite erfordert eine Genehmigung. Du kannst versuchen , die Verzeichnisse zu wechseln.
Ruft das Layout lokaler Variablen für eine Reihe von Methoden ab.
Syntax
int GetLocalVariablelayout(
uint ulAppDomainID,
Guid guidModule,
uint cMethods,
int[] rgMethodTokens,
out IStream pStreamLayout
);
Parameter
ulAppDomainID
[in] Bezeichner der Anwendung Standard.
guidModule
[in] Eindeutiger Bezeichner des Moduls.
cMethods
[in] Anzahl der Methodentoken im rgMethodTokens Array.
rgMethodTokens
[in] Array von Methodentoken.
pStreamLayout
[out] Ein Textstream, der das Variablelayout enthält.
Rückgabewert
Wenn die Ausführung erfolgreich ist, wird S_OK, andernfalls ein Fehlercode zurückgegeben.
Beispiel
Das folgende Beispiel zeigt, wie Sie diese Methode für ein CDebugSymbolProvider -Objekt implementieren, das die IDebugComPlusSymbolProvider-Schnittstelle verfügbar macht.
HRESULT CDebugSymbolProvider::GetLocalVariablelayout(
ULONG32 ulAppDomainID,
GUID guidModule,
ULONG32 cMethods,
_mdToken rgMethodTokens[],
IStream** ppStreamLayout)
{
HRESULT hr = S_OK;
METHOD_ENTRY(CDebugSymbolProvider::GetLocalVariablelayout);
CComPtr<ISymUnmanagedReader> symReader;
IfFailRet(GetSymUnmanagedReader(ulAppDomainID, guidModule, (IUnknown **) &symReader));
CComPtr<IStream> stream;
IfFailRet(CreateStreamOnHGlobal(NULL, true, &stream));
for (ULONG32 iMethod = 0; iMethod < cMethods; iMethod += 1)
{
CComPtr<ISymUnmanagedMethod> method;
IfFailRet(symReader->GetMethod(rgMethodTokens[iMethod], &method));
CComPtr<ISymUnmanagedScope> rootScope;
IfFailRet(method->GetRootScope(&rootScope));
//
// Add the method's variables to the stream
//
IfFailRet(AddScopeToStream(rootScope, 0, stream));
// do end of method marker
ULONG32 depth = 0xFFFFFFFF;
ULONG cb = 0;
IfFailRet(stream->Write(&depth, sizeof(depth), &cb));
}
LARGE_INTEGER pos;
pos.QuadPart = 0;
IfFailRet(stream->Seek(pos, STREAM_SEEK_SET, 0));
*ppStreamLayout = stream.Detach();
METHOD_EXIT(CDebugSymbolProvider::GetLocalVariablelayout, hr);
return hr;
}