xxxxx@gmail.com wrote:
> There’s really no difference between a mapped file and normal allocated memory. It’s all memory.
>
Yes I know. But this is not what I wanted to say. Sorry if I say something wrong.
I want to do that my driver will map only one file. I assume that it will be more better, than to have a lot of mapped files.
Well, if you define “better” as “not working”, then you are right.
You are micro-optimizing. If we were talking about 150 mapped files,
that would be one thing. But on all but the most exotic of systems,
we’re talking about a maximum of roughly 3.
As much I have understood, when I switching accounts the picture that I see on display is current active surface.
When system switching or creating a new surface it calls DrvEnableSurface function.
Does it? Are you convinced that doing a fast user switch calls
DrvDisableSurface on the old driver and DrvEnableSurface on the new?
Inside this function I need to allocate memory for future surface. I want to do mapped file only map current surfaces memory. If to consider that when system creates a new surface the old must still to have own memory, I want to allocate new memory not in mapped file and assign it to old surface (ppdev->hsurfEng).
It is possible to do that?
Not the way you describe. I suppose you could copy the contents of the
mapped file to some safe area, and copy it back later, but that seems
like a lot more trouble.
And two more questions:
If I have for example two display on my Computer the system creates two or one surface?
Each display is a different driver instance, and hence a different surface.
And what about DIB section? How I can try to use it? It’s possible to share additional information through it?
A DIB section is a memory-mapped file or memory object that can be drawn
on like a bitmap. Personally, I don’t think that will lead anywhere for
you, but you may be able to think of some creative way to use it.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.