public static SafeCoTaskMemAllocHandle Alloc(int cb) { SafeCoTaskMemAllocHandle safeHandle = new SafeCoTaskMemAllocHandle(); IntPtr pBuffer = Marshal.AllocCoTaskMem(cb); safeHandle.TakeHandle(ref pBuffer); return(safeHandle); }
public static SafeCoTaskMemAllocHandle Alloc(int cb) { IntPtr pBuffer = Marshal.AllocCoTaskMem(cb); SafeCoTaskMemAllocHandle handle1 = new SafeCoTaskMemAllocHandle(); handle1.TakeHandle(ref pBuffer); return(handle1); }