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.

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