![]() 30 Parti: Essentials
tern. The device drivers need to be written according to the semantics imposed by
the operating system. The device drivers are called virtual device drivers (VXD) in
Windows 95/98, and they are called as kernel-mode device drivers in Windows NT.
Windows 95 uses LE file format for virtual device drivers, whereas Windows NT
uses the PE format. As a result, the applications that use VXDs cannot be run on
Windows NT. They need to be ported to a Windows NT (kernel-mode) device driver.
Chapter 2 explains how to write device drivers.
Microsoft has come up with a Common Driver Model in Windows 98 and
Windows 2000. At this point, however, you need to port all the applications that
use VXDs to Windows NT by writing an equivalent kernel-mode driver.
Security
The major WIN32 API implementation difference between Windows 95/98 and
Windows NT is security. Windows 95/98's implementation does not have any support
for security. In all the Win32 API functions that have SECURITY ATTRIBUTES as one
of the parameters, Windows 95/98's implementation just ignores these parameters.
This has some impact on the way a developer programs. Registry APIs such as
RegSaveKey and RegRestoreKey work fine under Windows 95/98. However, under
Windows NT, you need to do a few things before you can use these functions. In
Windows NT, there is a concept of privileges. There are different kinds of privileges,
such as Shutdown, Backup, and Restore. Before using a function such as RegSaveKey,
you need to acquire the Backup privilege. To use RegRestoreKey, you need to acquire
the Restore privilege, and to use the InitiateSystemShutdown function, you need to
acquire the Shutdown privilege.
Under Windows 95/98, anybody can install a VXD. To install a kernel-mode de-
vice driver under Windows NT, you need administrator privilege for security pur-
poses. As mentioned previously, device drivers are trusted components of the
operating system and have access to the entire hardware. By requiring privileges to
install a device driver, Windows NT restricts the possibility that a guest account
holder will install a device driver, which could potentially bring the whole system
down to its knees.
Newly Added API Calls
With each version of Windows NT, new APIs are being added to the WIN32 API set.
Most of these APIs do not have an equivalent API under Windows 95/98. Also,
there are a few APIs, such as CreateRemoteThread, that do not have the real imple-
|
|