using System; namespace NTwain { /// /// Interface that provides the correct methods for managing memory on data exchanged with TWAIN sources. /// public interface IMemoryManager { /// /// Function to allocate memory. Calls to this must be coupled with later. /// /// The size in bytes. /// Handle to the allocated memory. IntPtr Allocate(uint size); /// /// Function to free memory. /// /// The handle from . void Free(IntPtr handle); /// /// Function to lock some memory. Calls to this must be coupled with later. /// /// The handle to allocated memory. /// Handle to the lock. IntPtr Lock(IntPtr handle); /// /// Function to unlock a previously locked memory region. /// /// The same handle passed . void Unlock(IntPtr handle); } }