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 PcNewPort( PPORT *OutPort, REFCLSID ClassID );
Output pointer for the port-driver object created by this function. This parameter points to a caller-allocated pointer variable into which the function outputs the pointer to the newly created IPort object. This object has the port interface that is specified by the ClassId parameter. Specify a valid, non-NULL pointer value for this parameter.
Specifies the type of port interface that is being requested. For more information, see the following Remarks section.
PcNewPort returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code.
The ClassId parameter can be set to one of the GUIDs in the following table.
|Class GUID||Port Interface Name|
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.
For more information about creating port and miniport drivers for subdevices, see Subdevice Creation.
The OutPort parameter follows the reference-counting conventions for COM objects.
|Minimum supported client||The PortCls system driver implements the PcNewPort function in Microsoft Windows 98/Me and in Windows 2000 and later operating systems.|
|Header||portcls.h (include Portcls.h)|