Reece Dunn msclrhd@googlemail.com on Aug 13, 2008 11:32 AM wrote about .NET program crashes involving stubbed functions
2008/8/13 Adam Petaccia adam@tpetaccia.com:
Its customary to make a function return NotImplemented in Gdiplus, if its just a dummy function that does nothing and returns. But .NET seems to check for this and throw an exception, crashing the program anyway.
See bug http://bugs.winehq.org/show_bug.cgi?id=12951 for details, but originally a program crashed because GdipNewPrivateFontCollection was just a stub. After the function was created, it still crashes because it returns "NotImplemented", rather than "Ok". IIRC, we return "NotImplemented" for some debugging reason, but if the goal of Wine is to run Windows applications, should we just go ahead and return "Ok" so that .NET apps don't freak out?
Of course in a perfect world, we wouldn't have to fake a return code, but until that time comes do people have opinions one way or another?
The problem with returning Ok is that it implies that the function succeeded in what it is intended to do. As a result, the application will continue and in this case expect to be able to use the private font collection. To prevent the application crashing, it is likely that several functions will need to be implemented.
Also note that the reporter of the bug mentions that they installed mono. This means that using MS.NET may lead to different behaviour. It also means that it should be possible to see how the GdipNewPrivateFontCollection call is being used by mono and the data that it returns.
Is there a method of resolving this using functions provided by Mono or will this require additional tools?
So to summarise, I suspect this will require more than simply returning Ok.
I agree. There should be more responses than just OK.
James McKenzie