Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadDirectoryChangesCallback()

void System.IO.FileSystemWatcher.ReadDirectoryChangesCallback ( uint errorCode,
uint numBytes,
AsyncReadState state )
inlineprivate

Definition at line 818 of file FileSystemWatcher.cs.

819 {
820 try
821 {
822 if (IsHandleInvalid(state.DirectoryHandle))
823 {
824 return;
825 }
826 switch (errorCode)
827 {
828 default:
829 OnError(new ErrorEventArgs(new Win32Exception((int)errorCode)));
830 EnableRaisingEvents = false;
831 break;
832 case 995u:
833 break;
834 case 0u:
835 if (state.Session == Volatile.Read(ref _currentSession))
836 {
837 if (numBytes == 0)
838 {
840 }
841 else
842 {
844 }
845 }
846 break;
847 }
848 }
849 finally
850 {
851 Monitor(state);
852 }
853 }
void OnError(ErrorEventArgs e)
unsafe void ParseEventBufferAndNotifyForEach(ReadOnlySpan< byte > buffer)
unsafe void Monitor(AsyncReadState state)
static bool IsHandleInvalid([NotNullWhen(false)] SafeFileHandle handle)
static bool Read(ref bool location)
Definition Volatile.cs:67

References System.IO.FileSystemWatcher._currentSession, System.IO.FileSystemWatcher.EnableRaisingEvents, System.IO.FileSystemWatcher.IsHandleInvalid(), System.IO.FileSystemWatcher.Monitor(), System.IO.FileSystemWatcher.NotifyInternalBufferOverflowEvent(), System.IO.FileSystemWatcher.OnError(), System.IO.FileSystemWatcher.ParseEventBufferAndNotifyForEach(), System.Threading.Volatile.Read(), and System.state.