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.

110 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. authzdebug.c
  5. Abstract:
  6. This module implements debug helper functions for the user mode
  7. authorization APIs.
  8. Author:
  9. Kedar Dubhashi - March 2000
  10. Environment:
  11. User mode only.
  12. Revision History:
  13. Created - March 2000
  14. --*/
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include <authzp.h>
  18. //
  19. // Function name: AuthzPrintContext
  20. //
  21. // Purpose: Debug support
  22. //
  23. VOID
  24. AuthzPrintContext(
  25. IN PAUTHZI_CLIENT_CONTEXT pCC
  26. )
  27. {
  28. #ifdef AUTHZ_DEBUG
  29. DWORD i = 0;
  30. NTSTATUS Status;
  31. UNICODE_STRING mystr;
  32. WCHAR StrBuf[512];
  33. mystr.Length = 512;
  34. mystr.MaximumLength = 512;
  35. mystr.Buffer = (LPWSTR) StrBuf;
  36. fflush(stdout);
  37. wprintf(L"Server = %u", pCC->Server);
  38. wprintf(L"\t Revision = %x\n", pCC->Revision);
  39. wprintf(L"Flags = %x\n", pCC->Flags);
  40. wprintf(L"\t SidCount = %x\n", pCC->SidCount);
  41. for (i = 0; i < pCC->SidCount; i++ )
  42. {
  43. Status = RtlConvertSidToUnicodeString(&mystr, pCC->Sids[i].Sid, FALSE);
  44. if (!NT_SUCCESS(Status))
  45. {
  46. wprintf(L"RtlConvertSidToUnicode failed with %x\n", Status);
  47. return;
  48. }
  49. wprintf(L"Attrib = %x, Sid = %s\n", pCC->Sids[i].Attributes, mystr.Buffer);
  50. }
  51. wprintf(L"\n");
  52. for (i = 0; i < pCC->RestrictedSidCount; i++ )
  53. {
  54. Status = RtlConvertSidToUnicodeString(&mystr, pCC->RestrictedSids[i].Sid, FALSE);
  55. if (!NT_SUCCESS(Status))
  56. {
  57. return;
  58. }
  59. wprintf(L"Attrib = %x, Sid = %s\n", pCC->RestrictedSids[i].Attributes, mystr.Buffer);
  60. }
  61. wprintf(L"\n");
  62. #if 0
  63. for (i = 0; i < pTPrivs->PrivilegeCount ; i++ )
  64. {
  65. DumpLuidAttr(&pTPrivs->Privileges[i], SATYPE_PRIV);
  66. }
  67. #endif
  68. fflush(stdout);
  69. #else
  70. UNREFERENCED_PARAMETER(pCC);
  71. #endif
  72. }