ReactOS 0.4.17-dev-940-g8bd6e85
SetSearchPathMode.c File Reference
#include <apitest.h>
#include <winbase.h>
Include dependency graph for SetSearchPathMode.c:

Go to the source code of this file.

Functions

 START_TEST (SetSearchPathMode)
 

Function Documentation

◆ START_TEST()

START_TEST ( SetSearchPathMode  )

Definition at line 11 of file SetSearchPathMode.c.

12{
13 BOOL Ret;
14
15 /* Testing invalid flags */
16
17 SetLastError(0xdeadbeef);
18 Ret = SetSearchPathMode(0x0);
19 ok(!Ret, "SetSearchPathMode unexpectedly succeeded with invalid parameter\n");
21
22 SetLastError(0xdeadbeef);
23 Ret = SetSearchPathMode(0xdeadbeef);
24 ok(!Ret, "SetSearchPathMode unexpectedly succeeded with invalid parameter\n");
26
27 SetLastError(0xdeadbeef);
30 ok(!Ret, "SetSearchPathMode unexpectedly succeeded with invalid parameter\n");
32
33 SetLastError(0xdeadbeef);
35 ok(!Ret, "SetSearchPathMode unexpectedly succeeded with invalid parameter\n");
37
38 SetLastError(0xdeadbeef);
41 ok(!Ret, "SetSearchPathMode unexpectedly succeeded with invalid parameter\n");
43
44 /* Enabling and disabling safe search mode */
45
46 SetLastError(0xdeadbeef);
48 ok(Ret, "ENABLE_SAFE_SEARCHMODE failed\n");
49 ok_eq_ulong(GetLastError(), 0xdeadbeef);
50
51 SetLastError(0xdeadbeef);
53 ok(Ret, "DISABLE_SAFE_SEARCHMODE failed\n");
54 ok_eq_ulong(GetLastError(), 0xdeadbeef);
55
56 SetLastError(0xdeadbeef);
58 ok(Ret, "ENABLE_SAFE_SEARCHMODE failed (second call)\n");
59 ok_eq_ulong(GetLastError(), 0xdeadbeef);
60 ok(Ret, "ENABLE_SAFE_SEARCHMODE failed (second call)\n");
61 ok_eq_ulong(GetLastError(), 0xdeadbeef);
62
63 /* Testing permanent mode */
64
65 SetLastError(0xdeadbeef);
68 ok(Ret, "Permanent mode failed\n");
69 ok_eq_ulong(GetLastError(), 0xdeadbeef);
70
71 SetLastError(0xdeadbeef);
73 ok(!Ret, "ENABLE unexpectedly succeeded after permanent mode\n");
75
76 SetLastError(0xdeadbeef);
78 ok(!Ret, "DISABLE unexpectedly succeeded after permanent mode\n");
80
81 SetLastError(0xdeadbeef);
84 ok(Ret, "Calling permanent mode again should succeed\n");
85 ok_eq_ulong(GetLastError(), 0xdeadbeef);
86}
#define ok_eq_ulong(value, expected)
Definition: apitest.h:120
#define ok(value,...)
Definition: atltest.h:57
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
BOOL WINAPI SetSearchPathMode(_In_ DWORD dwFlags)
Definition: path.c:1181
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE
Definition: winbase.h:587
#define BASE_SEARCH_PATH_PERMANENT
Definition: winbase.h:588
#define BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE
Definition: winbase.h:586