CallbackFilter

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

CallbackFilter.AddBytesToWriteBuffer method

Filter:

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

CallbackFilter     See also    

Overview

This method reserves extra buffer space when faking file contents.

Declaration

[Pascal]
    function AddBytesToWriteBuffer( WriteBufferExtraBytes : Byte ): boolean;

[C++ (Lib)]
    bool AddBytesToWriteBuffer( unsigned char WriteBufferExtraBytes );

[C++ (VCL)]
    bool __fastcall AddBytesToWriteBuffer( unsigned char WriteBufferExtraBytes );

[C++ (.NET)]
    bool AddBytesToWriteBuffer( unsigned char WriteBufferExtraBytes );

[C#]
    bool AddBytesToWriteBuffer( byte WriteBufferExtraBytes );

[VB.NET]
    Function AddBytesToWriteBuffer( ByVal WriteBufferExtraBytes As Byte) As Boolean

Parameters

  • WriteBufferExtraBytes - the number of pages to reserve

Return values

TRUE / true if the function succeeded or FALSE / false if the function failed.

Description

This method should be used on Windows XP (on Vista and later this is not needed) when you plan to fake the size of the file and place additional data before or after actual file data. You need to reserve certain space to accomodate extra data.

The size is specified in bytes but the value must be multiple to sector size on the filesystem to which the file belongs. For usual HDD sector is 512 bytes, for CDFS the sector is 4Kb. The size of the sector/page on the device can be learned by calling GetSystemInfo() WinAPI function.

Call the method before the call to AttachFilter().

See also

AttachFilter    

Back to top