Esempio n. 1
0
        public static SafeOverlappedFree Alloc()
        {
            SafeOverlappedFree result = Interop.mincore_obsolete.LocalAlloc(LPTR, (UIntPtr)Win32.OverlappedSize);

            if (result.IsInvalid)
            {
                result.SetHandleAsInvalid();
                throw new OutOfMemoryException();
            }
            return(result);
        }
Esempio n. 2
0
        public static SafeOverlappedFree Alloc()
        {
            SafeOverlappedFree result = Interop.Kernel32.LocalAlloc_SafeOverlappedFree(
                Interop.Kernel32.LPTR,
                (UIntPtr)Interop.Kernel32.OverlappedSize);

            if (result.IsInvalid)
            {
                result.SetHandleAsInvalid();
                throw new OutOfMemoryException();
            }

            return(result);
        }