wined3d: Pass a wined3d_device_context to wined3d_cs_emit_blt_sub_resource().
[wine/zf.git] / dlls / wevtapi / tests / wevtapi.c
bloba0a21aa9971646e13b73aeb82e4172ba93a598ca
1 /*
2 * Copyright 2021 Dmitry Timoshkov
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #define NONAMELESSUNION
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winevt.h"
26 #include "wine/test.h"
28 static void test_EvtGetChannelConfigProperty(void)
30 HKEY key;
31 EVT_HANDLE config;
32 DWORD size, ret;
33 struct
35 EVT_VARIANT var;
36 WCHAR buf[MAX_PATH];
37 } path;
39 ret = RegCreateKeyW(HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Services\\EventLog\\Winetest", &key);
40 if (ret == ERROR_ACCESS_DENIED)
42 skip("Not enough privileges to modify HKLM\n");
43 return;
45 ok(ret == ERROR_SUCCESS, "RegCreateKey error %u\n", ret);
47 config = EvtOpenChannelConfig(NULL, L"Winetest", 0);
48 ok(config != NULL, "EvtOpenChannelConfig error %u\n", GetLastError());
50 ret = EvtGetChannelConfigProperty(config, EvtChannelLoggingConfigLogFilePath, 0, 0, NULL, &size);
51 ok(!ret, "EvtGetChannelConfigProperty should fail\n");
52 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %u\n", GetLastError());
53 ok(size < sizeof(path), "got %u\n", size);
55 memset(&path, 0, sizeof(path));
56 path.var.Count = 0xdeadbeef;
57 path.var.Type = 0xdeadbeef;
58 ret = EvtGetChannelConfigProperty(config, EvtChannelLoggingConfigLogFilePath, 0, size, (EVT_VARIANT *)&path, &size);
59 ok(ret, "EvtGetChannelConfigProperty error %u\n", GetLastError());
60 ok(path.var.Count == 0xdeadbeef, "got %u\n", path.var.Count);
61 ok(path.var.Type == EvtVarTypeString, "got %u\n", path.var.Type);
62 ok(size == sizeof(EVT_VARIANT) + (wcslen(path.var.u.StringVal) + 1) * sizeof(WCHAR), "got %u\n", size);
63 ok(path.var.u.StringVal == path.buf, "path.var.u.StringVal = %p, path.buf = %p\n", path.var.u.StringVal, path.buf);
65 EvtClose(config);
67 RegDeleteKeyW(key, L"");
68 RegCloseKey(key);
71 START_TEST(wevtapi)
73 test_EvtGetChannelConfigProperty();