2

Apparently when I run some 32-bit apps I created using gtkD on Win64 systems with Symantec Endpoint Protection installed and network drives mapped, and try to bring up a file dialog, something in the runtime attempts to load SnacNp64.dll, a 64-bit DLL, into 32-bit address space. This DLL is a component of Symantec Endpoint Protection that's used for networking stuff, hence this error only happening under such a narrow set of circumstances.

When I run a program from a Win64 native console and try to load a file dialog, I get:

The image file C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\SnacNp64.dll is valid, but is for a machine type other than the current machine. Select OK to continue, or CANCEL to fail the DLL load.

When I select cancel everything works fine, and the program seems to suffer no ill effects from the DLL failing to load. When I select ok, I get an access violation, presumably because gtkD tries to load a 64-bit DLL into a 32-bit program.

However, when I run from a Cygwin terminal instead of a native Win64 one, it seems that the Cygwin console catches the error and forces the DLL to be loaded, thus crashing my application.

This error does not seem to happen for other 32-bit GTK-based apps, such as GIMP, on the same machines.

Basically, how do I make absolutely sure that my 32-bit app never tries to load a 64-bit DLL under any circumstances?

dsimcha
  • 67,514
  • 53
  • 213
  • 334
  • Maybe it's because cmd.exe is a 64 bit app? Is the Cygwin terminal 64 bit too? Your could add some code in your app that just opens a file dialog on startup, and build it with /subsystem:windows:4, to avoid it being run through a 64 bit program. The next step would be to try a minimal a D program that just creates a file open dialog. I don't know if gtkD uses GetOpenFileName or the newer IFileDialog COM version of the dialog box. Not much help, I know. – torhu Jul 23 '10 at 00:05

0 Answers0