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.

146 lines
2.6 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. // File: drt.hxx
  7. //
  8. // Contents: DRT header
  9. //
  10. //---------------------------------------------------------------
  11. #ifndef __DRT_HXX__
  12. #define __DRT_HXX__
  13. #ifndef _WIN32
  14. #include "../../h/ref.hxx"
  15. #include "../../h/tchar.h"
  16. #endif
  17. #ifdef _UNICODE
  18. #define OLEWIDECHAR
  19. #else
  20. #undef OLEWIDECHAR
  21. #endif
  22. #define DfGetScode(hr) GetScode(hr)
  23. typedef DWORD LPSTGSECURITY;
  24. // [later] typedef LPSECURITY_ATTRIBUTES LPSTGSECURITY;
  25. #define ULIGetLow(li) ((li).u.LowPart)
  26. #define ULIGetHigh(li) ((li).u.HighPart)
  27. // Exit codes
  28. #define EXIT_BADSC 1
  29. #define EXIT_OOM 2
  30. #define EXIT_UNKNOWN 3
  31. #define STR(x) _T(x)
  32. #ifdef _UNICODE
  33. #ifndef ATOT
  34. #define ATOT(psz, ptcs, max) mbstowcs(ptcs, psz, max)
  35. #endif
  36. #ifndef TTOA
  37. #define TTOA(ptcs, psz, max) wcstombs(psz, ptcs, max)
  38. #endif
  39. #else
  40. #ifndef ATOT
  41. #define ATOT(psz, ptcs) strcpy(ptcs, psz)
  42. #endif
  43. #ifndef TTOA
  44. #define TTOA(ptcs, psz) strcpy(psz, ptcs)
  45. #endif
  46. #endif
  47. #ifdef OLEWIDECHAR
  48. //typedef WCHAR TCHAR;
  49. #ifndef _WIN32
  50. #include "../../h/wchar.h"
  51. #endif
  52. #ifndef ATOOLE
  53. #ifdef _WIN32
  54. #define ATOOLE(psz, ptcs, max) mbstowcs(ptcs, psz, max)
  55. #else
  56. #define ATOOLE(psz, ptcs, max) sbstowcs(ptcs, psz, max)
  57. #endif
  58. #endif
  59. #ifndef OLETOA
  60. #ifdef _WIN32
  61. #define OLETOA(ptcs, psz, max) wcstombs(psz, ptcs, max)
  62. #else
  63. #define OLETOA(ptcs, psz, max) wcstosbs(psz, ptcs, max)
  64. #endif
  65. #endif
  66. #ifndef olecscmp
  67. #define olecscmp wcscmp
  68. #endif
  69. #ifndef olecscpy
  70. #define olecscpy wcscpy
  71. #endif
  72. #ifndef olecslen
  73. #define olecslen wcslen
  74. #endif
  75. #ifndef olecsprintf
  76. #ifdef _UNICODE
  77. #define olecsprintf swprintf
  78. #else
  79. #define olecsprintf sprintf
  80. #endif
  81. #endif
  82. #else // #ifdef OLEWIDECHAR
  83. #ifdef _WIN32
  84. typedef char TCHAR;
  85. #endif
  86. #ifndef ATOOLE
  87. #define ATOOLE(psz, ptcs, len) strcpy(ptcs, psz)
  88. #endif
  89. #ifndef OLETOA
  90. #define OLETOA(ptcs, psz, len) strcpy(psz, ptcs)
  91. #endif
  92. #ifndef olecscmp
  93. #define olecscmp strcmp
  94. #endif
  95. #ifndef olecscpy
  96. #define olecscpy strcpy
  97. #endif
  98. #ifndef olecslen
  99. #define olecslen strlen
  100. #endif
  101. #ifndef olecsprintf
  102. #define olecsprintf sprintf
  103. #endif
  104. #endif
  105. #define pszDRTDF "drt.dfl"
  106. #ifdef _UNICODE
  107. #define DRTDF atcDrtDocfile
  108. #else
  109. #define DRTDF pszDRTDF
  110. #endif
  111. #define MARSHALDF STR("dup.dfl")
  112. #define ROOTP(x) ((x) | dwRootDenyWrite)
  113. #define STGP(x) ((x) | STGM_SHARE_EXCLUSIVE)
  114. #define STMP(x) ((x) | STGM_SHARE_EXCLUSIVE)
  115. extern DWORD dwRootDenyWrite;
  116. extern BOOL fVerbose;
  117. extern OLECHAR atcDrtDocfile[];
  118. #endif // #ifndef __DRT_HXX__