ReactOS 0.4.15-dev-7674-gc0b4db1
clipper_main.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS DirectX
4 * FILE: dll/directx/ddraw/Clipper/clipper_main.c
5 * PURPOSE: IDirectDrawClipper Implementation
6 * PROGRAMMER: Maarten Bosma
7 *
8 */
9
10#include "rosdraw.h"
11
14 REFIID id, LPVOID *obj)
15{
16 if(!iface)
18
19 return E_NOINTERFACE;
20}
21
25{
28
30
31 if(!This)
33
34 if(This->dwIntRefCnt)
36
38 This->dwIntRefCnt = 1;
39
41 //This->lpLcl->lpClipMore
42 This->lpLcl->lpDD_int = DDraw;
43 This->lpLcl->lpGbl->dwRefCnt = 1;
44 This->lpLcl->pAddrefedThisOwner = (IUnknown*)DDraw;
45
46 // FIXME: Implement Linking and share global object
47 DxHeapMemAlloc(This->lpLcl->lpGbl, sizeof(DDRAWI_DDRAWCLIPPER_GBL));
48 This->lpLcl->lpGbl->dwProcessId = GetCurrentProcessId();
49
50 return DD_OK;
51}
52
55{
57 if(!This)
59
61
62 if (iface!=NULL)
63 {
64 This->lpLcl->dwLocalRefCnt--;
65 This->dwIntRefCnt--;
66
67 if (This->lpLcl->lpGbl)
68 This->lpLcl->lpGbl->dwRefCnt--;
69 }
70
71 return This->dwIntRefCnt;
72}
73
76{
78 if(!This)
80
82
83 if (iface!=NULL)
84 {
85 This->dwIntRefCnt++;
86 This->lpLcl->dwLocalRefCnt++;
87 if (This->lpLcl->lpGbl)
88 This->lpLcl->lpGbl->dwRefCnt++;
89 }
90 return This->dwIntRefCnt;
91}
92
96 HWND hWnd)
97{
99
100 if(!This)
101 return DDERR_INVALIDOBJECT;
102
103 if(!IsWindow(hWnd))
104 return DDERR_INVALIDPARAMS;
105
106 // TODO: check flags
107
108 This->lpLcl->lpGbl->hWnd = (ULONG_PTR)hWnd;
109 This->lpLcl->lpGbl->dwFlags = dwFlags;
110
111 return DD_OK;
112}
113
116 HWND* hWndPtr)
117{
119
120 if(!This)
121 return DDERR_INVALIDOBJECT;
122
123 if(!hWndPtr)
124 return DDERR_INVALIDPARAMS;
125
126 *hWndPtr = (HWND)This->lpLcl->lpGbl->hWnd;
127
128 return DD_OK;
129}
130
131IDirectDrawClipperVtbl DirectDrawClipper_Vtable =
132{
142};
HWND hWnd
Definition: settings.c:17
HRESULT WINAPI DirectDrawClipper_GetClipList(LPDIRECTDRAWCLIPPER, LPRECT, LPRGNDATA, LPDWORD)
Definition: clipper_stubs.c:13
HRESULT WINAPI DirectDrawClipper_IsClipListChanged(LPDIRECTDRAWCLIPPER, BOOL *lpbChanged)
Definition: clipper_stubs.c:32
HRESULT WINAPI DirectDrawClipper_SetClipList(LPDIRECTDRAWCLIPPER, LPRGNDATA, DWORD)
Definition: clipper_stubs.c:23
HRESULT WINAPI DirectDrawClipper_GetHWnd(LPDIRECTDRAWCLIPPER iface, HWND *hWndPtr)
Definition: clipper_main.c:115
HRESULT WINAPI DirectDrawClipper_SetHwnd(LPDIRECTDRAWCLIPPER iface, DWORD dwFlags, HWND hWnd)
Definition: clipper_main.c:94
ULONG WINAPI DirectDrawClipper_AddRef(LPDIRECTDRAWCLIPPER iface)
Definition: clipper_main.c:75
ULONG WINAPI DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface)
Definition: clipper_main.c:54
HRESULT WINAPI DirectDrawClipper_Initialize(LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD, DWORD dwFlags)
Definition: clipper_main.c:23
IDirectDrawClipperVtbl DirectDrawClipper_Vtable
Definition: clipper_main.c:131
HRESULT WINAPI DirectDrawClipper_QueryInterface(LPDIRECTDRAWCLIPPER iface, REFIID id, LPVOID *obj)
Definition: clipper_main.c:13
struct _DDRAWI_DDRAWCLIPPER_INT * LPDDRAWI_DDRAWCLIPPER_INT
Definition: ddrawi.h:145
struct _DDRAWI_DIRECTDRAW_INT * LPDDRAWI_DIRECTDRAW_INT
Definition: ddrawi.h:124
#define NULL
Definition: types.h:112
HANDLE HWND
Definition: compat.h:19
#define ULONG_PTR
Definition: config.h:101
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LPVOID
Definition: nt_native.h:45
#define REFIID
Definition: guiddef.h:118
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
struct IDirectDrawClipper * LPDIRECTDRAWCLIPPER
Definition: ddraw.h:721
#define DDERR_INVALIDOBJECT
Definition: ddraw.h:78
struct IDirectDraw * LPDIRECTDRAW
Definition: ddraw.h:710
#define DD_OK
Definition: ddraw.h:186
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
#define DDERR_ALREADYINITIALIZED
Definition: ddraw.h:67
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
BOOL WINAPI IsWindow(_In_opt_ HWND)