CryptoSys Home > Using on a 64-bit system

Using CryptoSys API, CryptoSys PKI, FirmaSAT, etc. on a 64-bit system


Our cryptographic products CryptoSys API, CryptoSys PKI, FirmaSAT, SC14N, diQRcode and xmlsq will work on both 32-bit and 64-bit Windows systems. The distribution includes core DLL executables and test programs compiled for both 32-bit (Win32) and 64-bit (X64) platforms.

Latest Installation | Exception from HRESULT:0x8007000B | How to check which version is being used | Wow64: Background | Acknowledgements and References | Disclaimer | Contact Us

Latest Installation

The latest build includes an alternative core DLL compiled for 64-bit machines. The setup program should install both the 32-bit and 64-bit core DLLs in the correct Windows system folders and make the required entries in the correct 32-bit and 64-bit views of the registry. Windows Wow64 will automatically select the correct DLL for the platform of the application you are running, provided it can find it.

There are two core DLLs, one for each platform

Only the core DLL in each product is affected by the platform: namely,

Two versions of the core DLL are provided - one compiled for Win32 (x86) platforms and a separate one compiled for Win64 (X64) platforms. To check which DLL file is which, right-click on the file in Windows Explorer and select Properties > Details. You should see "32-bit" or "64-bit" in the description.
When we say "core" DLL we mean the core native Windows DLL. Nothing to do with .NET core.

32-bit version 64-bit version

The correct system directories for the core DLLs on a 64-bit machine are usually as follows.

64-bit DLL
C:\Windows\System32
32-bit DLL
C:\Windows\SysWOW64

Note that these directory names are the opposite to what you might expect. The 64-bit DLL goes into the System32 directory, while the 32-bit DLL goes into the SysWOW64 directory.

But there is only one .NET class library DLL

The DLLs for the .NET class libraries are compiled for all platforms and so will work on both Win32 and Win64 platforms. These are:

When compiling your .NET project in MS Visual Studio, make sure you set Solution Platforms to Any CPU
Set Solution Platforms to Any CPU

ActiveX (COM) DLL

Note that the free 32-bit ActiveX (COM) DLL diCryptOCX.dll in CryptoSys API is only for Win32 platforms and is not supported by 64-bit Microsoft Office.

Exception from HRESULT:0x8007000B

If you get this error
An attempt was made to load a program with an incorrect format. (Exception from HRESULT:0x8007000B)
then a 64-bit program is trying to access a 32-bit DLL or vice versa. Make sure you have the core DLLs in the correct folders and make sure you are compiling for Any CPU (see above).

Note that if you use the .NET methods in MS Visual Studio on a 64-bit machine, then it must use the 64-bit core DLL. If you have mistakenly copied the 32-bit DLL into the C:\Windows\System32 directory, you will get this error.

How to check which version is being used

See Detecting Win32 or X64 platform (API) or Detecting Win32 or X64 platform (PKI).

Wow64: Background

WoW64 (Windows-on-Windows 64-bit) manages 64-bit and 32-bit applications transparently on a Windows 64-bit operating system.

In 64-bit Windows, there are two %ProgramFiles% directories:

There are two directories for library and executable files:

where %SystemRoot% is usually C:\Windows.

Yes, it's the opposite of the way you'd expect it to be. The native 64-bit libraries are in the System32 directory, but the 32-bit libraries are in SysWOW64. When executing 32-bit applications, WoW64 redirects requests for DLLs automatically to %SystemRoot%\SysWOW64. WOW64 can also make the source directory appear to be C:\Windows\system32 to the application that calls it, even if it's a 32-bit application and the library is really in C:\Windows\SysWOW64. So be careful.

Similarly, there are two registry keys to which WoW64 will automatically redirect requests depending on the application:

Acknowledgements and References

Thanks to Terry Wallace and other 64-bit users for their help and to the contributors at NSIS for helping us get the setup program working properly.

Disclaimer

Please download the Trial Edition and make whatever checks you need to on your system before purchase.

Contact

For more information or to comment on this page, please send us a message.

This page last updated 30 December 2021