Porting .NET app to Vista.. DEP strikes!
An interesting issue happened these days when I tried to port some apps to Vista.
Basically all .NET apps compiled with Visual Studio 2005/2008 are marked “NX compatible” by default. If your .NET app uses an incompatible DLL or COM object, the app will crash. What I found funny was that the message was a standard access violation error instead of a more specific DEP error.
Debugging it was not easy: I was unable to step through the code in VS2005 and using WinDbg wasn’t much of help too, except that the line where it crashed was something like a mov [esp+24h], constant with ESP well within limits — an instruction which should not generate an access violation exception given the current ESP value. At that point I was starting to think that my “attempt to read or write protected memory“ was, in fact, something else.
Luckily my mind went to DEP and in less than 1 minute of Google search I was able to find this link with a good solution.
I tried, without much faith, and it worked. And the C# app was finally working on Vista.
TargetInvocationException in asynchronous web service call
I’ve seen so many solutions around to solve a TargetInvocationException raised by an asynchronous web service call in .NET and they are all but satisfactory. Some go so far to create a worker thread which is overkill and, above all, a clear sign of cargo culting.
The solution is very very simple. The exception is raised if a call fails due to a network problem, and you have accessed the Result properties of the completion event arguments. Simply check if the Error property is null before accessing the Result property (it’s this access which raises the exception).
ScummVM DS Patches - version 4
(Quick download links : .NDS builds or .DS.GBA builds, modified sources here, SourceForge patches here)
I’ve patched ScummVM DS once again..
See here for more details, versioning, how, why, what, which, who..
Changes in ScummVM/DS 0.11.1.MMP4 (.NDS builds or .DS.GBA builds):
- All previous changes
- Fixed a bug with mouse icon
- Attempt to show mouse cursor on upper screen also when LCDs are swapped (sometimes it fails to be in the correct position but it covers most cases).
Be vigilant.
ScummVM DS Patches - version 3
(Quick download links : .NDS builds or .DS.GBA builds, modified sources here)
I’ve patched ScummVM DS once again..
See here for more details, versioning, how, why, what, which, who..
Changes in ScummVM/DS 0.11.1.MMP3 (.NDS builds or .DS.GBA builds):
- All previous changes
ScummVM Build G (NDS only - for Lure of the Temptress… untested yet and the main site does not report it as working.. so state is unknown.)- Hover-only mouse option - this will simulate the job done by a mousepad on a laptop
- Show cursor on aux screen - this will show the cursor on the secondary screen if the screens are not swapped (together with Hover-only, it provides an UI to ScummVM more similar to the classical one found on laptops).
Now I have to go.. Kyrandia needs my help ![]()
