Edit

Share via


IDebugBreakpointRequest2::GetLocationType

Gets the breakpoint location type of this breakpoint request.

Syntax

int GetLocationType(
    out enum_BP_LOCATION_TYPE pBPLocationType
);

Parameters

pBPLocationType
[out] Returns a value from the BP_LOCATION_TYPE enumeration that describes the location of this breakpoint request.

Return Value

If successful, returns S_OK; otherwise, returns an error code. Returns E_FAIL if the bpLocation field in the associated BP_REQUEST_INFO structure is not valid.

Example

The following example shows how to implement this method for a simple CDebugBreakpointRequest object that exposes theIDebugBreakpointRequest2 interface.

HRESULT CDebugBreakpointRequest::GetLocationType(BP_LOCATION_TYPE* pBPLocationType)
{
    HRESULT hr;

    if (pBPLocationType)
    {
        // Set default BP_LOCATION_TYPE.
        *pBPLocationType = BPLT_NONE;

        // Check if the BPREQI_BPLOCATION flag is set in BPREQI_FIELDS.
        if (IsFlagSet(m_bpRequestInfo.dwFields, BPREQI_BPLOCATION))
        {
            // Get the new BP_LOCATION_TYPE.
            *pBPLocationType = m_bpRequestInfo.bpLocation.bpLocationType;
            hr = S_OK;
        }
        else
        {
            hr = E_FAIL;
        }
    }
    else
    {
        hr = E_INVALIDARG;
    }

    return hr;
}

See also