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.

443 lines
10 KiB

  1. #include "stdafx.h"
  2. #include "t3test.h"
  3. #include "t3testD.h"
  4. #include "calldlg.h"
  5. #include "callnot.h"
  6. #include "externs.h"
  7. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  8. //
  9. // ReleaseAddresses
  10. //
  11. // Release all the address objects in the address tree
  12. //
  13. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  14. void CT3testDlg::ReleaseAddresses()
  15. {
  16. HTREEITEM hItem;
  17. TV_ITEM item;
  18. item.mask = TVIF_HANDLE | TVIF_PARAM;
  19. //
  20. // get the first address
  21. //
  22. hItem = TreeView_GetChild(
  23. ghAddressesWnd,
  24. ghAddressesRoot
  25. );
  26. //
  27. // go through all the addresses
  28. // and release
  29. while (NULL != hItem)
  30. {
  31. HTREEITEM hNewItem;
  32. ITAddress * pAddress;
  33. item.hItem = hItem;
  34. TreeView_GetItem(
  35. ghAddressesWnd,
  36. &item
  37. );
  38. pAddress = (ITAddress *)item.lParam;
  39. if (NULL != pAddress)
  40. {
  41. pAddress->Release();
  42. }
  43. hNewItem = TreeView_GetNextSibling(
  44. ghAddressesWnd,
  45. hItem
  46. );
  47. //
  48. // delete the item
  49. //
  50. // TreeView_DeleteItem(
  51. // ghAddressesWnd,
  52. // hItem
  53. // );
  54. hItem = hNewItem;
  55. }
  56. TreeView_DeleteAllItems(ghAddressesWnd);
  57. }
  58. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  59. //
  60. // ReleaseMediaTypes
  61. //
  62. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  63. void CT3testDlg::ReleaseMediaTypes()
  64. {
  65. HTREEITEM hItem;
  66. TV_ITEM item;
  67. BSTR pMediaType;
  68. gbUpdatingStuff = TRUE;
  69. item.mask = TVIF_HANDLE | TVIF_PARAM;
  70. //
  71. // go through all the mediatypes
  72. // and free the associated strings
  73. // and delete the item from the
  74. // tree
  75. //
  76. hItem = TreeView_GetChild(
  77. ghMediaTypesWnd,
  78. ghMediaTypesRoot
  79. );
  80. while (NULL != hItem)
  81. {
  82. HTREEITEM hNewItem;
  83. hNewItem = TreeView_GetNextSibling(
  84. ghMediaTypesWnd,
  85. hItem
  86. );
  87. //
  88. // delete the item
  89. //
  90. TreeView_DeleteItem(
  91. ghMediaTypesWnd,
  92. hItem
  93. );
  94. hItem = hNewItem;
  95. }
  96. gbUpdatingStuff = FALSE;
  97. }
  98. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  99. //
  100. // ReleaseListen
  101. //
  102. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  103. void CT3testDlg::ReleaseListen()
  104. {
  105. HTREEITEM hItem;
  106. TV_ITEM item;
  107. item.mask = TVIF_HANDLE | TVIF_PARAM;
  108. //
  109. // delete all the leave on the listen
  110. // tree
  111. // there are no resources associated with
  112. // this, so nothing to free
  113. //
  114. hItem = TreeView_GetChild(
  115. ghListenWnd,
  116. ghListenRoot
  117. );
  118. while (NULL != hItem)
  119. {
  120. HTREEITEM hNewItem;
  121. hNewItem = TreeView_GetNextSibling(
  122. ghListenWnd,
  123. hItem
  124. );
  125. TreeView_DeleteItem(
  126. ghListenWnd,
  127. hItem
  128. );
  129. hItem = hNewItem;
  130. }
  131. }
  132. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  133. //
  134. // ReleaseTerminalClasses
  135. //
  136. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  137. void CT3testDlg::ReleaseTerminalClasses()
  138. {
  139. HTREEITEM hItem;
  140. TV_ITEM item;
  141. item.mask = TVIF_HANDLE | TVIF_PARAM;
  142. //
  143. // go through all the terminal classes
  144. // free the memory allocated for the
  145. // guid, and delete the item
  146. //
  147. hItem = TreeView_GetChild(
  148. ghClassesWnd,
  149. ghClassesRoot
  150. );
  151. while (NULL != hItem)
  152. {
  153. HTREEITEM hNewItem;
  154. GUID * pGuid;
  155. item.hItem = hItem;
  156. TreeView_GetItem(
  157. ghClassesWnd,
  158. &item
  159. );
  160. pGuid = (GUID *)item.lParam;
  161. delete pGuid;
  162. hNewItem = TreeView_GetNextSibling(
  163. ghClassesWnd,
  164. hItem
  165. );
  166. TreeView_DeleteItem(
  167. ghClassesWnd,
  168. hItem
  169. );
  170. hItem = hNewItem;
  171. }
  172. }
  173. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  174. //
  175. // ReleaseTerminalClasses
  176. //
  177. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  178. void CT3testDlg::ReleaseTerminals()
  179. {
  180. HTREEITEM hItem;
  181. TV_ITEM item;
  182. item.mask = TVIF_HANDLE | TVIF_PARAM;
  183. //
  184. // go though all the terminals, and
  185. // free the terminals, and delete the
  186. // item
  187. //
  188. hItem = TreeView_GetChild(
  189. ghTerminalsWnd,
  190. ghTerminalsRoot
  191. );
  192. while (NULL != hItem)
  193. {
  194. HTREEITEM hNewItem;
  195. ITTerminal * pTerminal;
  196. item.hItem = hItem;
  197. TreeView_GetItem(
  198. ghTerminalsWnd,
  199. &item
  200. );
  201. pTerminal = (ITTerminal *)item.lParam;
  202. pTerminal->Release();
  203. hNewItem = TreeView_GetNextSibling(
  204. ghTerminalsWnd,
  205. hItem
  206. );
  207. TreeView_DeleteItem(
  208. ghTerminalsWnd,
  209. hItem
  210. );
  211. hItem = hNewItem;
  212. }
  213. }
  214. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  215. //
  216. // ReleaseSelectedTerminals
  217. //
  218. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  219. void CT3testDlg::ReleaseSelectedTerminals()
  220. {
  221. HTREEITEM hItem;
  222. TV_ITEM item;
  223. item.mask = TVIF_HANDLE | TVIF_PARAM;
  224. //
  225. // go through all the selected terminals
  226. // and free and delete
  227. //
  228. hItem = TreeView_GetChild(
  229. ghSelectedWnd,
  230. ghSelectedRoot
  231. );
  232. while (NULL != hItem)
  233. {
  234. HTREEITEM hNewItem;
  235. ITTerminal * pTerminal;
  236. item.hItem = hItem;
  237. TreeView_GetItem(
  238. ghSelectedWnd,
  239. &item
  240. );
  241. pTerminal = (ITTerminal *)item.lParam;
  242. pTerminal->Release();
  243. hNewItem = TreeView_GetNextSibling(
  244. ghSelectedWnd,
  245. hItem
  246. );
  247. TreeView_DeleteItem(
  248. ghSelectedWnd,
  249. hItem
  250. );
  251. hItem = hNewItem;
  252. }
  253. }
  254. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  255. //
  256. // ReleaseCalls
  257. //
  258. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  259. void CT3testDlg::ReleaseCalls()
  260. {
  261. HTREEITEM hItem;
  262. TV_ITEM item;
  263. item.mask = TVIF_HANDLE | TVIF_PARAM;
  264. //
  265. // go through all the calls, and
  266. // release and delete
  267. //
  268. hItem = TreeView_GetChild(
  269. ghCallsWnd,
  270. ghCallsRoot
  271. );
  272. while (NULL != hItem)
  273. {
  274. HTREEITEM hNewItem;
  275. ITCallInfo * pCallInfo;
  276. item.hItem = hItem;
  277. TreeView_GetItem(
  278. ghCallsWnd,
  279. &item
  280. );
  281. pCallInfo = (ITCallInfo *)item.lParam;
  282. pCallInfo->Release();
  283. hNewItem = TreeView_GetNextSibling(
  284. ghCallsWnd,
  285. hItem
  286. );
  287. TreeView_DeleteItem(
  288. ghCallsWnd,
  289. hItem
  290. );
  291. hItem = hNewItem;
  292. }
  293. }
  294. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  295. //
  296. // ReleaseCalls
  297. //
  298. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  299. void CT3testDlg::ReleaseCreatedTerminals()
  300. {
  301. HTREEITEM hItem;
  302. TV_ITEM item;
  303. item.mask = TVIF_HANDLE | TVIF_PARAM;
  304. //
  305. // go through all the created terminals
  306. // and release and delete
  307. //
  308. hItem = TreeView_GetChild(
  309. ghCreatedWnd,
  310. ghCreatedRoot
  311. );
  312. while (NULL != hItem)
  313. {
  314. HTREEITEM hNewItem;
  315. ITTerminal * pTerminal;
  316. item.hItem = hItem;
  317. TreeView_GetItem(
  318. ghCreatedWnd,
  319. &item
  320. );
  321. pTerminal = (ITTerminal *)item.lParam;
  322. pTerminal->Release();
  323. hNewItem = TreeView_GetNextSibling(
  324. ghCreatedWnd,
  325. hItem
  326. );
  327. TreeView_DeleteItem(
  328. ghCreatedWnd,
  329. hItem
  330. );
  331. hItem = hNewItem;
  332. }
  333. }