* Added helper function to read Direct3D registry properties
[reactos.git] / reactos / dll / directx / d3d9 / d3d9.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS ReactX
4 * FILE: dll/directx/d3d9/d3d9.c
5 * PURPOSE: d3d9.dll implementation
6 * PROGRAMERS: Magnus Olsen <greatlrd (at) reactos (dot) org>
7 * Gregor Brunmar <gregor (dot) brunmar (at) home (dot) se>
8 */
9
10 #include <windows.h>
11 #include "d3d9_private.h"
12 #include "d3d9_helpers.h"
13
14 #include <debug.h>
15
16 DLLAPI
17 HRESULT Direct3DShaderValidatorCreate9(void)
18 {
19 UNIMPLEMENTED
20 return 0;
21 }
22
23 DLLAPI
24 HRESULT PSGPError(void)
25 {
26 UNIMPLEMENTED
27 return 0;
28 }
29
30 DLLAPI
31 HRESULT PSGPSampleTexture(void)
32 {
33 UNIMPLEMENTED
34 return 0;
35 }
36
37 DLLAPI
38 HRESULT DebugSetLevel(void)
39 {
40 UNIMPLEMENTED
41 return 0;
42 }
43
44 DLLAPI
45 HRESULT DebugSetMute(DWORD dw1)
46 {
47 UNIMPLEMENTED
48 return 0;
49 }
50
51 DLLAPI
52 IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion)
53 {
54 HINSTANCE hDebugDll;
55 DWORD LoadDebugDll;
56 DWORD LoadDebugDllSize;
57 LPDIRECT3D9 D3D9Obj = 0;
58 LPDIRECT3DCREATE9 DebugDirect3DCreate9 = 0;
59
60 UNIMPLEMENTED
61
62 LoadDebugDllSize = sizeof(LoadDebugDll);
63 if (ReadRegistryValue(REG_DWORD, "LoadDebugRuntime", (LPBYTE)&LoadDebugDll, &LoadDebugDllSize))
64 {
65 if (0 != LoadDebugDll)
66 {
67 hDebugDll = LoadLibrary("d3d9d.dll");
68
69 if (0 != hDebugDll)
70 {
71 DebugDirect3DCreate9 = (LPDIRECT3DCREATE9)GetProcAddress(hDebugDll, "Direct3DCreate9");
72
73 D3D9Obj = DebugDirect3DCreate9(SDKVersion);
74 }
75 }
76 }
77
78 return D3D9Obj;
79 }
80
81 BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
82 {
83 switch (ul_reason_for_call)
84 {
85 case DLL_PROCESS_ATTACH:
86 case DLL_THREAD_ATTACH:
87 case DLL_THREAD_DETACH:
88 case DLL_PROCESS_DETACH:
89 break;
90 }
91
92 return TRUE;
93 }