Windows NT 4.0 source code leak
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.

67 lines
1.9 KiB

4 years ago
  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1991 - 1992
  6. //
  7. // File: connmgr.h
  8. //
  9. // Contents: Connection Manager code for KSecDD
  10. //
  11. //
  12. // History: 3 Jun 92 RichardW Created
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __CONNMGR_H__
  16. #define __CONNMGR_H__
  17. typedef struct _Client {
  18. struct _Client * pNext;
  19. PVOID ProcessId;
  20. HANDLE hPort;
  21. ULONG fClient;
  22. LONG cRefs;
  23. } Client, *PClient;
  24. typedef struct _KernelContext {
  25. struct _KernelContext * pNext; // Link to next context
  26. struct _KernelContext * pPrev; // Link to previous context
  27. UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
  28. UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
  29. HANDLE TokenHandle;
  30. PACCESS_TOKEN AccessToken;
  31. } KernelContext, *PKernelContext;
  32. // FSP connections are managed thusly:
  33. //
  34. // A Client structure is allocated for each FSP that connects. At the same
  35. // time, the LPC port is created Additionally, hanging off a Client is the
  36. // list of active impersonations, and the list of contexts.
  37. #define CLIENT_CONTEXT 2 // Client has at least one context
  38. #define CONNFLAG_BROKEN 2 // Connection is broken and cannot be reused
  39. #define CONNFLAG_CONTEXT 4 // Connection has contexts
  40. #define CONNFLAG_IMPERSON 8 // Connection has impersonations
  41. BOOLEAN InitConnMgr(void);
  42. NTSTATUS CreateClient(PClient *);
  43. NTSTATUS LocateClient(PClient *);
  44. void FreeClient(PClient);
  45. NTSTATUS CreateConnection(HANDLE *);
  46. void AddKernelContext(PKernelContext *, PKSPIN_LOCK, PKernelContext);
  47. SECURITY_STATUS DeleteKernelContext(PKernelContext *, PKSPIN_LOCK, PKernelContext);
  48. extern ULONG PackageId;
  49. #endif // __CONNMGR_H__