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.

90 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. impersn.h
  5. Abstract:
  6. Definitions for impersonation routines
  7. Author:
  8. Anthony Discolo (adiscolo) 04-Aug-1995
  9. Revision History:
  10. --*/
  11. #ifndef _IMPERSON_
  12. #define _IMPERSON_
  13. typedef struct _IMPERSONATION_INFO {
  14. CRITICAL_SECTION csLock; // lock over entire structure
  15. HANDLE hToken; // process token
  16. HANDLE hTokenImpersonation; // impersonation token
  17. HANDLE hProcess; // handle of shell process
  18. BOOLEAN fGroupsLoaded; // TRUE if fGuest is valid
  19. BOOLEAN fGuest; // user is member of the guests group
  20. PSID pGuestSid; // SID of the local guests group
  21. DWORD dwCurSessionId;
  22. BOOLEAN fSessionInitialized;
  23. } IMPERSONATION_INFO;
  24. extern IMPERSONATION_INFO ImpersonationInfoG;
  25. extern SECURITY_ATTRIBUTES SecurityAttributeG;
  26. #define RASAUTO_CRITSEC_ADDRMAP 0x00000001
  27. #define RASAUTO_CRITSEC_REQUESTLIST 0x00000002
  28. #define RASAUTO_CRITSEC_IMPERSON 0x00000004
  29. #define RASAUTO_CRITSEC_RASG 0x00000008
  30. #define RASAUTO_CRITSEC_DISABLEDADD 0x00000010
  31. #define RASAUTO_CRITSEC_NETMAP 0x00000020
  32. #define RASAUTO_CRITSEC_TAPI 0x00000040
  33. BOOLEAN
  34. InteractiveSession();
  35. DWORD
  36. SetCurrentLoginSession(
  37. IN DWORD dwSessionId);
  38. HANDLE
  39. RefreshImpersonation (
  40. HANDLE hProcess
  41. );
  42. VOID
  43. RevertImpersonation();
  44. DWORD
  45. InitSecurityAttribute();
  46. VOID
  47. TraceCurrentUser(VOID);
  48. DWORD
  49. DwGetHkcu();
  50. DWORD
  51. InitializeImpersonation();
  52. VOID
  53. CleanupImpersonation();
  54. BOOLEAN
  55. ImpersonatingGuest();
  56. VOID
  57. LockImpersonation();
  58. VOID
  59. UnlockImpersonation();
  60. #endif // _IMPERSON_