Post by Tim RobertsYOU related this thread to user-mode reallocation. I answered your
The weord "kernel" in the thread title should make it quite clear what this
is about..
If i point to functions like GloballAlloc, is because some people took the
idea of acctualy reallocating a memory buffer without copy close to
blasfemy, while it is quite possible in "user mode" but was not verry clear
how to do it in "kernel mode"
Post by Tim Robertsquestion with a concrete, verifiable reference. If you have somehow
You answer nothing, you pointed to the C++ Run Tim Library source code, and
that is...well...stupid
How can i learn how to realloc a memory buffer in "kernel" mode by looking
at that?
Post by Tim Robertsdeveloped the idea that insulting the people who are trying to help you is
the right way to get them to continue that help, then you are sadly
mistaken.
Fine, don't post anymore...whatver
Post by Tim RobertsPost by AlexAs it's been sed before, pointing to RTL source code to understand how
**SYSTEM** APIs work is stupid.
Wrong. The key algorithms for most system-based functions were established
and refined decades ago. It is extremely unlikely that the API
There is no algorithm in the RTL, the RTL is just a wrapper over some
windows API
Post by Tim Robertsimplementation of a memory-related function will vary significantly from
the RTL implementation of that same function.
Did you acctually look at this misterious RTL code? Well, i did (for reasons
unrelated to this thread) and it maps to the user mode HeapXXX windows API,
Same as GloballAlloc, as Max pointed out...
Post by Tim RobertsPost by AlexSorry, if it's ofensive, but this is what it is
"Allocates movable memory. Memory blocks are never moved in physical memory,
but they can be moved within the default heap."
**"never moved in physical memory"**
As David pointed out, this comment is a leftover from the 16-bit days and
no longer applies in Win32 code.
Really? this whole memory management is more of a x86 thing then a OS
dependent, the OS part is only the specific API to work with the memory, If
you ask me
Post by Tim RobertsDid you perform any actual experiments to see if what you describe is even
C:\tmp>type x.c
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
int main()
{
HANDLE heap = GetProcessHeap();
void* pv1[4];
int i;
for( i = 0; i < 4; i++ )
{
pv1[i] = HeapAlloc( heap, 0, 16 );
printf( "%08x\n", pv1[i] );
}
for( i = 0; i < 4; i++ )
HeapFree( heap, 0, pv1[i] );
return 0;
}
C:\tmp>cl x.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
x.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:x.exe
x.obj
C:\tmp>x
00132f48
00132f60
00132f78
00132f90
C:\tmp>
The system API HeapAlloc has allocated those addresses within the same
page. You cannot alter the paging of one of those objects without screwing
Ok, fine... but another experiment is in order
In user mode, allocate a 1 page memory block, then keep resizing it in
multiples of 1 page
After each reallocation get the VA returned
Pass the VA to a kernel mode driver, find out the physical adress for the VA
Print the physical adress
Post by Tim Robertsup the others.
--
Providenza & Boekelheide, Inc