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.

150 lines
3.8 KiB

  1. /****************************************************************************/
  2. /* Copyright(C) Microsoft Corporation 1998 */
  3. /****************************************************************************/
  4. #ifndef _WINCE_H_
  5. #define _WINCE_H_
  6. #ifdef OS_WINCE
  7. #include <windows.h>
  8. #include <windowsx.h>
  9. #include <stdlib.h>
  10. #include <bldver.h>
  11. #if defined (WIN32_PLATFORM_PSPC) || defined (WIN32_PLATFORM_HPCPRO) || defined (WIN32_PLATFORM_HPC2000)
  12. #define WINCE_SDKBUILD
  13. #endif
  14. #ifndef WINCE_SDKBUILD
  15. #include "memleak.h"
  16. #endif
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif /* __cplusplus */
  20. // This should work via OS
  21. #define _stprintf swprintf
  22. #define sprintf swprintf
  23. #define _stscanf swscanf
  24. #define _itot _itow
  25. #define _ttoi _wtoi
  26. #if ((defined(_WCEATL_H_)) || (_WIN32_WCE >= 300))
  27. #ifndef WINCE_GLOBAL_ALLOC_DEFINED
  28. #define WINCE_GLOBAL_ALLOC_DEFINED
  29. #endif
  30. #endif
  31. #ifndef WINCE_GLOBAL_ALLOC_DEFINED
  32. // These are required on 2.11 builds, but not for 3.0. All 3.0 sources should set
  33. // WINCE_GLOBAL_ALLOC_DEFINED to avoid obnoxious build warnings.
  34. #define GlobalAlloc (HGLOBAL)LocalAlloc
  35. #define GlobalFree (HGLOBAL)LocalFree
  36. #define GlobalReAlloc (HGLOBAL)LocalReAlloc
  37. #define GlobalSize LocalSize
  38. #define GlobalLock(x) (LPVOID)(x)
  39. #define GlobalUnlock(x) (TRUE)
  40. #define GlobalHandle (void*)
  41. #define GMEM_MOVEABLE LMEM_FIXED
  42. #define GMEM_DDESHARE 0
  43. #define GMEM_DISCARDABLE 0
  44. #define GHND 0
  45. #define GPTR 0
  46. #endif
  47. _CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...);
  48. _CRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *, ...);
  49. #define KF_REPEAT 0x4000
  50. // This is here because it's easy, and I'm not sure it matters
  51. #define KF_EXTENDED 0x0100
  52. // May not need this if WinCE is always full screen
  53. typedef struct tagWINDOWPLACEMENT {
  54. UINT length;
  55. UINT flags;
  56. UINT showCmd;
  57. POINT ptMinPosition;
  58. POINT ptMaxPosition;
  59. RECT rcNormalPosition;
  60. } WINDOWPLACEMENT;
  61. typedef WINDOWPLACEMENT *PWINDOWPLACEMENT, *LPWINDOWPLACEMENT;
  62. _CRTIMP int __cdecl vswprintf(wchar_t *, const wchar_t *, va_list);
  63. #define KEYEVENTF_EXTENDEDKEY 0x0001
  64. #define MakeProcInstance(lpProc,hInstance) (lpProc)
  65. #ifndef HandleToUlong
  66. #define HandleToUlong( h ) ((ULONG) (h) )
  67. #endif
  68. #ifndef PtrToUlong
  69. #define PtrToUlong( p ) ((ULONG) (p) )
  70. #endif
  71. #ifndef PtrToLong
  72. #define PtrToLong( p ) ((LONG) (p) )
  73. #endif
  74. #ifndef PtrToUshort
  75. #define PtrToUshort( p ) ((unsigned short) (p) )
  76. #endif
  77. #ifndef PtrToShort
  78. #define PtrToShort( p ) ((short) (p) )
  79. #endif
  80. // CE isn't going to be going 64 bit anytime soon, so we'll be safe
  81. // using the original functions for now.
  82. #define GetWindowLongPtr(x,y) GetWindowLong(x,y)
  83. #define SetWindowLongPtr(x,y,z) SetWindowLong(x,y,z)
  84. #ifndef GWLP_USERDATA
  85. #define GWLP_USERDATA GWL_USERDATA
  86. #endif
  87. #ifndef DWLP_USER
  88. #define DWLP_USER DWP_USER
  89. #endif
  90. #define VER_PRODUCTVERSION_STR1(x,y) L#x L"." L#y
  91. #ifdef VER_PRODUCTVERSION_STR
  92. #undef VER_PRODUCTVERSION_STR
  93. #endif
  94. #define VER_PRODUCTVERSION_STR VER_PRODUCTVERSION_STR1(CE_MAJOR_VER,CE_MINOR_VER)
  95. #define VK_PACKET 0xE7
  96. #define WM_DRAWCLIPBOARD 0x0308
  97. void AutoHideCE(HWND hwnd, WPARAM wParam);
  98. #ifdef WINCE_SDKBUILD
  99. #include "sdkbuild.h"
  100. #endif
  101. #ifdef WINCE_USEBRUSHCACHE
  102. #include "brcache.h"
  103. #else
  104. #define BrushCacheInitialize()
  105. #define BrushCacheUninitialize()
  106. #define CECreateSolidBrush CreateSolidBrush
  107. #define CEDeleteBrush(x) DeleteObject((HGDIOBJ )(x))
  108. #endif
  109. #define ETDT_DISABLE 0x00000001
  110. #define ETDT_ENABLE 0x00000002
  111. #define ETDT_USETABTEXTURE 0x00000004
  112. #define ETDT_ENABLETAB (ETDT_ENABLE | ETDT_USETABTEXTURE)
  113. #ifdef __cplusplus
  114. }
  115. #endif /* __cplusplus */
  116. #endif // OS_WINCE
  117. #endif // _WINCE_H_