Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


Sign in to follow this  
Followers 0
TmEE

GetOpenFileName causes a crash

3 posts in this topic

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.

0

Share this post


Link to post
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...

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.