Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Dos Protected Mode Interface - <b>set descriptor access rights</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
        Set Descriptor Access Rights

                 This function allows a protected mode program to modify
                 the access rights and type fields of a descriptor.

            To Call

                 AX = 0009h
                 BX = Selector
                 CL = Access rights/type byte
                 CH =  80386 extended  access rights/type  byte  (32-bit
                      DPMI implementations only)

            Returns

                 If function was successful:
                 Carry flag is clear.

                 If function was not successful:
                 Carry flag is set.

            Programmer's Notes

                 o    This function  will fail if the selector specified
                      in BX is invalid.
                 o    Your program  should only  modify descriptors that
                      were   allocated    through   the   Allocate   LDT
                      Descriptors function.
                 o    To examine  the access  rights of a descriptor you
                      should  use   the  instruction  lar  (load  access
                      rights) which  is supported  on  80286  and  80386
                      machines.
                 o    The access  rights/type byte  passed in CL has the
                      following format:



                      +-------------------------------+
                      | P |  DPL  | 1 |C/D|E/C|W/R| A |
                      +-------+-----------------------+
                        |     |     |   |   |   |   +- 0=>Not Accessed
                        |     |     |   |   |   |            1=>Accessed
                         |       |        |   |   |   +-- Data: 0=>Read,
                      1=>R/W
                         |      |     |   |   |               Code: Must
                      be 1 (readable)
                        |     |     |   |   +-- Data: 0=>Exp-up, 1=>Exp-
                      dn
                         |      |     |   |              Code: Must be 0
                      (non-conform)
                        |     |     |   +-- 0=>Data, 1=>Code
                        |     |     |
                        |     |     +-- Must be 1
                        |     |
                        |     +-- Must equal caller's CPL
                        |
                        +- 0=>Absent, 1=>Present

                      A  parameter   which  does   not  meet  the  above
                      requirements is  invalid, and  causes the function
                      to return with the carry flag set.

                 o    16-bit  DPMI   implementations  will   ignore  the
                      extended access rights/type byte passed in CH even
                      if it  is running on an 80386 system.  32-bit DPMI
                      implementations  interpret  the  CH  parameter  as
                      follows:

                      +-------------------------------+
                      | G |B/D| 0 |Avl|    Reserved   |
                      +-----------------------+-------+
                        |   |   |   |         +-- Ignored
                        |   |   |   +-- Can be 0 or 1
                        |   |   +-- Must be 0
                        |   +-- 0=>Default 16-bit, 1=>Default 32-bit
                        +- 0=>Byte Granular, 1=>Page Granular

                      A  parameter   which  does   not  meet  the  above
                      requirements is  invalid, and  causes the function
                      to return with the carry flag set.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson