Run 32 bit program on windows xp

954 views Asked by At

I have a problem with Rad Studio XE3: my program (32 bit), goes regularly on my machine (Windows 7-64 bit), but when i try to run the executable on "xp mode" the following error message appears:"cannot find entry point for Wow64RevertWow64FsRedirection in KERNEL32.dll library".

I have to run it on a computer, 32 bit, mounting xp.

Thanks in advance.

2

There are 2 answers

0
Ken White On

The Wow64RevertWow64FsRedirection function is available only on Win64 systems.

Minimum supported client Windows Vista, Windows XP Professional x64 Edition [desktop apps only]

It's not something that is used anywhere in the Delphi RTL or VCL, so it's something your code (or a third-party component or library you're using) is doing.

You'll need to remove it (and any other 64-bit only functions) in order to make your application compatible with 32-bit versions of Windows.

1
David Heffernan On

WOW64 file system redirection only makes sense when running under WOW64. As such, the function only works on a 32 bit process running on a 64 bit system, that is under WOW64. The function if available for a 64 bit process, but always fails (returns FALSE). And the function is not available on a 32 bit system.

So, you must not use load-time linking for the function, if you want your program to run on a 32 bit OS. And you must expect it to fail if you call it from a 64 bit process.

If you are going to disable file system redirection then you should:

  1. Use runtime linking. That is with calls to GetModuleHandle('kernel32') and GetProcAddress().
  2. Add code to handle the fact that GetProcAddress() may return NULL. In that scenario you just skip the calls that disable file system redirection.
  3. Skip the calls to disable file system redirection if your process is 64 bit because they always fail.

Now, there are very few scenarios where disabling file system redirection is appropriate. Generally, in my experience, if a developer is savvy enough to recognise such a scenario, then they are also savvy enough to deal with the three points I listed above. So, it seems plausible to me that your code should not be disabling file system redirection at all. I wonder if there is a better solution to whatever problem led you to disable file system redirection