Bogdan
Wed Feb 04 18:27:04 CST 2004
"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:uUv9Oy36DHA.1936@TK2MSFTNGP12.phx.gbl...
> > Let me guess, realloc is written using system calls like GlobalRealloc,
to
>
> This is not a syscall. This is hooked to user-mode ntdll!RtlxxxHeap, which
do
> all heap management.
I didn't mean syscall (as in a call to kernel) i meant a system call or API,
imlemented in a user mode dll, like you sed :)
All the runtime function from C/C++ have to go trough windows user mode API
to do the real-work, so if I look at the realloc code I won't learn much, do
I?
So the real newbe here was David J.
:P
When i sed malloc/realloc some people understood it literaly when I only
ment them as the end result I was looking for, that is being able to resize
a kernel mode memory buffer.
>
> VirtualAlloc and other Virtualxxx are syscalls, hooked to
> ZwAllocateVirtualMemort.
>
> > Besides, I know how realloc works on x86 CPUs, what i don't know is the
> > windows kernel API to get the same thing.
>
> Just - no such API. Allocate the second block and copy.
For startes I will do just that, but, you should be able to realocate the
number of fizical pages behind a buffer and map them in a diffrent location
(yes, i still have to finish looking at the zilions of memory functions from
the DDK) where there is enough virtual space, right?
That way you don't do the costly copy operation.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
>
http://www.storagecraft.com
>
>