Source code of Windows XP (NT5)
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.

103 lines
2.2 KiB

  1. #pragma once
  2. #define IS_PATH_SEPARATOR_U(ch) ((ch == L'\\') || (ch == L'/'))
  3. #if FUSION_WIN2000xxxx
  4. PSINGLE_LIST_ENTRY
  5. FirstEntrySList (
  6. const SLIST_HEADER *ListHead
  7. );
  8. VOID
  9. InitializeSListHead (
  10. IN PSLIST_HEADER ListHead
  11. );
  12. #define RtlInitializeSListHead InitializeSListHead
  13. #define RtlFirstEntrySList FirstEntrySList
  14. #define RtlInterlockedPopEntrySList InterlockedPopEntrySList
  15. #define RtlInterlockedPushEntrySList InterlockedPushEntrySList
  16. #define RtlInterlockedFlushSList InterlockedFlushSList
  17. #define RtlQueryDepthSList QueryDepthSList
  18. #endif
  19. inline BOOL
  20. SxspIsSListEmpty(
  21. IN const SLIST_HEADER* ListHead
  22. )
  23. {
  24. #if _NTSLIST_DIRECT_
  25. return FirstEntrySList(ListHead) == NULL;
  26. #else
  27. return RtlFirstEntrySList(ListHead) == NULL;
  28. #endif
  29. }
  30. inline VOID
  31. SxspInitializeSListHead(
  32. IN PSLIST_HEADER ListHead
  33. )
  34. {
  35. RtlInitializeSListHead(ListHead);
  36. }
  37. inline PSINGLE_LIST_ENTRY
  38. SxspPopEntrySList(
  39. IN PSLIST_HEADER ListHead
  40. )
  41. {
  42. return RtlInterlockedPopEntrySList(ListHead);
  43. }
  44. inline PSINGLE_LIST_ENTRY
  45. SxspInterlockedPopEntrySList(
  46. IN PSLIST_HEADER ListHead
  47. )
  48. {
  49. return RtlInterlockedPopEntrySList(ListHead);
  50. }
  51. inline PSINGLE_LIST_ENTRY
  52. SxspInterlockedPushEntrySList(
  53. IN PSLIST_HEADER ListHead,
  54. IN PSINGLE_LIST_ENTRY ListEntry
  55. )
  56. {
  57. return RtlInterlockedPushEntrySList(ListHead, ListEntry);
  58. }
  59. inline RTL_PATH_TYPE
  60. SxspDetermineDosPathNameType(
  61. PCWSTR DosFileName
  62. )
  63. // RtlDetermineDosPathNameType_U is a bit wacky..
  64. {
  65. if ( DosFileName[0] == '\\'
  66. && DosFileName[1] == '\\'
  67. && DosFileName[2] == '?'
  68. && DosFileName[3] == '\\'
  69. )
  70. {
  71. if ( (DosFileName[4] == 'u' || DosFileName[4] == 'U')
  72. && (DosFileName[5] == 'n' || DosFileName[5] == 'N')
  73. && (DosFileName[6] == 'c' || DosFileName[6] == 'C')
  74. && DosFileName[7] == '\\'
  75. )
  76. {
  77. return RtlPathTypeUncAbsolute;
  78. }
  79. if (DosFileName[4] != 0
  80. && DosFileName[5] == ':'
  81. && DosFileName[6] == '\\'
  82. )
  83. {
  84. return RtlPathTypeDriveAbsolute;
  85. }
  86. }
  87. #if FUSION_WIN
  88. return RtlDetermineDosPathNameType_U(DosFileName);
  89. #else
  90. return RtlPathTypeRelative;
  91. #endif
  92. }