Microsoft.Win32.SafeHandles.SafeLocalAllocHandle.LocalAlloc C# (CSharp) 메소드

LocalAlloc() 정적인 개인적인 메소드

static private LocalAlloc ( int cb ) : SafeLocalAllocHandle
cb int
리턴 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;
        }