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.

329 lines
6.3 KiB

  1. /* Copyright (c) 1993, Microsoft Corporation, all rights reserved
  2. **
  3. ** ppputil.h
  4. ** Public header for miscellaneuos PPP common library functions.
  5. */
  6. #ifndef _PPPUTIL_H_
  7. #define _PPPUTIL_H_
  8. #include "wincrypt.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #ifdef INCL_PARAMBUF
  13. VOID
  14. AddFlagToParamBuf(
  15. IN CHAR* pszzBuf,
  16. IN CHAR* pszKey,
  17. IN BOOL fValue );
  18. VOID
  19. AddLongToParamBuf(
  20. IN CHAR* pszzBuf,
  21. IN CHAR* pszKey,
  22. IN LONG lValue );
  23. VOID
  24. AddStringToParamBuf(
  25. IN CHAR* pszzBuf,
  26. IN CHAR* pszKey,
  27. IN CHAR* pszValue );
  28. VOID
  29. ClearParamBuf(
  30. IN OUT CHAR* pszzBuf );
  31. BOOL
  32. FindFlagInParamBuf(
  33. IN CHAR* pszzBuf,
  34. IN CHAR* pszKey,
  35. IN BOOL* pfValue );
  36. BOOL
  37. FindLongInParamBuf(
  38. IN CHAR* pszzBuf,
  39. IN CHAR* pszKey,
  40. IN LONG* plValue );
  41. BOOL
  42. FindStringInParamBuf(
  43. IN CHAR* pszzBuf,
  44. IN CHAR* pszKey,
  45. IN CHAR* pchValueBuf,
  46. IN DWORD cbValueBuf );
  47. #endif // INCL_PARAMBUF
  48. #ifdef INCL_PWUTIL
  49. CHAR*
  50. DecodePw(
  51. IN CHAR chSeed,
  52. CHAR* pszPassword );
  53. CHAR*
  54. EncodePw(
  55. IN CHAR chSeed,
  56. CHAR* pszPassword );
  57. CHAR*
  58. WipePw(
  59. CHAR* pszPassword );
  60. DWORD
  61. EncodePassword(
  62. DWORD cbPassword,
  63. PBYTE pbPassword,
  64. DATA_BLOB * pDataBlobPassword);
  65. DWORD
  66. DecodePassword(
  67. DATA_BLOB * pDataBlobPassword,
  68. DWORD * pcbPassword,
  69. PBYTE * ppbPassword);
  70. VOID
  71. FreePassword(
  72. DATA_BLOB * pDataBlobPassword);
  73. #endif // INCL_PWUTIL
  74. #ifdef INCL_ENCRYPT
  75. BOOL
  76. IsEncryptionPermitted();
  77. #endif // INCL_ENCRYPT
  78. #ifdef INCL_HOSTWIRE
  79. VOID
  80. HostToWireFormat16(
  81. IN WORD wHostFormat,
  82. OUT PBYTE pWireFormat );
  83. VOID
  84. HostToWireFormat16U(
  85. IN WORD wHostFormat,
  86. OUT PBYTE pWireFormat );
  87. WORD
  88. WireToHostFormat16(
  89. IN PBYTE pWireFormat );
  90. WORD
  91. WireToHostFormat16U(
  92. IN PBYTE pWireFormat );
  93. VOID
  94. HostToWireFormat32(
  95. IN DWORD dwHostFormat,
  96. OUT PBYTE pWireFormat );
  97. DWORD
  98. WireToHostFormat32(
  99. IN PBYTE pWireFormat );
  100. #endif // INCL_HOSTWIRE
  101. #ifdef INCL_SLSA
  102. NTSTATUS
  103. InitLSA();
  104. VOID
  105. EndLSA();
  106. WORD
  107. GetChallenge(
  108. OUT PBYTE pChallenge );
  109. DWORD
  110. GetDefaultDomain(
  111. OUT PWCHAR pwchDomainName,
  112. OUT PNT_PRODUCT_TYPE ProductType );
  113. NTSTATUS
  114. GetLsaHandle(
  115. IN PUNICODE_STRING pSystem OPTIONAL,
  116. IN OUT PLSA_HANDLE phLsa );
  117. #endif // INCL_SLSA
  118. #ifdef INCL_CLSA
  119. DWORD
  120. GetChallengeResponse(
  121. IN DWORD dwTraceId,
  122. IN PBYTE pszUsername,
  123. IN PBYTE pszPassword,
  124. IN PLUID pLuid,
  125. IN PBYTE pbChallenge,
  126. IN BOOL fMachineAuth,
  127. OUT PBYTE CaseInsensitiveChallengeResponse,
  128. OUT PBYTE CaseSensitiveChallengeResponse,
  129. OUT PBYTE fUseNtResponse,
  130. OUT PBYTE pLmSessionKey,
  131. OUT PBYTE pUserSessionKey
  132. );
  133. DWORD GetEncryptedOwfPasswordsForChangePassword(
  134. IN PCHAR pClearTextOldPassword,
  135. IN PCHAR pClearTextNewPassword,
  136. IN PLM_SESSION_KEY pLmSessionKey,
  137. OUT PENCRYPTED_LM_OWF_PASSWORD pEncryptedLmOwfOldPassword,
  138. OUT PENCRYPTED_LM_OWF_PASSWORD pEncryptedLmOwfNewPassword,
  139. OUT PENCRYPTED_NT_OWF_PASSWORD pEncryptedNtOwfOldPassword,
  140. OUT PENCRYPTED_NT_OWF_PASSWORD pEncryptedNtOwfNewPassword
  141. );
  142. BOOL Uppercase(
  143. IN OUT PBYTE pString
  144. );
  145. VOID
  146. CGetSessionKeys(
  147. IN CHAR* pszPw,
  148. OUT LM_SESSION_KEY* pLmKey,
  149. OUT USER_SESSION_KEY* pUserKey );
  150. #endif // INCL_CLSA
  151. #ifdef INCL_RASUSER
  152. BOOL
  153. DialinPrivilege(
  154. IN PWCHAR Username,
  155. IN PWCHAR ServerName );
  156. WORD
  157. GetCallbackPrivilege(
  158. IN PWCHAR Username,
  159. IN PWCHAR ServerName,
  160. OUT PCHAR CallbackNumber );
  161. #endif // INCL_RASUSER
  162. #ifdef INCL_RASAUTHATTRIBUTES
  163. RAS_AUTH_ATTRIBUTE *
  164. RasAuthAttributeCreate(
  165. IN DWORD dwNumAttributes
  166. );
  167. VOID
  168. RasAuthAttributeDestroy(
  169. IN RAS_AUTH_ATTRIBUTE * pAttributes
  170. );
  171. RAS_AUTH_ATTRIBUTE *
  172. RasAuthAttributeGet(
  173. IN RAS_AUTH_ATTRIBUTE_TYPE raaType,
  174. IN RAS_AUTH_ATTRIBUTE * pAttributes
  175. );
  176. VOID
  177. RasAuthAttributesPrint(
  178. IN DWORD dwTraceID,
  179. IN DWORD dwFlags,
  180. IN RAS_AUTH_ATTRIBUTE * pInAttributes
  181. );
  182. DWORD
  183. RasAuthAttributeInsert(
  184. IN DWORD dwIndex,
  185. IN RAS_AUTH_ATTRIBUTE * pAttributes,
  186. IN RAS_AUTH_ATTRIBUTE_TYPE raaType,
  187. IN BOOL fConvertToMultiByte,
  188. IN DWORD dwLength,
  189. IN PVOID Value
  190. );
  191. DWORD
  192. RasAuthAttributeInsertVSA(
  193. IN DWORD dwIndex,
  194. IN RAS_AUTH_ATTRIBUTE * pAttributes,
  195. IN DWORD dwVendorId,
  196. IN DWORD dwLength,
  197. IN PVOID pValue
  198. );
  199. RAS_AUTH_ATTRIBUTE *
  200. RasAuthAttributeCopy(
  201. IN RAS_AUTH_ATTRIBUTE * pAttributes
  202. );
  203. RAS_AUTH_ATTRIBUTE *
  204. RasAuthAttributeCopyWithAlloc(
  205. IN RAS_AUTH_ATTRIBUTE * pAttributes,
  206. IN DWORD dwNumExtraAttributes
  207. );
  208. RAS_AUTH_ATTRIBUTE *
  209. RasAuthAttributeGetFirst(
  210. IN RAS_AUTH_ATTRIBUTE_TYPE raaType,
  211. IN RAS_AUTH_ATTRIBUTE * pAttributes,
  212. OUT HANDLE * phAttribute
  213. );
  214. RAS_AUTH_ATTRIBUTE *
  215. RasAuthAttributeGetNext(
  216. IN OUT HANDLE *phAttribute,
  217. IN RAS_AUTH_ATTRIBUTE_TYPE raaType
  218. );
  219. RAS_AUTH_ATTRIBUTE *
  220. RasAuthAttributeGetVendorSpecific(
  221. IN DWORD dwVendorId,
  222. IN DWORD dwVendorType,
  223. IN RAS_AUTH_ATTRIBUTE * pAttributes
  224. );
  225. RAS_AUTH_ATTRIBUTE *
  226. RasAuthAttributeReAlloc(
  227. IN OUT RAS_AUTH_ATTRIBUTE * pAttributes,
  228. IN DWORD dwNumAttributes
  229. );
  230. CHAR *
  231. RasAuthAttributeGetConcatString(
  232. IN RAS_AUTH_ATTRIBUTE_TYPE raaType,
  233. IN RAS_AUTH_ATTRIBUTE * pAttributes,
  234. IN OUT DWORD * pdwStringLength
  235. );
  236. BYTE *
  237. RasAuthAttributeGetConcatVendorSpecific(
  238. IN DWORD dwVendorId,
  239. IN DWORD dwVendorType,
  240. IN RAS_AUTH_ATTRIBUTE * pAttributes
  241. );
  242. #endif
  243. #ifdef INCL_MISC
  244. DWORD
  245. ExtractUsernameAndDomain(
  246. IN LPSTR szIdentity,
  247. OUT LPSTR szUserName,
  248. OUT LPSTR szDomainName OPTIONAL
  249. );
  250. #endif
  251. #ifdef __cplusplus
  252. }
  253. #endif
  254. #endif // _PPPUTIL_H_