ReactOS 0.4.16-dev-336-gb667d82
d3d9.c File Reference
#include <d3d9.h>
#include "d3d9_helpers.h"
#include "d3d9_create.h"
#include <debug.h>
Include dependency graph for d3d9.c:

Go to the source code of this file.

Macros

#define DEBUG_MESSAGE_BUFFER_SIZE   512
 

Typedefs

typedef IDirect3D9 *(WINAPILPDIRECT3DCREATE9) (UINT)
 

Functions

HRESULT WINAPI Direct3DShaderValidatorCreate9 (void)
 
HRESULT WINAPI PSGPError (void)
 
HRESULT WINAPI PSGPSampleTexture (void)
 
HRESULT WINAPI DebugSetLevel (void)
 
HRESULT WINAPI DebugSetMute (DWORD dw1)
 
IDirect3D9 *WINAPI Direct3DCreate9 (UINT SDKVersion)
 
BOOL APIENTRY DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
 

Variables

static LPCSTR D3dError_WrongSdkVersion
 

Macro Definition Documentation

◆ DEBUG_MESSAGE_BUFFER_SIZE

#define DEBUG_MESSAGE_BUFFER_SIZE   512

Definition at line 15 of file d3d9.c.

Typedef Documentation

◆ LPDIRECT3DCREATE9

typedef IDirect3D9 *(WINAPI * LPDIRECT3DCREATE9) (UINT)

Definition at line 17 of file d3d9.c.

Function Documentation

◆ DebugSetLevel()

HRESULT WINAPI DebugSetLevel ( void  )

Definition at line 45 of file d3d9.c.

46{
48 return 0;
49}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

◆ DebugSetMute()

HRESULT WINAPI DebugSetMute ( DWORD  dw1)

Definition at line 51 of file d3d9.c.

52{
54 return 0;
55}

◆ Direct3DCreate9()

IDirect3D9 *WINAPI Direct3DCreate9 ( UINT  SDKVersion)

Definition at line 57 of file d3d9.c.

58{
59 HINSTANCE hDebugDll;
60 DWORD LoadDebugDll;
61 DWORD LoadDebugDllSize;
62 LPDIRECT3D9 D3D9Obj = 0;
63 LPDIRECT3DCREATE9 DebugDirect3DCreate9 = 0;
64 CHAR DebugMessageBuffer[DEBUG_MESSAGE_BUFFER_SIZE];
65 UINT NoDebugSDKVersion = SDKVersion & ~DX_D3D9_DEBUG;
66
67 LoadDebugDllSize = sizeof(LoadDebugDll);
68 if (ReadRegistryValue(REG_DWORD, "LoadDebugRuntime", (LPBYTE)&LoadDebugDll, &LoadDebugDllSize))
69 {
70 if (0 != LoadDebugDll)
71 {
72 hDebugDll = LoadLibraryA("d3d9d.dll");
73
74 if (0 != hDebugDll)
75 {
76 DebugDirect3DCreate9 = (LPDIRECT3DCREATE9)GetProcAddress(hDebugDll, "Direct3DCreate9");
77
78 return DebugDirect3DCreate9(SDKVersion);
79 }
80 }
81 }
82
83 if (NoDebugSDKVersion != D3D_SDK_VERSION && NoDebugSDKVersion != D3D9b_SDK_VERSION)
84 {
85 if (SDKVersion & DX_D3D9_DEBUG)
86 {
87 HRESULT hResult;
88 hResult = SafeFormatString(DebugMessageBuffer, DEBUG_MESSAGE_BUFFER_SIZE, D3dError_WrongSdkVersion, NoDebugSDKVersion, D3D_SDK_VERSION);
89 if (SUCCEEDED(hResult))
90 OutputDebugStringA(DebugMessageBuffer);
91 }
92
93 return NULL;
94 }
95
96 CreateD3D9(&D3D9Obj, SDKVersion);
97
98 return D3D9Obj;
99}
IDirect3D9 *(WINAPI * LPDIRECT3DCREATE9)(UINT)
Definition: d3d9.c:17
#define DEBUG_MESSAGE_BUFFER_SIZE
Definition: d3d9.c:15
static LPCSTR D3dError_WrongSdkVersion
Definition: d3d9.c:19
struct IDirect3D9 * LPDIRECT3D9
Definition: d3d9.h:124
#define DX_D3D9_DEBUG
Definition: d3d9_common.h:15
HRESULT CreateD3D9(OUT LPDIRECT3D9 *ppDirect3D9, UINT SDKVersion)
Definition: d3d9_create.c:237
BOOL ReadRegistryValue(IN DWORD ValueType, IN LPCSTR ValueName, OUT LPBYTE DataBuffer, IN OUT LPDWORD DataBufferSize)
Definition: d3d9_helpers.c:19
HRESULT SafeFormatString(OUT LPSTR Buffer, IN DWORD BufferSize, IN LPCSTR FormatString,...)
Definition: d3d9_helpers.c:41
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
unsigned long DWORD
Definition: ntddk_ex.h:95
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
Definition: ignoredbgout.c:18
#define SUCCEEDED(hr)
Definition: intsafe.h:50
unsigned int UINT
Definition: ndis.h:50
#define REG_DWORD
Definition: sdbapi.c:596
#define D3D_SDK_VERSION
Definition: d3d8.h:56
unsigned char * LPBYTE
Definition: typedefs.h:53
char CHAR
Definition: xmlstorage.h:175

Referenced by create_device(), fill_display_information_d3d(), init_d3d9(), new_test_context(), START_TEST(), test_create_effect_from_file(), test_effect_find_next_valid_technique(), test_effect_parameter_block(), test_fragment_linker(), test_load_skin_mesh_from_xof(), test_registerset(), test_registerset_defaults(), test_setting_constants(), and test_texture_shader().

◆ Direct3DShaderValidatorCreate9()

HRESULT WINAPI Direct3DShaderValidatorCreate9 ( void  )

Definition at line 27 of file d3d9.c.

28{
30 return 0;
31}

◆ DllMain()

BOOL APIENTRY DllMain ( HANDLE  hModule,
DWORD  ul_reason_for_call,
LPVOID  lpReserved 
)

Definition at line 101 of file d3d9.c.

102{
103 switch (ul_reason_for_call)
104 {
109 break;
110 }
111
112 return TRUE;
113}
#define TRUE
Definition: types.h:120
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define DLL_THREAD_ATTACH
Definition: compat.h:132

◆ PSGPError()

HRESULT WINAPI PSGPError ( void  )

Definition at line 33 of file d3d9.c.

34{
36 return 0;
37}

◆ PSGPSampleTexture()

HRESULT WINAPI PSGPSampleTexture ( void  )

Definition at line 39 of file d3d9.c.

40{
42 return 0;
43}

Variable Documentation

◆ D3dError_WrongSdkVersion

LPCSTR D3dError_WrongSdkVersion
static
Initial value:
=
"D3D ERROR: D3D header version mismatch.\n"
"The application was compiled against and will only work with "
"D3D_SDK_VERSION (%d), but the currently installed runtime is "
"version (%d).\n"
"Recompile the application against the appropriate SDK for the installed runtime.\n"
"\n"

Definition at line 19 of file d3d9.c.

Referenced by Direct3DCreate9().