CallbackDisk

Create and manage virtual disk drives from your Windows applications

OnFileWrite event/delegate/callback

Filter:

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

CBDisk     See also    

Overview

This event is fired when CBDisk wants to write the data to the storage.

Declaration

[Pascal]
    TCBDiskWriteFileEvent = procedure( Sender : TObject; Offset : Int64; Buffer : Pointer; Count : LongWord) of object;

[C++ (Lib)]
    typedef Error (*CBDiskWriteFileFunc)( CBDisk* Sender, LongLongWord Offset, void* Buffer, unsigned long Count);

[C++ (VCL)]
    typedef void (__closure *TCBDiskWriteFileEvent)( System::TObject* Sender, LongLongWord Offset, void* Buffer, unsigned long Count);

[C++ (.NET)]
    public __delegate void CBDiskWriteFileEvent( CBDisk^ Sender, LongLongInt Offset, array<unsigned char>^ Buffer, unsigned long Count);

[C#]
    public void CBDiskWriteFileEvent( CBDisk.CBDisk Sender, long Offset, uchar[] Buffer, long Count);

[VB.NET]
    Sub CBDiskWriteFileEvent( ByVal Sender As CBDisk.CBDisk, ByVal Offset As Int64, ByVal Buffer As Byte(), ByVal Count As Int32)

Parameters

  • Sender - reference to the class that called the delegate/event handler.
  • Offset - offset in the storage at which to start writing the data to.
  • Buffer - a reference to the buffer wchich must be written to the storage.
  • Count - the number of bytes to be written
  • Result - out parameter (return value for DLL) where the application places the result of the operation. If you are working with file system, Win32 error code is a good candidate for placing to Result parameter. Otherwise you can use any other error codes, just be sure that 0 means success.

Description

This event is fired when CBDisk wants to write the data to the storage.
Write operation is successful only when Count bytes have been written. Otherwise the application must return non-zero error code in Result parameter.

If the event handler for this event is not set, the media is mounted in read-only mode, even when ReadOnly parameter in MountMedia is set to false.

See also

Information about callbacks    

Back to top