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.

265 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation.
  3. Module Name:
  4. header.h
  5. Abstract:
  6. This module contains the main infrastructure for mup data structures.
  7. Revision History:
  8. Uday Hegde (udayh) 11\10\1999
  9. NOTES:
  10. */
  11. #ifndef __DFS_MISC_H__
  12. #define __DFS_MISC_H__
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. VOID
  17. DfsGetNetbiosName(
  18. PUNICODE_STRING pName,
  19. PUNICODE_STRING pNetbiosName,
  20. PUNICODE_STRING pRemaining );
  21. DFSSTATUS
  22. DfsGetPathComponents(
  23. PUNICODE_STRING pName,
  24. PUNICODE_STRING pServerName,
  25. PUNICODE_STRING pShareName,
  26. PUNICODE_STRING pRemaining);
  27. DFSSTATUS
  28. DfsGetFirstComponent(
  29. PUNICODE_STRING pName,
  30. PUNICODE_STRING pFirstName,
  31. PUNICODE_STRING pRemaining);
  32. DFSSTATUS
  33. DfsGetNextComponent(
  34. PUNICODE_STRING pName,
  35. PUNICODE_STRING pFirstName,
  36. PUNICODE_STRING pRemaining);
  37. DFSSTATUS
  38. DfsIsThisAMachineName(LPWSTR MachineName);
  39. DFSSTATUS
  40. DfsIsThisAStandAloneDfsName(
  41. LPWSTR ServerName,
  42. LPWSTR ShareName );
  43. DFSSTATUS
  44. DfsIsThisARealDfsName(
  45. LPWSTR ServerName,
  46. LPWSTR ShareName,
  47. BOOLEAN * IsDomainDfs );
  48. DFSSTATUS
  49. DfsIsThisADomainName(LPWSTR DomainName);
  50. DFSSTATUS
  51. DfsGenerateUuidString(LPWSTR *UuidString );
  52. VOID
  53. DfsReleaseUuidString(LPWSTR *UuidString );
  54. DFSSTATUS
  55. DfsCreateUnicodeString(
  56. PUNICODE_STRING pDest,
  57. PUNICODE_STRING pSrc );
  58. DFSSTATUS
  59. DfsCreateUnicodeStringFromString(
  60. PUNICODE_STRING pDest,
  61. LPWSTR pSrcString );
  62. DFSSTATUS
  63. DfsCreateUnicodePathString(
  64. PUNICODE_STRING pDest,
  65. ULONG NumberOfLeadingSeperators,
  66. LPWSTR pFirstComponent,
  67. LPWSTR pRemaining );
  68. DFSSTATUS
  69. DfsCreateUnicodePathStringFromUnicode(
  70. PUNICODE_STRING pDest,
  71. ULONG NumberOfLeadingSeperators,
  72. PUNICODE_STRING pFirst,
  73. PUNICODE_STRING pRemaining );
  74. VOID
  75. DfsFreeUnicodeString(
  76. PUNICODE_STRING pDfsString );
  77. DFSSTATUS
  78. DfsGetSharePath(
  79. IN LPWSTR ServerName,
  80. IN LPWSTR ShareName,
  81. OUT PUNICODE_STRING pPathName );
  82. ULONG
  83. DfsSizeUncPath(
  84. PUNICODE_STRING FirstComponent,
  85. PUNICODE_STRING SecondComponent );
  86. VOID
  87. DfsCopyUncPath(
  88. LPWSTR NewPath,
  89. PUNICODE_STRING FirstComponent,
  90. PUNICODE_STRING SecondComponent );
  91. DFSSTATUS
  92. DfsApiSizeLevelHeader(
  93. ULONG Level,
  94. LONG * ReturnedSize );
  95. NTSTATUS
  96. AddNextPathComponent(
  97. PUNICODE_STRING pPath );
  98. NTSTATUS
  99. StripLastPathComponent(
  100. PUNICODE_STRING pPath );
  101. DFSSTATUS
  102. PackGetULong(
  103. PULONG pValue,
  104. PVOID *ppBuffer,
  105. PULONG pSizeRemaining );
  106. DFSSTATUS
  107. PackSetULong(
  108. ULONG Value,
  109. PVOID *ppBuffer,
  110. PULONG pSizeRemaining );
  111. ULONG
  112. PackSizeULong();
  113. DFSSTATUS
  114. PackGetUShort(
  115. PUSHORT pValue,
  116. PVOID *ppBuffer,
  117. PULONG pSizeRemaining );
  118. DFSSTATUS
  119. PackSetUShort(
  120. USHORT Value,
  121. PVOID *ppBuffer,
  122. PULONG pSizeRemaining );
  123. ULONG
  124. PackSizeUShort();
  125. DFSSTATUS
  126. PackGetString(
  127. PUNICODE_STRING pString,
  128. PVOID *ppBuffer,
  129. PULONG pSizeRemaining );
  130. DFSSTATUS
  131. PackSetString(
  132. PUNICODE_STRING pString,
  133. PVOID *ppBuffer,
  134. PULONG pSizeRemaining );
  135. ULONG
  136. PackSizeString(
  137. PUNICODE_STRING pString);
  138. DFSSTATUS
  139. PackGetGuid(
  140. GUID *pGuid,
  141. PVOID *ppBuffer,
  142. PULONG pSizeRemaining );
  143. DFSSTATUS
  144. PackSetGuid(
  145. GUID *pGuid,
  146. PVOID *ppBuffer,
  147. PULONG pSizeRemaining );
  148. ULONG
  149. PackSizeGuid();
  150. void
  151. StripTrailingSpacesFromPath(
  152. LPWSTR pPath );
  153. LPWSTR
  154. StripLeadingSpacesFromPath(
  155. LPWSTR pPath );
  156. LPWSTR
  157. StripSpacesFromPath(
  158. LPWSTR pPath );
  159. DFSSTATUS
  160. DfsRtlInitUnicodeStringEx(PUNICODE_STRING DestinationString,
  161. PCWSTR SourceString);
  162. DFSSTATUS
  163. DfsStringCchLength(
  164. LPWSTR pStr,
  165. size_t CchMax,
  166. size_t *pCch);
  167. DFSSTATUS
  168. DfsGetRegValueString(
  169. HKEY Key,
  170. LPWSTR pKeyName,
  171. PUNICODE_STRING pValue );
  172. VOID
  173. DfsReleaseRegValueString(
  174. PUNICODE_STRING pValue );
  175. #define UNICODE_PATH_SEP L'\\'
  176. #define IsEmptyString(_str) \
  177. ( ((_str) == NULL) || ((_str)[0] == UNICODE_NULL) )
  178. #define IsEmptyUnicodeString(_unistr) \
  179. ( ((_unistr) == NULL) || ((_unistr)->Length == 0) || IsEmptyString((_unistr)->Buffer) )
  180. #define IsLocalName(_pUnicode) \
  181. ( (((_pUnicode)->Length == sizeof(WCHAR)) && ((_pUnicode)->Buffer[0] == L'.')) || \
  182. (((_pUnicode)->Length == 2 * sizeof(WCHAR)) && ((_pUnicode)->Buffer[0] == L'.') && ((_pUnicode)->Buffer[1] == UNICODE_NULL)) )
  183. #ifdef __cplusplus
  184. }
  185. #endif
  186. #endif /* __DFS_MISC_H__ */