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.

89 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. tuser.c
  5. Abstract:
  6. This module tests windows LookupPrivilegeNameX for a specific
  7. condition that required a Daytona hotfix.
  8. Author:
  9. Jim Kelly (JimK) July-27-1994
  10. Revision History:
  11. --*/
  12. #include <windows.h>
  13. #include <stdio.h>
  14. VOID
  15. DoLookup( DWORD L );
  16. CHAR BufferA[0x11000];
  17. CHAR BufferA1[0x11000];
  18. WCHAR BufferW[11000];
  19. int
  20. main (void)
  21. {
  22. //
  23. // Lookup privilege names with certain special buffer lengths.
  24. DoLookup( 0xFFFF );
  25. DoLookup( 0xFFFC );
  26. DoLookup( 0x45 );
  27. DoLookup( 0x10000 );
  28. DoLookup( 0x10010 );
  29. DoLookup( 0x2 );
  30. return(0);
  31. }
  32. VOID
  33. DoLookup( DWORD L )
  34. {
  35. DWORD
  36. Language,
  37. Length;
  38. LUID
  39. PrivilegeId;
  40. Language = 0;
  41. Length = L;
  42. PrivilegeId.HighPart = 0;
  43. PrivilegeId.LowPart = 7; //SE_TCB_PRIVILEGE;
  44. printf("length %d\n", Length);
  45. printf(" LookupPrivilegeNameA:");
  46. if (LookupPrivilegeNameA( "", &PrivilegeId, &BufferA[0], &Length)) {
  47. printf("success (%s)\n", &BufferA[0] );
  48. } else {
  49. printf("failed ****\n");
  50. }
  51. printf(" LookupPrivilegeDisplayNameA:");
  52. if (LookupPrivilegeDisplayNameA( "", &BufferA[0], &BufferA1[0], &Length, &Language)) {
  53. printf("success (%s)\n", &BufferA1[0] );
  54. } else {
  55. printf("failed ****\n");
  56. }
  57. return;
  58. }