Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

GetOpenFileName causes a crash


  • Please log in to reply
2 replies to this topic

#1
TmEE

TmEE

    Mega Drive Modding Master

  • Member
  • PipPipPip
  • 361 posts
  • OS:98SE
  • Country: Country Flag
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.
Posted Image Mida sa loed ? Nagunii aru ei saa ;)


How to remove advertisement from MSFN

#2
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Supervisor
  • 5,844 posts
  • OS:98SE
  • Country: Country Flag

Donator

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...

#3
TmEE

TmEE

    Mega Drive Modding Master

  • Member
  • PipPipPip
  • 361 posts
  • OS:98SE
  • Country: Country Flag
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.
Posted Image Mida sa loed ? Nagunii aru ei saa ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN