fix the build
[reactos.git] / reactos / dll / directx / ddraw / kernel.c
1 /* $Id: kernel_main.c 21434 2006-04-01 19:12:56Z greatlrd $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS
5 * FILE: lib/ddraw/main/kernel.c
6 * PURPOSE: IDirectDrawKernel and IDirectDrawSurfaceKernel Implementation
7 * PROGRAMMER: Maarten Bosma
8 *
9 */
10
11 #include "rosdraw.h"
12
13
14 /***** IDirectDrawKernel ****/
15
16 ULONG WINAPI
17 DirectDrawKernel_AddRef ( LPDIRECTDRAWKERNEL iface)
18 {
19 DX_WINDBG_trace();
20
21 IDirectDrawKernelImpl * This = (IDirectDrawKernelImpl*)iface;
22
23 ULONG ref=0;
24
25 if (iface!=NULL)
26 {
27 ref = InterlockedIncrement( (PLONG) &This->ref);
28 }
29 return ref;
30 }
31
32 ULONG WINAPI
33 DirectDrawKernel_Release ( LPDIRECTDRAWKERNEL iface)
34 {
35 DX_WINDBG_trace();
36
37 IDirectDrawKernelImpl* This = (IDirectDrawKernelImpl*)iface;
38 ULONG ref=0;
39
40 if (iface!=NULL)
41 {
42 ref = InterlockedDecrement( (PLONG) &This->ref);
43
44 if (ref == 0)
45 {
46 /* Add here if we need releae some memory pointer before
47 * exists
48 */
49
50 if (This!=NULL)
51 {
52 HeapFree(GetProcessHeap(), 0, This);
53 }
54 }
55 }
56 return ref;
57 }
58
59 HRESULT WINAPI
60 DirectDrawKernel_QueryInterface ( LPDIRECTDRAWKERNEL iface,
61 REFIID riid,
62 LPVOID* ppvObj)
63 {
64 DX_WINDBG_trace();
65 DX_STUB;
66 }
67
68 HRESULT WINAPI
69 DirectDrawKernel_GetKernelHandle ( LPDIRECTDRAWKERNEL iface,
70 ULONG* handle)
71 {
72 DX_WINDBG_trace();
73 DX_STUB;
74 }
75
76 HRESULT WINAPI
77 DirectDrawKernel_ReleaseKernelHandle ( LPDIRECTDRAWKERNEL iface)
78 {
79 DX_WINDBG_trace();
80 DX_STUB;
81 }
82
83
84 ULONG WINAPI
85 DDSurfaceKernel_AddRef ( LPDIRECTDRAWSURFACEKERNEL iface)
86 {
87 DX_WINDBG_trace();
88
89 IDirectDrawSurfaceKernelImpl * This = (IDirectDrawSurfaceKernelImpl*)iface;
90
91 ULONG ref=0;
92
93 if (iface!=NULL)
94 {
95 ref = InterlockedIncrement( (PLONG) &This->ref);
96 }
97 return ref;
98 }
99
100 ULONG WINAPI
101 DDSurfaceKernel_Release ( LPDIRECTDRAWSURFACEKERNEL iface)
102 {
103 DX_WINDBG_trace();
104
105 IDirectDrawSurfaceKernelImpl* This = (IDirectDrawSurfaceKernelImpl*)iface;
106 ULONG ref=0;
107
108 if (iface!=NULL)
109 {
110 ref = InterlockedDecrement( (PLONG) &This->ref);
111
112 if (ref == 0)
113 {
114 /* Add here if we need releae some memory pointer before
115 * exists
116 */
117
118 if (This!=NULL)
119 {
120 HeapFree(GetProcessHeap(), 0, This);
121 }
122 }
123 }
124 return ref;
125 }
126
127 HRESULT WINAPI
128 DDSurfaceKernel_QueryInterface ( LPDIRECTDRAWSURFACEKERNEL iface,
129 REFIID riid,
130 LPVOID* ppvObj)
131 {
132 DX_WINDBG_trace();
133 DX_STUB;
134 }
135
136 HRESULT WINAPI
137 DDSurfaceKernel_GetKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface,
138 ULONG* handle)
139 {
140 DX_WINDBG_trace();
141 DX_STUB;
142 }
143
144 HRESULT WINAPI
145 DDSurfaceKernel_ReleaseKernelHandle ( LPDIRECTDRAWSURFACEKERNEL iface)
146 {
147 DX_WINDBG_trace();
148 DX_STUB;
149 }
150
151
152 IDirectDrawKernelVtbl DirectDrawKernel_Vtable =
153 {
154 DirectDrawKernel_QueryInterface,
155 DirectDrawKernel_AddRef,
156 DirectDrawKernel_Release,
157 DirectDrawKernel_GetKernelHandle,
158 DirectDrawKernel_ReleaseKernelHandle
159 };
160
161 IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable =
162 {
163 DDSurfaceKernel_QueryInterface,
164 DDSurfaceKernel_AddRef,
165 DDSurfaceKernel_Release,
166 DDSurfaceKernel_GetKernelHandle,
167 DDSurfaceKernel_ReleaseKernelHandle
168 };