The PcNewPort function creates a new system-supplied port-driver object, whose interface (derived from base class IPort) is specified by a class ID.
PORTCLASSAPI NTSTATUS NTAPI
PcNewPort(
OUT PPORT *OutPort,
IN REFCLSID ClassId
);
PcNewPort returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code.
Declared in portcls.h. Include portcls.h.
The ClassId parameter can be set to one of the GUIDs in the following table.
| Class GUID | Port Interface Name |
|---|---|
| CLSID_PortDMus | IPortDMus |
| CLSID_PortMidi | IPortMidi |
| CLSID_PortTopology | IPortTopology |
| CLSID_PortWaveCyclic | IPortWaveCyclic |
| CLSID_PortWavePci | IPortWavePci |
CLSID_PortDMus is defined in header file dmusicks.h. The other four GUIDs in the preceding table are defined in portcls.h.
In Microsoft® Windows® XP and later, the MIDI and DirectMusic port drivers share the same internal software implementation. This means that the CLSID_PortMidi GUID is equivalent to CLSID_PortDMus.
See Subdevice Creation for more information on creating port and miniport drivers for subdevices.
The OutPort parameter follows the reference-counting conventions for COM objects.
IPort, IPortDMus, IPortMidi, IPortTopology, IPortWaveCyclic, IPortWavePci