IopDeviceRemovalForResetComplete

VOID __stdcall IopDeviceRemovalForResetComplete(VOID *Context){
  UINT64 *v1; 
  int v3; 
  __int64 v4; 
  __int64 v5; 
  __int64 v6; 
  size_t v7; 
  const wchar_t *v8; 
  __int64 v9; 
  __int16 v10; 
  signed __int64 v11; 
  UNICODE_STRING *cchMax; 
  WCHAR **dwFlags; 
  UINT64 *v14; 
  UINT64 v15; 
  size_t pcchDest; 
  wchar_t *ppszDest; 
  if( !Context )
    __fastfail(5u);
  v3 = *((_DWORD *)Context + 41);
  if( v3 >= 0 || !*((_DWORD *)Context + 40) )
  {
    v4 = *((_QWORD *)Context + 23);
    v5 = v4 ? *(_QWORD *)(*(_QWORD *)(v4 + 312) + 40i64) : 0i64;
    if( (byte_140C130BB & 8) != 0 )
    {
      v6 = *((_QWORD *)Context + 21);
      McTemplateK0hzr0qqhzr4_EtwWriteTransfer(
        *(_QWORD *)(v6 + 56),
        *(_QWORD *)(v6 + 48),
        **(_WORD **)(v6 + 56) >> 1,
        *(_WORD *)(v5 + 40) >> 1,
        *(_QWORD *)(v5 + 48),
        v3,
        **(_DWORD **)(v6 + 48),
        **(_WORD **)(v6 + 56) >> 1,
        *(_QWORD *)(*(_QWORD *)(v6 + 56) + 8i64));
    }
  }
  if( v3 >= 0
    || *((_DWORD *)Context + 48) == 13
    || *((_DWORD *)Context + 44) >= (unsigned int)PnpResetMaximumRetryAttempts )
  {
    PnpTraceDeviceRemovalForResetComplete();
    IopFreeResetRemovalContext((CHAR *)Context);
  }
  else
  {
    if( _InterlockedExchangeAdd((volatile signed __int32 *)(*((_QWORD *)Context + 21) + 64i64), 0xFFFFFFFF) == 1 )
      ExFreePoolWithTag(*((PVOID *)Context + 21), 0x4B706E50u);
    *((_DWORD *)Context + 40) = v3;
    *((_QWORD *)Context + 21) = 0i64;
    *((_DWORD *)Context + 48) = 0;
    ppszDest = 0i64;
    pcchDest = 0i64;
    if( (int)RtlUnicodeStringValidateDestWorker(
                (UNICODE_STRING *)((char *)Context + 200),
                &ppszDest,
                &pcchDest,
                v1,
                cchMax,
                dwFlags,
                v14,
                v15) >= 0 )
    {
      v7 = pcchDest;
      v8 = &word_1407CF120;
      v9 = 0x7FFFi64;
      v10 = 0;
      if( pcchDest )
      {
        v11 = (char *)ppszDest - (char *)&word_1407CF120;
        do
        {
          if( !v9 )
            break;
          if( !*v8 )
            break;
          *(const wchar_t *)((char *)v8 + v11) = *v8;
          --v9;
          ++v8;
          ++v10;
        }
        while( v9 + v7 - 0x7FFF );
      }
      *((_WORD *)Context + 100) = 2 * v10;
    }
    ++*((_DWORD *)Context + 44);
    KiSetTimerEx((_KTIMER *)Context, PnpResetRetryInterval, 0i64, 0, (_KDPC *)Context + 1);
  }
}

Referenced by:

No references.