2 * Unit test suite for fault reporting in XP and above
4 * Copyright 2010 Detlef Riekenberg
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.
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.
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
31 #include "wine/test.h"
33 static char regpath_root
[] = "Software\\Microsoft\\PCHealth\\ErrorReporting";
34 static char regpath_exclude
[] = "ExclusionList";
38 static void test_AddERExcludedApplicationA(void)
46 lres
= RegOpenKeyExA(HKEY_LOCAL_MACHINE
, regpath_root
, 0, KEY_WRITE
, &hroot
);
49 lres
= RegOpenKeyA(hroot
, regpath_exclude
, &hexclude
);
52 RegDeleteValueA(hexclude
, "winetest_faultrep.exe");
55 SetLastError(0xdeadbeef);
56 res
= AddERExcludedApplicationA(NULL
);
57 ok(!res
, "got %d and 0x%x (expected FALSE)\n", res
, GetLastError());
59 SetLastError(0xdeadbeef);
60 res
= AddERExcludedApplicationA("");
61 ok(!res
, "got %d and 0x%x (expected FALSE)\n", res
, GetLastError());
63 SetLastError(0xdeadbeef);
64 /* access rights to HKLM or existence of the path doesn't matter
65 this function succeeded */
66 res
= AddERExcludedApplicationA("winetest_faultrep.exe");
67 ok(res
, "got %d and 0x%x (expected TRUE)\n", res
, GetLastError());
69 /* add, when already present */
70 SetLastError(0xdeadbeef);
71 res
= AddERExcludedApplicationA("winetest_faultrep.exe");
72 ok(res
, "got %d and 0x%x (expected TRUE)\n", res
, GetLastError());
75 RegDeleteValueA(hexclude
, "winetest_faultrep.exe");
77 RegCloseKey(hexclude
);
81 /* ########################### */
85 test_AddERExcludedApplicationA();