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.

139 lines
3.1 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1999
  3. Module Name:
  4. sysinc.h
  5. Abstract:
  6. This contains all the platform-independent stuff for the SENS project.
  7. Author:
  8. Gopal Parupudi <GopalP>
  9. [Notes:]
  10. optional-notes
  11. Revision History:
  12. GopalP 3/6/1998 Start.
  13. --*/
  14. #ifndef __SYSINC_H__
  15. #define __SYSINC_H__
  16. //
  17. // Global defines
  18. //
  19. #ifndef SENS_CHICAGO
  20. #define SENS_NT
  21. #define UNICODE
  22. #define _UNICODE
  23. #else // SENS_CHICAGO
  24. #undef UNICODE
  25. #undef _UNICODE
  26. #endif // SENS_CHICAGO
  27. //
  28. // Includes
  29. //
  30. #include <nt.h>
  31. #include <ntrtl.h>
  32. #include <nturtl.h>
  33. #include <tchar.h>
  34. #include <stdio.h>
  35. #include <windows.h>
  36. #include <rpc.h>
  37. #include <strsafe.h>
  38. //
  39. // Typedefs
  40. //
  41. typedef WCHAR SENS_CHAR;
  42. typedef SHORT SENS_SCHAR;
  43. typedef WCHAR *PSENS_CHAR;
  44. typedef SHORT *PSENS_SCHAR;
  45. //
  46. // Defines
  47. //
  48. #define SENS_STRING(string) L##string
  49. #define SENS_BSTR(bstr) L##bstr
  50. //
  51. // Function Mappings
  52. //
  53. //
  54. // Threadpool Apis
  55. //
  56. #define SENS_TIMER_CALLBACK_RETURN VOID NTAPI
  57. #define SENS_LONG_ITEM (WT_EXECUTELONGFUNCTION)
  58. #define SENS_TIMER_CREATE_FAILED(bStatus, hTimer) \
  59. (FALSE == bStatus)
  60. // Use KERNEL32's Win32 functions
  61. #define SensQueueUserWorkItem QueueUserWorkItem
  62. #define SensRegisterWaitForSingleObject RegisterWaitForSingleObject
  63. #define SensUnregisterWait UnregisterWait
  64. #define SensCreateTimerQueue CreateTimerQueue
  65. #define SensDeleteTimerQueue DeleteTimerQueue
  66. #define SensCancelTimerQueueTimer(TimerQueue, Timer, Event) \
  67. DeleteTimerQueueTimer(TimerQueue, Timer, Event)
  68. #define SensSetTimerQueueTimer(bStatus, hTimer, hQueue, pfnCallback, pContext, dwDueTime, dwPeriod, dwFlags) \
  69. bStatus = CreateTimerQueueTimer(&hTimer, hQueue, pfnCallback, pContext, dwDueTime, dwPeriod, SENS_LONG_ITEM)
  70. //
  71. // Output Macros and functions
  72. //
  73. #ifdef DBG
  74. //
  75. // Currently these macros get preprocesed as some some variants of printf.
  76. // Eventually, these will be replaced by a function more comprehensive than
  77. // printf.
  78. //
  79. // Notes:
  80. //
  81. // o SensDbgPrintW works like ntdll!DbgPrint() except that it can handle wide
  82. // strings.
  83. //
  84. #define SensPrint(_LEVEL_, _X_) SensDbgPrintW _X_
  85. #define SensPrintA(_LEVEL_, _X_) SensDbgPrintA _X_
  86. #define SensPrintW(_LEVEL_, _X_) SensDbgPrintW _X_
  87. #define SensPrintToDebugger(_LEVEL_, _X_) DbgPrint _X_
  88. #define SensBreakPoint() DebugBreak()
  89. #else // RETAIL
  90. //
  91. // The following functions do nothing and they should be optimized and no
  92. // code should be generated by the compiler.
  93. //
  94. #define SensPrint(_LEVEL_, _X_) // Nothing
  95. #define SensPrintA(_LEVEL_, _X_) // Nothing
  96. #define SensPrintW(_LEVEL_, _X_) // Nothing
  97. #define SensPrintToDebugger(_LEVEL_, _X_) // Nothing
  98. #define SensBreakPoint() // Nothing
  99. #endif // DBG
  100. #endif // __SYSINC_H__