VirtualBox

Changeset 53304 in vbox


Ignore:
Timestamp:
Nov 11, 2014 3:00:41 PM (10 years ago)
Author:
vboxsync
Message:

VBoxDD: Dynamically resolve Direct3DCreate9Ex and make sure other d3d9.dll imports are loaded in a delayed fashion.

Location:
trunk/src/VBox/Devices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp

    r53206 r53304  
    503503    AssertReturn(pState->pD3D9, VERR_INTERNAL_ERROR);
    504504#else
    505     hr = Direct3DCreate9Ex(D3D_SDK_VERSION, &pState->pD3D9);
     505    /* Direct3DCreate9Ex was introduced in Vista, so resolve it dynamically. */
     506    typedef HRESULT (WINAPI *PFNDIRECT3DCREATE9EX)(UINT, IDirect3D9Ex **);
     507    PFNDIRECT3DCREATE9EX pfnDirect3dCreate9Ex = (PFNDIRECT3DCREATE9EX)RTLdrGetSystemSymbol("d3d9.dll", "Direct3DCreate9Ex");
     508    if (!pfnDirect3dCreate9Ex)
     509        return PDMDevHlpVMSetError(pThis->CTX_SUFF(pDevIns), VERR_SYMBOL_NOT_FOUND, RT_SRC_POS,
     510                                   "vmsvga3d: Unable to locate Direct3DCreate9Ex. This feature requires Vista and later.");
     511    hr = pfnDirect3dCreate9Ex(D3D_SDK_VERSION, &pState->pD3D9);
    506512    AssertReturn(hr == D3D_OK, VERR_INTERNAL_ERROR);
    507513#endif
  • trunk/src/VBox/Devices/Makefile.kmk

    r53299 r53304  
    244244  ifeq ($(KBUILD_TARGET),win) # (Disable this to work with OpenGL on Windows.)
    245245   VBoxDD_SOURCES       += Graphics/DevVGA-SVGA3d-win.cpp
    246    VBoxDD_LIBS.win      += d3d9.lib
     246   VBoxDD_LIBS.win      += d3d9.lib $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
     247   VBoxDD_LDFLAGS.win   += /DELAYLOAD:d3d9.dll
    247248  else
    248249   VBoxDD_SOURCES       += Graphics/DevVGA-SVGA3d-ogl.cpp
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette