NO

Sign in to follow this  
  • entries
    145
  • comments
    222
  • views
    138280

Security through instability.

Sign in to follow this  
Tape_Worm

20 views

So I observed an interesting problem with Managed DirectX, Vista and running Visual Studio 2005 as Administrator (I do this because dbmon doesn't work properly if I run as a normal user).

Yes, I'm still working on Gorgon. I refactored it a couple of times in an attempt to streamline a few things and clean out some leftover garbage.

Anyway, the quirk.

So, after refactoring and removing a lot of junk code regarding lost devices I decided to test it. I switch to full screen mode (which is a fake device loss, as it's initiated by the library), this works beautifully. So I alt+tab back to the desktop. No errors, awesome. I switch back... and the fun begins. The window doesn't even appear, nothing happens at all. Usually this comes from polling for a lost device logic, but after confirming the logic was fine I was at a loss. So I run dbmon and check the debug messages, and this is what I saw:



FATAL ERROR! What the fuck man? I mean really, I had NEVER seen that error before. So I decide to check it outside of the IDE (which I'm doing regularly after a debacle involving multi-threading and VB.NET at work). I perform the tests again and what do you know? I get an error when I go to switch back to the application. I launch a debugging process and it's just a normal problem (that is, I'm dumb and forgot to check for a lost device condition before calling a Device method). So it got me thinking... what's different? I know! I'm running at admin level with the IDE. So I switch it to user level and the device loss and reset works as it should (minus the aforementioned stupidity on my part). So hopefully this will help someone else who might be running into the same problems.

Device loss/reset stuff is very annoying, and requires a bit of thought considering that MDX decides to throw exceptions all over the place if a device is lost (this is incredibly stupid, considering it's pretty harmless to call things while a device is lost in C++, you'll get just an non-SUCCESS HRESULT). I know I can turn off exceptions, but what happens here is that ALL the exceptions get turned off. This is not desirable either since I can't check for an error condition on particular methods/properties. So I'm damned if I do, and damned if I don't. Clearly this part wasn't well thought out.

Hopefully Promit and others can get SlimDX fleshed out sometime.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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