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.

123 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. or.h
  5. Abstract:
  6. General include file for C things the OR. This file is pre-compiled.
  7. Author:
  8. Mario Goertzel [mariogo] Feb-10-95
  9. Revision History:
  10. --*/
  11. #ifndef __OR_H
  12. #define __OR_H
  13. #include <dcomss.h>
  14. #include <rc4.h>
  15. #include <randlib.h>
  16. #include <crypt.h>
  17. #include <stddef.h>
  18. #include <malloc.h> // alloca
  19. #include <limits.h>
  20. #include <math.h>
  21. #define SAFEALLOCA_ASSERT ASSERT
  22. #include <alloca.h>
  23. #include <lclor.h> // Local OR if from private\dcomidl
  24. #include <objex.h> // Remote OR if from private\dcomidl
  25. #include <orcb.h> // Callback if from private\dcomidl
  26. #include <rawodeth.h> // Raw RPC -> ORPC OID rundown interface
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #define IN
  31. #define OUT
  32. #define CONST const
  33. #define OrStringCompare(str1, str2, len) wcscmp((str1), (str2), (len))
  34. #define OrStringLen(str) wcslen(str)
  35. #define OrStringCat(str1, str2) wcscat((str1), (str2))
  36. #define OrStringCopy(str1, str2) wcscpy((str1), (str2))
  37. #define OrMemorySet(p, value, len) memset((p), (value), (len))
  38. #define OrMemoryCompare(p1, p2, len) memcmp((p1), (p2), (len))
  39. #define OrMemoryCopy(dest, src, len) memcpy((dest), (src), (len))
  40. // OrStringSearch in or.hxx
  41. //
  42. // The OR uses Win32 (RPC) error codes.
  43. //
  44. typedef LONG ORSTATUS;
  45. // When the OR code asigns and error it uses
  46. // one of the following mappings:
  47. // There are no internal error codes.
  48. #define OR_OK RPC_S_OK
  49. #define OR_NOMEM RPC_S_OUT_OF_MEMORY
  50. #define OR_NORESOURCE RPC_S_OUT_OF_RESOURCES
  51. #define OR_NOACCESS ERROR_ACCESS_DENIED
  52. #define OR_BADOXID OR_INVALID_OXID
  53. #define OR_BADOID OR_INVALID_OID
  54. #define OR_BADSET OR_INVALID_SET
  55. #define OR_NOSERVER RPC_S_SERVER_UNAVAILABLE
  56. #define OR_BADPARAM ERROR_INVALID_PARAMETER
  57. // Internal codes used to indicate a special event.
  58. #define OR_I_RETRY 0xC0210051UL
  59. #define OR_I_NOPROTSEQ 0xC0210052UL
  60. #define UNUSED(_x_) ((void *)(_x_))
  61. #if DBG
  62. #define DEBUG_MIN(a,b) (min((a),(b)))
  63. extern int __cdecl ValidateError(
  64. IN ORSTATUS Status,
  65. IN ...);
  66. #define VALIDATE(X) if (!ValidateError X) ASSERT(0);
  67. #if DBG_DETAIL
  68. #undef ASSERT
  69. #define ASSERT( exp ) \
  70. if (! (exp) ) \
  71. { \
  72. DbgPrintEx(DPFLTR_DCOMSS_ID, \
  73. DPFLTR_ERROR_LEVEL, \
  74. "OR: Assertion failed: %s(%d) %s\n", \
  75. __FILE__, \
  76. __LINE__, \
  77. #exp); \
  78. DebugBreak(); \
  79. }
  80. #endif // DETAIL
  81. #else // DBG
  82. #define DEBUG_MIN(a,b) (max((a),(b)))
  83. #define VALIDATE(X)
  84. #endif // DBG
  85. extern DWORD ObjectExporterWorkerThread(LPVOID);
  86. extern DWORD ObjectExporterTaskThread(LPVOID);
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif // __OR_H