Ejemplo n.º 1
0
 /// <summary>
 /// Allocates the specified number of bytes from the heap.
 /// </summary>
 /// <param name="uFlags">
 /// The memory allocation attributes. The default is the <see cref="LocalAllocFlags.LMEM_FIXED"/> value. This parameter can be one or more of the following values, except for the incompatible combinations that are specifically noted.
 /// </param>
 /// <param name="uBytes">The number of bytes to allocate. If this parameter is zero and the <paramref name="uFlags"/> parameter specifies <see cref="LocalAllocFlags.LMEM_MOVEABLE"/>, the function returns a handle to a memory object that is marked as discarded.</param>
 /// <returns>
 /// If the function succeeds, the return value is a handle to the newly allocated memory object.
 /// If the function fails, the return value is NULL. To get extended error information, call <see cref="GetLastError"/>.
 /// </returns>
 public static unsafe void *LocalAlloc(LocalAllocFlags uFlags, int uBytes)
 {
     // The length of SIZE_T and IntPtr vary with the bitness of the process.
     // For convenience to callers we want to expose the size of a memory allocation
     // as an Int32 no matter the process bitness. So safely 'upscale' the Int32 to
     // the appropriate IntPtr and call the native overload.
     return(LocalAlloc(uFlags, new IntPtr(uBytes)));
 }
Ejemplo n.º 2
0
 public static extern unsafe void* LocalAlloc(LocalAllocFlags uFlags, IntPtr uBytes);
Ejemplo n.º 3
0
 public static extern IntPtr LocalAlloc(LocalAllocFlags flags, uint size);
Ejemplo n.º 4
0
 public static extern IntPtr LocalAlloc(LocalAllocFlags flags, uint size);
Ejemplo n.º 5
0
 internal static extern IntPtr LocalAlloc(LocalAllocFlags uFlags, uint uBytes);
Ejemplo n.º 6
0
 /// <summary>
 /// Allocates the specified number of bytes from the heap.
 /// </summary>
 /// <param name="uFlags">
 /// The memory allocation attributes. The default is the <see cref="LocalAllocFlags.LMEM_FIXED"/> value. This parameter can be one or more of the following values, except for the incompatible combinations that are specifically noted.
 /// </param>
 /// <param name="uBytes">The number of bytes to allocate. If this parameter is zero and the <paramref name="uFlags"/> parameter specifies <see cref="LocalAllocFlags.LMEM_MOVEABLE"/>, the function returns a handle to a memory object that is marked as discarded.</param>
 /// <returns>
 /// If the function succeeds, the return value is a handle to the newly allocated memory object.
 /// If the function fails, the return value is NULL. To get extended error information, call <see cref="GetLastError"/>.
 /// </returns>
 public static unsafe void* LocalAlloc(LocalAllocFlags uFlags, int uBytes)
 {
     // The length of SIZE_T and IntPtr vary with the bitness of the process.
     // For convenience to callers we want to expose the size of a memory allocation
     // as an Int32 no matter the process bitness. So safely 'upscale' the Int32 to
     // the appropriate IntPtr and call the native overload.
     return LocalAlloc(uFlags, new IntPtr(uBytes));
 }
Ejemplo n.º 7
0
 internal static extern IntPtr LocalAlloc(LocalAllocFlags uFlags, uint uBytes);