if Root- Entry Attr ATTR_LFN LFN struct TLFNS BUFFER for LFN_BUFFER Un

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if (Root->Entry[X].Attr == ATTR_LFN)
{
LFN = (struct TLFNS*)BUFFER;
for(I = 0; I < 5; I++)
LFN_BUFFER[I] = Unicode(LFN->LFNS[X].LFN1[I]); //1-5
for(I = 0; I < 6; I++)
LFN_BUFFER[I + 5] = Unicode(LFN->LFNS[X].LFN2[I]);//6-11
for(I = 0; I < 2; I++)
LFN_BUFFER[I + 11] = Unicode(LFN->LFNS[X].LFN3[I]);//12-13
LFN_BUFFER[13] = '\0';
if(LFN->LFNS[X].Counter > 64)
{
INDEX_LFN = LFN->LFNS[X].Counter - 0x40;
for(I = 0; I < 13; I++)
{
if (LFN_BUFFER[I] == '\0')
{
INDEX_END = I;
break;
}
}
for(I = 0; I < INDEX_END + 1; I++)
FILE_NAME[(INDEX_LFN - 1) * 13 + I] = LFN_BUFFER[I];
} else
{
for(I = 0; I < 13; I++)
FILE_NAME[(LFN->LFNS[X].Counter - 1) * 13 + I] = LFN_BUFFER[I];
}
}