0

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.

  • This is the worst close I've seen for while. *Questions about general computing hardware and software are off-topic for Stack Overflow.* Yes indeed. But questions about why calls to Win32 API functions cannot be resolved are very much on-topic. Close voters, shame on you! – David Heffernan Dec 18 '13 at 19:40

2 Answers2

3

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

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Sometimes people spend a lot of time to climb over walls instead of using the door just a small step away – Sir Rufo Dec 18 '13 at 15:12
2

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.

Ken White
  • 123,280
  • 14
  • 225
  • 444