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.

95 lines
5.3 KiB

  1. /****************************************************************************/
  2. /* */
  3. /* wdcgmcro.h */
  4. /* */
  5. /* DC-Groupware common macros - Windows specific header. */
  6. /* */
  7. /* Copyright(c) Microsoft 1997 */
  8. /* */
  9. /****************************************************************************/
  10. /* Changes: */
  11. /* */
  12. /* $Log: Y:/logs/h/dcl/wdcgmcro.h_v $ */
  13. //
  14. // Rev 1.2 17 Jul 1997 18:23:06 JPB
  15. // SFR1031: Fixed FIELDSIZE macro for Win16
  16. //
  17. // Rev 1.1 19 Jun 1997 14:40:00 ENH
  18. // Win16Port: Make compatible with 16 bit build
  19. /* */
  20. /****************************************************************************/
  21. #ifndef _H_WDCGMCRO
  22. #define _H_WDCGMCRO
  23. /****************************************************************************/
  24. /* */
  25. /* MACROS */
  26. /* */
  27. /****************************************************************************/
  28. /****************************************************************************/
  29. /* Byte swapping macros for different endian architectures. */
  30. /****************************************************************************/
  31. #define DCWIRETONATIVE16(A)
  32. #define DCWIRETONATIVE32(A)
  33. #define DCNATIVETOWIRE16(A)
  34. #define DCNATIVETOWIRE32(A)
  35. /****************************************************************************/
  36. /* Macros to convert from/to a DC-Share standard app ID and an OS-specific */
  37. /* task/process handle. */
  38. /****************************************************************************/
  39. #define CO_TO_DCAPPID(htask) ((DCAPPID)(htask))
  40. #define CO_FROM_DCAPPID(appid) ((DWORD)(appid))
  41. /****************************************************************************/
  42. /* Macros to convert from/to a DC-Share standard handles and OS-specific */
  43. /* handles. */
  44. /****************************************************************************/
  45. #define CO_TO_DCWINID(hwnd) ((DCWINID)(hwnd))
  46. #define CO_TO_DCINSTANCE(hinst) ((DCINSTANCE)(hinst))
  47. #define CO_TO_DCREGIONID(region) ((DCREGIONID)(region))
  48. #define CO_TO_DCSURFACEID(surface) ((DCSURFACEID)(surface))
  49. #define CO_TO_DCPALID(palette) ((DCPALID)(palette))
  50. #define CO_FROM_DCWINID(winid) ((HWND)(winid))
  51. #define CO_FROM_DCINSTANCE(instance) ((HINSTANCE)(instance))
  52. #define CO_FROM_DCREGIONID(dcregion) ((HRGN)(dcregion))
  53. #define CO_FROM_DCSURFACEID(dcsurface) ((HDC)(dcsurface))
  54. #define CO_FROM_DCPALID(dcpalid) ((HPALETTE)(dcpalid))
  55. /****************************************************************************/
  56. /* Macros to convert from/to a DC-Share standard cursor ID and an */
  57. /* OS-specific cursor handle. */
  58. /****************************************************************************/
  59. #define CO_TO_DCCURSORID(hcursor) ((DCCURSORID)((DCUINT32)(hcursor)))
  60. #define CO_FROM_DCCURSORID(cursorid) ((HCURSOR)((DCUINT32)(cursorid)))
  61. /****************************************************************************/
  62. /* Macro to return the current tick count. */
  63. /****************************************************************************/
  64. #define CO_GET_TICK_COUNT() GetTickCount()
  65. /****************************************************************************/
  66. /* Macros to Post / Send messages */
  67. /****************************************************************************/
  68. #define CO_POST_MSG(a,b,c,d) \
  69. PostMessage(CO_FROM_DCWINID(a),(b),(WPARAM)(c),(LPARAM)(d))
  70. #define CO_SEND_MSG(a,b,c,d) \
  71. SendMessage(CO_FROM_DCWINID(a),(b),(WPARAM)(c),(LPARAM)(d))
  72. #define CO_POST_QUIT_MSG(a) PostQuitMessage(a)
  73. /****************************************************************************/
  74. /* Check if a pointer is valid */
  75. /****************************************************************************/
  76. #define DC_IS_VALID_PTR(PTR, SIZE) (!IsBadWritePtr((PTR), (SIZE)))
  77. /****************************************************************************/
  78. /* Include platform specific stuff. */
  79. /****************************************************************************/
  80. #ifdef OS_WIN16
  81. #include <ddcgmcro.h>
  82. #else
  83. #include <ndcgmcro.h>
  84. #endif
  85. #endif /* _H_WDCGMCRO */