Discussion:
dynamic vxd loads on boot as static
(too old to reply)
c***@gmail.com
2006-01-16 12:38:04 UTC
Permalink
Hi,

I have one dynamic VXD that starts as static during boot time, but
start as dynamic when my app use the CreateFile function. I want only
one copy of my VXD running, but now I have two copies, one static and
one dynamic.

I would appreciate any help.

Thanks in advance.

Cesar
Ian Blake
2006-01-16 15:25:10 UTC
Permalink
Post by c***@gmail.com
Hi,
I have one dynamic VXD that starts as static during boot time, but
start as dynamic when my app use the CreateFile function. I want only
one copy of my VXD running, but now I have two copies, one static and
one dynamic.
I would appreciate any help.
Thanks in advance.
Cesar
What string are you passing to CreateFile? If you have a pathname
then an attempt to load the vxd will be made. If you have just a vxd
name then the existing vxd is connected to without any image being
loaded.

CreateFile("\\\\.\\YOURNAME, ....)

No .Vxd No path. YOURNAME just the vxd name.
c***@gmail.com
2006-01-16 16:56:22 UTC
Permalink
Blake,

thanks for your answer.

I've tried to use CreateFile("\\\\.\\MYVXD", ...), but the CreateFile
failed with error 2 (File not found). The VXD file is in the
"Windows\system\VMM32" folder, and the driver's registry key is:

HKLM \ SYSTEM \ CURRENTCONTROLSET \ SERVICES \ VXD \ MYVXD

with values

StaticVxD = "*MYVXD"
Start = 0 [binary]

I've also tried putting the vxd file in the system folder, changing the
StaticVxD key in the registry to "c:\windows\system\MYVXD.vxd". In this
case the CreateFile("\\\\.\\MYVXD", ...) also failed, but the command
CreateFile("\\\\.\\MYVXD.vxd", ...) worked, but again two instances of
the VXD were created.

Am I doing something wrong?
Ian Blake
2006-01-18 10:14:51 UTC
Permalink
Post by c***@gmail.com
Blake,
thanks for your answer.
I've tried to use CreateFile("\\\\.\\MYVXD", ...), but the CreateFile
failed with error 2 (File not found). The VXD file is in the
HKLM \ SYSTEM \ CURRENTCONTROLSET \ SERVICES \ VXD \ MYVXD
with values
StaticVxD = "*MYVXD"
Start = 0 [binary]
I've also tried putting the vxd file in the system folder, changing the
StaticVxD key in the registry to "c:\windows\system\MYVXD.vxd". In this
case the CreateFile("\\\\.\\MYVXD", ...) also failed, but the command
CreateFile("\\\\.\\MYVXD.vxd", ...) worked, but again two instances of
the VXD were created.
Am I doing something wrong?
The only thing I can suggest is the internal name of your vxd is not
"MYVXD". The fact that CreateFile("\\\\.\\MYVXD",...) fails to find
the already loaded Vxd suggests this.
c***@gmail.com
2006-01-18 15:18:35 UTC
Permalink
Thanks again!

I don't know exactly what happened, but I think that I found the
problem.

I've changed

Control_Dispatch INIT_COMPLETE, _On_DriverInit, cCall

to

Control_Dispatch SYS_DYNAMIC_DEVICE_INIT, _On_Sys_Dynamic_Init, cCall
Control_Dispatch DEVICE_INIT, _OnDriverInit, cCall

The function On_Sys_Dynamic_Init does nothing except return TRUE.

And now, it's working.

Loading...