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.

69 lines
1.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: etask.hxx
  7. //
  8. // Contents: extern definitions from etask.hxx
  9. //
  10. // History: 08-Mar-94 BobDay Taken from OLE2INT.H & OLECOLL.H
  11. //
  12. //----------------------------------------------------------------------------
  13. #ifdef WIN32
  14. #define HTASK DWORD // Use Proccess id / Thread id
  15. #define GetCurrentThread() GetCurrentThreadId()
  16. #define GetCurrentProcess() GetCurrentProcessId()
  17. #define GetWindowThread(h) ((HTASK)GetWindowTask(h))
  18. #else
  19. #define GetCurrentThread() GetCurrentTask()
  20. #define GetCurrentProcess() GetCurrentTask()
  21. #define GetWindowThread(h) GetWindowTask(h)
  22. #endif
  23. /*
  24. * MACROS for Mac/PC core code
  25. *
  26. * The following macros reduce the proliferation of #ifdefs. They
  27. * allow tagging a fragment of code as Mac only, PC only, or with
  28. * variants which differ on the PC and the Mac.
  29. *
  30. * Usage:
  31. *
  32. *
  33. * h = GetHandle();
  34. * Mac(DisposeHandle(h));
  35. *
  36. *
  37. * h = GetHandle();
  38. * MacWin(h2 = h, CopyHandle(h, h2));
  39. *
  40. */
  41. #ifdef _MAC
  42. #define Mac(x) x
  43. #define Win(x)
  44. #define MacWin(x,y) x
  45. #else
  46. #define Mac(x)
  47. #define Win(x) x
  48. #define MacWin(x,y) y
  49. #endif
  50. extern CMapHandleEtask NEAR v_mapToEtask;
  51. STDAPI_(BOOL) LookupEtask(HTASK FAR& hTask, Etask FAR& etask);
  52. STDAPI_(BOOL) SetEtask(HTASK hTask, Etask FAR& etask);
  53. void ReleaseEtask(HTASK htask, Etask FAR& etask);
  54. #define ETASK_FAKE_INIT 0
  55. #define ETASK_NO_INIT 0xffffffff
  56. #ifdef _CHICAGO_
  57. #define IsEtaskInit(htask, etask) \
  58. ( LookupEtask( htask, etask ) \
  59. && etask.m_inits != ETASK_NO_INIT)
  60. #else
  61. #define IsEtaskInit(htask, etask) LookupEtask( htask, etask )
  62. #endif