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.

218 lines
5.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. // CProxy_RefDialEvents
  3. template <class T>
  4. class CProxy_RefDialEvents : public IConnectionPointImpl<T, &DIID__RefDialEvents, CComDynamicUnkArray>
  5. {
  6. public:
  7. //methods:
  8. //_RefDialEvents : IDispatch
  9. public:
  10. void Fire_RasDialStatus(WORD wRasEvent)
  11. {
  12. T* pT = (T*)this;
  13. pT->Lock();
  14. IUnknown** pp = m_vec.begin();
  15. while (pp < m_vec.end())
  16. {
  17. if (*pp != NULL)
  18. {
  19. VARIANTARG* pvars = new VARIANTARG[1];
  20. VariantInit(&pvars[0]);
  21. pvars[0].vt = VT_I2;
  22. pvars[0].iVal= wRasEvent;
  23. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  24. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  25. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  26. }
  27. pp++;
  28. }
  29. pT->Unlock();
  30. }
  31. void Fire_DownloadProgress(
  32. long lProgress)
  33. {
  34. VARIANTARG* pvars = new VARIANTARG[1];
  35. for (int i = 0; i < 1; i++)
  36. VariantInit(&pvars[i]);
  37. T* pT = (T*)this;
  38. pT->Lock();
  39. IUnknown** pp = m_vec.begin();
  40. while (pp < m_vec.end())
  41. {
  42. if (*pp != NULL)
  43. {
  44. pvars[0].vt = VT_I4;
  45. pvars[0].lVal= lProgress;
  46. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  47. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  48. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  49. }
  50. pp++;
  51. }
  52. pT->Unlock();
  53. delete[] pvars;
  54. }
  55. void Fire_DownloadComplete(
  56. BSTR bstrURL,
  57. long lStatus)
  58. {
  59. VARIANTARG* pvars = new VARIANTARG[2];
  60. for (int i = 0; i < 2; i++)
  61. VariantInit(&pvars[i]);
  62. T* pT = (T*)this;
  63. pT->Lock();
  64. IUnknown** pp = m_vec.begin();
  65. while (pp < m_vec.end())
  66. {
  67. if (*pp != NULL)
  68. {
  69. pvars[1].vt = VT_BSTR;
  70. pvars[1].bstrVal= bstrURL;
  71. pvars[0].vt = VT_I4;
  72. pvars[0].lVal= lStatus;
  73. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  74. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  75. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  76. }
  77. pp++;
  78. }
  79. pT->Unlock();
  80. delete[] pvars;
  81. }
  82. void Fire_RasConnectComplete(
  83. long bSuccess)
  84. {
  85. VARIANTARG* pvars = new VARIANTARG[1];
  86. for (int i = 0; i < 1; i++)
  87. VariantInit(&pvars[i]);
  88. T* pT = (T*)this;
  89. pT->Lock();
  90. IUnknown** pp = m_vec.begin();
  91. while (pp < m_vec.end())
  92. {
  93. if (*pp != NULL)
  94. {
  95. pvars[0].vt = VT_I4;
  96. pvars[0].lVal= bSuccess;
  97. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  98. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  99. pDispatch->Invoke(0x4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  100. }
  101. pp++;
  102. }
  103. pT->Unlock();
  104. delete[] pvars;
  105. }
  106. };
  107. //////////////////////////////////////////////////////////////////////////////
  108. // CProxy_WebGateEvents
  109. template <class T>
  110. class CProxy_WebGateEvents : public IConnectionPointImpl<T, &DIID__WebGateEvents, CComDynamicUnkArray>
  111. {
  112. public:
  113. //methods:
  114. //_WebGateEvents : IDispatch
  115. public:
  116. void Fire_WebGateDownloadComplete(
  117. long lProgress)
  118. {
  119. VARIANTARG* pvars = new VARIANTARG[1];
  120. for (int i = 0; i < 1; i++)
  121. VariantInit(&pvars[i]);
  122. T* pT = (T*)this;
  123. pT->Lock();
  124. IUnknown** pp = m_vec.begin();
  125. while (pp < m_vec.end())
  126. {
  127. if (*pp != NULL)
  128. {
  129. pvars[0].vt = VT_I4;
  130. pvars[0].lVal= lProgress;
  131. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  132. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  133. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  134. }
  135. pp++;
  136. }
  137. pT->Unlock();
  138. delete[] pvars;
  139. }
  140. void Fire_WebGateDownloadProgress(
  141. long lProgress)
  142. {
  143. VARIANTARG* pvars = new VARIANTARG[1];
  144. for (int i = 0; i < 1; i++)
  145. VariantInit(&pvars[i]);
  146. T* pT = (T*)this;
  147. pT->Lock();
  148. IUnknown** pp = m_vec.begin();
  149. while (pp < m_vec.end())
  150. {
  151. if (*pp != NULL)
  152. {
  153. pvars[0].vt = VT_I4;
  154. pvars[0].lVal= lProgress;
  155. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  156. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  157. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  158. }
  159. pp++;
  160. }
  161. pT->Unlock();
  162. delete[] pvars;
  163. }
  164. };
  165. //////////////////////////////////////////////////////////////////////////////
  166. // CProxy_INSHandlerEvents
  167. template <class T>
  168. class CProxy_INSHandlerEvents : public IConnectionPointImpl<T, &DIID__INSHandlerEvents, CComDynamicUnkArray>
  169. {
  170. public:
  171. //methods:
  172. //_INSHandlerEvents : IDispatch
  173. public:
  174. void Fire_RunningCustomExecutable()
  175. {
  176. T* pT = (T*)this;
  177. pT->Lock();
  178. IUnknown** pp = m_vec.begin();
  179. while (pp < m_vec.end())
  180. {
  181. if (*pp != NULL)
  182. {
  183. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  184. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  185. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  186. }
  187. pp++;
  188. }
  189. pT->Unlock();
  190. }
  191. void Fire_KillConnection()
  192. {
  193. T* pT = (T*)this;
  194. pT->Lock();
  195. IUnknown** pp = m_vec.begin();
  196. while (pp < m_vec.end())
  197. {
  198. if (*pp != NULL)
  199. {
  200. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  201. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  202. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  203. }
  204. pp++;
  205. }
  206. pT->Unlock();
  207. }
  208. };