CallbackFilter

Instant control over file and folder operations in Windows and .NET applications

OnUserFsRequestC event/delegate/notification

Filter:

Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   

CallbackFilter     See also    

Overview

This callback is called when the OS sends one of the supplementary IRPs to the filesystem.

Declaration

[Pascal]
    property OnUserFsRequestC : TCbFltUserFsRequestEventC;
    TCbFltUserFsRequestEventC = procedure(Sender : TObject; FileName: TCBString; UserFsControlCode: LongWord; Buffer : Pointer; BufferLength: LongWord; var ProcessRequest: boolean ) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltUserFsRequestEventC)(CallbackFilter* Sender, LPWSTR FileName, unsigned long UserFsControlCode, void * Buffer, unsigned long BufferLength, LPBOOL ProcessRequest );

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltUserFsRequestEventC)(System::TObject* Sender, WideString FileName, unsigned long UserFsControlCode, void * Buffer, unsigned long BufferLength, bool &ProcessRequest );

[C++ (.NET)]
    public delegate void CbFltUserFsRequestEventC(CallbackFilter^ Sender, String^ FileName, UInt32 UserFsControlCode, IntPtr Buffer, UInt32 BufferLength, bool% ProcessRequest );

[C#]
    delegate void CbFltUserFsRequestEventC(CallbackFilter^ Sender, string FileName, UInt32 UserFsControlCode, IntPtr Buffer, UInt32 BufferLength, ref bool ProcessRequest );

[VB.NET]
    Delegate Sub CbFltUserFsRequestEventC(ByVal Sender As CallbackFilter, ByVal FileName As String, ByVal UserFsControlCode As UInt32, ByVal Buffer As IntPtr, ByVal BufferLength As UInt32, ByRef ProcessRequest As Boolean )

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • FileName - contains the name of the file
  • UserFsControlCode - the IRP code that was reported (see description for details)
  • Buffer - the data passed with the IRP
  • BufferLength - the length of the data contained in Bufer
  • ProcessRequest - specifies, whether the request must be passed further to the underlying filters and the file system

Description

This pre-operation callback is called when the OS sends one of the following IRPs to the filesystem: FSCTL_FILE_LEVEL_TRIM, FSCTL_OFFLOAD_WRITE, FSCTL_SET_ZERO_DATA. The operation is identified in UserFsControlCode parameter. The Buffer can be typecast to the request-specific data structure for use.

See also

OnPostUserFsRequestC     OnUserFsRequestN    

Back to top