コード例 #1
0
        public void Run()
        {
            DllImports.SystemInfo si;
            DllImports.GetSystemInfo(out si);
            uint pageSize = si.PageSize;
            uint allocationGranulatity = si.AllocationGranularity;

            while (true)
            {
                ulong block = (ulong)DllImports.VirtualAlloc(IntPtr.Zero, new IntPtr(pageSize),
                                                             DllImports.AllocationType.Commit,
                                                             DllImports.MemoryProtection.ReadWrite);
                Console.WriteLine($"Allocated ${pageSize:X16} at ${block:X16}");
                Thread.Sleep(10);
            }
        }