@@ -63,12 +63,12 @@ public virtual void CloseFile(string fileName, IDokanFileInfo info)
6363 public virtual NtStatus FlushFileBuffers ( string fileName , IDokanFileInfo info )
6464 {
6565 if ( handlesManager . GetHandle < FileHandle > ( GetContextValue ( info ) ) is not { } fileHandle )
66- return Trace ( DokanResult . InvalidHandle , nameof ( FlushFileBuffers ) , fileName , info ) ;
66+ return Trace ( DokanResult . InvalidHandle , fileName , info ) ;
6767
6868 try
6969 {
7070 fileHandle . Stream . Flush ( ) ;
71- return Trace ( DokanResult . Success , nameof ( FlushFileBuffers ) , fileName , info ) ;
71+ return Trace ( DokanResult . Success , fileName , info ) ;
7272 }
7373 catch ( IOException )
7474 {
@@ -86,10 +86,10 @@ public virtual NtStatus FindFiles(string fileName, out IList<FileInformation> fi
8686 public virtual NtStatus SetEndOfFile ( string fileName , long length , IDokanFileInfo info )
8787 {
8888 if ( handlesManager . GetHandle < FileHandle > ( GetContextValue ( info ) ) is not { } fileHandle )
89- return Trace ( DokanResult . InvalidHandle , nameof ( SetEndOfFile ) , fileName , info ) ;
89+ return Trace ( DokanResult . InvalidHandle , fileName , info ) ;
9090
9191 fileHandle . Stream . SetLength ( length ) ;
92- return Trace ( DokanResult . Success , nameof ( SetEndOfFile ) , fileName , info ) ;
92+ return Trace ( DokanResult . Success , fileName , info ) ;
9393 }
9494
9595 /// <inheritdoc/>
@@ -107,27 +107,27 @@ public virtual NtStatus GetVolumeInformation(out string volumeLabel, out FileSys
107107 maximumComponentLength = volumeModel . MaximumComponentLength ;
108108 features = volumeModel . FileSystemFeatures ;
109109
110- return Trace ( DokanResult . Success , nameof ( GetVolumeInformation ) , null , info ) ;
110+ return Trace ( DokanResult . Success , null , info ) ;
111111 }
112112
113113 /// <inheritdoc/>
114114 public virtual NtStatus Mounted ( string mountPoint , IDokanFileInfo info )
115115 {
116116 _ = mountPoint ; // TODO: Check if mountPoint is different and update the RootFolder (?)
117- return Trace ( DokanResult . Success , nameof ( Mounted ) , null , info ) ;
117+ return Trace ( DokanResult . Success , null , info ) ;
118118 }
119119
120120 /// <inheritdoc/>
121121 public virtual NtStatus Unmounted ( IDokanFileInfo info )
122122 {
123- return Trace ( DokanResult . Success , nameof ( Unmounted ) , null , info ) ;
123+ return Trace ( DokanResult . Success , null , info ) ;
124124 }
125125
126126 /// <inheritdoc/>
127127 public virtual NtStatus FindStreams ( string fileName , out IList < FileInformation > streams , IDokanFileInfo info )
128128 {
129129 streams = Array . Empty < FileInformation > ( ) ;
130- return Trace ( DokanResult . NotImplemented , nameof ( FindStreams ) , fileName , info ) ;
130+ return Trace ( DokanResult . NotImplemented , fileName , info ) ;
131131 }
132132
133133 /// <inheritdoc/>
@@ -143,7 +143,7 @@ public virtual unsafe NtStatus ReadFile(string fileName, IntPtr buffer, uint buf
143143 if ( ciphertextPath is null )
144144 {
145145 bytesRead = 0 ;
146- return Trace ( DokanResult . PathNotFound , nameof ( ReadFile ) , fileName , info ) ;
146+ return Trace ( DokanResult . PathNotFound , fileName , info ) ;
147147 }
148148
149149 // Memory-mapped
@@ -170,22 +170,22 @@ public virtual unsafe NtStatus ReadFile(string fileName, IntPtr buffer, uint buf
170170 var bufferSpan = new Span < byte > ( buffer . ToPointer ( ) , ( int ) bufferLength ) ;
171171 bytesRead = fileHandle . Stream . Read ( bufferSpan ) ;
172172
173- return Trace ( DokanResult . Success , nameof ( ReadFile ) , fileName , info ) ;
173+ return Trace ( DokanResult . Success , fileName , info ) ;
174174 }
175175 catch ( PathTooLongException )
176176 {
177177 bytesRead = 0 ;
178- return Trace ( DokanResult . InvalidName , nameof ( ReadFile ) , fileName , info ) ;
178+ return Trace ( DokanResult . InvalidName , fileName , info ) ;
179179 }
180180 catch ( CryptographicException )
181181 {
182182 bytesRead = 0 ;
183- return Trace ( NtStatus . CrcError , nameof ( ReadFile ) , fileName , info ) ;
183+ return Trace ( NtStatus . CrcError , fileName , info ) ;
184184 }
185185 catch ( UnavailableStreamException )
186186 {
187187 bytesRead = 0 ;
188- return Trace ( NtStatus . HandleNoLongerValid , nameof ( ReadFile ) , fileName , info ) ;
188+ return Trace ( NtStatus . HandleNoLongerValid , fileName , info ) ;
189189 }
190190 finally
191191 {
@@ -207,7 +207,7 @@ public virtual unsafe NtStatus WriteFile(string fileName, IntPtr buffer, uint bu
207207 if ( ciphertextPath is null )
208208 {
209209 bytesWritten = 0 ;
210- return Trace ( DokanResult . PathNotFound , nameof ( WriteFile ) , fileName , info ) ;
210+ return Trace ( DokanResult . PathNotFound , fileName , info ) ;
211211 }
212212
213213 // Memory-mapped
@@ -235,29 +235,29 @@ public virtual unsafe NtStatus WriteFile(string fileName, IntPtr buffer, uint bu
235235 fileHandle . Stream . Write ( bufferSpan ) ;
236236 bytesWritten = alignedBytesToCopy ;
237237
238- return Trace ( DokanResult . Success , nameof ( WriteFile ) , fileName , info ) ;
238+ return Trace ( DokanResult . Success , fileName , info ) ;
239239 }
240240 catch ( PathTooLongException )
241241 {
242242 bytesWritten = 0 ;
243- return Trace ( DokanResult . InvalidName , nameof ( WriteFile ) , fileName , info ) ;
243+ return Trace ( DokanResult . InvalidName , fileName , info ) ;
244244 }
245245 catch ( CryptographicException )
246246 {
247247 bytesWritten = 0 ;
248- return Trace ( NtStatus . CrcError , nameof ( WriteFile ) , fileName , info ) ;
248+ return Trace ( NtStatus . CrcError , fileName , info ) ;
249249 }
250250 catch ( UnavailableStreamException )
251251 {
252252 bytesWritten = 0 ;
253- return Trace ( NtStatus . HandleNoLongerValid , nameof ( WriteFile ) , fileName , info ) ;
253+ return Trace ( NtStatus . HandleNoLongerValid , fileName , info ) ;
254254 }
255255 catch ( IOException ioEx )
256256 {
257257 if ( ErrorHandlingHelpers . NtStatusFromException ( ioEx , out var ntStatus ) )
258258 {
259259 bytesWritten = 0 ;
260- return Trace ( ( NtStatus ) ntStatus , nameof ( WriteFile ) , fileName , info ) ;
260+ return Trace ( ( NtStatus ) ntStatus , fileName , info ) ;
261261 }
262262
263263 throw ;
@@ -354,8 +354,8 @@ protected static int AlignSizeForPagingIo(int bufferLength, long offset, long st
354354 return bufferLength ;
355355 }
356356
357- protected static NtStatus Trace ( NtStatus result , string methodName , string fileName , IDokanFileInfo info ,
358- FileAccess access , FileShare share , FileMode mode , FileOptions options , FileAttributes attributes )
357+ protected static NtStatus Trace ( NtStatus result , string fileName , IDokanFileInfo info ,
358+ FileAccess access , FileShare share , FileMode mode , FileOptions options , FileAttributes attributes , [ CallerMemberName ] string methodName = "" )
359359 {
360360#if ! DEBUG
361361 return result ;
@@ -373,7 +373,7 @@ protected static NtStatus Trace(NtStatus result, string methodName, string fileN
373373 return result ;
374374 }
375375
376- protected static NtStatus Trace ( NtStatus result , string methodName , string ? fileName , IDokanFileInfo info , params object [ ] ? args )
376+ protected static NtStatus Trace ( NtStatus result , string ? fileName , IDokanFileInfo info , [ CallerMemberName ] string methodName = "" , params object [ ] ? args )
377377 {
378378#if ! DEBUG
379379 return result ;
0 commit comments