ws2_32/tests: Remove redundant NULL check before HeapFree().
[wine] / dlls / d3d9 / d3d9_main.c
1 /*
2  * Direct3D 9
3  *
4  * Copyright 2002-2003 Jason Edmeades
5  * Copyright 2002-2003 Raphael Junqueira
6  * Copyright 2005 Oliver Stieber
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  *
22  */
23
24 #include "config.h"
25 #include "initguid.h"
26 #include "d3d9_private.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
29
30 static int D3DPERF_event_level = 0;
31
32 HRESULT WINAPI D3D9GetSWInfo(void) {
33     FIXME("(void): stub\n");
34     return 0;
35 }
36
37 void WINAPI DebugSetMute(void) {
38     /* nothing to do */
39 }
40
41 IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) {
42     IDirect3D9Impl* object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D9Impl));
43
44     object->lpVtbl = &Direct3D9_Vtbl;
45     object->ref = 1;
46     object->WineD3D = WineDirect3DCreate(SDKVersion, 9, (IUnknown *)object);
47
48     TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);
49
50     return (IDirect3D9*) object;
51 }
52
53 /* At process attach */
54 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
55 {
56     TRACE("fdwReason=%d\n", fdwReason);
57     if (fdwReason == DLL_PROCESS_ATTACH)
58         DisableThreadLibraryCalls(hInstDLL);
59
60     return TRUE;
61 }
62
63 /***********************************************************************
64  *              D3DPERF_BeginEvent (D3D9.@)
65  */
66 int WINAPI D3DPERF_BeginEvent(D3DCOLOR color, LPCWSTR name) {
67     FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
68
69     return D3DPERF_event_level++;
70 }
71
72 /***********************************************************************
73  *              D3DPERF_EndEvent (D3D9.@)
74  */
75 int WINAPI D3DPERF_EndEvent(void) {
76     FIXME("(void) : stub\n");
77
78     return --D3DPERF_event_level;
79 }
80
81 /***********************************************************************
82  *              D3DPERF_GetStatus (D3D9.@)
83  */
84 DWORD WINAPI D3DPERF_GetStatus(void) {
85     FIXME("(void) : stub\n");
86
87     return 0;
88 }
89
90 /***********************************************************************
91  *              D3DPERF_SetOptions (D3D9.@)
92  *
93  */
94 void WINAPI D3DPERF_SetOptions(DWORD options)
95 {
96   FIXME("(%#x) : stub\n", options);
97 }
98
99 /***********************************************************************
100  *              D3DPERF_QueryRepeatFrame (D3D9.@)
101  */
102 BOOL WINAPI D3DPERF_QueryRepeatFrame(void) {
103     FIXME("(void) : stub\n");
104
105     return FALSE;
106 }
107
108 /***********************************************************************
109  *              D3DPERF_SetMarker (D3D9.@)
110  */
111 void WINAPI D3DPERF_SetMarker(D3DCOLOR color, LPCWSTR name) {
112     FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
113 }
114
115 /***********************************************************************
116  *              D3DPERF_SetRegion (D3D9.@)
117  */
118 void WINAPI D3DPERF_SetRegion(D3DCOLOR color, LPCWSTR name) {
119     FIXME("(color %#x, name %s) : stub\n", color, debugstr_w(name));
120 }