Troubleshooting Win32

Find out what types of applications are NT compatibles, and learn how to optimize Win32 applications.

Mark Mosher

August 31, 1998

6 Min Read
ITPro Today logo in a gray background | ITPro Today

Maximize your applications' NT compatibility

Life was simple before Microsoft released Windows NT. Most users had only 16-bit DOS and Windows applications that ran only on Intel processors. NT supports most 16-bit DOS and Windows applications and runs 32-bit native applications on multiple hardware architectures, such as Intel, Alpha, and MIPS.

In NT environments, application compatibility and support can be confusing. Users waste time and money determining which applications are NT compatible, and they waste time troubleshooting application compatibility problems. Users often ask the following questions about running Win32 applications on NT.

What is a Win32 application?

A Win32 application is a 32-bit application that meets Microsoft's Win32 APIstandard. This standard ensures that applications can take advantage of Windowsfeatures such as graphics, window management, memory management, file I/O,security, networking, and threading. Win32 applications run on one processor ormultiple processors and on multiple hardware architectures.

Why do different versions of the Win32 API exist?

An advantage of developing an application to the Win32 API standard is thatyou can deploy the application to any operating system (OS) that adheres to thestandard. To accommodate architectural differences in OSs, subsets (or flavors)of the Win32 API are necessary. Wherever possible (as the OSs' architecturesallow), each Win32 API flavor shares a common set of APIs. For example, WindowsNT and Windows 95 support multithreaded applications. The Win32 API flavors forNT and Win95 offer the same functions to create and manage threads. In contrast,NT supports native multithreading, but Windows 3.1 does not. The Win32 APIsubset on Windows 3.1 does not support the Win32 functions for creating andmanaging threads.

To help differentiate Win32 API flavors, Microsoft established a namingconvention in which a trailing character follows the name Win32. For example,Win32s is the Win32 subset for 32-bit applications that run on Windows 3.1. Formore detailed documentation about the different flavors of Win32 for eachplatform, see the Help files that Microsoft provides with its development tools.

The Win32 API standard also exists on non-Microsoft OSs. For example,Digital Equipment provides a Win32 interface for VMS.

What is the portable executable format?

Win32 applications are stored in the portable executable format. No matterwhich Win32 API flavor a developer uses to write an application, the applicationhas this format. For example, Win32s on Windows 3.1 is a subset of Win32 underWindows NT. Windows 3.1 and NT applications share the portable executableformat, so Win32s programs run natively under NT. This rule does not always apply if the machine running NT is not Intel based.

Which operating systems (OSs) run Win32 applications?

OSs that support Win32 applications include Windows NT 3.1 and later,Windows 95, Windows Consumer Electronics (Windows CE), Windows 3.1 (usingWin32s), and VMS (using the Affinity program).

Can I run 16-bit DOS and Windows applications on an Alpha Windows NTsystem?

NT on all platforms supports 16-bit DOS and Windows 3.1 applications(also known as binary compatibility). Therefore, you can run 16-bit applicationson an Alpha-based NT platform without rebuilding them.

How do developers create Win32 applications for non-Intel platforms?

To create an executable application for a non-Intel platform, you must use acompiler that supports the creation of applications for the platform. Forexample, Microsoft has different versions of Visual C++ for each platform. Thesedifferent versions let you use the same source code to target applications formultiple platforms, such as Intel, Alpha, or a Windows Consumer Electronics (CE)device running an SH3 processor.

How do I determine an application's native processor type?

Native Win32 applications come in different flavors, but they all havethe .exe extension. To effectively troubleshoot application compatibilityproblems, you need to determine what kind of processor the application'sdeveloper designed it for.

In NT Explorer, find the application you want to run. Right-click theapplication, and select Quick View. Screen 1 shows the Quick View window that pops up. This window contains information about the application, including its native platform. Under Technical File Information, the Image File Header section shows information about the application type. This section's layout depends on the application type. For Win32 applications, the Image File Header section shows the machine type. Intel-based Win32 applications' machine type is Intel x86. Alpha-based Win32 applications' machine type is DEC Alpha AXP.

For 16-bit DOS applications, the Quick View window shows the operatingsystem (OS) but not the application type. To verify that an application is a 16-bit DOS application, you must view a detailed listing of the application's files. Open NT Explorer and select View, Details from the toolbar. Screen 2 shows a detailed listing of files in a directory. For 16-bit DOS applications, the words MS-DOS Application appear in the Type column.

How do I run a Win32 Intel application on an Alpha machine?

Win32 applications are source-code compatible. If you try to run an Intelapplication on an Alpha machine running Windows NT 4.0, you get the errormessage you see in Screen 3. Earlier versions of NT generate the error message11 - An attempt was made to load a program with an incorrect format.

Users commonly need to run Intel applications on Alpha machines. For optimalperformance, you need to obtain the Alpha versions of your applications. Someapplications don't have Alpha versions. To run Win32 Intel applications on yourAlpha machine, you need to install special software such as DigitalSemiconductor's FX!32.

What is FX!32?

FX!32 is translation software for Alpha systems. It lets users run 32-bitIntel-based Windows applications on Alpha machines. You can download FX!32 forfree at http://www
.digital.com/semiconductor/amt/fx32/
fxdownload.html. (For more information about FX!32, see Brian Gallagher, "FX!32,"April 1998.)

What types of applications does FX!32 support?

FX!32 supports standard executables files, screen savers, services,and ActiveX controls. For restrictions on FX!32's functionality, see the FX!32 README document that comes with the software.

Why are Win32 applications that run on different platforms onlysource-code compatible?

You might think Win32 applications' source-code compatibility is adisadvantage because developers must rebuild applications to run on non-Intel platforms. However, source-code compatible applications give you optimal performance.

Each processor that NT runs on has a machine-readable instruction set. The portable executable format for a Win32 application is the same regardless of platform, but the application's machine-readable instructions are platformspecific. For example, an Intel Win32 application contains x86 machineinstructions. Performance decreases if the system must convert from oneinstruction set to another on the fly. When a developer recompiles anapplication for a specific processor, the application runs more efficientlybecause it contains the machine-readable instructions for the processor.Developing applications for the Win32 standard lets you target multipleplatforms and achieve native application performance on any platform.

Where can I find additional information about 32-bit applications?

For information about the Win32 API, refer to Microsoft Win32Programmer's Reference (Microsoft Press). For more information about Win32 development, go to Microsoft's Win32 Web site (http://www.microsoft.com/win32dev/). For information about Windows NT application support, refer to Helen Custer's Inside Windows NT (Microsoft Press). For information about running Win32 applications on VMS, go to http://www.openvms.digital.com/ affinity.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like