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.

154 lines
8.6 KiB

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