IopDeviceRemovalForResetComplete

VOID __stdcall IopDeviceRemovalForResetComplete(VOID *Context, const WCHAR *a2, const _GUID *a3){
  UINT64 *v3; 
  int v5; 
  __int64 v6; 
  __int64 v7; 
  __int64 v8; 
  UINT64 v9; 
  const _NTSTRSAFE_PCWSTR *v10; 
  __int64 v11; 
  __int16 v12; 
  signed __int64 v13; 
  _UNICODE_STRING *v14; 
  WCHAR **v15; 
  UINT64 *v16; 
  UINT64 dwFlags; 
  UINT64 pcchDest; 
  WCHAR *ppszDest; 

  if( !Context )
    __fastfail(5u);
  v5 = *((_DWORD *)Context + 41);
  if( v5 >= 0 || !*((_DWORD *)Context + 40) )
  {
    v6 = *((_QWORD *)Context + 23);
    v7 = v6 ? *(_QWORD *)(*(_QWORD *)(v6 + 312) + 40i64) : 0i64;
    if( (byte_140C130BB & 8) != 0 )
    {
      v8 = *((_QWORD *)Context + 21);
      McTemplateK0hzr0qqhzr4_EtwWriteTransfer(
        *(_QWORD *)(v8 + 56),
        *(_QWORD *)(v8 + 48),
        **(_WORD **)(v8 + 56) >> 1,
        *(_WORD *)(v7 + 40) >> 1,
        *(_QWORD *)(v7 + 48),
        v5,
        **(_DWORD **)(v8 + 48),
        **(_WORD **)(v8 + 56) >> 1,
        *(_QWORD *)(*(_QWORD *)(v8 + 56) + 8i64));
    }
  }
  if( v5 >= 0 || *((_DWORD *)Context + 48) == 13 || *((_DWORD *)Context + 44) >= *(&stru_140C452E0 + 6) )
  {
    PnpTraceDeviceRemovalForResetComplete();
    IopFreeResetRemovalContext((_RESET_REMOVAL_CONTEXT *)Context);
  }
  else
  {
    if( _InterlockedExchangeAdd((volatile signed __int32 *)(*((_QWORD *)Context + 21) + 64i64), 0xFFFFFFFF) == 1 )
      ExFreePoolWithTag(*((PVOID *)Context + 21), 0x4B706E50u);
    *((_DWORD *)Context + 40) = v5;
    *((_QWORD *)Context + 21) = 0i64;
    *((_DWORD *)Context + 48) = 0;
    ppszDest = 0i64;
    pcchDest = 0i64;
    if( RtlUnicodeStringValidateDestWorker(
           (_UNICODE_STRING *)((char *)Context + 200),
           &ppszDest,
           &pcchDest,
           v3,
           v14,
           v15,
           v16,
           dwFlags) >= 0 )
    {
      v9 = pcchDest;
      v10 = &dword_1407CF120;
      v11 = 0x7FFFi64;
      v12 = 0;
      if( pcchDest )
      {
        v13 = (char *)ppszDest - (char *)&dword_1407CF120;
        do
        {
          if( !v11 )
            break;
          if( !*(_WORD *)v10 )
            break;
          *(_WORD *)((char *)v10 + v13) = *(_WORD *)v10;
          --v11;
          v10 = (const _NTSTRSAFE_PCWSTR *)((char *)v10 + 2);
          ++v12;
        }
        while( v11 + v9 - 0x7FFF );
      }
      *((_WORD *)Context + 100) = 2 * v12;
    }
    ++*((_DWORD *)Context + 44);
    KiSetTimerEx((_KTIMER *)Context, *(&stru_140C452E0 + 4), 0i64, 0, (_KDPC *)Context + 1);
  }
}

Referenced by:

No references.