ReactOS 0.4.15-dev-8227-g32d615f
PathFileExistsDefExtAndAttributesW.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Tests for PathFileExistsDefExtAndAttributesW
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include <apitest.h>
9#include <shlobj.h>
10#include <shlwapi.h>
11#include <shlwapi_undoc.h>
12
14{
16 DWORD attrs;
17 BOOL ret;
18
19 /* NULL check */
22
23 /* Not existent file */
24 lstrcpynW(szPath, L"Not Existent File.txt", _countof(szPath));
27
28 /* "Windows" directory */
31 ok_int(ret, TRUE);
32
33 /* "Windows" directory with attributes check */
34 attrs = 0;
36 ok_int(ret, TRUE);
37 ok(attrs != 0 && attrs != INVALID_FILE_ATTRIBUTES, "attrs was 0x%lX\n", attrs);
38
39 /* Find notepad.exe */
40 SearchPathW(NULL, L"notepad.exe", NULL, _countof(szPath), szPath, NULL);
42 ok_int(ret, TRUE);
43
44 /* Remove .exe */
48
49 /* Add .exe */
51 ok_int(ret, TRUE);
53 ok_int(ret, TRUE);
54
55 /* notepad.cmd doesn't exist */
61}
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
#define lstrcpynW
Definition: compat.h:738
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1298
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
BOOL WINAPI PathFileExistsDefExtAndAttributesW(_Inout_ LPWSTR pszPath, _In_ DWORD dwWhich, _Out_opt_ LPDWORD pdwFileAttributes)
Definition: utils.cpp:108
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
LPCWSTR szPath
Definition: env.c:37
#define L(x)
Definition: ntvdm.h:50
#define WHICH_CMD
#define WHICH_EXE
#define _countof(array)
Definition: sndvol32.h:70
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int ret
__wchar_t WCHAR
Definition: xmlstorage.h:180