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.

140 lines
5.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: proto.h
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 10-02-96 RichardW Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #include <align.h>
  18. //
  19. // RELOCATE_ONE - Relocate a single pointer in a client buffer.
  20. //
  21. // Note: this macro is dependent on parameter names as indicated in the
  22. // description below. On error, this macro goes to 'Cleanup' with
  23. // 'Status' set to the NT Status code.
  24. //
  25. // The MaximumLength is forced to be Length.
  26. //
  27. // Define a macro to relocate a pointer in the buffer the client passed in
  28. // to be relative to 'ProtocolSubmitBuffer' rather than being relative to
  29. // 'ClientBufferBase'. The result is checked to ensure the pointer and
  30. // the data pointed to is within the first 'SubmitBufferSize' of the
  31. // 'ProtocolSubmitBuffer'.
  32. //
  33. // The relocated field must be aligned to a WCHAR boundary.
  34. //
  35. // _q - Address of UNICODE_STRING structure which points to data to be
  36. // relocated
  37. //
  38. #define RELOCATE_ONE( _q ) \
  39. { \
  40. ULONG_PTR Offset; \
  41. \
  42. Offset = (((PUCHAR)((_q)->Buffer)) - ((PUCHAR)ClientBufferBase)); \
  43. if ( Offset >= SubmitBufferSize || \
  44. Offset + (_q)->Length > SubmitBufferSize || \
  45. !COUNT_IS_ALIGNED( Offset, ALIGN_WCHAR) ) { \
  46. \
  47. Status = STATUS_INVALID_PARAMETER; \
  48. goto Cleanup; \
  49. } \
  50. \
  51. (_q)->Buffer = (PWSTR)(((PUCHAR)ProtocolSubmitBuffer) + Offset); \
  52. (_q)->MaximumLength = (_q)->Length ; \
  53. }
  54. //
  55. // NULL_RELOCATE_ONE - Relocate a single (possibly NULL) pointer in a client
  56. // buffer.
  57. //
  58. // This macro special cases a NULL pointer then calls RELOCATE_ONE. Hence
  59. // it has all the restrictions of RELOCATE_ONE.
  60. //
  61. //
  62. // _q - Address of UNICODE_STRING structure which points to data to be
  63. // relocated
  64. //
  65. #define NULL_RELOCATE_ONE( _q ) \
  66. { \
  67. if ( (_q)->Buffer == NULL ) { \
  68. if ( (_q)->Length != 0 ) { \
  69. Status = STATUS_INVALID_PARAMETER; \
  70. goto Cleanup; \
  71. } \
  72. } else if ( (_q)->Length == 0 ) { \
  73. (_q)->Buffer = NULL; \
  74. } else { \
  75. RELOCATE_ONE( _q ); \
  76. } \
  77. }
  78. SpInitializeFn SpInitialize;
  79. SpGetInfoFn SpUniGetInfo;
  80. SpGetInfoFn SpSslGetInfo;
  81. SpAcceptCredentialsFn SpAcceptCredentials;
  82. SpAcquireCredentialsHandleFn SpUniAcquireCredentialsHandle;
  83. SpFreeCredentialsHandleFn SpFreeCredentialsHandle;
  84. SpQueryCredentialsAttributesFn SpQueryCredentialsAttributes;
  85. SpSaveCredentialsFn SpSaveCredentials;
  86. SpGetCredentialsFn SpGetCredentials;
  87. SpDeleteCredentialsFn SpDeleteCredentials;
  88. SpInitLsaModeContextFn SpInitLsaModeContext;
  89. SpDeleteContextFn SpDeleteContext;
  90. SpAcceptLsaModeContextFn SpAcceptLsaModeContext;
  91. LSA_AP_LOGON_TERMINATED SpLogonTerminated;
  92. SpApplyControlTokenFn SpApplyControlToken;
  93. LSA_AP_CALL_PACKAGE SpCallPackage;
  94. LSA_AP_CALL_PACKAGE SpCallPackageUntrusted;
  95. LSA_AP_CALL_PACKAGE_PASSTHROUGH SpCallPackagePassthrough;
  96. SpShutdownFn SpShutdown;
  97. SpGetUserInfoFn SpGetUserInfo;
  98. SpInstanceInitFn SpInstanceInit;
  99. SpInitUserModeContextFn SpInitUserModeContext;
  100. SpMakeSignatureFn SpMakeSignature;
  101. SpVerifySignatureFn SpVerifySignature;
  102. SpSealMessageFn SpSealMessage;
  103. SpUnsealMessageFn SpUnsealMessage;
  104. SpGetContextTokenFn SpGetContextToken;
  105. SpQueryContextAttributesFn SpUserQueryContextAttributes;
  106. SpQueryContextAttributesFn SpLsaQueryContextAttributes;
  107. SpSetContextAttributesFn SpSetContextAttributes;
  108. SpDeleteContextFn SpDeleteUserModeContext;
  109. SpCompleteAuthTokenFn SpCompleteAuthToken;
  110. SpFormatCredentialsFn SpFormatCredentials;
  111. SpMarshallSupplementalCredsFn SpMarshallSupplementalCreds;
  112. SpGetExtendedInformationFn SpGetExtendedInformation;
  113. SpExportSecurityContextFn SpExportSecurityContext;
  114. SpImportSecurityContextFn SpImportSecurityContext;
  115. SECURITY_STATUS
  116. SEC_ENTRY
  117. SpSslGetInfo(
  118. PSecPkgInfo pInfo);
  119. SECURITY_STATUS PctTranslateError(SP_STATUS spRet);
  120. BOOL
  121. SslRelocateToken(
  122. IN HLOCATOR Locator,
  123. OUT HLOCATOR * NewLocator);