예제 #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)));
 }
예제 #2
0
파일: Kernel32.cs 프로젝트: Eucaly/pinvoke
 public static extern unsafe void* LocalAlloc(LocalAllocFlags uFlags, IntPtr uBytes);
예제 #3
0
파일: Win32.cs 프로젝트: xorkrus/vk_wm
 public static extern IntPtr LocalAlloc(LocalAllocFlags flags, uint size);
예제 #4
0
 public static extern IntPtr LocalAlloc(LocalAllocFlags flags, uint size);
예제 #5
0
 internal static extern IntPtr LocalAlloc(LocalAllocFlags uFlags, uint uBytes);
예제 #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));
 }
예제 #7
0
 internal static extern IntPtr LocalAlloc(LocalAllocFlags uFlags, uint uBytes);