Running DP4 on 64-bit versions of Windows - A4000038 - 14 October 2009

As most modern PCs come with processors capable of running 64-bit operating systems, some DP4 users are considering trying to run their DP4 systems on machines running a 64-bit version of Windows. Unfortunately, for reasons that are not entirely clear, no release of DP4 available before September 2009 runs properly on these operating systems. The first version of DP4 that will support 64-bit Windows will be the 4.624 release dated 18 September 2009 or later. In this release you will be able to run either regular 32 bit DP4 for Windows, or a native 64 bit version of DP4. These two releases of DP4 will be 100% compatible with one another - both 64-bit and 32-bit processes can run simultaneously in the same instance of DP4. It is even possible for the service components to be mixed and matched, so that a 64-bit instance of DP4 could use the 64-bit database manager, but 32-bit components for networking.

Why older release do not run

Most 32-bit DP4 components from earlier releases (from 4.620 or so) run on 64-bit Windows. However two very important components do not work properly: dp4srvr.w32 and dfsetup.exe, will not run properly. Also the DP4 versioning utility, kentcurs.exe, does not run. The reason for this is is connected with the fact that these executables are encrypted and cannot be debugged because they perform sensitive encryption and decryption. This encryption uses a Windows API called VirtualQuery(), and this API does not work properly in 64-bit Windows and causes other kernel functions to misbehave subsequently. The encryption also uses a little known structure called the Thread Information Block (TIB), and it appears that on 64 bit Windows uses an item of data in this structure which is supposed to be available to applications. Therefore for 4.624 our encryption code has been modified not to use the problematic API, and not to use this item of data..

Pre 4.620 versions of DP4 cannot run on 64-bit Windows, because they request privileges that security policies will normally disallow. In addition session 0 isolation will prevent the DP4 service from interacting with the desktop on most 64-bit platforms.

Running 32-bit 4.624 DP4

You should note that in order to support simultaneous running of 32-bit and 64-bit DP4 executables there have been some changes to certain DP4 DLLs. In particular there are internal changes to the layout of DP4 IPC. This does not affect applications directly (there is no need to rebuild the applications with the latest DP4 libraries), but it means that three DLL files must all come from the same release of DP4 otherwise DP4 will almost certainly GPF and die horribly. The three DLLs concerned are syslibt.dll, usrlibt.dll, and sqllibt.dll. win1632w.exe (used for supporting legacy DOS applications on Win9x computers, and 16 bit Windows applications on all platforms) is also affected.

When 32-bit DP4 is installed on a 64-bit operating system you are offered an additional component to enable support for 64-bit DP4 applications as well.

Running 64-bit DP4

From release 4.624 DP4 is available as a native 64-bit package. Installing and running 64-bit DP4 is almost identical to installing and running 32-bit DP4. The only difference is that filenames which formerly contained w32 in the names are have w64 instead. Thus the 64-bit database manager is called dp4srvr.w64 and the DP4 service is srvw64.exe. Therefore dp4.ini files will need to be modified to run 64-bit components. One important point to note is that there is as yet no [win64] section in dp4.ini. Both the 64-bit and 32-bit DP4 will use the [win32] section. This will be of importance if you use the loader entry to set how DP4 is loaded, because if DP4 is started as an application you may find that instead of running srvw64.exe you are using srvw32.exe. If you run DP4 as a service than and loader is set to either srvw32.exe -start or srvw64.exe, then in fact the DP4 service will start with whichever of these is designated as the executable for the DP4 service, and, as noted at the top of this document, neither srvw32.exe or srvw64.exe will care whether the programs it is asked to run are 32-bit or 64-bit executables. You should also note that many DP4 DLLs will exist in both their 32-bit and 64-bit versions. In many cases the 32-bit version will be called ???libt.dll and the 64-bit version will be called ???w64t.dll. Not all the 32-bit DP4 DLLs have 64-bit equivalents. In particular the 64-bit syslib (sysw64t.dll) contains the equivalent of the functionality from usrlibt.dll and syslibnt.dll.

One other minor difference from the regular 32-bit set of DP4 is that if use600=0 is set for a 64-bit application it will run with a console rather than with the 4.5xx GUI terminal manager. We have no plans to produce a 4.5xx style GUI terminal manager for 64-bit applications.

Almost all components in the 64-bit release of DP4 are genuine 64-bit programs apart from the additional components that are installed to support running 32-bit processes as well. The only significant exception is mapedit.exe, which is and will remain a 32-bit only component. This component uses an old version of MFC and it is not easily possible to convert it to run natively.

As yet we do not have enough experience of running DP4 on 64-bit machines to know whether there is a significant advantage in using native 64-bit processes. These will tend to use more memory, which will make them tend to run more slowly, but on the other hand the more modern instruction set, which has far more registers available to it, will tend to speed things up. In principle the database manager could benefit considerably from being 64-bit, because it will be possible to allocate a very large amount of buffer space. Additionally, advanced data compression, which has a serious impact on performance in the 32-bit version of DP4, may well work better, since it uses 64-bit integer arithmetic.

Which version of Windows is right for you?

Since the 64-bit version of Windows does not support ntvdm or running 16 bit Windows applications, then if you want to run any 16-bit applications at all you cannot use a 64-bit version of Windows. If not, then running a native 64-bit OS is likely to be better, since you can install and use more than 4 Gigabytes of RAM, which might significantly improve performance with large databases. If you have decided to do this then it does not much matter whether you decide to use 32-bit or 64-bit DP4, since it will be easy to change your mind later on, and since 32-bit and 64-bit DP4 will happily co-exist.