Obsolete Port Class Functions

The header file portcls.hdefines macros that contain the names of obsolete PortCls functions that have been replaced by new PortCls functions. These macros allow old source code that contains references to obsolete PortCls function names to be recompiled to use the new PortCls functions without requiring any edits to the source files.

When compiling source code that uses the obsolete names, define the parameter name PC_OLD_NAMES. This parameter can be defined by the compiler command-line argument "-DPC_OLD_NAMES" if that is more convenient than introducing the statement #define PC_OLD_NAMES into the source files themselves.

The following table lists the obsolete PortCls function names in the left column. For each obsolete name, the center column contains the name of the new PortCls function that replaces it.

Obsolete function name New function name Did arguments change?

AddAdapterDevice

PcAddAdapterDevice

YES

CompletePendingPropertyRequest

PcCompletePendingPropertyRequest

no

GetTimeInterval

PcGetTimeInterval

no

InitializeAdapterDriver

PcInitializeAdapterDriver

YES

NewDmaChannel

PcNewDmaChannel

no

NewMiniport

PcNewMiniport

no

NewPort

PcNewPort

no

NewResourceList

PcNewResourceList

no

NewResourceSublist

PcNewResourceSublist

no

NewServiceGroup

PcNewServiceGroup

no

RegisterPhysicalConnection

PcRegisterPhysicalConnection

YES

RegisterPhysicalConnectionFromExternal

PcRegisterPhysicalConnectionFromExternal

YES

RegisterPhysicalConnectionToExternal

PcRegisterPhysicalConnectionToExternal

YES

RegisterSubdevice

PcRegisterSubdevice

YES

In some cases, the change amounts to no more than a simple name change: The qualifier Pc is inserted at the beginning of the name to indicate that the function is implemented in PortCls. In other cases, however, the argument list has changed in addition to the name of the function. The right column in the preceding table indicates whether the arguments have changed.

In cases in which the arguments changed, the macros in portcls.hconvert the argument lists for the obsolete PortCls functions to the equivalent arguments for the new PortCls functions. The following macros contain argument conversions:

#define InitializeAdapterDriver(c1,c2,a) \
    PcInitializeAdapterDriver(PDRIVER_OBJECT(c1),PUNICODE_STRING(c2),PDRIVER_ADD_DEVICE(a))
#define AddAdapterDevice(c1,c2,s,m) \
    PcAddAdapterDevice(PDRIVER_OBJECT(c1),PDEVICE_OBJECT(c2),s,m,0)
#define RegisterSubdevice(c1,c2,n,u) \
    PcRegisterSubdevice(PDEVICE_OBJECT(c1),n,u)
#define RegisterPhysicalConnection(c1,c2,fs,fp,ts,tp) \
    PcRegisterPhysicalConnection(PDEVICE_OBJECT(c1),fs,fp,ts,tp)
#define RegisterPhysicalConnectionToExternal(c1,c2,fs,fp,ts,tp) \
    PcRegisterPhysicalConnectionToExternal(PDEVICE_OBJECT(c1),fs,fp,ts,tp)
#define RegisterPhysicalConnectionFromExternal(c1,c2,fs,fp,ts,tp) \
    PcRegisterPhysicalConnectionFromExternal(PDEVICE_OBJECT(c1),fs,fp,ts,tp)