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.

178 lines
3.9 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1991-1999
  6. //
  7. // File: secext.h
  8. //
  9. // Contents: Security function prototypes for functions not part of
  10. // the SSPI interface. This file should not be directly
  11. // included - include security.h instead.
  12. //
  13. //
  14. // History: 22 Dec 92 RichardW Created
  15. //
  16. //------------------------------------------------------------------------
  17. #ifndef __SECEXT_H__
  18. #define __SECEXT_H__
  19. #if _MSC_VER > 1000
  20. #pragma once
  21. #endif
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. //
  26. // Extended Name APIs for ADS
  27. //
  28. typedef enum
  29. {
  30. // Examples for the following formats assume a fictitous company
  31. // which hooks into the global X.500 and DNS name spaces as follows.
  32. //
  33. // Enterprise root domain in DNS is
  34. //
  35. // widget.com
  36. //
  37. // Enterprise root domain in X.500 (RFC 1779 format) is
  38. //
  39. // O=Widget, C=US
  40. //
  41. // There exists the child domain
  42. //
  43. // engineering.widget.com
  44. //
  45. // equivalent to
  46. //
  47. // OU=Engineering, O=Widget, C=US
  48. //
  49. // There exists a container within the Engineering domain
  50. //
  51. // OU=Software, OU=Engineering, O=Widget, C=US
  52. //
  53. // There exists the user
  54. //
  55. // CN=John Doe, OU=Software, OU=Engineering, O=Widget, C=US
  56. //
  57. // And this user's downlevel (pre-ADS) user name is
  58. //
  59. // Engineering\JohnDoe
  60. // unknown name type
  61. NameUnknown = 0,
  62. // CN=John Doe, OU=Software, OU=Engineering, O=Widget, C=US
  63. NameFullyQualifiedDN = 1,
  64. // Engineering\JohnDoe
  65. NameSamCompatible = 2,
  66. // Probably "John Doe" but could be something else. I.e. The
  67. // display name is not necessarily the defining RDN.
  68. NameDisplay = 3,
  69. // String-ized GUID as returned by IIDFromString().
  70. // eg: {4fa050f0-f561-11cf-bdd9-00aa003a77b6}
  71. NameUniqueId = 6,
  72. // engineering.widget.com/software/John Doe
  73. NameCanonical = 7,
  74. // [email protected]
  75. NameUserPrincipal = 8,
  76. // Same as NameCanonical except that rightmost '/' is
  77. // replaced with '\n' - even in domain-only case.
  78. // eg: engineering.widget.com/software\nJohn Doe
  79. NameCanonicalEx = 9,
  80. // www/srv.engineering.com/engineering.com
  81. NameServicePrincipal = 10,
  82. // DNS domain name + SAM username
  83. // eg: engineering.widget.com\JohnDoe
  84. NameDnsDomain = 12
  85. } EXTENDED_NAME_FORMAT, * PEXTENDED_NAME_FORMAT ;
  86. BOOLEAN
  87. SEC_ENTRY
  88. GetUserNameExA(
  89. EXTENDED_NAME_FORMAT NameFormat,
  90. LPSTR lpNameBuffer,
  91. PULONG nSize
  92. );
  93. BOOLEAN
  94. SEC_ENTRY
  95. GetUserNameExW(
  96. EXTENDED_NAME_FORMAT NameFormat,
  97. LPWSTR lpNameBuffer,
  98. PULONG nSize
  99. );
  100. #ifdef UNICODE
  101. #define GetUserNameEx GetUserNameExW
  102. #else
  103. #define GetUserNameEx GetUserNameExA
  104. #endif
  105. BOOLEAN
  106. SEC_ENTRY
  107. GetComputerObjectNameA(
  108. EXTENDED_NAME_FORMAT NameFormat,
  109. LPSTR lpNameBuffer,
  110. PULONG nSize
  111. );
  112. BOOLEAN
  113. SEC_ENTRY
  114. GetComputerObjectNameW(
  115. EXTENDED_NAME_FORMAT NameFormat,
  116. LPWSTR lpNameBuffer,
  117. PULONG nSize
  118. );
  119. #ifdef UNICODE
  120. #define GetComputerObjectName GetComputerObjectNameW
  121. #else
  122. #define GetComputerObjectName GetComputerObjectNameA
  123. #endif
  124. BOOLEAN
  125. SEC_ENTRY
  126. TranslateNameA(
  127. LPCSTR lpAccountName,
  128. EXTENDED_NAME_FORMAT AccountNameFormat,
  129. EXTENDED_NAME_FORMAT DesiredNameFormat,
  130. LPSTR lpTranslatedName,
  131. PULONG nSize
  132. );
  133. BOOLEAN
  134. SEC_ENTRY
  135. TranslateNameW(
  136. LPCWSTR lpAccountName,
  137. EXTENDED_NAME_FORMAT AccountNameFormat,
  138. EXTENDED_NAME_FORMAT DesiredNameFormat,
  139. LPWSTR lpTranslatedName,
  140. PULONG nSize
  141. );
  142. #ifdef UNICODE
  143. #define TranslateName TranslateNameW
  144. #else
  145. #define TranslateName TranslateNameA
  146. #endif
  147. #ifdef __cplusplus
  148. }
  149. #endif
  150. #endif // __SECEXT_H__