![x3daudio1 7 dll is either not designed to run on windows x3daudio1 7 dll is either not designed to run on windows](https://anzalweb.ir/wp-content/uploads/2019/02/how-to-fix-bad-image-error-when-running-a-program.jpg)
I ran the binary with OllyDbg and neither the address nor the content of the pointer didn't changed between the two PlayWavecalls. Allocating a TMixWave in the caller app and copy the content in that structure from the returned pointer. The LoadWave function returns a pointer (PMixWave) to a TMixWave structure. Load the DLL dynamically: LoadLibrary, GetProcAddress, etc. the console app doesn't even play a single sound). Playing with DLL calling conventions: stdcall, cdecl, register, pascal - none of them working, some of them makes the symptoms worse (e.g. I was able to reproduce the issue without Delphi: when a caller application is written in assembly, the same symptom can be observed (both GUI and console). It is true when stepping through bytecode in the integrated debugger (CPU view) or in OllyDbg, whatever. This bonus also makes debugging impossible: since the process is "paused" while stepping through the commands one-by-one, it will again fail without making sound (because Load and Play don't follow each other immediately). Read of address 0000001E.īonus: when a single writeln is put between LoadWave and PlayWave, it will also crash instead of playing the sound. In the non-working code, it plays the wave file once, and after the readln, the program crashes with the following: Exception EAccessViolation in module waveout.dll at 000096A6.Īccess violation at address 00A096A6 in module 'waveout.dll'. In the working code, you can press the button as you will, it will work and play the loaded wave file (if you run the app outside Delphi - inside it sometimes doesn't even start up).
#X3daudio1 7 dll is either not designed to run on windows code#
Not working code (console app): InitWaveOut Procedure TForm1.FormDestroy(Sender: TObject) Procedure TForm1.Button1Click(Sender: TObject) Sound := LoadWave(PChar('.\keydown.wav')) Working code (GUI app): procedure TForm1.FormCreate(Sender: TObject) But circumstances also matter.Īpp is Delphi, DLL is also Delphi, same version, same architecture, source code is here: In short: there is a DLL call which causes EAccessViolation in the app when not called immediately after another procedure call of the DLL. After spending about two weeks investigating the problem without luck, I decided to ask this question on SO.