Jump to content

GetOpenFileName causes a crash


TmEE

Recommended Posts

I am not sure if this should be in the programming section or not but this is directly related to Win8. If this is in wrong place I will apologize for doing so and kindly request this to be moved to the right place :blushing:

I have been developing a music tool for a retro game console (Sega Mega Drive / Genesis) and everything has been nice and dandy on Win98SE, XP32, Vista and 7 (32 and 64bit) but Win8 64bit (and possibly 32, I have not yet tested) is causing me massive headache.

Whenever I call GetOpenFileName (ANSI version) I will experience a crash sooner or later after random amount of time in random part of the program. The error report says the crash happens in NTDLL.DLL (which I don't directly deal with), problem is an access violation. My program is not having any out of bounds array accesses nor any black pointer magic vomiting all over the memory (well, mostly not, but when there is some I'll always see and fix it). When I compile the program with debug option I'll be noted on any such problem and there is none of that happening, everything is clean.

I have no hooks attached to the function, all is as vanilla as it gets. I have double checked all buffers that I pass, there is no problem of them being too small or such, everything has right size and proper termination character in the end.

Doing things differently in the OFN struct does not really seem to make any difference, things will still work in other windowses and still fail in 8... Running the program in compatibility mode and/or as administrator makes almost no difference - setting the compatibility to 98 will make the program crash immediately upon calling the function, and on real 98SE (where I primarily develop the program on) all will work perfectly. I am developing the program in FreeBASIC, compiler version 0.24 if it is important to know.

So I wonder is there any changes done in Win8 around that part that break something...? It seems so unlikely, or there would be a lot of old programs experiencing issues...

I'd happily add a workaround to get this work, but I really have no idea what I could do about it... all I have tried has not got me any closer to desired operation.

Link to comment
Share on other sites


GetOpenFileName (ANSI version)... I wouldn't be surprised if they turn out to have done away with some ANSI functions. Try using the UNICODE version (I know it causes problems with 9xME) instead just for testing. If that turns out to work, we'll know how shallow runs backward compatibility nowadays...

Link to comment
Share on other sites

  • 3 weeks later...

A tester of mine found a really unlikely fix :

When you enable Stereo Mix in the sound settings then there are no more crashes ! It fixes some games too, like Bioshock according to him.

As for unicode, I have been having some problems making my compiler understand it right so I have not managed to test things around it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...