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.

97 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. dsrolep.h
  5. Abstract:
  6. Definitions and globals for internal only debug and support routines
  7. Author:
  8. Mac McLain (MacM) Aug 11, 1997
  9. Environment:
  10. Revision History:
  11. --*/
  12. #ifndef __DSROLEP1_H__
  13. #define __DSROLEP1_H__
  14. #define DSROLEP_VERBOSE_LOGGING
  15. #ifdef DSROLEP_VERBOSE_LOGGING
  16. extern HANDLE DsRolepLogFile;
  17. #define DSROLEP_LOGNAME L"\\debug\\DCPROMO.LOG"
  18. #define DSROLEP_BAKNAME L"\\debug\\DCPROMO.BAK"
  19. DWORD
  20. DsRolepInitializeLog(
  21. VOID
  22. );
  23. DWORD
  24. DsRolepSetAndClearLog(
  25. VOID
  26. );
  27. DWORD
  28. DsRolepCloseLog(
  29. VOID
  30. );
  31. VOID
  32. DsRolepLogPrintRoutine(
  33. IN DWORD DebugFlag,
  34. IN LPSTR Format,
  35. ...
  36. );
  37. #define DsRolepLogPrint( x ) DsRolepLogPrintRoutine x
  38. #define DsRolepDisplayOptional( y ) y ? y : L"(NULL)"
  39. #define DsRolepLogOnFailure( z, a ) if ( z != ERROR_SUCCESS ) a
  40. #define DsRolepLogGuid( l, t, g ) g == NULL ? DsRolepLogPrint(( l, "%S (NULL)\n", t )) : \
  41. DsRolepLogPrint(( l, "%S %08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x\n", \
  42. t,(g)->Data1,(g)->Data2,(g)->Data3,(g)->Data4[0], \
  43. (g)->Data4[1],(g)->Data4[2],(g)->Data4[3],(g)->Data4[4], \
  44. (g)->Data4[5],(g)->Data4[6],(g)->Data4[7]))
  45. #define DsRolepLogSid( l, t, s ) \
  46. { LPWSTR sidstring; \
  47. ConvertSidToStringSidW( s, &sidstring ); \
  48. DsRolepLogPrint(( l, "%S %ws\n", t, sidstring )); \
  49. LocalFree(sidstring); \
  50. }
  51. #define DsRolepUnicodestringtowstr( s, u ) \
  52. { s = (WCHAR*)malloc(u.Length+sizeof(WCHAR)); \
  53. if (s){ \
  54. CopyMemory(s,u.Buffer,u.Length); \
  55. s[u.Length/sizeof(WCHAR)] = L'\0'; \
  56. } \
  57. }
  58. #else
  59. #define DsRolepInitializeLog()
  60. #define DsRolepCloseLog()
  61. #define DsRolepLogPrint( x )
  62. #define DsRolepDisplayOptional( y )
  63. #define DsRolepLogOnFailure( z, a )
  64. #define DsRolepLogGuid( t, g )
  65. #define DsRolepLogSid( t, s )
  66. #define DsRolepSetAndClearLog()
  67. #define DsRolepUnicodestringtowstr( s, u )
  68. #endif
  69. #endif // __DSROLEP1_H__