internal int GetModuleNameString(DEBUG_MODNAME requestType, uint index, ulong baseAddress, StringBuilder sbpath, uint needed1, out uint needed2) { if (_symbols3 == null) { needed2 = 0; return(-1); } SetClientInstance(); return(_symbols3.GetModuleNameString(requestType, index, baseAddress, sbpath, needed1, out needed2)); }
internal int GetModuleNameString(DEBUG_MODNAME Which, int Index, ulong Base, StringBuilder Buffer, uint BufferSize, out uint NameSize) { if (_symbols3 == null) { NameSize = 0; return(-1); } SetClientInstance(); return(_symbols3.GetModuleNameString(Which, (uint)Index, Base, Buffer, BufferSize, out NameSize)); }
} // end property _DS private string _GetName(DEBUG_MODNAME which) { uint nameSizeHint; switch (which) { case DEBUG_MODNAME.IMAGE: nameSizeHint = NativeParams.ImageNameSize; break; case DEBUG_MODNAME.LOADED_IMAGE: nameSizeHint = NativeParams.LoadedImageNameSize; break; case DEBUG_MODNAME.MAPPED_IMAGE: nameSizeHint = NativeParams.MappedImageNameSize; break; case DEBUG_MODNAME.MODULE: nameSizeHint = NativeParams.ModuleNameSize; break; case DEBUG_MODNAME.SYMBOL_FILE: nameSizeHint = NativeParams.SymbolFileNameSize; break; default: var msg = Util.Sprintf("Unknown DEBUG_MODNAME value: {0}", which); Util.Fail(msg); throw new NotSupportedException(msg); } if (0 == nameSizeHint) { // Sometimes this happens, like for unloaded modules. (I don't know why, // since unloaded modules have names too...) nameSizeHint = 0; } return(Debugger.ExecuteOnDbgEngThread(() => { _BailIfMissingProcessContext(); using (new DbgEngContextSaver(Debugger, Target.Context)) { string name; CheckHr(_DS.GetModuleNameStringWide(which, DEBUG_ANY_ID, NativeParams.Base, nameSizeHint, out name)); return name; } })); } // end _GetName()
private string GetModuleName(out int hresult) { ulong moduleBase; hresult = _symbols.GetModuleByIndex(0, out moduleBase); if (hresult != HResult.Ok) return string.Empty; StringBuilder moduleName = new StringBuilder(Defaults.BufferSize); uint nameSize; DEBUG_MODNAME nameType = DEBUG_MODNAME.IMAGE; hresult = _symbols.GetModuleNameString(nameType, 0, moduleBase, moduleName, (uint)Defaults.BufferSize, out nameSize); if (hresult != HResult.Ok) return string.Empty; return moduleName.ToString(); }
internal int GetModuleNameString(DEBUG_MODNAME requestType, uint index, ulong baseAddress, StringBuilder sbpath, uint needed1, out uint needed2) { if (_symbols3 == null) { needed2 = 0; return -1; } SetClientInstance(); return _symbols3.GetModuleNameString(requestType, index, baseAddress, sbpath, needed1, out needed2); }
internal int GetModuleNameString(DEBUG_MODNAME Which, int Index, UInt64 Base, StringBuilder Buffer, UInt32 BufferSize, out UInt32 NameSize) { if (_symbols3 == null) { NameSize = 0; return -1; } SetClientInstance(); return _symbols3.GetModuleNameString(Which, (uint)Index, Base, Buffer, BufferSize, out NameSize); }