DrvGetModes

Hello,
I am using one driver to load another driver, which is my original display
driver through the EngLoadImage function. I am successfully able to use all
the export functions of my loaded original dll and now I am calling the
functions of the original driver through the new driver I have written such
as DrvEnableDriver, DrvGetModes etc.

Now, My Task is to change the Modes returned by the original driver and then
load these modes through the new driver I have written. But when I start to
make changes I encounter problems.

Firstly, to check whether correct modes are returned I used the modes given
to me by the GetModes function of the original driver and copy them into my
local temp DEVMODEW structure and then call Get Modes, all the modes
supported are displayed with no problems.

But when I read the modes returned by the original GetModes and make changes
to it such as swap the height and width, only 768x1024 modes are returned
and no other modes are returned.

1.Why is this happening is there something about PDM and DEVMODEW structure
I am not clear about.
2.I want to reallocate the DEVMODEW structure as 2 times the size of
original one so that it can contain the original modes and the modes I want
to add, can I reallocate the size, I tried using EngAllocMem.it doesn’t
happen, is there any other method.

Thanks & Regards,
Nitin Kapoor