Fix broke SVN after me, thx to it I found wrong ref was release in different place...
[reactos.git] / reactos / lib / ddraw / main / color_main.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS
5 * FILE: lib/ddraw/main/color.c
6 * PURPOSE: IDirectDrawColorControl Implementation
7 * PROGRAMMER: Maarten Bosma
8 *
9 */
10
11 #include "rosdraw.h"
12
13 ULONG WINAPI
14 Main_DirectDrawColorControl_AddRef(LPDIRECTDRAWCOLORCONTROL iface)
15 {
16 IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
17 ULONG ref = InterlockedIncrement((PLONG)&This->DirectDrawGlobal.dwRefCnt);
18
19 return ref;
20 }
21
22 ULONG WINAPI
23 Main_DirectDrawColorControl_Release(LPDIRECTDRAWCOLORCONTROL iface)
24 {
25 IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
26 ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt);
27
28 if (ref == 0)
29 HeapFree(GetProcessHeap(), 0, This);
30
31 return ref;
32 }
33
34 HRESULT WINAPI
35 Main_DirectDrawColorControl_QueryInterface(LPDIRECTDRAWCOLORCONTROL iface,
36 REFIID riid, LPVOID* ppvObj)
37 {
38 return E_NOINTERFACE;
39 }
40
41 HRESULT WINAPI
42 Main_DirectDrawColorControl_GetColorControls(LPDIRECTDRAWCOLORCONTROL iface, LPDDCOLORCONTROL lpColorControl)
43 {
44 DX_STUB;
45 }
46
47 HRESULT WINAPI
48 Main_DirectDrawColorControl_SetColorControls(LPDIRECTDRAWCOLORCONTROL iface, LPDDCOLORCONTROL lpColorControl)
49 {
50 DX_STUB;
51 }
52
53 IDirectDrawColorControlVtbl DirectDrawColorControl_Vtable =
54 {
55 Main_DirectDrawColorControl_QueryInterface,
56 Main_DirectDrawColorControl_AddRef,
57 Main_DirectDrawColorControl_Release,
58 Main_DirectDrawColorControl_GetColorControls,
59 Main_DirectDrawColorControl_SetColorControls
60 };