Commit c090bdbe authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wldp: Improve the WldpGetLockdownPolicy() stub.

parent 59485f00
......@@ -22205,6 +22205,7 @@ wine_fn_config_makefile dlls/wlanui enable_wlanui
wine_fn_config_makefile dlls/wldap32 enable_wldap32
wine_fn_config_makefile dlls/wldap32/tests enable_tests
wine_fn_config_makefile dlls/wldp enable_wldp
wine_fn_config_makefile dlls/wldp/tests enable_tests
wine_fn_config_makefile dlls/wmasf enable_wmasf
wine_fn_config_makefile dlls/wmi enable_wmi
wine_fn_config_makefile dlls/wmiutils enable_wmiutils
......
......@@ -3247,6 +3247,7 @@ WINE_CONFIG_MAKEFILE(dlls/wlanui)
WINE_CONFIG_MAKEFILE(dlls/wldap32)
WINE_CONFIG_MAKEFILE(dlls/wldap32/tests)
WINE_CONFIG_MAKEFILE(dlls/wldp)
WINE_CONFIG_MAKEFILE(dlls/wldp/tests)
WINE_CONFIG_MAKEFILE(dlls/wmasf)
WINE_CONFIG_MAKEFILE(dlls/wmi)
WINE_CONFIG_MAKEFILE(dlls/wmiutils)
......
TESTDLL = wldp.dll
SOURCES = \
wldp.c
/*
* Copyright 2023 Hans Leidekker 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 <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wldp.h"
#include "wine/test.h"
static HRESULT (WINAPI *pWldpGetLockdownPolicy)(WLDP_HOST_INFORMATION *, DWORD *, DWORD);
static HRESULT (WINAPI *pWldpQueryWindowsLockdownMode)(WLDP_WINDOWS_LOCKDOWN_MODE *);
static void test_WldpGetLockdownPolicy(void)
{
WLDP_HOST_INFORMATION info;
DWORD state;
HRESULT hr;
if (!pWldpGetLockdownPolicy)
{
win_skip( "WldpGetLockdownPolicy not available\n" );
return;
}
state = 0xdeadbeef;
hr = pWldpGetLockdownPolicy( NULL, &state, 0 );
ok( hr == 0x10000000, "got %#lx\n", hr );
ok( state == WLDP_LOCKDOWN_DEFINED_FLAG, "got %#lx\n", state );
memset( &info, 0, sizeof(info) );
info.dwRevision = 1;
info.dwHostId = WLDP_HOST_ID_GLOBAL;
state = 0xdeadbeef;
hr = pWldpGetLockdownPolicy( &info, &state, 0 );
ok( hr == S_OK, "got %#lx\n", hr );
ok( state == WLDP_LOCKDOWN_DEFINED_FLAG, "got %#lx\n", state );
}
static void test_WldpQueryWindowsLockdownMode(void)
{
WLDP_WINDOWS_LOCKDOWN_MODE mode;
HRESULT hr;
if (!pWldpQueryWindowsLockdownMode)
{
win_skip( "WldpQueryWindowsLockdownMode not available\n" );
return;
}
mode = 0xdeadbeef;
hr = pWldpQueryWindowsLockdownMode( &mode );
ok( hr == S_OK, "got %#lx\n", hr );
ok( mode == WLDP_WINDOWS_LOCKDOWN_MODE_UNLOCKED, "got %u\n", mode );
}
START_TEST(wldp)
{
HMODULE hwldp = LoadLibraryW( L"wldp" );
pWldpGetLockdownPolicy = (void *)GetProcAddress( hwldp, "WldpGetLockdownPolicy" );
pWldpQueryWindowsLockdownMode = (void *)GetProcAddress( hwldp, "WldpQueryWindowsLockdownMode" );
test_WldpGetLockdownPolicy();
test_WldpQueryWindowsLockdownMode();
}
......@@ -44,9 +44,10 @@ HRESULT WINAPI WldpIsDynamicCodePolicyEnabled(BOOL *is_enabled)
*/
HRESULT WINAPI WldpGetLockdownPolicy(WLDP_HOST_INFORMATION *info, DWORD *state, DWORD flags)
{
FIXME("%p %p %lu\n", info, state, flags);
FIXME("%p %p %lx\n", info, state, flags);
*state = 0;
*state = WLDP_LOCKDOWN_DEFINED_FLAG;
if (!info) return HRESULT_FROM_NT(0);
return S_OK;
}
......
......@@ -19,6 +19,14 @@
#ifndef WLDP_H
#define WLDP_H
#define WLDP_LOCKDOWN_UNDEFINED 0x00000000
#define WLDP_LOCKDOWN_DEFINED_FLAG 0x80000000
#define WLDP_LOCKDOWN_CONFIG_CI_FLAG 0x00000001
#define WLDP_LOCKDOWN_CONFIG_CI_AUDIT_FLAG 0x00000002
#define WLDP_LOCKDOWN_UMCIENFORCE_FLAG 0x00000004
#define WLDP_LOCKDOWN_AUDIT_FLAG 0x00000008
#define WLDP_LOCKDOWN_EXCLUSION_FLAG 0x00000010
typedef enum WLDP_HOST_ID
{
WLDP_HOST_ID_UNKNOWN,
......@@ -50,5 +58,6 @@ typedef struct WLDP_HOST_INFORMATION
HRESULT WINAPI WldpGetLockdownPolicy(WLDP_HOST_INFORMATION*,DWORD*,DWORD);
HRESULT WINAPI WldpIsDynamicCodePolicyEnabled(BOOL*);
HRESULT WINAPI WldpQueryWindowsLockdownMode(WLDP_WINDOWS_LOCKDOWN_MODE*);
#endif
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