1
10
13
14
20
21
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
89
90
91
92
93
94
97
98
99
100
101
102
103
104
105
106
112
113
114
118
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
...
...
#define FX_SOURCE_CODE
#include "fx_api.h"
#include "fx_system.h"
#include "fx_directory.h"
#include "fx_file.h"
#include "fx_utility.h"
5 includes
...
...
UINT _fx_file_attributes_read(FX_MEDIA *media_ptr, CHAR *file_name, UINT *attributes_ptr)
{
UINT status;
FX_DIR_ENTRY dir_entry;
#ifdef TX_ENABLE_EVENT_TRACE
TX_TRACE_BUFFER_ENTRY *trace_event;
ULONG trace_timestamp;/* ... */
#endif
UCHAR not_a_file_attr;
#ifndef FX_MEDIA_STATISTICS_DISABLE
media_ptr -> fx_media_file_attributes_reads++;/* ... */
#endif
dir_entry.fx_dir_entry_name = media_ptr -> fx_media_name_buffer + FX_MAX_LONG_NAME_LEN;
dir_entry.fx_dir_entry_short_name[0] = 0;
if (media_ptr -> fx_media_id != FX_MEDIA_ID)
{
return(FX_MEDIA_NOT_OPEN);
}if (media_ptr -> fx_media_id != FX_MEDIA_ID) { ... }
#ifdef FX_ENABLE_EXFAT
if (media_ptr -> fx_media_FAT_type == FX_exFAT)
{
not_a_file_attr = FX_DIRECTORY;
}if (media_ptr -> fx_media_FAT_type == FX_exFAT) { ... }
else
{
#endif
not_a_file_attr = FX_DIRECTORY | FX_VOLUME;
#ifdef FX_ENABLE_EXFAT
}else { ... }
#endif
FX_TRACE_IN_LINE_INSERT(FX_TRACE_FILE_ATTRIBUTES_READ, media_ptr, file_name, 0, 0, FX_TRACE_FILE_EVENTS, &trace_event, &trace_timestamp)
FX_PROTECT
status = _fx_directory_search(media_ptr, file_name, &dir_entry, FX_NULL, FX_NULL);
if (status != FX_SUCCESS)
{
FX_UNPROTECT
return(status);
}if (status != FX_SUCCESS) { ... }
if (dir_entry.fx_dir_entry_attributes & not_a_file_attr)
{
FX_UNPROTECT
return(FX_NOT_A_FILE);
}if (dir_entry.fx_dir_entry_attributes & not_a_file_attr) { ... }
*attributes_ptr = (UINT)dir_entry.fx_dir_entry_attributes;
FX_TRACE_EVENT_UPDATE(trace_event, trace_timestamp, FX_TRACE_FILE_ATTRIBUTES_READ, 0, 0, dir_entry.fx_dir_entry_attributes, 0)
FX_UNPROTECT
return(FX_SUCCESS);
}{ ... }