PpProfileCancelHardwareProfileTransition

INT64 __stdcall PpProfileCancelHardwareProfileTransition(){
  __int64 *i; 
  INT64 result; 
  ExAcquireFastMutex(&PiProfileDeviceListLock);
  for( i = (__int64 *)PiProfileDeviceListHead; i != &PiProfileDeviceListHead; i = (__int64 *)*i )
  {
    if( *((_DWORD *)i - 2) != 1 )
    {
      _InterlockedDecrement(&PiProfileDevicesInTransition);
      *((_DWORD *)i - 2) = 1;
    }
  }
  KeReleaseGuardedMutex(&PiProfileDeviceListLock);
  if( PiProfileChangeCancelRequired )
    PnpRequestHwProfileChangeNotification(&GUID_HWPROFILE_CHANGE_CANCELLED, 2, 0i64, 0i64);
  LODWORD(result) = KeReleaseSemaphore(&PiProfileChangeSemaphore, 0i64, 1i64, 0);
  return result;
}

Referenced by:

PipProcessStartPhase2
PnpProcessQueryRemoveAndEject