# Windows NT Server 4.0 Notes
> Module 8: Supporting Applications There are two Windows NT environment subsystems that support applications designed for other operating environments: the POSIX subsystem, and the O/S2 subsystem. These subsystems receive all function requests from the applications that they support. A subsystem either carries out the request itself or passes it to the Windows NT Executive. The Win32 Subsystem is sometimes referred to as the client/server subsystem, the CSR subsystem, or the CSRSS. It supports Win32-, MS-DOS-, and Win 3.x-based applications and environment subsystems. The Win32 subsystem, also supports error handing functions, application shutdown and console applications—applications not written for the Windows GUI.
> Note: the security subsystem supports the logon process. It doesn’t support other applications.
The Windows NT Executive performs basic OS functions for all subsystems. The Executive Services lreside in the Kernel mode. This provides stability for the OS, because no application or subsystem can directly access the Executive Services. A malfunctioning user-mode component cannot cause a kernel mode component to stop functioning. All GUI related I/O requests are channeled through the Win32K Window Manager & GDI component of the Executive Services, which is responsible for maintaining the display. This provides a common GUI for all applications. The Win32-based applications can fully take advantage of the following features of Windows NT: Multi-threading, to enhance system performance: For example; the Win32-based setup program can be broken into three threads: One that decompresses files. One that copies files. One that modifies the system configuration. These threads function completely independent from each other, maintaining high system performance. Each win32-based application runs in its own 2GB address space. Therefore it cannot corrupt the memory of another application. On failure it doesn’t affect other win32-based applications. OLE/Microsoft ActiveX, and OpenGL support: OLE and ActiveX are both based on the Component Object Model (COM). They provide low level object binding that enables objects to communicate with each other.
Features | OLE | ActiveX
Function | Provides applications services such as linking or embedding, for creation of compound documents. | Enables controls to be embedded in Web sites and respond interactively to events.
Optimization | For usability and integration of desktop applications. | Optimized for size and speed.
Scope | For 16-and 32-bit applications interoperability. | Adds innovations for the Internet, including support for incremental renderings and asynchronous connections
OpenGL (Graphics Language) for 2-and 3-dimensional graphics. Under Windows NT it supports VGA 16-color-mode. Other implementations require at least 256-colors. Microsoft Direct X set of APIs in Windows NT (designed especially for high performance applications such as games): There are three DirectX components included with Windows NT: DirectDraw API: unlike Win95 it does not communicate directly with any hardware. DirectSound API: calls communicate directly with the I/O manager. DirectPlay API: this simplifies communications between computers, allowing DirectX programs run a network. You don't need to know more about this topic for the exam but it maybe better to review page 221 of the MOC. Windows NT supports MS-DOS-based applications in an Windows NT virtual DOS Machine (NTVDM). The NTVDM can also support Win16 applications in an emulated Win16 on Win32 (WOW) environment! Each MS-DOS based application has its own NTVDM, if one fails, the others will keep running. There are some NTVDM key components:
Component | Function
Ntvdm.exe | Runs in kernel mode. Provides MS-DOS emulation and manages NTVDM.
Ntio.sys | Equivalent of the MS-DOS Io.sys
Ntdos.sys | Equivalent of the Msdos.sys (the MS-DOS kernel).
IEU | On RISC-based computers, an additional component in the NTVDM. The Instruction Execution Unit emulates an Intel 80486-microprocessor.
> The NTVDM uses virtual device drivers (VDDs) to allow MS-DOS applications to access the system hardware. The VDD intercept the applications hardware calls and interact with the Windows NT-32-bit device driver. Windows NT provides VDDs for the mouse, keyboard, printer and COM-ports. The NTVDM is configurable in the properties dialog box of the MS-DOS application. It supports the same autoexec.bat and config.sys instructions as MS-DOS 5.0 did. Win16-based applications are actually MS-DOS –based programs, therefore they require their own NTVDM.
> Note: 16-bit Win 3.x VxDs are not supported under WOW. Win16 applications that rely on these drivers may not function correctly under Windows NT. (Visual Basic 3.x).
Look at page 225 for an overview of WOW components and their discription. WOW translates or thunks, 16-bit calls to 32-bit. It also translates the replies from the Win32 function into 16-bit. By default one NTVDM is started when a 16-bit application is started, then all Win16 applications will run in that NTVDM (this can be changed). This means that failure of one 16-bit application can affect the other 16-bit applications that are running. There is no shared memory between applications running in the WOW and other applications running under Windows NT. 16-bit applications cannot call Win32 DLLs, nor can 32-bit applications call Win16 DLLs. Win16 applications can be configured to use their own memory space, therefore using their own NTVDM. This gives several advantages: Reliability improvement. Interoperability, they can interoperate with applications in other memory spaces. It enables preemptive multitasking. Multiprocessing will be possible if the Win16 applications don’t run in the same NTVDM (if they do only one thread at the time is processed). There are some disadvantages to: There is a lot of additional memory usage when each Win16 application is running in its own NTVDM. If Win16 applications do not follow the OLE and DDE specifications or if they rely on shared memory to exchange data, the will not function in separate memory spaces. Such applications must be run in a shared NTVDM and WOW application environment. To start a Win16 application in its own environment there are several options:
Method | Procedure
At a command prompt | Type start /separate [path]application_executable
On the start menu | Run à in the Open box type [path]application_executable and select the Run in separate memory space.
From a shortcut | In the properties tab select Run in separate memory space.
By file association | In Windows NT Explorer; View à Options à file types, and select the application to be edited. Click Edit and double click Open. Edit the open line to include the /separate switch using the following syntax: Cmd /c start /separate [path]application_executable %1
Using the short-cut method ensures always starting in a separate NTVDM. Windows NT supports OS/2 and POSIX applications. To fully understand this matter you will need to read P.231-242. These also involve the Distributed Component Object Model (DCOM). You should read these pages, to put it into this trainngdump would mean typing over all the pages, and that is unnecessary (you should get the MOC anyway). The Windows NT command prompt (Cmd.exe) is 32-bit. When this is started, no NTVDM is started, this only happens when an MS-DOS-based application is launched. You can use the Console program in Control Panel to configure it. Each user can do this and the settings are stored in: \HKEY_CURRENT_USER\Console Windows NT assigns priorities to applications and distributes processor time to them. The normal base priority is 7. The levels can range from 0-31. Critical systemapps use higher priority levels than normal applications.
Priority | Used by
0-15 | Dynamic applications – user applications and most OS functions that are not crucial to the performance of the system and can be written to the page file.
16-31 | Real-time applications, such as the kernel, that cannot be written to the page file.
You can improve performance by increasing or decreasing the priorities of the process. To start an application, changing its base priority, use the following:
At the command prompt type | Effect on base priority
Start /realtime application_executable | Sets base priority to 24
Start /high application_executable | Sets base priority to 13
Start /normal application_executable | Sets base priority to 8
Start /low application_executable | Sets base priority to 4
Note: Using the start command to run an application at high priority may slow down performance, because other applications get less I/O time. This is why only Administrators can use the /realtime option.
You can use the boost settings on performance tab of the system properties program in Control Panel to improve the systems performance by manually changing the relative priority of foreground and background applications. There are three settings:
"Boost" Setting | Response | Registry Setting
None | All applications have base priority; if all are equally important. | 0
Middle Setting | Foreground priority increases by one. Background applications maintain base priority. Use it for non critical operations (playing game while checking spelling on .doc) | 1
Maximum | Foreground priority increases by two. Background applications maintain base priority. Use it to run an application that must have as much processor time as possible. But still allow background applications to have minimal access to resources. | 2
In Windows NT quantum (time slicing) scheduling is used, Performance Monitor is not able to show these priority changes. They can only be seen in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Control\PriorityControl\Win32PrioritySeparation Task Manager (can be started by clicking CTRL+ALT+DEL) is a Windows NT utility that provides data about propcesses currently running in Windows NT. It includes the following capabilities: Displays running applications and processes, including 16-bit. Allows you to monitor the use of some system resources; CPU-time, physical memory size, virtual memory size, page faults, base priority, and thread count. Displays graphs for CPU and Memory Usage. Sets microprocessor affinity for an application, changes the base priority of a process, and activates a debugger. Task Manager has the following tabs:
Task Manager Tab | Function
Applications | Shows the status of the applications and processes currently running on the computer. Here you can start, end, or switch to a program.
Processes | Info on the processes currently running on the computer. On the options menu, select show 16-bit tasks to include these in the process table.
Performance | Monitors the computers system performance, including microprocessor and memory usage.
Task Manager can be started with one of the following methods: Press CTRL+ALT+DELETE then click Task Manager. Right-click the Windows NT Taskbar, then click Task Manager. Press CTRL+SHIFT+ESC. Windows NT uses a algorithm called soft affinity to distribute processor load, when you use multiple processors. When possible Windows NT will assign a process to a processor. You can also force Windows NT to use a specific processor for a specific task, this is called hard affinity. To select microprocessors for a task, use the Task Manager processes tab à right-click the process name and click Set affinity (this option is only visable on multiprocessor computers.
| Top of page
Comments and suggestions? E-mail me at grantwil@sk.sympatico.ca
Last Updated: Wednesday, March 10, 1999 | Grant Wilson, Tisdale, SK. Canada