OSR Dev Blog

Don't Define NT_UP
(By: Hector J. Rodriguez | Published: 21-Nov-01| Modified: 07-Jan-02)

Using the Windows XP DDK (or, really, ANY time you build a driver) make sure you do not to define NT_UP.


NT_UP is defined when the uniprocessor build of the o/s is created, and turns on various short-cuts that can be used when it is known that only a single CPU is present.


Due to conditionals in ntddk.h and wdm.h, a driver that's built with NT_UP defined will not work correctly on an MP system. The symptoms that are exhibited can be rather subtle: For example, calls to KeGetCurrentProcessorNumber() can return the wrong processor number.


NOT defining the symbol produces a driver that works on BOTH uni- and multi- processor systems. So, there's really no reason a driver should ever define this symbol -- EVEN when that driver is targetted to work solely to a uniprocessor system.

 

This article was printed from OSR Online http://www.osronline.com

Copyright 2017 OSR Open Systems Resources, Inc.