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.

83 lines
1.9 KiB

  1. /***************************************************************************\
  2. *
  3. * File: OSAL.inl
  4. *
  5. * History:
  6. * 1/18/2000: JStall: Created
  7. *
  8. * Copyright (C) 2000 by Microsoft Corporation. All rights reserved.
  9. *
  10. \***************************************************************************/
  11. #if !defined(SERVICES__OSAL_inl__INCLUDED)
  12. #define SERVICES__OSAL_inl__INCLUDED
  13. #pragma once
  14. struct OSInfo
  15. {
  16. BOOL fUnicode; // Unicode support is available
  17. BOOL fXForm; // GDI X-Forms are avaialble
  18. BOOL fQInputAvailableFlag; // MWMO_INPUTAVAILABLE is available
  19. };
  20. extern OSInfo g_OSI;
  21. extern OSAL * g_pOS;
  22. //------------------------------------------------------------------------------
  23. inline OSAL *
  24. OS()
  25. {
  26. AssertMsg(g_pOS != NULL, "OSAL must be initialized by now");
  27. return g_pOS;
  28. }
  29. //------------------------------------------------------------------------------
  30. inline BOOL
  31. SupportUnicode()
  32. {
  33. return g_OSI.fUnicode;
  34. }
  35. //------------------------------------------------------------------------------
  36. inline BOOL
  37. SupportXForm()
  38. {
  39. return g_OSI.fXForm;
  40. }
  41. //------------------------------------------------------------------------------
  42. inline BOOL
  43. SupportQInputAvailable()
  44. {
  45. return g_OSI.fQInputAvailableFlag;
  46. }
  47. //------------------------------------------------------------------------------
  48. inline BOOL
  49. OSAL::IsWin98orWin2000(OSVERSIONINFO * povi)
  50. {
  51. return povi->dwMajorVersion >= 5;
  52. }
  53. //------------------------------------------------------------------------------
  54. inline BOOL
  55. OSAL::IsWhistler(OSVERSIONINFO * povi)
  56. {
  57. return (povi->dwMajorVersion >= 5) && (povi->dwMinorVersion >= 1);
  58. }
  59. //------------------------------------------------------------------------------
  60. inline BOOL
  61. IsRemoteSession()
  62. {
  63. return GetSystemMetrics(SM_REMOTESESSION);
  64. }
  65. #endif // SERVICES__OSAL_inl__INCLUDED