As mentioned previously, the Win32 full-text search engine runs on three different platforms. It uses the following code to detect which operating system it is running on:
/////////////////////////////////////////////////
// operating system identification
#define OS_WIN95 0x03
#define OS_WIN32s 0x02
#define OS_NT 0x00
g_os_version = (GetVersion() >> 30) & 0x0003;
If you plan to create a single binary that will run on Windows NT, Windows 95, and Win32s, make sure that you account for the slight differences in national language support on each platform. Appendix K lists which NLSAPI functions each platform supports. You will have to find alternatives when your application runs on a version of Windows that doesn't support the API function you want to use.
For example, Win32s and Windows NT 3.x do not support IsDBCSLeadByteEx. You can, however, retrieve the lead-byte ranges for a particular code page by calling GetCPInfo. Windows 95, on the other hand, doesn't support Unicode-based NLSAPI calls such as LCMapStringW or GetStringTypeW. If your application is Unicode-based, you will need to assemble information by converting data with WideCharToMultiByte and calling the -A version of the appropriate function. If your data spans multiple Windows code pages, you'll have to break the data down into segments that span a single code page, call the -A function on each segment, and merge the results.