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.

191 lines
11 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 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 CONTINUE_ON_FAILURE(hr) \
  23. if (FAILED(hr)) { \
  24. continue; \
  25. }\
  26. #define INVALID_CREDENTIALS_ERROR(hr) \
  27. ( hr == HRESULT_FROM_WIN32(ERROR_LOGON_FAILURE) || \
  28. hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED) || \
  29. hr == HRESULT_FROM_WIN32(ERROR_DS_INAPPROPRIATE_AUTH) || \
  30. hr == HRESULT_FROM_WIN32(ERROR_DS_AUTH_UNKNOWN) || \
  31. hr == DB_SEC_E_PERMISSIONDENIED)
  32. #define LIMIT_EXCEEDED_ERROR(hr) \
  33. ( hr == HRESULT_FROM_WIN32(ERROR_DS_SIZELIMIT_EXCEEDED) || \
  34. hr == HRESULT_FROM_WIN32(ERROR_DS_TIMELIMIT_EXCEEDED))
  35. #define DEFINE_IDispatch_Implementation_Unimplemented(cls) \
  36. STDMETHODIMP \
  37. cls::GetTypeInfoCount(unsigned int FAR* pctinfo) \
  38. { \
  39. RRETURN(E_NOTIMPL); \
  40. } \
  41. \
  42. STDMETHODIMP \
  43. cls::GetTypeInfo(unsigned int itinfo, LCID lcid, \
  44. ITypeInfo FAR* FAR* pptinfo) \
  45. { \
  46. RRETURN(E_NOTIMPL); \
  47. } \
  48. \
  49. STDMETHODIMP \
  50. cls::GetIDsOfNames(REFIID iid, LPWSTR FAR* rgszNames, \
  51. unsigned int cNames, LCID lcid, DISPID FAR* rgdispid) \
  52. { \
  53. RRETURN(E_NOTIMPL); \
  54. } \
  55. \
  56. STDMETHODIMP \
  57. cls::Invoke(DISPID dispidMember, REFIID iid, LCID lcid, \
  58. unsigned short wFlags, DISPPARAMS FAR* pdispparams, \
  59. VARIANT FAR* pvarResult, EXCEPINFO FAR* pexcepinfo, \
  60. unsigned int FAR* puArgErr) \
  61. { \
  62. RRETURN(E_NOTIMPL); \
  63. }
  64. #define DEFINE_IDispatch_Implementation(cls) \
  65. STDMETHODIMP \
  66. cls::GetTypeInfoCount(unsigned int FAR* pctinfo) \
  67. { \
  68. RRETURN(_pDispMgr->GetTypeInfoCount(pctinfo)); \
  69. } \
  70. \
  71. STDMETHODIMP \
  72. cls::GetTypeInfo(unsigned int itinfo, LCID lcid, \
  73. ITypeInfo FAR* FAR* pptinfo) \
  74. { \
  75. RRETURN(_pDispMgr->GetTypeInfo(itinfo, \
  76. lcid, \
  77. pptinfo \
  78. )); \
  79. } \
  80. STDMETHODIMP \
  81. cls::GetIDsOfNames(REFIID iid, LPWSTR FAR* rgszNames, \
  82. unsigned int cNames, LCID lcid, DISPID FAR* rgdispid) \
  83. { \
  84. RRETURN(_pDispMgr->GetIDsOfNames(iid, \
  85. rgszNames, \
  86. cNames, \
  87. lcid, \
  88. rgdispid \
  89. )); \
  90. } \
  91. \
  92. STDMETHODIMP \
  93. cls::Invoke(DISPID dispidMember, REFIID iid, LCID lcid, \
  94. unsigned short wFlags, DISPPARAMS FAR* pdispparams, \
  95. VARIANT FAR* pvarResult, EXCEPINFO FAR* pexcepinfo, \
  96. unsigned int FAR* puArgErr) \
  97. { \
  98. RRETURN (_pDispMgr->Invoke(dispidMember, \
  99. iid, \
  100. lcid, \
  101. wFlags, \
  102. pdispparams, \
  103. pvarResult, \
  104. pexcepinfo, \
  105. puArgErr \
  106. )); \
  107. }
  108. #define DEFINE_IADs_Implementation(cls) \
  109. STDMETHODIMP \
  110. cls::get_Name(THIS_ BSTR FAR* retval) \
  111. { \
  112. RRETURN(get_CoreName(retval)); \
  113. } \
  114. \
  115. STDMETHODIMP \
  116. cls::get_ADsPath(THIS_ BSTR FAR* retval) \
  117. { \
  118. \
  119. RRETURN(get_CoreADsPath(retval)); \
  120. } \
  121. \
  122. STDMETHODIMP \
  123. cls::get_Class(THIS_ BSTR FAR* retval) \
  124. { \
  125. \
  126. RRETURN(get_CoreADsClass(retval)); \
  127. } \
  128. \
  129. \
  130. STDMETHODIMP \
  131. cls::get_Parent(THIS_ BSTR FAR* retval) \
  132. { \
  133. RRETURN(get_CoreParent(retval)); \
  134. } \
  135. \
  136. STDMETHODIMP \
  137. cls::get_Schema(THIS_ BSTR FAR* retval) \
  138. { \
  139. RRETURN(E_NOTIMPL); \
  140. } \
  141. \
  142. STDMETHODIMP \
  143. cls::get_GUID(THIS_ BSTR FAR* retval) \
  144. { \
  145. RRETURN(get_CoreGUID(retval)); \
  146. } \
  147. \
  148. STDMETHODIMP \
  149. cls::Get(THIS_ BSTR bstrName, VARIANT FAR* pvProp) \
  150. { \
  151. RRETURN(E_NOTIMPL); \
  152. } \
  153. \
  154. STDMETHODIMP \
  155. cls::Put(THIS_ BSTR bstrName, VARIANT vProp) \
  156. { \
  157. RRETURN(E_NOTIMPL); \
  158. } \
  159. STDMETHODIMP \
  160. cls::GetEx(THIS_ BSTR bstrName, VARIANT FAR* pvProp) \
  161. { \
  162. RRETURN(E_NOTIMPL); \
  163. } \
  164. \
  165. STDMETHODIMP \
  166. cls::PutEx(THIS_ long lnControlCode, BSTR bstrName, VARIANT vProp) \
  167. { \
  168. RRETURN(E_NOTIMPL); \
  169. } \
  170. STDMETHODIMP \
  171. cls::GetInfoEx(THIS_ VARIANT vProperties, long lnReserved) \
  172. { \
  173. RRETURN(E_NOTIMPL); \
  174. }