Trouble creating a D3DDevice inside WoW menu

Shout-Out

User Tag List

Results 1 to 2 of 2
  1. #1
    Saridormi's Avatar Contributor
    Reputation
    307
    Join Date
    Mar 2007
    Posts
    556
    Thanks G/R
    19/17
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble creating a D3DDevice inside WoW

    Hi all,

    I'm currently trying to learn how to draw on WoW by hooking the DirectX functions, however I've run into a problem I don't know how to approach.

    I can successfully create a D3DDevice (and grab functions from its vtable) from an injected dll, however doing so causes a number of problems to appear, notably:

    Lua errors (triggered by combat log and appear occasionally): https://i.imgur.com/EzFjHTh.png
    Latency jumping to an incredibly high number: https://i.imgur.com/zyoJKlP.png
    WoW hanging when closed after logging into the game world (but not if hook is only done on the login screen)

    My only assumption is that there's some kind of memory corruption going on, but I have no idea what could be causing it or how to fix it.

    These problems only appear when the d3d9device is created, and not before.


    Here is my code (called from WoW's main thread):

    Code:
        // 0x20
        LPDIRECT3D9 Direct3D_Object = Direct3DCreate9(D3D_SDK_VERSION);
    
        D3DPRESENT_PARAMETERS params;
        ZeroMemory(&params, sizeof(params));
        params.Windowed = true;
        params.SwapEffect = D3DSWAPEFFECT_DISCARD;
        params.BackBufferFormat = D3DFMT_UNKNOWN;
    
    
        IDirect3DDevice9* device = nullptr;
    
        // Was using WoW's HWND before this, added this to see if that was the issue
        HWND window = CreateWindowA("STATIC", "dummy", 0, 0, 0, 100, 100, NULL, NULL, NULL, NULL);
    
        // After this line is executed, problems appear
        HRESULT result = Direct3D_Object->CreateDevice(0x0, D3DDEVTYPE_HAL, window, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &params, &device);
        if (result < 0)
        {
            PrintD3DError(result);
            return;
        }
    
    
        return;
    Any help would be greatly appreciated. Thank you!


    Trouble creating a D3DDevice inside WoW
  2. #2
    Saridormi's Avatar Contributor
    Reputation
    307
    Join Date
    Mar 2007
    Posts
    556
    Thanks G/R
    19/17
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I appear to have fixed this by calling this code from a separate thread. I don't know enough about Direct3D to know why this worked, but I'm glad it has


Similar Threads

  1. [Core] Who know create 3.3.5a wow server on linux ubuntu?
    By extreme5 in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 07-31-2011, 08:23 AM
  2. Timing inside WoW(ASM)
    By lanman92 in forum WoW Memory Editing
    Replies: 7
    Last Post: 04-17-2009, 09:32 PM
  3. Joining/Creating a Private Server WoW Joining(not creating server)
    By Otaka in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 02-12-2008, 04:57 PM
  4. Recommended Programs for Creating WoW Movies
    By Örpheus in forum World of Warcraft Guides
    Replies: 2
    Last Post: 12-24-2006, 08:13 PM
All times are GMT -5. The time now is 11:31 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search