ReactOS 0.4.15-dev-7934-g1dc8d80
FileAttributes_user.c File Reference
#include <kmt_test.h>
#include "kernel32_test.h"
Include dependency graph for FileAttributes_user.c:

Go to the source code of this file.

Functions

 START_TEST (FileAttributes)
 

Function Documentation

◆ START_TEST()

START_TEST ( FileAttributes  )

Directory attribute

Definition at line 13 of file FileAttributes_user.c.

14{
15 PCWSTR FileName = L"\\\\.\\Global\\GLOBALROOT\\Device\\Kmtest-kernel32\\Somefile";
16 BOOL Ret;
19
20 Error = KmtLoadAndOpenDriver(L"kernel32", FALSE);
22 if (Error)
23 return;
24
25 /* Set read-only attribute */
28 ok(Ret == TRUE, "SetFileAttributesW returned %d, error %lu\n", Ret, GetLastError());
29
30 /* Set normal attribute */
33 ok(Ret == TRUE, "SetFileAttributesW returned %d, error %lu\n", Ret, GetLastError());
34
35 /* Set 0 attribute (driver should receive normal) */
38 ok(Ret == TRUE, "SetFileAttributesW returned %d, error %lu\n", Ret, GetLastError());
39
40 /* Set invalid attributes */
43 ok(Ret == TRUE, "SetFileAttributesW returned %d, error %lu\n", Ret, GetLastError());
44
45 /* Query read-only attribute */
49
50 /* Query read-only + normal attribute */
54
55 /* Query normal attribute */
59
60 /* Query 0 attribute */
64
65 /* Query invalid attributes */
69
71 /* Set read-only and directory attribute */
74 ok(Ret == TRUE, "SetFileAttributesW returned %d, error %lu\n", Ret, GetLastError());
75
76 /* Set normal and directory attribute */
79 ok(Ret == TRUE, "SetFileAttributesW returned %d, error %lu\n", Ret, GetLastError());
80
81 /* Set directory attribute */
84 ok(Ret == TRUE, "SetFileAttributesW returned %d, error %lu\n", Ret, GetLastError());
85
86 /* Query read-only and directory attribute */
90
91 /* Query read-only + normal + directory attribute */
95
96 /* Query normal and directory attribute */
100
101 /* Query directory attribute */
105
108}
#define ok_eq_hex(value, expected)
Definition: apitest.h:77
#define ok_eq_int(value, expected)
Definition: apitest.h:60
#define ok(value,...)
Definition: atltest.h:57
BOOL Error
Definition: chkdsk.c:66
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IOCTL_RETURN_QUERY_ATTRIBUTES
Definition: kernel32_test.h:12
#define IOCTL_EXPECT_SET_ATTRIBUTES
Definition: kernel32_test.h:13
#define FILE_ATTRIBUTE_VALID_SET_FLAGS
Definition: nt_native.h:715
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define L(x)
Definition: ntvdm.h:50
DWORD KmtLoadAndOpenDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
Definition: support.c:213
VOID KmtCloseDriver(VOID)
Definition: support.c:236
DWORD KmtSendUlongToDriver(IN DWORD ControlCode, IN DWORD Value)
Definition: support.c:333
VOID KmtUnloadDriver(VOID)
Definition: support.c:167
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
DWORD WINAPI GetLastError(void)
Definition: except.c:1042