PiControlGetDeviceDepth

INT64 __stdcall PiControlGetDeviceDepth(
        _PLUGPLAY_CONTROL_CLASS PnPControlClass,
        _PLUGPLAY_CONTROL_DEPTH_DATA *DepthData,
        UINT64 PnPControlDataLength,
        CHAR CallerMode){
  unsigned int Length; 
  INT64 result; 
  unsigned int DeviceDepth; 
  UINT64 AllocateDestination; 
  _UNICODE_STRING DeviceInstance; 
  Length = DepthData->DeviceInstance.Length;
  DeviceInstance = 0i64;
  DeviceInstance.MaximumLength = Length;
  DeviceInstance.Length = Length;
  if( (unsigned __int16)(Length - 1) > 0x18Fu || (Length & 1) != 0 )
    return 3221225485i64;
  LODWORD(AllocateDestination) = 1;
  result = PiControlMakeUserModeCallersCopy(
             (VOID **)&DeviceInstance.Buffer,
             DepthData->DeviceInstance.Buffer,
             Length,
             2ui64,
             CallerMode,
             AllocateDestination);
  if( (int)result >= 0 )
  {
    DeviceDepth = PiGetDeviceDepth(&DeviceInstance, (UINT64 *)&DepthData->Depth);
    PiControlFreeUserModeCallersBuffer(CallerMode, DeviceInstance.Buffer);
    return DeviceDepth;
  }
  return result;
}

Referenced by:

No references.