Ring 0 access from within a ring 3 program without VxD 
Author Message
 Ring 0 access from within a ring 3 program without VxD

Quote:

> 4) Getting into VxD programming looks too damn complex just to lock some
>    memory and thus solve the problem of the fake VirtualLock() of Win95.

Doesn't DerectDraw use a win16 Lock  function to lock surfaces on W95 / 98 ? and
if so shouldn't it be possible for you to do the same ? I know this would
involve thunking but that shouldn't be to hard (or is it ?) i hop.

(I don't have any real experience in this, it's just a thought, something i read
in the dx5 ddk, if  i'm wrong please correct me cos i have ben thinking abut
using this myself).

Leif.



Tue, 31 Jul 2001 03:00:00 GMT  
 Ring 0 access from within a ring 3 program without VxD

Quote:


>> 4) Getting into VxD programming looks too damn complex just to lock some
>>    memory and thus solve the problem of the fake VirtualLock() of Win95.

>Doesn't DerectDraw use a win16 Lock  function to lock surfaces on W95 / 98 ?
>and if so shouldn't it be possible for you to do the same ? I know this would
>involve thunking but that shouldn't be to hard (or is it ?) i hop.

>(I don't have any real experience in this, it's just a thought, something i
>read in the dx5 ddk, if i'm wrong please correct me cos i have ben thinking
>abut using this myself).

>Leif.

Tjena Leif,
You should *never* rely on Microsoft documentation. About this subject
in particular, I guess that the win16 lock you were referring to is
the mutex, which is another thing (let's say that it will prevent
multitasking, but not much more).

To lock virtual memory, you could use DirectX's PageLock() function.
This function is provided because most gfx boards capable of system mem
to video mem DMA (are there any, anyway? most AGP boards I examinated
don't support it, let away PCI ones) of course need locked pages when
accessing to system memory via DMA.
But.. as very often happens in the Microsoft world, the function
returns "success" but it really didn't do anything, and even less it
has actually locked the pages..!

Same behaviour for VirtualLock() on Windows9x, and even on NT (look
at KB article Q94996). I've experienced the same lame++ behaviour
about other function calls (i.e. return "success", but didn't do what
they were supposed to do anyway. This is not so rare in functions where
this behaviour will not crash the computer anyway, but just give other
kind of problems (mostly performance)).

Now, your only chance to lock memory is to use the ring0 VMM services.
To do this, you're supposed to write a VxD.. or to use the undocumented
KERNEL32 function (ordinal number 1..9) VxDCall. A very nice thing, and
thus Microsoft doesn't want you to use it (suprise surprise).

Hejd?!
---
Fabio Bizzetti



Tue, 31 Jul 2001 03:00:00 GMT  
 Ring 0 access from within a ring 3 program without VxD
This is wrong (IMHO).  A kernel driver CANNOT rely on a user app to lock
memory.  The driver could MmProbeAndLockPages() itself.  Also, VirtualLock
on NT doesn't lock the pages, it says the system will make every effort not
to swap it out while the owning process is running or ready to run.

Andy



Thu, 02 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ring 0 to ring 123

2. rotate a BMP without using a picture ring?

3. Multiuser access slow on Token Ring network

4. Array of Rings - Accessing Strings[] Property

5. Submit Your Site to the Forth Programming Web Ring

6. Read/Writing bootsectors from Ring-3 program

7. Ring 0 from win16 program

8. Execute a program from ring 0

9. New: Modula-2 web-ring. Please add your site to the ring.

10. Syntax colo(u)ring

11. You ring my bell.

12. Focus Ring

 

 
Powered by phpBB® Forum Software