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.

698 lines
21 KiB

  1. /*
  2. * DemLFN.H
  3. *
  4. * Include file for all the things that lfn implementation is using
  5. *
  6. * VadimB Created 09-12-96
  7. *
  8. */
  9. /* --------------------------------------------------------------------------
  10. LFN function numbers defined as enum
  11. -------------------------------------------------------------------------- */
  12. typedef enum tagLFNFunctionNumber {
  13. fnLFNCreateDirectory = 0x39,
  14. fnLFNRemoveDirectory = 0x3A,
  15. fnLFNSetCurrentDirectory = 0x3B,
  16. fnLFNDeleteFile = 0x41,
  17. fnLFNGetSetFileAttributes= 0x43,
  18. fnLFNGetCurrentDirectory = 0x47,
  19. fnLFNFindFirstFile = 0x4e,
  20. fnLFNFindNextFile = 0x4f,
  21. fnLFNMoveFile = 0x56,
  22. fnLFNGetPathName = 0x60,
  23. fnLFNOpenFile = 0x6c,
  24. fnLFNGetVolumeInformation = 0xa0,
  25. fnLFNFindClose = 0xa1,
  26. fnLFNGetFileInformationByHandle = 0xa6,
  27. fnLFNFileTime = 0xa7,
  28. fnLFNGenerateShortFileName = 0xa8,
  29. fnLFNSubst = 0xaa
  30. } enumLFNFunctionNumber;
  31. #define fnLFNMajorFunction 0x71
  32. /* --------------------------------------------------------------------------
  33. Useful Macros
  34. -------------------------------------------------------------------------- */
  35. // returns : count of elements in an array
  36. #define ARRAYCOUNT(rgX) (sizeof(rgX)/sizeof(rgX[0]))
  37. // returns : length (in characters) of a counted Unicode string
  38. #define UNICODESTRLENGTH(pStr) ((pStr)->Length >> 1)
  39. // returns : whether an api (like GetShortPathName) has returned count of
  40. // characters required and failed to succeed (due to buffer being too short)
  41. // Note that api here means win32 api, not rtl api (as return value is assumed
  42. // be count of chars, not bytes
  43. #define CHECK_LENGTH_RESULT_USTR(dwStatus, pUnicodeString) \
  44. CHECK_LENGTH_RESULT(dwStatus, \
  45. (pUnicodeString)->MaximumLength, \
  46. (pUnicodeString)->Length)
  47. // returns : dwStatus - whether an api that returns char count
  48. // succeeded on a call, takes string count variables instead of
  49. // unicode string structure (see prev call)
  50. #define CHECK_LENGTH_RESULT(dwStatus, MaximumLength, Length) \
  51. { \
  52. if (0 == dwStatus) { \
  53. dwStatus = GET_LAST_STATUS(); \
  54. } \
  55. else { \
  56. Length = (USHORT)dwStatus * sizeof(WCHAR); \
  57. if ((MaximumLength) > (Length)) { \
  58. dwStatus = STATUS_SUCCESS; \
  59. } \
  60. else { \
  61. dwStatus = NT_STATUS_FROM_WIN32(ERROR_BUFFER_OVERFLOW); \
  62. Length = 0; \
  63. } \
  64. } \
  65. }
  66. // these 2 macros are identical to the ones above but dwStatus is assumed
  67. // to represent a byte count rather than the char count (as in rtl apis)
  68. #define CHECK_LENGTH_RESULT_RTL(dwStatus, MaximumLength, Length) \
  69. { \
  70. if (0 == dwStatus) { \
  71. dwStatus = GET_LAST_STATUS(); \
  72. } \
  73. else { \
  74. Length = (USHORT)dwStatus; \
  75. if ((MaximumLength) > (Length)) { \
  76. dwStatus = STATUS_SUCCESS; \
  77. } \
  78. else { \
  79. dwStatus = NT_STATUS_FROM_WIN32(ERROR_BUFFER_OVERFLOW); \
  80. Length = 0; \
  81. } \
  82. } \
  83. }
  84. #define CHECK_LENGTH_RESULT_RTL_USTR(dwStatus, pUnicodeString) \
  85. CHECK_LENGTH_RESULT_RTL(dwStatus, \
  86. (pUnicodeString)->MaximumLength, \
  87. (pUnicodeString)->Length)
  88. /* --------------------------------------------------------------------------
  89. STATUS and ERROR code macros
  90. -------------------------------------------------------------------------- */
  91. // returns nt status code assembled from separate parts
  92. // see ntstatus.h for details
  93. #define MAKE_STATUS_CODE(Severity,Facility,ErrorCode) \
  94. (((ULONG)Severity << 30) | ((ULONG)Facility << 16) | ((ULONG)ErrorCode))
  95. #define ERROR_CODE_FROM_NT_STATUS(Status) \
  96. ((ULONG)Status & 0xffff)
  97. #define FACILITY_FROM_NT_STATUS(Status) \
  98. (((ULONG)Status >> 16) & 0x0fff)
  99. // returns TRUE if nt status signifies error
  100. #define IS_NT_STATUS_ERROR(Status) \
  101. (((ULONG)Status >> 30) == STATUS_SEVERITY_ERROR)
  102. // converts win32 error code to nt status code
  103. #define NT_STATUS_FROM_WIN32(dwErrorCode) \
  104. MAKE_STATUS_CODE(STATUS_SEVERITY_WARNING,FACILITY_WIN32,dwErrorCode)
  105. // converts nt status to win32 error code
  106. #define WIN32_ERROR_FROM_NT_STATUS(Status) \
  107. RtlNtStatusToDosError(Status)
  108. // returns last win32 error in nt status format
  109. #define GET_LAST_STATUS() NT_STATUS_FROM_WIN32(GetLastError())
  110. /* --------------------------------------------------------------------------
  111. String Conversion macros and functions
  112. -------------------------------------------------------------------------- */
  113. //
  114. // Macro to provide init fn for oem counted strings
  115. //
  116. #define RtlInitOemString(lpOemStr,lpBuf) \
  117. RtlInitString(lpOemStr, lpBuf)
  118. //
  119. // defines a conversion fn from Unicode to Destination type (as accepted by the
  120. // application (oem or ansi)
  121. //
  122. //
  123. typedef NTSTATUS (*PFNUNICODESTRINGTODESTSTRING)(
  124. PVOID pDestString, // counted oem/ansi string -- returned
  125. PUNICODE_STRING pUnicodeString, // unicode string to convert
  126. BOOLEAN fAllocateDestination, // allocate destination dynamically ?
  127. BOOLEAN fVerifyTranslation); // should the translation unicode->oem/ansi be verified ?
  128. //
  129. // defines a conversion fn from Oem/Ansi to Unicode type (as needed by dem)
  130. //
  131. //
  132. typedef NTSTATUS (*PFNSRCSTRINGTOUNICODESTRING)(
  133. PUNICODE_STRING pUnicodeString, // counted unicode string -- returned
  134. PVOID pSrcString, // oem or ansi string to convert
  135. BOOLEAN fAllocateDestination); // allocate destination dynamically ?
  136. //
  137. // these two macros define apis we use for consistency across lfn support land
  138. //
  139. #define DemAnsiStringToUnicodeString RtlAnsiStringToUnicodeString
  140. #define DemOemStringToUnicodeString RtlOemStringToUnicodeString
  141. //
  142. // these two functions provide actual translations
  143. // oem/ansi to unicode
  144. //
  145. NTSTATUS
  146. DemUnicodeStringToAnsiString(
  147. PANSI_STRING pAnsiString,
  148. PUNICODE_STRING pUnicodeString,
  149. BOOLEAN fAllocateResult,
  150. BOOLEAN fVerifyTranslation);
  151. NTSTATUS
  152. DemUnicodeStringToOemString(
  153. POEM_STRING pOemString,
  154. PUNICODE_STRING pUnicodeString,
  155. BOOLEAN fAllocateResult,
  156. BOOLEAN fVerifyTranslation);
  157. //
  158. // This macro returns a pointer (in the current teb) to a unicode string,
  159. // we are using this buffer for unicode/ansi/oem translations
  160. // be careful with inter-function passing of this buffer
  161. // Many Win32's Ansi apis use this buffer as a translation buffer
  162. //
  163. #define GET_STATIC_UNICODE_STRING_PTR() \
  164. (&NtCurrentTeb()->StaticUnicodeString)
  165. /* --------------------------------------------------------------------------
  166. DOS and Windows call frame definition
  167. These macros allow for access to the User's registers, that is
  168. registers which the calling application receives after dos returns
  169. -------------------------------------------------------------------------- */
  170. /*
  171. * See dossym.inc for more details (if any)
  172. * These values represent offsets from user stack top
  173. * during the system call (again, as defined in dossym.inc)
  174. *
  175. * The stack layout is formed by dos and mimicked by kernel in windows
  176. *
  177. */
  178. #pragma pack(1)
  179. // macro: used to declare a named word size register
  180. //
  181. #define DECLARE_WORDREG(Name) \
  182. union { \
  183. USHORT User_ ## Name ## X; \
  184. struct { \
  185. UCHAR User_ ## Name ## L; \
  186. UCHAR User_ ## Name ## H; \
  187. }; \
  188. }
  189. typedef struct tagUserFrame {
  190. DECLARE_WORDREG(A); // ax 0x00
  191. DECLARE_WORDREG(B); // bx 0x02
  192. DECLARE_WORDREG(C); // cx 0x04
  193. DECLARE_WORDREG(D); // dx 0x06
  194. USHORT User_SI; // si 0x8
  195. USHORT User_DI; // di 0xa
  196. USHORT User_BP; // bp 0xc
  197. USHORT User_DS; // ds 0xe
  198. USHORT User_ES; // es 0x10
  199. union {
  200. USHORT User_IP; // ip 0x12 -- Real Mode IP
  201. USHORT User_ProtMode_F; // prot-mode Flags (see i21entry.asm)
  202. };
  203. USHORT User_CS; // cs 0x14 -- this is Real Mode CS!
  204. USHORT User_F; // f 0x16 -- this is Real Mode Flags!!!
  205. } DEMUSERFRAME;
  206. typedef DEMUSERFRAME UNALIGNED *PDEMUSERFRAME;
  207. #pragma pack()
  208. // macro: retrieve flat ptr given separate segment/offset and prot mode
  209. // flag
  210. //
  211. #define dempGetVDMPtr(Segment, Offset, fProtMode) \
  212. Sim32GetVDMPointer((ULONG)MAKELONG(Offset, Segment), 0, (UCHAR)fProtMode)
  213. /*
  214. * Macros to set misc registers on user's stack -
  215. * this is equivalent to what dos kernel does with regular calls
  216. *
  217. * remember that ax is set according to the call result
  218. * (and then dos takes care of it)
  219. *
  220. */
  221. #define getUserDSSI(pUserEnv, fProtMode) \
  222. dempGetVDMPtr(getUserDS(pUserEnv), getUserSI(pUserEnv), fProtMode)
  223. #define getUserDSDX(pUserEnv, fProtMode) \
  224. dempGetVDMPtr(getUserDS(pUserEnv), getUserDX(pUserEnv), fProtMode)
  225. #define getUserESDI(pUserEnv, fProtMode) \
  226. dempGetVDMPtr(getUserES(pUserEnv), getUserDI(pUserEnv), fProtMode)
  227. #define setUserReg(pUserEnv, Reg, Value) \
  228. ( ((PDEMUSERFRAME)pUserEnv)->User_ ## Reg = Value )
  229. #define getUserReg(pUserEnv, Reg) \
  230. (((PDEMUSERFRAME)pUserEnv)->User_ ## Reg)
  231. #define getUserAX(pUserEnv) getUserReg(pUserEnv,AX)
  232. #define getUserBX(pUserEnv) getUserReg(pUserEnv,BX)
  233. #define getUserCX(pUserEnv) getUserReg(pUserEnv,CX)
  234. #define getUserDX(pUserEnv) getUserReg(pUserEnv,DX)
  235. #define getUserSI(pUserEnv) getUserReg(pUserEnv,SI)
  236. #define getUserDI(pUserEnv) getUserReg(pUserEnv,DI)
  237. #define getUserES(pUserEnv) getUserReg(pUserEnv,ES)
  238. #define getUserDS(pUserEnv) getUserReg(pUserEnv,DS)
  239. #define getUserAL(pUserEnv) getUserReg(pUserEnv,AL)
  240. #define getUserAH(pUserEnv) getUserReg(pUserEnv,AH)
  241. #define getUserBL(pUserEnv) getUserReg(pUserEnv,BL)
  242. #define getUserBH(pUserEnv) getUserReg(pUserEnv,BH)
  243. #define getUserCL(pUserEnv) getUserReg(pUserEnv,CL)
  244. #define getUserCH(pUserEnv) getUserReg(pUserEnv,CH)
  245. #define getUserDL(pUserEnv) getUserReg(pUserEnv,DL)
  246. #define getUserDH(pUserEnv) getUserReg(pUserEnv,DH)
  247. #define setUserAX(Value, pUserEnv) setUserReg(pUserEnv, AX, Value)
  248. #define setUserBX(Value, pUserEnv) setUserReg(pUserEnv, BX, Value)
  249. #define setUserCX(Value, pUserEnv) setUserReg(pUserEnv, CX, Value)
  250. #define setUserDX(Value, pUserEnv) setUserReg(pUserEnv, DX, Value)
  251. #define setUserSI(Value, pUserEnv) setUserReg(pUserEnv, SI, Value)
  252. #define setUserDI(Value, pUserEnv) setUserReg(pUserEnv, DI, Value)
  253. #define setUserAL(Value, pUserEnv) setUserReg(pUserEnv, AL, Value)
  254. #define setUserAH(Value, pUserEnv) setUserReg(pUserEnv, AH, Value)
  255. #define setUserBL(Value, pUserEnv) setUserReg(pUserEnv, BL, Value)
  256. #define setUserBH(Value, pUserEnv) setUserReg(pUserEnv, BH, Value)
  257. #define setUserCL(Value, pUserEnv) setUserReg(pUserEnv, CL, Value)
  258. #define setUserCH(Value, pUserEnv) setUserReg(pUserEnv, CH, Value)
  259. #define setUserDL(Value, pUserEnv) setUserReg(pUserEnv, DL, Value)
  260. #define setUserDH(Value, pUserEnv) setUserReg(pUserEnv, DH, Value)
  261. //
  262. // These macros are supposed to be used ONLY when being called from
  263. // protected mode Windows (i.e. krnl386 supplies proper stack)
  264. //
  265. #define getUserPModeFlags(pUserEnv) getUserReg(pUserEnv, ProtMode_F)
  266. #define setUserPModeFlags(Value, pUserEnv) setUserReg(pUserEnv, ProtMode_F, Value)
  267. /* --------------------------------------------------------------------------
  268. Volume information definitions
  269. as they apply to a GetVolumeInformation api
  270. -------------------------------------------------------------------------- */
  271. typedef struct tagLFNVolumeInformation {
  272. DWORD dwFSNameBufferSize;
  273. LPSTR lpFSNameBuffer;
  274. DWORD dwMaximumFileNameLength;
  275. DWORD dwMaximumPathNameLength;
  276. DWORD dwFSFlags;
  277. } LFNVOLUMEINFO, *PLFNVOLUMEINFO, *LPLFNVOLUMEINFO;
  278. //
  279. // defines a flag that indicates LFN api support on a volume
  280. //
  281. #define FS_LFN_APIS 0x00004000UL
  282. //
  283. // allowed lfn volume flags
  284. //
  285. #define LFN_FS_ALLOWED_FLAGS \
  286. (FS_CASE_IS_PRESERVED | FS_CASE_SENSITIVE | \
  287. FS_UNICODE_STORED_ON_DISK | FS_VOL_IS_COMPRESSED | \
  288. FS_LFN_APIS)
  289. /* --------------------------------------------------------------------------
  290. File Time /Dos time conversion definitions
  291. -------------------------------------------------------------------------- */
  292. //
  293. // minor code to use in demLFNFileTimeControl
  294. //
  295. typedef enum tagFileTimeControlMinorCode {
  296. fnFileTimeToDosDateTime = 0,
  297. fnDosDateTimeToFileTime = 1
  298. } enumFileTimeControlMinorCode;
  299. // this constant masks enumFileTimeControlMinorCode values
  300. //
  301. #define FTCTL_CODEMASK (UINT)0x000F
  302. // this flag tells file time control to use UTC time in conversion
  303. //
  304. #define FTCTL_UTCTIME (UINT)0x0010
  305. //
  306. // structure that is used in time conversion calls in demlfn.c
  307. //
  308. typedef struct tagLFNFileTimeInfo {
  309. USHORT uDosDate;
  310. USHORT uDosTime;
  311. USHORT uMilliseconds; // spill-over
  312. } LFNFILETIMEINFO, *PLFNFILETIMEINFO, *LPLFNFILETIMEINFO;
  313. //
  314. // These functions determine whether the target file's time should not be
  315. // converted to local time -- such as files from the cdrom
  316. //
  317. BOOL dempUseUTCTimeByHandle(HANDLE hFile);
  318. BOOL dempUseUTCTimeByName(PUNICODE_STRING pFileName);
  319. /* --------------------------------------------------------------------------
  320. Get/Set File attributes definitions
  321. -------------------------------------------------------------------------- */
  322. typedef enum tagGetSetFileAttributesMinorCode {
  323. fnGetFileAttributes = 0,
  324. fnSetFileAttributes = 1,
  325. fnGetCompressedFileSize = 2,
  326. fnSetLastWriteDateTime = 3,
  327. fnGetLastWriteDateTime = 4,
  328. fnSetLastAccessDateTime = 5,
  329. fnGetLastAccessDateTime = 6,
  330. fnSetCreationDateTime = 7,
  331. fnGetCreationDateTime = 8
  332. } enumGetSetFileAttributesMinorCode;
  333. typedef union tagLFNFileAttributes {
  334. USHORT wFileAttributes; // file attrs
  335. LFNFILETIMEINFO TimeInfo; // for date/time
  336. DWORD dwFileSize; // for compressed file size
  337. } LFNFILEATTRIBUTES, *PLFNFILEATTRIBUTES;
  338. /* --------------------------------------------------------------------------
  339. Get/Set File Time (by handle) definitions - fn 57h
  340. handled by demFileTimes
  341. -------------------------------------------------------------------------- */
  342. //
  343. // flag in SFT indicating that entry references a device (com1:, lpt1:, etc)
  344. //
  345. #define SFTFLAG_DEVICE_ID 0x0080
  346. //
  347. // Minor code for file time requests
  348. //
  349. typedef enum tagFileTimeMinorCode {
  350. fnFTGetLastWriteDateTime = 0x00,
  351. fnFTSetLastWriteDateTime = 0x01,
  352. fnFTGetLastAccessDateTime = 0x04,
  353. fnFTSetLastAccessDateTime = 0x05,
  354. fnFTGetCreationDateTime = 0x06,
  355. fnFTSetCreationDateTime = 0x07
  356. } enumFileTimeMinorCode;
  357. /* --------------------------------------------------------------------------
  358. Open File (function 716ch) definitions
  359. largely equivalent to handling fn 6ch
  360. -------------------------------------------------------------------------- */
  361. //
  362. // Access flags
  363. //
  364. #define DEM_OPEN_ACCESS_READONLY 0x0000
  365. #define DEM_OPEN_ACCESS_WRITEONLY 0x0001
  366. #define DEM_OPEN_ACCESS_READWRITE 0x0002
  367. #define DEM_OPEN_ACCESS_RESERVED 0x0003
  368. // Not supported
  369. #define DEM_OPEN_ACCESS_RO_NOMODLASTACCESS 0x0004
  370. #define DEM_OPEN_ACCESS_MASK 0x000F
  371. //
  372. // Share flags
  373. //
  374. #define DEM_OPEN_SHARE_COMPATIBLE 0x0000
  375. #define DEM_OPEN_SHARE_DENYREADWRITE 0x0010
  376. #define DEM_OPEN_SHARE_DENYWRITE 0x0020
  377. #define DEM_OPEN_SHARE_DENYREAD 0x0030
  378. #define DEM_OPEN_SHARE_DENYNONE 0x0040
  379. #define DEM_OPEN_SHARE_MASK 0x0070
  380. //
  381. // Open flags
  382. //
  383. #define DEM_OPEN_FLAGS_NOINHERIT 0x0080
  384. #define DEM_OPEN_FLAGS_NO_BUFFERING 0x0100
  385. #define DEM_OPEN_FLAGS_NO_COMPRESS 0x0200
  386. // Not supported
  387. #define DEM_OPEN_FLAGS_ALIAS_HINT 0x0400
  388. #define DEM_OPEN_FLAGS_NOCRITERR 0x2000
  389. #define DEM_OPEN_FLAGS_COMMIT 0x4000
  390. #define DEM_OPEN_FLAGS_VALID \
  391. (DEM_OPEN_FLAGS_NOINHERIT | DEM_OPEN_FLAGS_NO_BUFFERING | \
  392. DEM_OPEN_FLAGS_NO_COMPRESS | DEM_OPEN_FLAGS_ALIAS_HINT | \
  393. DEM_OPEN_FLAGS_NOCRITERR | DEM_OPEN_FLAGS_COMMIT)
  394. #define DEM_OPEN_FLAGS_MASK 0xFF00
  395. //
  396. // Action flags
  397. //
  398. // DEM_OPEN_FUNCTION_FILE_CREATE combines with action_file_open or
  399. // action_file_truncate flags
  400. #define DEM_OPEN_ACTION_FILE_CREATE 0x0010
  401. #define DEM_OPEN_ACTION_FILE_OPEN 0x0001
  402. #define DEM_OPEN_ACTION_FILE_TRUNCATE 0x0002
  403. //
  404. // resulting action (returned to the app)
  405. //
  406. #define ACTION_OPENED 0x0001
  407. #define ACTION_CREATED_OPENED 0x0002
  408. #define ACTION_REPLACED_OPENED 0x0003
  409. /* --------------------------------------------------------------------------
  410. Additional file attribute definitions
  411. -------------------------------------------------------------------------- */
  412. // Volume id attribute
  413. #define DEM_FILE_ATTRIBUTE_VOLUME_ID 0x00000008L
  414. //
  415. // Valid file attributes mask as understood by dos
  416. //
  417. #define DEM_FILE_ATTRIBUTE_VALID \
  418. (FILE_ATTRIBUTE_READONLY| FILE_ATTRIBUTE_HIDDEN| \
  419. FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY | \
  420. FILE_ATTRIBUTE_ARCHIVE | DEM_FILE_ATTRIBUTE_VOLUME_ID)
  421. //
  422. // Valid to set attributes
  423. //
  424. #define DEM_FILE_ATTRIBUTE_SET_VALID \
  425. (FILE_ATTRIBUTE_READONLY| FILE_ATTRIBUTE_HIDDEN| \
  426. FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE)
  427. /* --------------------------------------------------------------------------
  428. FindFirst/FindNext definitions
  429. -------------------------------------------------------------------------- */
  430. //
  431. // Definition for the handle table entries
  432. // Handle (which is returned to the app) references this entry
  433. // providing all the relevant info for FindFirst/FindNext
  434. //
  435. typedef struct tagLFNFindHandleTableEntry {
  436. union {
  437. HANDLE hFindHandle; // handle for searching
  438. UINT nNextFreeEntry;
  439. };
  440. USHORT wMustMatchAttributes;
  441. USHORT wSearchAttributes;
  442. UNICODE_STRING unicodeFileName; // counted file name string,
  443. // only used if matched a vol label
  444. // process id, aka pdb requesting this handle
  445. // or 0xffff if the entry is empty
  446. USHORT wProcessPDB;
  447. } LFN_SEARCH_HANDLE_ENTRY, *PLFN_SEARCH_HANDLE_ENTRY;
  448. //
  449. // Definition of a handle table
  450. // Table is dynamic and it expands/shrinks as necessary
  451. //
  452. typedef struct tagFindHandleTable {
  453. PLFN_SEARCH_HANDLE_ENTRY pHandleTable;
  454. UINT nTableSize; // total size in entries
  455. UINT nFreeEntry; // free list head
  456. UINT nHandleCount; // handles stored (bottom)
  457. } DemSearchHandleTable;
  458. //
  459. // Definitions of a constants used in managing handle table
  460. //
  461. // initial table size
  462. #define LFN_SEARCH_HANDLE_INITIAL_SIZE 0x20
  463. // handle table growth increment
  464. #define LFN_SEARCH_HANDLE_INCREMENT 0x10
  465. // used to mark a last free list entry
  466. #define LFN_SEARCH_HANDLE_LIST_END ((UINT)-1)
  467. //
  468. // Application receives handles in format
  469. // LFN_DOS_HANDLE_MASK + (index to the handle table)
  470. // so that it looks legit to the app
  471. //
  472. #define LFN_DOS_HANDLE_MASK ((USHORT)0x4000)
  473. // max number of search handles we can support
  474. #define LFN_DOS_HANDLE_LIMIT ((USHORT)0x3FFF)
  475. //
  476. // Date/Time format as returned in WIN32_FIND_DATAA structure
  477. //
  478. typedef enum tagLFNDateTimeFormat {
  479. dtfWin32 = 0, // win32 file time/date format
  480. dtfDos = 1 // dos date time format
  481. } enumLFNDateTimeFormat;
  482. /* --------------------------------------------------------------------------
  483. GetPathName definitions
  484. -------------------------------------------------------------------------- */
  485. //
  486. // minor code for the fn 7160h
  487. //
  488. typedef enum tagFullPathNameMinorCode {
  489. fnGetFullPathName = 0,
  490. fnGetShortPathName = 1,
  491. fnGetLongPathName = 2
  492. } enumFullPathNameMinorCode;
  493. /* --------------------------------------------------------------------------
  494. Subst function definitions
  495. -------------------------------------------------------------------------- */
  496. //
  497. // minor code for the fn 71aah
  498. // used in demLFNSubstControl
  499. //
  500. typedef enum tagSubstMinorCode {
  501. fnCreateSubst = 0,
  502. fnRemoveSubst = 1,
  503. fnQuerySubst = 2
  504. } enumSubstMinorCode;