IopResetEvent

VOID __stdcall IopResetEvent(FILE_OBJECT *FileObject){
  unsigned __int8 CurrentIrql; 
  UINT64 SpinCount; 
  if( (FileObject->Flags & 0x4000000) == 0 )
  {
    CurrentIrql = KeGetCurrentIrql();
    __writecr8(2ui64);
    LODWORD(SpinCount) = 0;
    while( _interlockedbittestandset(&FileObject->Event.Header.Lock, 7u) )
    {
      do
        KeYieldProcessorEx(&SpinCount);
      while( (FileObject->Event.Header.Lock & 0x80u) != 0 );
    }
    FileObject->Event.Header.SignalState = 0;
    _InterlockedAnd(&FileObject->Event.Header.Lock, 0xFFFFFF7F);
    __writecr8(CurrentIrql);
  }
}

Referenced by:

IopCloseFile
IopSetEaOrQuotaInformationFile
IopXxxControlFile
NtFlushBuffersFileEx
NtLockFile
NtNotifyChangeDirectoryFileEx
NtQueryEaFile
NtQueryInformationFile
NtQueryQuotaInformationFile
NtQueryVolumeInformationFile
NtReadFile
NtReadFileScatter
NtSetEaFile
NtSetInformationFile
NtUnlockFile
NtWriteFile
NtWriteFileGather