共用方式為


IDebugPortSupplier2

This interface supplies ports to the session debug manager (SDM).

IDebugPortSupplier2 : IUnknown

Notes for Implementers

A custom port supplier implements this interface to represent a port supplier.

Notes for Callers

A call to CoCreateInstance with a port supplier's GUID returns this interface (this is the typical way to obtain this interface). For example:

IDebugPortSupplier2 *GetPortSupplier(GUID *pPortSupplierGuid)
{
    IDebugPortSupplier2 *pPS = NULL;
    if (pPortSupplierGuid != NULL) {
        CComPtr<IDebugPortSupplier2> spPortSupplier;
        spPortSupplier.CoCreateInstance(*pPortSupplierGuid);
        if (spPortSupplier != NULL) {
            pPS = spPortSupplier.Detach();
        }
    }
    return (pPS);
}

A call to IDebugCoreServer2::GetPortSupplier returns this interface, representing the current port supplier being used by Visual Studio.

IDebugPort2::GetPortSupplier returns this interface, representing the port supplier that created the port.

IEnumDebugPortSuppliers2 represents a list of IDebugPortSupplier interfaces (the IEnumDebugPortSuppliers interface is obtained from IDebugCoreServer2::EnumPortSuppliers, representing all of the port suppliers registered with Visual Studio).

A debug engine typically does not interact with a port supplier.

Methods in Vtable Order

The following table shows the methods of IDebugPortSupplier2.

Method

Description

IDebugPortSupplier2::GetPortSupplierName

Gets the port supplier name.

IDebugPortSupplier2::GetPortSupplierId

Gets the port supplier identifier.

IDebugPortSupplier2::GetPort

Gets a port from a port supplier.

IDebugPortSupplier2::EnumPorts

Enumerates the ports that already exist.

IDebugPortSupplier2::CanAddPort

Verifies that a port supplier supports adding new ports.

IDebugPortSupplier2::AddPort

Adds a port.

IDebugPortSupplier2::RemovePort

Removes a port.

Remarks

A port supplier can identify itself by name and ID, add and remove ports, and enumerate all ports that the port supplier provides.

Requirements

Header: msdbg.h

Namespace: Microsoft.VisualStudio.Debugger.Interop

Assembly: Microsoft.VisualStudio.Debugger.Interop.dll

See Also

Reference

IDebugPort2::GetPortSupplier

IDebugCoreServer2::GetPortSupplier

IEnumDebugPortSuppliers2

Concepts

Core Interfaces