Windows 98Me Compatibility Notes

Windows 98/Me Compatibility Notes

Some minor differences exist between Windows 98/Me and Windows XP insofar as the material discussed in this chapter goes.

Error Logging

Windows 98/Me doesn t implement an error-logging file or an Event Viewer. When you call IoWriteErrorLogEntry in Windows 98/Me, all that happens is that several lines of data appear on your debugging terminal. I find the formatting of this information unaesthetic, so I prefer simply not to use the error-logging facility under Windows 98/Me. Refer to Appendix A for suggestions about how to determine whether you re running Windows 98/Me or Windows XP.

Waiting for System Threads to Finish

Windows 98/Me doesn t support the use of a pointer to a thread object (a PKTHREAD) as an argument to KeWaitForSingleObject or KeWaitForMultipleObjects. Those support functions simply pass their object pointer arguments through to VWIN32.VXD without any sort of validity checking, and VWIN32 crashes because the thread objects don t have the structure members needed to support synchronization use.

If you need to wait for a kernel-mode thread to complete in Windows 98/Me, therefore, you ll need to have the thread signal an event just before it calls PsTerminateSystemThread. It s possible that signalling this event will cause the terminating thread to lose control to a thread waiting for the same event. The terminating thread will then still be alive technically, but I don t think anything awful can happen as a result in Windows 98/Me. The POLLING sample shows how to elevate the priority of the terminating thread to diminish the risk.

Work Items

Windows 98 and Windows Me don t export the IoXxxWorkItem routines. This fact doesn t pose any particular reliability problem since these systems are not likely to invalidate or overstore driver program code before a queued work item executes. If you have a driver that calls ExQueueWorkItem in order to run in Windows 98/Me, you can t currently pass WHQL tests, even if you have a run-time check so as to avoid calling ExQueueWorkItem in Windows 2000 or later systems. But if your driver calls the IoXxxWorkItem routines that are needed for robustness in Windows 2000 and later, Window 98 and Windows Me won t load your driver because of the unresolved import. This situation is tailor-made for the WDMSTUB.SYS solution discussed in Appendix A. WDMSTUB defines the IoXxxWorkItem routines so you can load your driver.

My own GENERIC.SYS also contains calls to ExQueueWorkItem in order to work around the fact that power IRPs must be sent and completed at PASSIVE_LEVEL in Windows 98 and Windows Me. By the time you read this, I hope to have persuaded WHQL to move their work item tests into the Driver Verifier so as to allow safe uses of the older routine to pass muster.



Programming the Microsoft Windows Driver Model
Programming the Microsoft Windows Driver Model
ISBN: 0735618038
EAN: 2147483647
Year: 2003
Pages: 119
Authors: Walter Oney

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net