ReactOS 0.4.15-dev-8127-g6338913
dwmapi_main.c
Go to the documentation of this file.
1/*
2 * Dwmapi
3 *
4 * Copyright 2007 Andras Kovacs
5 *
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.
10 *
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.
15 *
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
19 *
20 */
21
22#include <stdarg.h>
23
24#ifdef __REACTOS__
25#include <rtlfuncs.h>
26#else
27#include "winternl.h"
28#endif
29
30#define COBJMACROS
31#include "windef.h"
32#include "winbase.h"
33#include "wingdi.h"
34#include "winuser.h"
35#include "dwmapi.h"
36#include "wine/debug.h"
37
39
40
41/**********************************************************************
42 * DwmIsCompositionEnabled (DWMAPI.@)
43 */
45{
46
47#ifdef __REACTOS__
49#else
51#endif
52
53 TRACE("%p\n", enabled);
54
55 if (!enabled)
56 return E_INVALIDARG;
57
58 *enabled = FALSE;
59 version.dwOSVersionInfoSize = sizeof(version);
61 *enabled = (version.dwMajorVersion > 6 || (version.dwMajorVersion == 6 && version.dwMinorVersion >= 3));
62
63 return S_OK;
64}
65
66/**********************************************************************
67 * DwmEnableComposition (DWMAPI.102)
68 */
70{
71 FIXME("(%d) stub\n", uCompositionAction);
72
73 return S_OK;
74}
75
76/**********************************************************************
77 * DwmExtendFrameIntoClientArea (DWMAPI.@)
78 */
80{
81 FIXME("(%p, %p) stub\n", hwnd, margins);
82
83 return S_OK;
84}
85
86/**********************************************************************
87 * DwmGetColorizationColor (DWMAPI.@)
88 */
89HRESULT WINAPI DwmGetColorizationColor(DWORD *colorization, BOOL *opaque_blend)
90{
91 FIXME("(%p, %p) stub\n", colorization, opaque_blend);
92
93 return E_NOTIMPL;
94}
95
96/**********************************************************************
97 * DwmFlush (DWMAPI.@)
98 */
100{
101 static BOOL once;
102
103 if (!once++) FIXME("() stub\n");
104
105 return S_OK;
106}
107
108/**********************************************************************
109 * DwmInvalidateIconicBitmaps (DWMAPI.@)
110 */
112{
113 static BOOL once;
114
115 if (!once++) FIXME("(%p) stub\n", hwnd);
116
117 return E_NOTIMPL;
118}
119
120/**********************************************************************
121 * DwmSetWindowAttribute (DWMAPI.@)
122 */
124{
125 static BOOL once;
126
127 if (!once++) FIXME("(%p, %lx, %p, %lx) stub\n", hwnd, attributenum, attribute, size);
128
129 return S_OK;
130}
131
132/**********************************************************************
133 * DwmGetGraphicsStreamClient (DWMAPI.@)
134 */
136{
137 FIXME("(%d, %p) stub\n", uIndex, pClientUuid);
138
139 return E_NOTIMPL;
140}
141
142/**********************************************************************
143 * DwmGetTransportAttributes (DWMAPI.@)
144 */
145HRESULT WINAPI DwmGetTransportAttributes(BOOL *pfIsRemoting, BOOL *pfIsConnected, DWORD *pDwGeneration)
146{
147 FIXME("(%p, %p, %p) stub\n", pfIsRemoting, pfIsConnected, pDwGeneration);
148
150}
151
152/**********************************************************************
153 * DwmUnregisterThumbnail (DWMAPI.@)
154 */
156{
157 FIXME("(%p) stub\n", thumbnail);
158
159 return E_NOTIMPL;
160}
161
162/**********************************************************************
163 * DwmEnableMMCSS (DWMAPI.@)
164 */
166{
167 FIXME("(%d) stub\n", enableMMCSS);
168
169 return S_OK;
170}
171
172/**********************************************************************
173 * DwmGetGraphicsStreamTransformHint (DWMAPI.@)
174 */
176{
177 FIXME("(%d, %p) stub\n", uIndex, pTransform);
178
179 return E_NOTIMPL;
180}
181
182/**********************************************************************
183 * DwmEnableBlurBehindWindow (DWMAPI.@)
184 */
186{
187 FIXME("%p %p\n", hWnd, pBlurBuf);
188
189 return E_NOTIMPL;
190}
191
192/**********************************************************************
193 * DwmDefWindowProc (DWMAPI.@)
194 */
196{
197 static int i;
198
199 if (!i++) FIXME("stub\n");
200
201 return FALSE;
202}
203
204/**********************************************************************
205 * DwmGetWindowAttribute (DWMAPI.@)
206 */
208{
209 FIXME("(%p %ld %p %ld) stub\n", hwnd, attribute, pv_attribute, size);
210
211 return E_NOTIMPL;
212}
213
214/**********************************************************************
215 * DwmRegisterThumbnail (DWMAPI.@)
216 */
218{
219 FIXME("(%p %p %p) stub\n", dest, src, thumbnail_id);
220
221 return E_NOTIMPL;
222}
223
224static int get_display_frequency(void)
225{
227 BOOL ret;
228
229 memset(&mode, 0, sizeof(mode));
230 mode.dmSize = sizeof(mode);
232 if (ret && mode.dmFields & DM_DISPLAYFREQUENCY && mode.dmDisplayFrequency)
233 {
234 return mode.dmDisplayFrequency;
235 }
236 else
237 {
238 WARN("Failed to query display frequency, returning a fallback value.\n");
239 return 60;
240 }
241}
242
243/**********************************************************************
244 * DwmGetCompositionTimingInfo (DWMAPI.@)
245 */
247{
248 LARGE_INTEGER performance_frequency, qpc;
249 static int i, display_frequency;
250
251 if (!info)
252 return E_INVALIDARG;
253
254 if (info->cbSize != sizeof(DWM_TIMING_INFO))
256
257 if(!i++) FIXME("(%p %p)\n", hwnd, info);
258
259 memset(info, 0, info->cbSize);
260 info->cbSize = sizeof(DWM_TIMING_INFO);
261
262 display_frequency = get_display_frequency();
263 info->rateRefresh.uiNumerator = display_frequency;
264 info->rateRefresh.uiDenominator = 1;
265 info->rateCompose.uiNumerator = display_frequency;
266 info->rateCompose.uiDenominator = 1;
267
268 QueryPerformanceFrequency(&performance_frequency);
269 info->qpcRefreshPeriod = performance_frequency.QuadPart / display_frequency;
270
272 info->qpcVBlank = (qpc.QuadPart / info->qpcRefreshPeriod) * info->qpcRefreshPeriod;
273
274 return S_OK;
275}
276
277/**********************************************************************
278 * DwmAttachMilContent (DWMAPI.@)
279 */
281{
282 FIXME("(%p) stub\n", hwnd);
283 return E_NOTIMPL;
284}
285
286/**********************************************************************
287 * DwmDetachMilContent (DWMAPI.@)
288 */
290{
291 FIXME("(%p) stub\n", hwnd);
292 return E_NOTIMPL;
293}
294
295/**********************************************************************
296 * DwmUpdateThumbnailProperties (DWMAPI.@)
297 */
299{
300 FIXME("(%p, %p) stub\n", thumbnail, props);
301 return E_NOTIMPL;
302}
303
304/**********************************************************************
305 * DwmSetPresentParameters (DWMAPI.@)
306 */
308{
309 FIXME("(%p %p) stub\n", hwnd, params);
310 return S_OK;
311};
312
313/**********************************************************************
314 * DwmSetIconicLivePreviewBitmap (DWMAPI.@)
315 */
317{
318 FIXME("(%p %p %p %lx) stub\n", hwnd, hbmp, pos, flags);
319 return S_OK;
320};
321
322/**********************************************************************
323 * DwmSetIconicThumbnail (DWMAPI.@)
324 */
326{
327 FIXME("(%p %p %lx) stub\n", hwnd, hbmp, flags);
328 return S_OK;
329};
330
331/**********************************************************************
332 * DwmpGetColorizationParameters (DWMAPI.@)
333 */
335{
336 FIXME("(%p) stub\n", params);
337 return E_NOTIMPL;
338}
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
static RECT margins
Definition: print.c:55
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
HBITMAP hbmp
struct @1637 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition: perfcnt.c:45
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition: perfcnt.c:23
HTHUMBNAIL * PHTHUMBNAIL
Definition: dwmapi.h:33
struct _DWM_TIMING_INFO DWM_TIMING_INFO
HRESULT WINAPI DwmExtendFrameIntoClientArea(HWND hwnd, const MARGINS *margins)
Definition: dwmapi_main.c:79
HRESULT WINAPI DwmGetWindowAttribute(HWND hwnd, DWORD attribute, PVOID pv_attribute, DWORD size)
Definition: dwmapi_main.c:207
HRESULT WINAPI DwmGetGraphicsStreamClient(UINT uIndex, UUID *pClientUuid)
Definition: dwmapi_main.c:135
HRESULT WINAPI DwmGetColorizationColor(DWORD *colorization, BOOL *opaque_blend)
Definition: dwmapi_main.c:89
HRESULT WINAPI DwmAttachMilContent(HWND hwnd)
Definition: dwmapi_main.c:280
HRESULT WINAPI DwmFlush(void)
Definition: dwmapi_main.c:99
HRESULT WINAPI DwmUnregisterThumbnail(HTHUMBNAIL thumbnail)
Definition: dwmapi_main.c:155
HRESULT WINAPI DwmSetWindowAttribute(HWND hwnd, DWORD attributenum, LPCVOID attribute, DWORD size)
Definition: dwmapi_main.c:123
HRESULT WINAPI DwmEnableBlurBehindWindow(HWND hWnd, const DWM_BLURBEHIND *pBlurBuf)
Definition: dwmapi_main.c:185
HRESULT WINAPI DwmGetGraphicsStreamTransformHint(UINT uIndex, MilMatrix3x2D *pTransform)
Definition: dwmapi_main.c:175
HRESULT WINAPI DwmIsCompositionEnabled(BOOL *enabled)
Definition: dwmapi_main.c:44
HRESULT WINAPI DwmEnableComposition(UINT uCompositionAction)
Definition: dwmapi_main.c:69
HRESULT WINAPI DwmUpdateThumbnailProperties(HTHUMBNAIL thumbnail, const DWM_THUMBNAIL_PROPERTIES *props)
Definition: dwmapi_main.c:298
HRESULT WINAPI DwmInvalidateIconicBitmaps(HWND hwnd)
Definition: dwmapi_main.c:111
HRESULT WINAPI DwmSetIconicThumbnail(HWND hwnd, HBITMAP hbmp, DWORD flags)
Definition: dwmapi_main.c:325
static int get_display_frequency(void)
Definition: dwmapi_main.c:224
HRESULT WINAPI DwmSetPresentParameters(HWND hwnd, DWM_PRESENT_PARAMETERS *params)
Definition: dwmapi_main.c:307
HRESULT WINAPI DwmRegisterThumbnail(HWND dest, HWND src, PHTHUMBNAIL thumbnail_id)
Definition: dwmapi_main.c:217
HRESULT WINAPI DwmGetCompositionTimingInfo(HWND hwnd, DWM_TIMING_INFO *info)
Definition: dwmapi_main.c:246
HRESULT WINAPI DwmDetachMilContent(HWND hwnd)
Definition: dwmapi_main.c:289
HRESULT WINAPI DwmGetTransportAttributes(BOOL *pfIsRemoting, BOOL *pfIsConnected, DWORD *pDwGeneration)
Definition: dwmapi_main.c:145
HRESULT WINAPI DwmSetIconicLivePreviewBitmap(HWND hwnd, HBITMAP hbmp, POINT *pos, DWORD flags)
Definition: dwmapi_main.c:316
HRESULT WINAPI DwmEnableMMCSS(BOOL enableMMCSS)
Definition: dwmapi_main.c:165
HRESULT WINAPI DwmpGetColorizationParameters(void *params)
Definition: dwmapi_main.c:334
BOOL WINAPI DwmDefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult)
Definition: dwmapi_main.c:195
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
GLenum src
Definition: glext.h:6340
GLenum mode
Definition: glext.h:6217
GLenum const GLfloat * params
Definition: glext.h:5645
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_OK
Definition: intsafe.h:52
static HBITMAP
Definition: button.c:44
static char * dest
Definition: rtl.c:135
unsigned int UINT
Definition: ndis.h:50
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: misc.c:279
LONGLONG QuadPart
Definition: typedefs.h:114
static const WCHAR props[]
Definition: wbemdisp.c:288
int ret
BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode, DWORD dwFlags)
Definition: display.c:330
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
CONST void * LPCVOID
Definition: windef.h:191
#define WINAPI
Definition: msvc.h:6
#define DWM_E_COMPOSITIONDISABLED
Definition: winerror.h:3274
#define MILERR_MISMATCHED_SIZE
Definition: winerror.h:3322
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179