示例#1
0
        public static SafeHGlobalHandleCritical AllocHGlobal(byte[] bytes)
        {
            SafeHGlobalHandleCritical result = AllocHGlobal(bytes.Length);

            Marshal.Copy(bytes, 0, result.DangerousGetHandle(), bytes.Length);
            return(result);
        }
        public static SafeHGlobalHandleCritical AllocHGlobal(byte[] bytes)
        {
            SafeHGlobalHandleCritical critical = AllocHGlobal(bytes.Length);

            Marshal.Copy(bytes, 0, critical.DangerousGetHandle(), bytes.Length);
            return(critical);
        }