1
0
mirror of https://github.com/soukoku/ntwain.git synced 2025-04-24 19:06:07 +08:00
ntwain/NTwain/IMemoryManager.cs

36 lines
1.3 KiB
C#
Raw Normal View History

2014-04-06 04:48:44 +08:00
using System;
namespace NTwain
{
/// <summary>
/// Interface that provides the correct methods for managing memory on data exchanged with TWAIN sources.
/// </summary>
public interface IMemoryManager
{
/// <summary>
/// Function to allocate memory. Calls to this must be coupled with <see cref="MemFree"/> later.
/// </summary>
/// <param name="size">The size in bytes.</param>
/// <returns>Handle to the allocated memory.</returns>
IntPtr MemAllocate(uint size);
/// <summary>
/// Function to free memory.
/// </summary>
/// <param name="handle">The handle from <see cref="MemAllocate"/>.</param>
void MemFree(IntPtr handle);
/// <summary>
/// Function to lock some memory. Calls to this must be coupled with <see cref="MemUnlock"/> later.
/// </summary>
/// <param name="handle">The handle to allocated memory.</param>
/// <returns>Handle to the lock.</returns>
IntPtr MemLock(IntPtr handle);
/// <summary>
/// Function to unlock a previously locked memory region.
/// </summary>
/// <param name="handle">The handle from <see cref="MemLock"/>.</param>
void MemUnlock(IntPtr handle);
}
}