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.

60 lines
2.1 KiB

  1. //****************************************************************************
  2. //
  3. // Copyright (C) 1999 Microsoft Corporation
  4. //
  5. // GROUPSFORUSER.H
  6. //
  7. //****************************************************************************
  8. #ifndef __Groups_For_User_Compiled__
  9. #define __Groups_For_User_Compiled__
  10. #include <authz.h>
  11. #include "esscpol.h"
  12. #include <NTSECAPI.H>
  13. // you'll need to link to netapi32.lib for this to fly
  14. // retireves access mask corresponding to permissions granted
  15. // by dacl to account denoted by pSid
  16. NTSTATUS ESSCLI_POLARITY GetAccessMask( PSID pSid, PACL pDacl, DWORD *pAccessMask );
  17. // returns STATUS_SUCCESS if user is in group
  18. // STATUS_ACCESS_DENIED if not
  19. // some error code or other on error
  20. NTSTATUS ESSCLI_POLARITY IsUserInGroup( PSID pSidUser, PSID pSidGroup );
  21. NTSTATUS ESSCLI_POLARITY IsUserAdministrator( PSID pSidUser );
  22. #ifndef __AUTHZ_H__
  23. #include <wbemcli.h>
  24. #include <winntsec.h>
  25. #include "esscpol.h"
  26. #include <NTSECAPI.H>
  27. // given a SID & server name
  28. // will return all groups of which user is a member
  29. // callers responsibility to HeapFree apSids & the memory to which they point.
  30. // pdwCount points to dword to receive count of group sids returned.
  31. // serverName may be NULL, in which case this function will look up
  32. // the sid on the local computer, and query the DC if required.
  33. NTSTATUS ESSCLI_POLARITY EnumGroupsForUser( LPCWSTR userName,
  34. LPCWSTR domainName,
  35. LPCWSTR serverName,
  36. PSID **apGroupSids,
  37. DWORD *pdwCount );
  38. // much the same as above except we are
  39. // given user name, domain name & server name
  40. // server name must not be NULL, it can, however
  41. // be the name of the local computer
  42. NTSTATUS ESSCLI_POLARITY EnumGroupsForUser( PSID pSid,
  43. LPCWSTR serverName,
  44. PSID **apGroupSids,
  45. DWORD *pdwCount );
  46. #endif
  47. #endif