Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1989-2000 Microsoft Corporation
  3. Module Name:
  4. Lfn.h
  5. Abstract:
  6. This module defines the on-disk structure of long file names on FAT.
  7. // @@BEGIN_DDKSPLIT
  8. Author:
  9. David Goebel [davidgoe] 16-Dec-1993
  10. Revision History:
  11. // @@END_DDKSPLIT
  12. --*/
  13. #ifndef _LFN_
  14. #define _LFN_
  15. //
  16. // This strucure defines the on disk format on long file name dirents.
  17. //
  18. typedef struct _PACKED_LFN_DIRENT {
  19. UCHAR Ordinal; // offset = 0
  20. UCHAR Name1[10]; // offset = 1 (Really 5 chars, but not WCHAR aligned)
  21. UCHAR Attributes; // offset = 11
  22. UCHAR Type; // offset = 12
  23. UCHAR Checksum; // offset = 13
  24. WCHAR Name2[6]; // offset = 14
  25. USHORT MustBeZero; // offset = 26
  26. WCHAR Name3[2]; // offset = 28
  27. } PACKED_LFN_DIRENT; // sizeof = 32
  28. typedef PACKED_LFN_DIRENT *PPACKED_LFN_DIRENT;
  29. #define FAT_LAST_LONG_ENTRY 0x40 // Ordinal field
  30. #define FAT_LONG_NAME_COMP 0x0 // Type field
  31. //
  32. // A packed lfn dirent is already quadword aligned so simply declare a
  33. // lfn dirent as a packed lfn dirent.
  34. //
  35. typedef PACKED_LFN_DIRENT LFN_DIRENT;
  36. typedef LFN_DIRENT *PLFN_DIRENT;
  37. //
  38. // This is the largest size buffer we would ever need to read an Lfn
  39. //
  40. #define MAX_LFN_CHARACTERS 260
  41. #define MAX_LFN_DIRENTS 20
  42. #define FAT_LFN_DIRENTS_NEEDED(NAME) (((NAME)->Length/sizeof(WCHAR) + 12)/13)
  43. #endif // _LFN_