Microsoft Windows Server 2003 Terminal Services

Large corporate environments often need to provide more than just standard commercial applications. They frequently develop and program their own special applications for terminal servers. How do these applications need to be programmed so that they are compatible with Terminal Services? To answer this question, let us first turn to the application runtime environment.

In some ways, terminal servers are similar to the older, centralized host or mainframe environments, in which users log on, start programs, read and write to joint files, print on joint printers, and access joint databases. Due to the operating system, however, all terminal server sessions in a host environment are completely separate, which also applies to the applications. This is one difference between terminal servers and host environments. Because terminal servers use central operating system services, the separation of sessions can never be as strict as on a host, with its distinctive options for session virtualization.

Another obvious difference is the graphical nature of applications on terminal servers compared to purely text-based applications on hosts . Applications with sophisticated graphics or animation significantly increase data traffic between server and client. In addition, advanced user -interaction functions, such as using a mouse, need to be supported.

Host applications were generally designed to run in multiuser environments. This was not the primary goal in designing many Windows-based applications, yet they often need to run on terminal servers. This section will describe all the parameters for designing your own or testing commercial applications for successful use on terminal servers. Both conventional 32-bit applications and the new .NET Windows Forms applications are addressed.

In principle, both types of applications can produce performance bottlenecks that affect all terminal server users. The bottlenecks are usually due to one of the following four reasons:

These potential bottlenecks point to the design requirements for applications appropriate for terminal servers.

32-Bit Windows-Based Applications

There are a number of general conditions required to make conventional 32-bit Windows-based applications suitable for terminal servers, including design specifications and the corresponding development guidelines. Only if all these preconditions are met will the application run properly on a terminal server or terminal server farm.

Fundamental Design Standards

Here are all the design requirements of terminal server “compatible applications.

Developer Guidelines

What specifically should developers do to create terminal server “compatible applications? Adapting the application logic and using certain API calls is helpful. The following list presents the key developer guidelines.

Verifying Compatibility

So how do we verify if an application is compatible with terminal servers? The Windows Application Compatibility Toolkit is a big help. It contains several tools for testing conventional 32-bit applications with Windows Server 2003, Windows XP, and Windows 2000. This includes the application s potential use on terminal servers.

Figure 5-7: The Windows Application Compatibility Toolkit Version 3.0 startup window.

The Microsoft Application Compatibility Analyzer supports the administrator in a tedious task that must precede a terminal server project: taking inventory of the applications used in an existing environment. The collection of data on existing applications can be configured using command-line parameters. There are several ways to collect data from remote computers on the network: starting a network release, using a logon script, or using predefined user actions. The actual data collection usually takes no longer than one to two minutes per computer.

The Microsoft Application Compatibility Analyzer consists of these two components:

Application Verifier (AppVerifier) is another tool in the Windows Application Compatibility Toolkit. It supports developers in verifying application compatibility under Windows Server 2003, Windows XP, and Windows 2000. AppVerifier focuses on reviewing typical problems related to application quality, especially heap errors, security gaps, drivers, system files, and access to certain registry areas. AppVerifier monitors the selected applications when they communicate with the operating system.

Note  

AppVerifier marks a file so that it continues to be monitored even when AppVerifier itself is no longer running. To stop monitoring an application, you need to remove it from the list in AppVerifier.

Figure 5-8: Application Verifier examining Notepad.exe.

Framework Applications

Much of what applies to 32-bit Windows-based applications is also true for .NET Windows Forms applications. However, the developer specifications and common language runtime make it much easier to adhere to the guidelines. Here are the reasons.

Terminal Server “Specific Applications

A special application variant directly accesses a terminal server s specific interfaces; this is the application programming interface, or API. This type of application is normally used for multiuser option administration on Windows Server 2003. It is also possible to use self-developed components to expand communication between the terminal server and RDP clients through virtual channels. The libraries and header files required to develop such applications or system components are known as Terminal Server SDK . The Terminal Server SDK is an integral part of the Platform SDK.

Note  

All terminal server “specific API functions are encapsulated in the Wtsapi32.dll file located in the Windows Server 2003 system directory.

Категории