Skip to content

Commit a87245f

Browse files
authored
CleanUp GetFileAttribute/SetFileAttribute(Ex) in PAL (#116096)
* Use stat in superpmi * Delete GetFileAttributes * Delete SetFikeAttributes * Delete tests
1 parent 968a8b6 commit a87245f

File tree

54 files changed

+25
-2028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+25
-2028
lines changed

src/coreclr/dlls/mscordac/mscordac_unixexports.src

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ nativeStringResourceTable_mscorrc
8686
#GetEnvironmentStringsW
8787
#GetEnvironmentVariableA
8888
#GetEnvironmentVariableW
89-
#GetFileAttributesExW
90-
#GetFileAttributesW
9189
#GetFileSize
9290
#GetFullPathNameW
9391
#GetLastError

src/coreclr/inc/longfilepathwrappers.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ CreateFileWrapper(
2525
_In_opt_ HANDLE hTemplateFile
2626
);
2727

28-
BOOL
29-
GetFileAttributesExWrapper(
30-
_In_ LPCWSTR lpFileName,
31-
_In_ GET_FILEEX_INFO_LEVELS fInfoLevelId,
32-
_Out_writes_bytes_(sizeof(WIN32_FILE_ATTRIBUTE_DATA)) LPVOID lpFileInformation
33-
);
34-
3528
BOOL
3629
CopyFileExWrapper(
3730
_In_ LPCWSTR lpExistingFileName,

src/coreclr/inc/winwrap.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@
4242
#ifdef HOST_WINDOWS
4343
#define WszLoadLibrary LoadLibraryExWrapper
4444
#define WszCreateFile CreateFileWrapper
45-
#define WszGetFileAttributesEx GetFileAttributesExWrapper
4645
#else // HOST_WINDOWS
4746
#define WszLoadLibrary LoadLibraryExW
4847
#define WszCreateFile CreateFileW
49-
#define WszGetFileAttributesEx GetFileAttributesExW
5048
#endif // HOST_WINDOWS
5149

5250
//APIS which have a buffer as an out parameter

src/coreclr/pal/inc/pal.h

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -517,56 +517,6 @@ SearchPathW(
517517

518518
#define SearchPath SearchPathW
519519

520-
PALIMPORT
521-
DWORD
522-
PALAPI
523-
GetFileAttributesW(
524-
IN LPCWSTR lpFileName);
525-
526-
#ifdef UNICODE
527-
#define GetFileAttributes GetFileAttributesW
528-
#else
529-
#define GetFileAttributes GetFileAttributesA
530-
#endif
531-
532-
typedef enum _GET_FILEEX_INFO_LEVELS {
533-
GetFileExInfoStandard
534-
} GET_FILEEX_INFO_LEVELS;
535-
536-
typedef enum _FINDEX_INFO_LEVELS {
537-
FindExInfoStandard,
538-
FindExInfoBasic,
539-
FindExInfoMaxInfoLevel
540-
} FINDEX_INFO_LEVELS;
541-
542-
typedef enum _FINDEX_SEARCH_OPS {
543-
FindExSearchNameMatch,
544-
FindExSearchLimitToDirectories,
545-
FindExSearchLimitToDevices,
546-
FindExSearchMaxSearchOp
547-
} FINDEX_SEARCH_OPS;
548-
549-
typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
550-
DWORD dwFileAttributes;
551-
FILETIME ftCreationTime;
552-
FILETIME ftLastAccessTime;
553-
FILETIME ftLastWriteTime;
554-
DWORD nFileSizeHigh;
555-
DWORD nFileSizeLow;
556-
} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
557-
558-
PALIMPORT
559-
BOOL
560-
PALAPI
561-
GetFileAttributesExW(
562-
IN LPCWSTR lpFileName,
563-
IN GET_FILEEX_INFO_LEVELS fInfoLevelId,
564-
OUT LPVOID lpFileInformation);
565-
566-
#ifdef UNICODE
567-
#define GetFileAttributesEx GetFileAttributesExW
568-
#endif
569-
570520
typedef struct _OVERLAPPED {
571521
ULONG_PTR Internal;
572522
ULONG_PTR InternalHigh;

src/coreclr/pal/inc/palprivate.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,6 @@ CreateDirectoryW(
4040
IN LPCWSTR lpPathName,
4141
IN LPSECURITY_ATTRIBUTES lpSecurityAttributes);
4242

43-
PALIMPORT
44-
DWORD
45-
PALAPI
46-
GetFileAttributesA(
47-
IN LPCSTR lpFileName);
48-
49-
PALIMPORT
50-
BOOL
51-
PALAPI
52-
SetFileAttributesA(
53-
IN LPCSTR lpFileName,
54-
IN DWORD dwFileAttributes);
55-
56-
PALIMPORT
57-
BOOL
58-
PALAPI
59-
SetFileAttributesW(
60-
IN LPCWSTR lpFileName,
61-
IN DWORD dwFileAttributes);
62-
6343
PALIMPORT
6444
DWORD
6545
PALAPI

src/coreclr/pal/src/config.h.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@
6363
#cmakedefine01 HAVE__FPX_SW_BYTES_WITH_XSTATE_BV
6464
#cmakedefine01 HAVE_PR_SET_PTRACER
6565

66-
#cmakedefine01 HAVE_STAT_TIMESPEC
67-
#cmakedefine01 HAVE_STAT_TIM
68-
#cmakedefine01 HAVE_STAT_NSEC
69-
7066
#cmakedefine01 HAVE_BSD_REGS_T
7167
#cmakedefine01 HAVE_PT_REGS
7268
#cmakedefine01 HAVE_GREGSET_T

src/coreclr/pal/src/configure.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ int main(int argc, char **argv) {
151151
return 0;
152152
}" HAVE_CPUSET_T)
153153

154-
check_struct_has_member ("struct stat" st_atimespec "sys/types.h;sys/stat.h" HAVE_STAT_TIMESPEC)
155-
check_struct_has_member ("struct stat" st_atim "sys/types.h;sys/stat.h" HAVE_STAT_TIM)
156-
check_struct_has_member ("struct stat" st_atimensec "sys/types.h;sys/stat.h" HAVE_STAT_NSEC)
157154
check_struct_has_member ("ucontext_t" uc_mcontext.gregs[0] ucontext.h HAVE_GREGSET_T)
158155
check_struct_has_member ("ucontext_t" uc_mcontext.__gregs[0] ucontext.h HAVE___GREGSET_T)
159156
check_struct_has_member ("ucontext_t" uc_mcontext.fpregs->__glibc_reserved1[0] ucontext.h HAVE_FPSTATE_GLIBC_RESERVED1)

0 commit comments

Comments
 (0)