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.

89 lines
2.4 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990-1992 **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6. #ifndef OSCFG_INCLUDED
  7. #define OSCFG_INCLUDED
  8. #if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || ((defined(_M_AMD64) || defined(_M_IA64)) && (_MSC_FULL_VER > 13009175))
  9. #define net_short(_x) _byteswap_ushort((USHORT)(_x))
  10. #define net_long(_x) _byteswap_ulong(_x)
  11. #else
  12. #define net_short(x) ((((x)&0xff) << 8) | (((x)&0xff00) >> 8))
  13. //#define net_long(x) (((net_short((x)&0xffff)) << 16) | net_short((((x)&0xffff0000L)>>16)))
  14. #define net_long(x) (((((ulong)(x))&0xffL)<<24) | \
  15. ((((ulong)(x))&0xff00L)<<8) | \
  16. ((((ulong)(x))&0xff0000L)>>8) | \
  17. ((((ulong)(x))&0xff000000L)>>24))
  18. #endif
  19. #define MIN(a,b) ((a) < (b) ? (a) : (b))
  20. #define MAX(a,b) ((a) > (b) ? (a) : (b))
  21. #ifdef VXD
  22. /////////////////////////////////////////////////////////////////////////////
  23. //
  24. // VXD definitions
  25. //
  26. ////////////////////////////////////////////////////////////////////////////
  27. #include <stddef.h>
  28. #ifndef CHICAGO
  29. #pragma code_seg("_LTEXT", "LCODE")
  30. #pragma data_seg("_LDATA", "LCODE")
  31. //* pragma bodies for bracketing of initialization code.
  32. #define BEGIN_INIT code_seg("_ITEXT", "ICODE")
  33. #define BEGIN_INIT_DATA data_seg("_IDATA", "ICODE")
  34. #define END_INIT code_seg()
  35. #define END_INIT_DATA data_seg()
  36. #else // CHICAGO
  37. #define INNOCUOUS_PRAGMA warning(4:4206) // Source File is empty
  38. #define BEGIN_INIT INNOCUOUS_PRAGMA
  39. #define BEGIN_INIT_DATA INNOCUOUS_PRAGMA
  40. #define END_INIT INNOCUOUS_PRAGMA
  41. #define END_INIT_DATA INNOCUOUS_PRAGMA
  42. #endif // CHICAGO
  43. #else // VXD
  44. #ifdef NT
  45. //////////////////////////////////////////////////////////////////////////////
  46. //
  47. // NT definitions
  48. //
  49. //////////////////////////////////////////////////////////////////////////////
  50. #include <ntos.h>
  51. #include <zwapi.h>
  52. #define BEGIN_INIT
  53. #define END_INIT
  54. #else // NT
  55. /////////////////////////////////////////////////////////////////////////////
  56. //
  57. // Definitions for additional environments go here
  58. //
  59. /////////////////////////////////////////////////////////////////////////////
  60. #error Environment specific definitions missing
  61. #endif // NT
  62. #endif // VXD
  63. #endif // OSCFG_INCLUDED