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.

88 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. uipriv.c
  5. Abstract:
  6. Implements the priv command in cmd.exe.
  7. Author:
  8. Robert Reichel (robertre) 6-8-92
  9. Revision History:
  10. --*/
  11. #include "cmd.h"
  12. extern TCHAR SwitChar;
  13. extern BOOL CtrlCSeen;
  14. extern unsigned LastRetCode;
  15. //
  16. // Maximum length of a Programmatic privilege name, in
  17. // characters
  18. //
  19. #define MAX_PRIVILEGE_NAME 128
  20. #define MAX_PRIVILEGE_COUNT 128
  21. #define INITIAL_DISPLAY_NAME_LENGTH 128
  22. BOOL
  23. DisablePrivileges(
  24. USHORT PassedPrivilegeCount,
  25. PLUID PrivilegeValues,
  26. PTOKEN_PRIVILEGES CurrentTokenPrivileges,
  27. PBOOL PrivilegesDisabled,
  28. HANDLE TokenHandle
  29. );
  30. BOOL
  31. EnablePrivileges(
  32. USHORT PassedPrivilegeCount,
  33. PLUID PrivilegeValues,
  34. PTOKEN_PRIVILEGES CurrentTokenPrivileges
  35. );
  36. BOOL
  37. ResetPrivileges(
  38. USHORT PassedPrivilegeCount,
  39. PLUID PrivilegeValues,
  40. PTOKEN_PRIVILEGES CurrentTokenPrivileges
  41. );
  42. int
  43. Priv (
  44. TCHAR *pszCmdLine
  45. );
  46. #define EqualLuid( Luid1, Luid2 ) (((Luid1).HighPart == (Luid2).HighPart) && \
  47. ((Luid1).LowPart == (Luid2).LowPart))
  48. //
  49. // temp hack until I put in actuall message
  50. //
  51. #define MSG_MISSING_PRIV_NAME MSG_BAD_SYNTAX
  52. #ifndef SHIFT
  53. #define SHIFT(c,v) {c--; v++;}
  54. #endif //SHIFT
  55. //
  56. // Function definitions...
  57. //