示例#1
0
文件: marshal.cs 项目: ydunk/masters
        public static IntPtr AllocHGlobal(IntPtr cb)
        {
            IntPtr pNewMem = Win32Native.LocalAlloc(LMEM_FIXED, cb);

            if (pNewMem == Win32Native.NULL)
            {
                throw new OutOfMemoryException();
            }
            return(pNewMem);
        }