wintrust/tests: Handle ERROR_ACCESS_DENIED failures.
[wine.git] / dlls / d3d8 / d3d8_main.c
blob340544724870185ed169ab27202f2bd720aa3d72
1 /*
2 * Direct3D 8
4 * Copyright 2005 Oliver Stieber
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "config.h"
23 #include "initguid.h"
24 #include "d3d8_private.h"
25 #include "wine/debug.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
29 HRESULT WINAPI D3D8GetSWInfo(void) {
30 FIXME("(void): stub\n");
31 return 0;
34 void WINAPI DebugSetMute(void) {
35 /* nothing to do */
38 IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
40 struct d3d8 *object;
42 TRACE("sdk_version %#x.\n", sdk_version);
44 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
46 ERR("Failed to allocate d3d8 object memory.\n");
47 return NULL;
50 if (!d3d8_init(object))
52 WARN("Failed to initialize d3d8.\n");
53 HeapFree(GetProcessHeap(), 0, object);
54 return NULL;
57 TRACE("Created d3d8 object %p.\n", object);
59 return &object->IDirect3D8_iface;
62 /* At process attach */
63 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
65 TRACE("fdwReason=%d\n", fdwReason);
66 if (fdwReason == DLL_PROCESS_ATTACH)
67 DisableThreadLibraryCalls(hInstDLL);
69 return TRUE;
72 /***********************************************************************
73 * ValidateVertexShader (D3D8.@)
75 * I've seen reserved1 and reserved2 always passed as 0's
76 * bool seems always passed as 0 or 1, but other values work as well...
77 * toto result?
79 HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto)
81 HRESULT ret;
82 static BOOL warned;
84 if (TRACE_ON(d3d8) || !warned) {
85 FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
86 warned = TRUE;
89 if (!vertexshader)
90 return E_FAIL;
92 if (reserved1 || reserved2)
93 return E_FAIL;
95 switch(*vertexshader) {
96 case 0xFFFE0101:
97 case 0xFFFE0100:
98 ret=S_OK;
99 break;
100 default:
101 WARN("Invalid shader version token %#x.\n", *vertexshader);
102 ret=E_FAIL;
105 return ret;
108 /***********************************************************************
109 * ValidatePixelShader (D3D8.@)
111 * PARAMS
112 * toto result?
114 HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto)
116 HRESULT ret;
117 static BOOL warned;
119 if (TRACE_ON(d3d8) || !warned) {
120 FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto);
121 warned = TRUE;
124 if (!pixelshader)
125 return E_FAIL;
127 if (reserved1)
128 return E_FAIL;
130 switch(*pixelshader) {
131 case 0xFFFF0100:
132 case 0xFFFF0101:
133 case 0xFFFF0102:
134 case 0xFFFF0103:
135 case 0xFFFF0104:
136 ret=S_OK;
137 break;
138 default:
139 WARN("Invalid shader version token %#x.\n", *pixelshader);
140 ret=E_FAIL;
142 return ret;