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.

197 lines
10 KiB

  1. #define BAIL_ON_NULL(p) \
  2. if (!(p)) { \
  3. goto error; \
  4. }
  5. #define BAIL_IF_ERROR(hr) \
  6. if (FAILED(hr)) { \
  7. goto cleanup; \
  8. }\
  9. #define BAIL_ON_FAILURE(hr) \
  10. if (FAILED(hr)) { \
  11. goto error; \
  12. }\
  13. #define CONTINUE_ON_FAILURE(hr) \
  14. if (FAILED(hr)) { \
  15. continue; \
  16. }\
  17. #define BAIL_ON_SUCCESS(hr) \
  18. if (SUCCEEDED(hr)) { \
  19. goto error; \
  20. }\
  21. #define QUERY_INTERFACE(hr, ptr, iid, ppObj) \
  22. hr = ptr->QueryInterface(iid, (void **)ppObj); \
  23. if (FAILED(hr)) { \
  24. goto cleanup;\
  25. }\
  26. #define RRETURN_ENUM_STATUS(hr) \
  27. if (hr != S_OK) { \
  28. RRETURN(S_FALSE); \
  29. } \
  30. RRETURN(S_OK);
  31. #define DEFINE_IDispatch_Implementation_Unimplemented(cls) \
  32. STDMETHODIMP \
  33. cls::GetTypeInfoCount(unsigned int FAR* pctinfo) \
  34. { \
  35. RRETURN(E_NOTIMPL); \
  36. } \
  37. \
  38. STDMETHODIMP \
  39. cls::GetTypeInfo(unsigned int itinfo, LCID lcid, \
  40. ITypeInfo FAR* FAR* pptinfo) \
  41. { \
  42. RRETURN(E_NOTIMPL); \
  43. } \
  44. \
  45. STDMETHODIMP \
  46. cls::GetIDsOfNames(REFIID iid, LPWSTR FAR* rgszNames, \
  47. unsigned int cNames, LCID lcid, DISPID FAR* rgdispid) \
  48. { \
  49. RRETURN(E_NOTIMPL); \
  50. } \
  51. \
  52. STDMETHODIMP \
  53. cls::Invoke(DISPID dispidMember, REFIID iid, LCID lcid, \
  54. unsigned short wFlags, DISPPARAMS FAR* pdispparams, \
  55. VARIANT FAR* pvarResult, EXCEPINFO FAR* pexcepinfo, \
  56. unsigned int FAR* puArgErr) \
  57. { \
  58. RRETURN(E_NOTIMPL); \
  59. }
  60. #define DEFINE_IDispatch_Implementation(cls) \
  61. STDMETHODIMP \
  62. cls::GetTypeInfoCount(unsigned int FAR* pctinfo) \
  63. { \
  64. RRETURN(_pDispMgr->GetTypeInfoCount(pctinfo)); \
  65. } \
  66. \
  67. STDMETHODIMP \
  68. cls::GetTypeInfo(unsigned int itinfo, LCID lcid, \
  69. ITypeInfo FAR* FAR* pptinfo) \
  70. { \
  71. RRETURN(_pDispMgr->GetTypeInfo(itinfo, \
  72. lcid, \
  73. pptinfo \
  74. )); \
  75. } \
  76. STDMETHODIMP \
  77. cls::GetIDsOfNames(REFIID iid, LPWSTR FAR* rgszNames, \
  78. unsigned int cNames, LCID lcid, DISPID FAR* rgdispid) \
  79. { \
  80. RRETURN(_pDispMgr->GetIDsOfNames(iid, \
  81. rgszNames, \
  82. cNames, \
  83. lcid, \
  84. rgdispid \
  85. )); \
  86. } \
  87. \
  88. STDMETHODIMP \
  89. cls::Invoke(DISPID dispidMember, REFIID iid, LCID lcid, \
  90. unsigned short wFlags, DISPPARAMS FAR* pdispparams, \
  91. VARIANT FAR* pvarResult, EXCEPINFO FAR* pexcepinfo, \
  92. unsigned int FAR* puArgErr) \
  93. { \
  94. RRETURN (_pDispMgr->Invoke(dispidMember, \
  95. iid, \
  96. lcid, \
  97. wFlags, \
  98. pdispparams, \
  99. pvarResult, \
  100. pexcepinfo, \
  101. puArgErr \
  102. )); \
  103. }
  104. #define DEFINE_IADs_Implementation(cls) \
  105. STDMETHODIMP \
  106. cls::get_Name(THIS_ BSTR FAR* retval) \
  107. { \
  108. RRETURN(get_CoreName(retval)); \
  109. } \
  110. \
  111. STDMETHODIMP \
  112. cls::get_ADsPath(THIS_ BSTR FAR* retval) \
  113. { \
  114. \
  115. RRETURN(get_CoreADsPath(retval)); \
  116. } \
  117. \
  118. STDMETHODIMP \
  119. cls::get_Class(THIS_ BSTR FAR* retval) \
  120. { \
  121. \
  122. RRETURN(get_CoreADsClass(retval)); \
  123. } \
  124. \
  125. \
  126. STDMETHODIMP \
  127. cls::get_Parent(THIS_ BSTR FAR* retval) \
  128. { \
  129. RRETURN(get_CoreParent(retval)); \
  130. } \
  131. \
  132. STDMETHODIMP \
  133. cls::get_Schema(THIS_ BSTR FAR* retval) \
  134. { \
  135. RRETURN(get_CoreSchema(retval)); \
  136. } \
  137. \
  138. STDMETHODIMP \
  139. cls::get_GUID(THIS_ BSTR FAR* retval) \
  140. { \
  141. RRETURN(get_CoreGUID(retval)); \
  142. }
  143. #define CHECK_AND_SET_EXTENDED_ERROR(dwStatus, hr) \
  144. if (dwStatus) { \
  145. hr = CheckAndSetExtendedError(dwStatus); \
  146. BAIL_ON_FAILURE(hr); \
  147. }
  148. #define ARRAY_SIZE(_a) (sizeof(_a) / sizeof(_a[0]))
  149. #define DEFINE_IADsPutGet_UnImplementation(cls) \
  150. STDMETHODIMP \
  151. cls::Get(THIS_ BSTR bstrName, VARIANT FAR* pvProp) \
  152. { \
  153. RRETURN(E_NOTIMPL); \
  154. } \
  155. \
  156. STDMETHODIMP \
  157. cls::Put(THIS_ BSTR bstrName, VARIANT vProp) \
  158. { \
  159. RRETURN(E_NOTIMPL); \
  160. } \
  161. \
  162. STDMETHODIMP \
  163. cls::GetEx(THIS_ BSTR bstrName, VARIANT FAR* pvProp) \
  164. { \
  165. RRETURN(E_NOTIMPL); \
  166. } \
  167. \
  168. STDMETHODIMP \
  169. cls::PutEx(THIS_ long lnControlCode, BSTR bstrName, VARIANT vProp) \
  170. { \
  171. RRETURN(E_NOTIMPL); \
  172. }