PnpFinalizeVetoedRemove

__int16 __fastcall PnpFinalizeVetoedRemove(__int64 a1, int a2, _UNICODE_STRING *a3){
  int *v3; 
  int v4; 
  _UNICODE_STRING *v8; 
  wchar_t *Buffer; 
  wchar_t *v10; 

  v3 = *(int **)(a1 + 48);
  v4 = 0;
  if( v3 )
    *v3 = a2;
  v8 = *(_UNICODE_STRING **)(a1 + 56);
  if( v8 && a3 )
    RtlCopyUnicodeString(v8, a3);
  LODWORD(Buffer) = *(_DWORD *)(a1 + 144);
  if( ((unsigned __int8)Buffer & 8) != 0 && a2 == 6 )
  {
    Buffer = a3->Buffer;
    v10 = (wchar_t *)((char *)Buffer + a3->Length);
    if( Buffer < v10 )
    {
      while( *Buffer != 92 || ++v4 != 3 )
      {
        if( ++Buffer >= v10 )
          return(__int16)Buffer;
      }
      LOWORD(Buffer) = (_WORD)Buffer - LOWORD(a3->Buffer);
      a3->Length = (unsigned __int16)Buffer;
    }
  }
  return(__int16)Buffer;
}

Referenced by:

PiCheckRemovalPreconditions
PiEventBuildPdoList
PiProcessQueryAndCancelRemoval
PnpProcessQueryRemoveAndEject