XNA Creators Club Online
foros de la comunidad
Page 1 of 1 (7 items)
Sort Posts: Previous Next

Hooking XNA

Last post 07/11/2009 10:18 by Stainless. 6 replies.
  • 06/11/2009 14:16

    Hooking XNA

    I have written an app that hooks d3d9.dll and intercepts the call to  Direct3DCreate9.

    I use it for warping the display to fit a projectors screen.

    It works fine for apps written for directx, but not for XNA apps.

    Xna is built on d3d9 isn't it?

    If so, I am lost as to why it is not being warped.

    [edit]

    I have done some more research, and it looks like if you use LoadLibrary then my hook will not work.

    How does pixwin intercept everything?

    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
  • 06/11/2009 16:25 In reply to

    Re: Hooking XNA

    Stainless:
    How does pixwin intercept everything?


    Also apps like Fraps manage hook into everything.

    This is the article I normally point people to who ask about this http://www.gamedev.net/community/forums/topic.asp?topic_id=359794 - is that what you are already doing?

    [edit: ah that one has the same limitation]
    Limitations
    Applications that manually load D3D9.dll via LoadLibrary, retrieve a pointer to Direct3DCreate9 using GetProcAddress and call it will NOT be hooked. All Direct3D SDK samples do this. If you really want to hook them, you can probably do it in another way, by providing your D3D9.dll and putting it in the same folder. I might try that out later.
    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 06/11/2009 16:43 In reply to

    Re: Hooking XNA

  • 06/11/2009 17:49 In reply to

    Re: Hooking XNA

    Sorry, I don't have $10,000 to spare.

    Proves it is possible though.
    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
  • 06/11/2009 17:55 In reply to

    Re: Hooking XNA

    I'll move the thread to the unmanaged forums, maybe one of the native guys knows more... you might also try gamedev.net - you get more native folk in there.
    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 06/11/2009 19:12 In reply to

    Re: Hooking XNA

    This link discusses how Fraps does its hooks.

    http://www.ring3circus.com/gameprogramming/case-study-fraps/


    Here is the key sentence...

    "The hooks are simply JMP operations assembled ad-hoc at the beginning of IDirect3DDevice9::Release and Present (and presumably the equivalent functions belonging to the other APIs)."
    Guardian is in playtest

    Blog | Willow Ridge
  • 07/11/2009 10:18 In reply to

    Re: Hooking XNA

    That's an interesting approach I will have to investigate.

    FRAPS works, sort of, so the approach must be valid, if his analysis is correct of course.

    I would have thought that it would fail if directx is in exclusive mode.


    Information is not knowledge, knowledge is not wisdom, wisdom is not truth, truth is not beauty, beauty is not love, love is not music, music is the best! Wisdom is the domain of the Wis (which is extinct).
Page 1 of 1 (7 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG