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.

84 lines
2.6 KiB

  1. /***************************************************************************\
  2. *
  3. * File: OSAL.h
  4. *
  5. * Description:
  6. * OSAL.h defines the process-wide Operating System Abstraction Layer that
  7. * allows DirectUser to run on different platforms.
  8. *
  9. *
  10. * History:
  11. * 1/18/2000: JStall: Created
  12. *
  13. * Copyright (C) 2000 by Microsoft Corporation. All rights reserved.
  14. *
  15. \***************************************************************************/
  16. #if !defined(SERVICES__OSAL_h__INCLUDED)
  17. #define SERVICES__OSAL_h__INCLUDED
  18. #pragma once
  19. /***************************************************************************\
  20. *
  21. * class OS
  22. *
  23. * OS abstracts out differences between various OS's including:
  24. * - Unicode / ANSI
  25. * - Platform implementation differences
  26. * - Version specific bugs
  27. *
  28. \***************************************************************************/
  29. class OSAL
  30. {
  31. // Construction
  32. public:
  33. virtual ~OSAL() { };
  34. static HRESULT Init();
  35. // USER Operations
  36. public:
  37. virtual int DrawText(HDC hDC, LPCWSTR lpString, int nCount, LPRECT lpRect, UINT uFormat) PURE;
  38. // GDI Operations
  39. public:
  40. virtual BOOL TextOut(HDC, int, int, LPCWSTR, int) PURE;
  41. virtual BOOL ExtTextOut(HDC, int, int, UINT, const RECT *, LPCWSTR, int, const int *) PURE;
  42. virtual HFONT CreateFontIndirect(CONST LOGFONTW *) PURE;
  43. virtual BOOL GetTextExtentPoint32(HDC, LPCWSTR, int, LPSIZE) PURE;
  44. virtual BOOL GetTextExtentExPoint(HDC, LPCWSTR, int, int, LPINT, LPINT, LPSIZE) PURE;
  45. // DirectUser/Core
  46. public:
  47. virtual void PushXForm(HDC hdc, XFORM * pxfOld) PURE;
  48. virtual void PopXForm(HDC hdc, const XFORM * pxfOld) PURE;
  49. virtual void RotateDC(HDC hdc, float flRotationRad) PURE;
  50. virtual void ScaleDC(HDC hdc, float flScaleX, float flScaleY) PURE;
  51. virtual void TranslateDC(HDC hdc, float flOffsetX, float flOffsetY) PURE;
  52. virtual void SetWorldTransform(HDC hdc, const XFORM * pxf) PURE;
  53. virtual void SetIdentityTransform(HDC hdc) PURE;
  54. // DirectUser/Services
  55. public:
  56. virtual BOOL IsInsideLoaderLock() PURE;
  57. // Implementation
  58. protected:
  59. static inline
  60. BOOL IsWin98orWin2000(OSVERSIONINFO * povi);
  61. static inline
  62. BOOL IsWhistler(OSVERSIONINFO * povi);
  63. };
  64. inline BOOL SupportUnicode();
  65. inline BOOL SupportXForm();
  66. inline BOOL SupportQInputAvailable();
  67. inline BOOL IsRemoteSession();
  68. LONG WINAPI StdExceptionFilter(PEXCEPTION_POINTERS pei);
  69. #include "OSAL.inl"
  70. #endif // SERVICES__OSAL_h__INCLUDED