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.

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