Commit 1ec8bf9b authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

dwmapi: Check NULL parameter in DwmIsCompositionEnabled().

parent ee9c1351
......@@ -20756,6 +20756,7 @@ wine_fn_config_makefile dlls/dsuiext enable_dsuiext
wine_fn_config_makefile dlls/dswave enable_dswave
wine_fn_config_makefile dlls/dswave/tests enable_tests
wine_fn_config_makefile dlls/dwmapi enable_dwmapi
wine_fn_config_makefile dlls/dwmapi/tests enable_tests
wine_fn_config_makefile dlls/dwrite enable_dwrite
wine_fn_config_makefile dlls/dwrite/tests enable_tests
wine_fn_config_makefile dlls/dx8vb enable_dx8vb
......
......@@ -3278,6 +3278,7 @@ WINE_CONFIG_MAKEFILE(dlls/dsuiext)
WINE_CONFIG_MAKEFILE(dlls/dswave)
WINE_CONFIG_MAKEFILE(dlls/dswave/tests)
WINE_CONFIG_MAKEFILE(dlls/dwmapi)
WINE_CONFIG_MAKEFILE(dlls/dwmapi/tests)
WINE_CONFIG_MAKEFILE(dlls/dwrite)
WINE_CONFIG_MAKEFILE(dlls/dwrite/tests)
WINE_CONFIG_MAKEFILE(dlls/dx8vb)
......
......@@ -60,6 +60,9 @@ HRESULT WINAPI DwmIsCompositionEnabled(BOOL *enabled)
else
TRACE("%p\n", enabled);
if (!enabled)
return E_INVALIDARG;
*enabled = FALSE;
return S_OK;
}
......
TESTDLL = dwmapi.dll
IMPORTS = dwmapi
C_SRCS = \
dwmapi.c
/*
* Copyright 2020 Zhiyi Zhang for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dwmapi.h"
#include "wine/test.h"
static void test_DwmIsCompositionEnabled(void)
{
BOOL enabled;
HRESULT hr;
hr = DwmIsCompositionEnabled(NULL);
ok(hr == E_INVALIDARG, "Expected %#x, got %#x.\n", E_INVALIDARG, hr);
enabled = -1;
hr = DwmIsCompositionEnabled(&enabled);
ok(hr == S_OK, "Expected %#x, got %#x.\n", S_OK, hr);
ok(enabled == TRUE || enabled == FALSE, "Got unexpected %#x.\n", enabled);
}
START_TEST(dwmapi)
{
test_DwmIsCompositionEnabled();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment