Arthur
2006-01-03 11:23:41 UTC
I'm having a problem with "multiple instances" of a dynamic VXD. The
problem goes as follows:
I have a global variable in my VXD with the following declaration:
#pragma VxD_LOCKED_CODE_SEG
#pragma VxD_LOCKED_DATA_SEG
BOOLEAN IsInit = FALSE;
My VXD loads at boot time. On my INIT_COMPLETE routine, I do some
initialization code and set this global variable "IsInit" to TRUE.
The problem arrives when my GUI tries to establish communication with
the VDX. When the GUI uses CreateFile to open the VXD, the VXD receives
a DIOC_OPEN open message in the W32_DEVICEIOCONTROL routine. So far so
good. The problem is that the global variable "IsInit" has lost its
value! It's like every time an App calls CreateFile, Windows 98 creates
a new instance of my VXD for that application!
I have a similar driver for Windows 2K that works fine.
Is there a way to declare the global variable so that it will retain
its value during CreateFile calls? Is there a way to tell Windows not
to open new instances of my Vxd but to use the same instance every
time? What am I doing wrong?
Thanks in advance...
problem goes as follows:
I have a global variable in my VXD with the following declaration:
#pragma VxD_LOCKED_CODE_SEG
#pragma VxD_LOCKED_DATA_SEG
BOOLEAN IsInit = FALSE;
My VXD loads at boot time. On my INIT_COMPLETE routine, I do some
initialization code and set this global variable "IsInit" to TRUE.
The problem arrives when my GUI tries to establish communication with
the VDX. When the GUI uses CreateFile to open the VXD, the VXD receives
a DIOC_OPEN open message in the W32_DEVICEIOCONTROL routine. So far so
good. The problem is that the global variable "IsInit" has lost its
value! It's like every time an App calls CreateFile, Windows 98 creates
a new instance of my VXD for that application!
I have a similar driver for Windows 2K that works fine.
Is there a way to declare the global variable so that it will retain
its value during CreateFile calls? Is there a way to tell Windows not
to open new instances of my Vxd but to use the same instance every
time? What am I doing wrong?
Thanks in advance...