Jump to content

Passing non NULL to base address parameter of NtAllocateVirtualMemory

- - - - -

  • Please log in to reply
No replies to this topic

#1
AWS

AWS

    Administrator

  • Administrators
  • 54102 posts
  • LocationJoliet, IL U.S.A.

Hello,

I am investigating the behavior of the C runtime regarding memory allocation (malloc, calloc, realloc, etc excluding VirtualAlloc).

It seems that all libc allocation will eventually reach NtAllocateVirtualMemory (user mode).

I observe the following scenarios when the runtime calls NtAllocateVirtualMemory:

1. Runtime always pass NULL to base address parameter when trying to reserve memory or commit big chunk of memory

2. Runtime always pass non-NULL to base address parameter when trying to commit a reserved memory.

I was wondering if the CRT always behaves like this or there are other kinds of variations.

My dev environment:

- windows 7 professional

- visual studio 10

Thanks


View the full article




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users