/// <summary>
/// Gets the breakpoint resolution information that describes this breakpoint.
/// (http://msdn.microsoft.com/en-us/library/bb146743.aspx)
/// </summary>
/// <param name="dwFields"> A combination of flags that determine which fields of the pBPResolutionInfo parameter are to be filled out. </param>
/// <param name="pBPResolutionInfo"> The BP_RESOLUTION_INFO structure to be filled in with information about this breakpoint. </param>
/// <returns> VSConstants.S_OK. </returns>
int IDebugBreakpointResolution2.GetResolutionInfo(enum_BPRESI_FIELDS dwFields, BP_RESOLUTION_INFO[] pBPResolutionInfo)
{
if ((dwFields & enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION) != 0)
{
// The sample engine only supports code breakpoints.
BP_RESOLUTION_LOCATION location = new BP_RESOLUTION_LOCATION();
location.bpType = (uint)enum_BP_TYPE.BPT_CODE;
// The debugger will not QI the IDebugCodeContex2 interface returned here. We must pass the pointer
// to IDebugCodeContex2 and not IUnknown.
AD7MemoryAddress codeContext = new AD7MemoryAddress(m_engine, m_address);
codeContext.SetDocumentContext(m_documentContext);
location.unionmember1 = Marshal.GetComInterfaceForObject(codeContext, typeof(IDebugCodeContext2));
pBPResolutionInfo[0].bpResLocation = location;
pBPResolutionInfo[0].dwFields |= enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION;
}
if ((dwFields & enum_BPRESI_FIELDS.BPRESI_PROGRAM) != 0)
{
pBPResolutionInfo[0].pProgram = (IDebugProgram2)m_engine;
pBPResolutionInfo[0].dwFields |= enum_BPRESI_FIELDS.BPRESI_PROGRAM;
}
return(VSConstants.S_OK);
}