Microsoft KB Archive/141231

{|
 * width="100%"|

PRB: Control Message Fails when Trying Dynamic VxDs as Static

 * }

Q141231

-

The information in this article applies to:


 * Microsoft Win32 Device Driver Kit (DDK) Windows 95

-

SYMPTOMS
While developing a new dynamic VxD for Windows 95, developers sometimes put the VxD into the System.ini files's [386Enh] section as a "device=" line to test initialization or other basic function. During early testing, the .inf might not be generated or the loading application may not be working yet, so this seems a good way to temporarily test some functions. Yet, the initialization routines are never called.

CAUSE
This is due to the fact that the control messages that VMM sends out for static and dynamic VxDs are not the same. Refer to the library compact disc or Vmm.doc from the DDK. To summarize (from VMM.DOC):

Static messages
Device_Init        Virtual devices initializing (interrupts enabled). Init_Complete      All virtual devices have initialized. Sys_Critical_Exit  System is terminating (interrupt disabled). Sys_Critical_Init  Virtual devices initializing (interrupts disabled). System_Exit        System is terminating (interrupts enabled).

Dynamic messages
Sys_Dynamic_Device_Exit  Dynamic VxD being unloaded (directed). Sys_Dynamic_Device_Init  Dynamic VxD being loaded (directed).

RESOLUTION
If you are planning to switch back and forth, you may want to include both types of messages in your control message procedure, for example:

  Control_Dispatch SYS_DYNAMIC_DEVICE_INIT, My_Init Control_Dispatch DEVICE_INIT, My_Init

Also, don't forget to finally remove the System.ini "device" line when your dynamic loading is working.

STATUS
This behavior is by design.