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.

94 lines
2.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: context.h
  7. //
  8. // Contents: Security Context structures and manipulation
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 2-24-97 RichardW Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __CONTEXT_H__
  18. #define __CONTEXT_H__
  19. typedef enum _XTCB_CONTEXT_TYPE {
  20. XtcbContextClient,
  21. XtcbContextServer,
  22. XtcbContextClientMapped,
  23. XtcbContextServerMapped
  24. } XTCB_CONTEXT_TYPE ;
  25. typedef enum _XTCB_CONTEXT_STATE {
  26. ContextFirstCall,
  27. ContextSecondCall,
  28. ContextThirdCall
  29. } XTCB_CONTEXT_STATE ;
  30. #define XTCB_CONTEXT_CHECK 'txtC'
  31. typedef struct _XTCB_CONTEXT_CORE {
  32. ULONG Check ;
  33. XTCB_CONTEXT_TYPE Type ;
  34. XTCB_CONTEXT_STATE State ;
  35. LONG RefCount ;
  36. ULONG Attributes ;
  37. UCHAR RootKey[ SEED_KEY_SIZE ];
  38. UCHAR InboundKey[ SEED_KEY_SIZE ];
  39. UCHAR OutboundKey[ SEED_KEY_SIZE ];
  40. ULONG InboundNonce ;
  41. ULONG OutboundNonce ;
  42. ULONG CoreTokenHandle ;
  43. } XTCB_CONTEXT_CORE, * PXTCB_CONTEXT_CORE ;
  44. typedef struct _XTCB_CONTEXT {
  45. XTCB_CONTEXT_CORE Core ;
  46. LSA_SEC_HANDLE CredHandle ;
  47. HANDLE Token ;
  48. } XTCB_CONTEXT, * PXTCB_CONTEXT ;
  49. NTSTATUS
  50. XtcbInitializeContexts(
  51. VOID
  52. );
  53. PXTCB_CONTEXT
  54. XtcbCreateContextRecord(
  55. XTCB_CONTEXT_TYPE Type,
  56. PXTCB_CRED_HANDLE Handle
  57. );
  58. VOID
  59. XtcbDeleteContextRecord(
  60. PXTCB_CONTEXT Context
  61. );
  62. NTSTATUS
  63. XtcbMapContextToUser(
  64. PXTCB_CONTEXT Context,
  65. PSecBuffer ContextBuffer
  66. );
  67. BOOL
  68. XtcbRefContextRecord(
  69. PXTCB_CONTEXT Context
  70. );
  71. VOID
  72. XtcbDerefContextRecordEx(
  73. PXTCB_CONTEXT Context,
  74. LONG RefBy
  75. );
  76. #define XtcbDerefContextRecord( C ) XtcbDerefContextRecordEx( C, 1 );
  77. #endif // __CONTEXT_H__