Fires after a directory entry is returned during directory enumeration.
The 'callback' is called when the 'AfterEnumerateDirectory' event is emited.
The argument 'e' has the following properties:
e.directoryName e.fileName e.creationTime e.lastAccessTime e.lastWriteTime e.changeTime e.size e.allocationSize e.fileId e.attributes e.status e.directoryContext e.handleContext e.enumerationContext e.processRequest e.resultCode
This event fires after a directory entry (i.e., a file or subdirectory) is returned during enumeration of the directory specified by DirectoryName.
Applications may use this event to modify the entry's metadata before it gets reported to the requestor, or even prevent the entry from being reported in the first place.
The FileName parameter reflects the name of the directory entry.
The CreationTime, LastAccessTime, LastWriteTime, and ChangeTime parameters specify the entry's time values, specified .
The Size parameter specifies the size of the file, in bytes; it must always be 0 for subdirectories.
The AllocationSize parameter specifies the amount of space allocated for the file, in bytes; it must always be 0 for subdirectories.
The FileId parameter specifies the unique Id of the entry, as reported by the filesystem (or, for virtual files, by the application itself). This Id is used by the network redirector, and some third-party applications, to open files and directories by Id instead of by name. The root directory always uses the predefined Id 0x7FFFFFFFFFFFFFFF.
The Attributes parameter specifies the entry's attributes; please refer to Microsoft's File Attribute Constants article for attribute descriptions.
The Status parameter contains an NT status code that indicates the outcome of the operation; 0 indicates success. To convert this value to a Win32 error code, call the NtStatusToWin32Error method. Please note that this event won't fire for failed requests unless the ProcessFailedRequests property is enabled. Applications may change this parameter's value if they want a different NT status code to be returned.
The DirectoryContext, HandleContext, and EnumerationContext parameters are placeholders for application-defined data associated with the directory, specific handle, and enumeration; respectively. (For general-purpose events, the DirectoryContext is called FileContext instead.) DirectoryContext corresponds to the FileContext in the file/directory creation, opening, and closing events. Please refer to the Contexts topic for more information.
The ProcessRequest parameter controls whether the directory entry should actually be reported to the requestor; it is true by default. Setting this parameter to false will "hide" the directory entry (i.e., prevent it from being reported).
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.