Microsoft.Win32.SafeHandles.SafeLocalAllocHandle.LocalAlloc C# (CSharp) Méthode

LocalAlloc() static private méthode

static private LocalAlloc ( int cb ) : SafeLocalAllocHandle
cb int
Résultat SafeLocalAllocHandle
        internal static SafeLocalAllocHandle LocalAlloc(int cb)
        {
            SafeLocalAllocHandle result = Interop.Kernel32.LocalAlloc(Interop.Kernel32.LMEM_FIXED, (UIntPtr)cb);
            if (result.IsInvalid)
            {
                result.SetHandleAsInvalid();
                throw new OutOfMemoryException();
            }
            return result;
        }