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.

135 lines
2.9 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. //
  36. // Typedefs
  37. //
  38. typedef WCHAR SENS_CHAR;
  39. typedef SHORT SENS_SCHAR;
  40. typedef WCHAR *PSENS_CHAR;
  41. typedef SHORT *PSENS_SCHAR;
  42. //
  43. // Defines
  44. //
  45. #define SENS_STRING(string) L##string
  46. #define SENS_BSTR(bstr) L##bstr
  47. //
  48. // Function Mappings
  49. //
  50. //
  51. // Threadpool Apis
  52. //
  53. #define SENS_TIMER_CALLBACK_RETURN VOID NTAPI
  54. #define SENS_LONG_ITEM (WT_EXECUTELONGFUNCTION)
  55. #define SENS_TIMER_CREATE_FAILED(bStatus, hTimer) \
  56. (FALSE == bStatus)
  57. // Use KERNEL32's Win32 functions
  58. #define SensQueueUserWorkItem QueueUserWorkItem
  59. #define SensRegisterWaitForSingleObject RegisterWaitForSingleObject
  60. #define SensUnregisterWait UnregisterWait
  61. #define SensCreateTimerQueue CreateTimerQueue
  62. #define SensDeleteTimerQueue DeleteTimerQueue
  63. #define SensCancelTimerQueueTimer(TimerQueue, Timer, Event) \
  64. DeleteTimerQueueTimer(TimerQueue, Timer, Event)
  65. #define SensSetTimerQueueTimer(bStatus, hTimer, hQueue, pfnCallback, pContext, dwDueTime, dwPeriod, dwFlags) \
  66. bStatus = CreateTimerQueueTimer(&hTimer, hQueue, pfnCallback, pContext, dwDueTime, dwPeriod, SENS_LONG_ITEM)
  67. //
  68. // Output Macros and functions
  69. //
  70. #ifdef DBG
  71. //
  72. // Currently these macros get preprocesed as some some variants of printf.
  73. // Eventually, these will be replaced by a function more comprehensive than
  74. // printf.
  75. //
  76. // Notes:
  77. //
  78. // o SensDbgPrintW works like ntdll!DbgPrint() except that it can handle wide
  79. // strings.
  80. //
  81. #define SensPrint(_LEVEL_, _X_) SensDbgPrintW _X_
  82. #define SensPrintA(_LEVEL_, _X_) SensDbgPrintA _X_
  83. #define SensPrintW(_LEVEL_, _X_) SensDbgPrintW _X_
  84. #define SensPrintToDebugger(_LEVEL_, _X_) DbgPrint _X_
  85. #define SensBreakPoint() DebugBreak()
  86. #else // RETAIL
  87. //
  88. // The following functions do nothing and they should be optimized and no
  89. // code should be generated by the compiler.
  90. //
  91. #define SensPrint(_LEVEL_, _X_) // Nothing
  92. #define SensPrintA(_LEVEL_, _X_) // Nothing
  93. #define SensPrintW(_LEVEL_, _X_) // Nothing
  94. #define SensPrintToDebugger(_LEVEL_, _X_) // Nothing
  95. #define SensBreakPoint() // Nothing
  96. #endif // DBG
  97. #endif // __SYSINC_H__