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.

174 lines
4.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995
  5. //
  6. // File: types.h
  7. //
  8. // Contents: Various type definitions
  9. //
  10. //----------------------------------------------------------------------------
  11. #include "config.h"
  12. #include "msgbox.h"
  13. #include "dispid.h"
  14. //****************************************************************************
  15. //
  16. // Defines
  17. //
  18. //****************************************************************************
  19. #define IDR_MAINMENU 100
  20. #define IDM_EXIT 300
  21. #define IDM_CONFIGURE 301
  22. #define IDM_ABOUT 302
  23. #define IDM_TRACETAG 303
  24. #define IDM_MEMORYMON 304
  25. #define IDM_RESTART 305
  26. #define IDM_STATUS 306
  27. #define VB_TRUE ((VARIANT_BOOL)-1) // TRUE for VARIANT_BOOL
  28. #define VB_FALSE ((VARIANT_BOOL)0) // FALSE for VARIANT_BOOL
  29. #define SZ_APPLICATION_NAME TEXT("MTScript")
  30. #define SZ_WNDCLASS SZ_APPLICATION_NAME TEXT("_HiddenWindow")
  31. #ifndef RC_INVOKED
  32. //****************************************************************************
  33. //
  34. // Globals
  35. //
  36. //****************************************************************************
  37. extern HANDLE g_hProcHeap; // Handle to process heap.
  38. extern HINSTANCE g_hInstance; // Instance handle of this EXE
  39. //****************************************************************************
  40. //
  41. // Function prototypes
  42. //
  43. //****************************************************************************
  44. void ErrorPopup(LPWSTR pszMsg);
  45. #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
  46. void ClearInterfaceFn(IUnknown **ppUnk);
  47. template <class PI>
  48. inline void
  49. ClearInterface(PI * ppI)
  50. {
  51. ClearInterfaceFn((IUnknown **) ppI);
  52. }
  53. #define ReleaseInterface(x) if (x) { (x)->Release(); }
  54. #define ULREF_IN_DESTRUCTOR 256
  55. #define DECLARE_STANDARD_IUNKNOWN(cls) \
  56. STDMETHOD(QueryInterface) (REFIID riid, LPVOID * ppv); \
  57. ULONG _ulRefs; \
  58. STDMETHOD_(ULONG, AddRef) (void) \
  59. { \
  60. return InterlockedIncrement((long*)&_ulRefs); \
  61. } \
  62. STDMETHOD_(ULONG, Release) (void) \
  63. { \
  64. if (InterlockedDecrement((long*)&_ulRefs) == 0) \
  65. { \
  66. _ulRefs = ULREF_IN_DESTRUCTOR; \
  67. delete this; \
  68. return 0; \
  69. } \
  70. return _ulRefs; \
  71. } \
  72. ULONG GetRefs(void) \
  73. { return _ulRefs; }
  74. //****************************************************************************
  75. //
  76. // Enums and Structs
  77. //
  78. //****************************************************************************
  79. //
  80. // THREADMSG -- messages that can be sent between threads.
  81. //
  82. enum THREADMSG
  83. {
  84. MD_SECONDARYSCRIPTTERMINATE,
  85. MD_MACHINECONNECT,
  86. MD_MACHEVENTCALL,
  87. MD_NOTIFYSCRIPT,
  88. MD_REBOOT,
  89. MD_RESTART,
  90. MD_PROCESSEXITED,
  91. MD_PROCESSTERMINATED,
  92. MD_PROCESSCRASHED,
  93. MD_PROCESSCONNECTED,
  94. MD_PROCESSDATA,
  95. MD_SENDTOPROCESS,
  96. MD_OUTPUTDEBUGSTRING,
  97. MD_PLEASEEXIT
  98. };
  99. enum MBT_SELECT
  100. {
  101. MBTS_TIMEOUT = 0,
  102. MBTS_BUTTON1 = 1,
  103. MBTS_BUTTON2 = 2,
  104. MBTS_BUTTON3 = 3,
  105. MBTS_BUTTON4 = 4,
  106. MBTS_BUTTON5 = 5,
  107. MBTS_INTERVAL,
  108. MBTS_ERROR
  109. };
  110. struct MBTIMEOUT
  111. {
  112. BSTR bstrMessage;
  113. long cButtons;
  114. BSTR bstrButtonText;
  115. long lTimeout;
  116. long lEventInterval;
  117. BOOL fCanCancel;
  118. BOOL fConfirm;
  119. HANDLE hEvent;
  120. MBT_SELECT mbts;
  121. };
  122. struct SCRIPT_PARAMS
  123. {
  124. LPTSTR pszPath;
  125. VARIANT *pvarParams;
  126. };
  127. struct PROCESS_PARAMS
  128. {
  129. LPTSTR pszCommand;
  130. LPTSTR pszDir;
  131. LPTSTR pszTitle;
  132. BOOL fMinimize;
  133. BOOL fGetOutput;
  134. BOOL fNoEnviron;
  135. BOOL fNoCrashPopup;
  136. };
  137. struct MACHPROC_EVENT_DATA
  138. {
  139. HANDLE hEvent;
  140. DWORD dwProcId;
  141. BSTR bstrCmd;
  142. BSTR bstrParams;
  143. VARIANT * pvReturn;
  144. DWORD dwGITCookie;
  145. HRESULT hrReturn;
  146. };
  147. #endif // RC_INVOKED