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.

80 lines
1.3 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. BOOLEAN
  27. InteractiveSession();
  28. DWORD
  29. SetCurrentLoginSession(
  30. IN DWORD dwSessionId);
  31. HANDLE
  32. RefreshImpersonation (
  33. HANDLE hProcess
  34. );
  35. VOID
  36. RevertImpersonation();
  37. DWORD
  38. InitSecurityAttribute();
  39. VOID
  40. TraceCurrentUser(VOID);
  41. DWORD
  42. DwGetHkcu();
  43. DWORD
  44. InitializeImpersonation();
  45. VOID
  46. CleanupImpersonation();
  47. BOOLEAN
  48. ImpersonatingGuest();
  49. VOID
  50. LockImpersonation();
  51. VOID
  52. UnlockImpersonation();
  53. #endif // _IMPERSON_