IWineD3D * WINAPI WineDirect3DCreate(UINT version, IUnknown *parent) { IWineD3DImpl *object; HRESULT hr; hr = VBoxExtCheckInit(); if (FAILED(hr)) { ERR("VBoxExtCheckInit failed, hr (0x%x)\n", hr); return NULL; } object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) { ERR("Failed to allocate wined3d object memory.\n"); VBoxExtCheckTerm(); return NULL; } hr = wined3d_init(object, version, parent); if (FAILED(hr)) { WARN("Failed to initialize wined3d object, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); #ifdef VBOX_WITH_WDDM VBoxExtCheckTerm(); #endif return NULL; } TRACE("Created wined3d object %p for d3d%d support.\n", object, version); return (IWineD3D *)object; }
/* Do not call while under the GL lock. */ struct wined3d * CDECL wined3d_create(UINT version, DWORD flags) { struct wined3d *object; HRESULT hr; object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) { ERR("Failed to allocate wined3d object memory.\n"); return NULL; } hr = wined3d_init(object, version, flags); if (FAILED(hr)) { WARN("Failed to initialize wined3d object, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); return NULL; } TRACE("Created wined3d object %p for d3d%d support.\n", object, version); return object; }
/* Do not call while under the GL lock. */ IWineD3D * WINAPI WineDirect3DCreate(UINT version, void *parent) { IWineD3DImpl *object; HRESULT hr; object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) { ERR("Failed to allocate wined3d object memory.\n"); return NULL; } hr = wined3d_init(object, version, parent); if (FAILED(hr)) { WARN("Failed to initialize wined3d object, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); return NULL; } TRACE("Created wined3d object %p for d3d%d support.\n", object, version); return (IWineD3D *)object; }