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.

549 lines
13 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. // ReleasePhones
  217. //
  218. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  219. void CT3testDlg::ReleasePhones()
  220. {
  221. HTREEITEM hItem;
  222. TV_ITEM item;
  223. item.mask = TVIF_HANDLE | TVIF_PARAM;
  224. //
  225. // go though all the phones, and
  226. // free the phones, and delete the
  227. // item
  228. //
  229. hItem = TreeView_GetChild(
  230. ghPhonesWnd,
  231. ghPhonesRoot
  232. );
  233. while (NULL != hItem)
  234. {
  235. HTREEITEM hNewItem;
  236. ITPhone * pPhone;
  237. item.hItem = hItem;
  238. TreeView_GetItem(
  239. ghPhonesWnd,
  240. &item
  241. );
  242. pPhone = (ITPhone *)item.lParam;
  243. pPhone->Release();
  244. hNewItem = TreeView_GetNextSibling(
  245. ghPhonesWnd,
  246. hItem
  247. );
  248. TreeView_DeleteItem(
  249. ghPhonesWnd,
  250. hItem
  251. );
  252. hItem = hNewItem;
  253. }
  254. }
  255. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  256. //
  257. // ReleaseSelectedTerminals
  258. //
  259. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  260. void CT3testDlg::ReleaseSelectedTerminals()
  261. {
  262. HTREEITEM hItem;
  263. TV_ITEM item;
  264. item.mask = TVIF_HANDLE | TVIF_PARAM;
  265. //
  266. // go through all the selected terminals
  267. // and free and delete
  268. //
  269. hItem = TreeView_GetChild(
  270. ghSelectedWnd,
  271. ghSelectedRoot
  272. );
  273. while (NULL != hItem)
  274. {
  275. HTREEITEM hNewItem;
  276. ITTerminal * pTerminal;
  277. item.hItem = hItem;
  278. TreeView_GetItem(
  279. ghSelectedWnd,
  280. &item
  281. );
  282. pTerminal = (ITTerminal *)item.lParam;
  283. pTerminal->Release();
  284. hNewItem = TreeView_GetNextSibling(
  285. ghSelectedWnd,
  286. hItem
  287. );
  288. TreeView_DeleteItem(
  289. ghSelectedWnd,
  290. hItem
  291. );
  292. hItem = hNewItem;
  293. }
  294. }
  295. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  296. //
  297. // ReleaseCalls
  298. //
  299. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  300. void CT3testDlg::ReleaseCalls()
  301. {
  302. HTREEITEM hItem;
  303. TV_ITEM item;
  304. item.mask = TVIF_HANDLE | TVIF_PARAM;
  305. //
  306. // go through all the calls, and
  307. // release and delete
  308. //
  309. hItem = TreeView_GetChild(
  310. ghCallsWnd,
  311. ghCallsRoot
  312. );
  313. while (NULL != hItem)
  314. {
  315. HTREEITEM hNewItem;
  316. ITCallInfo * pCallInfo;
  317. item.hItem = hItem;
  318. TreeView_GetItem(
  319. ghCallsWnd,
  320. &item
  321. );
  322. pCallInfo = (ITCallInfo *)item.lParam;
  323. pCallInfo->Release();
  324. hNewItem = TreeView_GetNextSibling(
  325. ghCallsWnd,
  326. hItem
  327. );
  328. TreeView_DeleteItem(
  329. ghCallsWnd,
  330. hItem
  331. );
  332. hItem = hNewItem;
  333. }
  334. }
  335. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  336. //
  337. // ReleaseSelectedCalls
  338. //
  339. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  340. void CT3testDlg::ReleaseSelectedCalls()
  341. {
  342. HTREEITEM hItem;
  343. TV_ITEM item;
  344. item.mask = TVIF_HANDLE | TVIF_PARAM;
  345. //
  346. // go through all the calls, and
  347. // release and delete
  348. //
  349. hItem = TreeView_GetChild(
  350. ghSelectedCallsWnd,
  351. ghSelectedCallsRoot
  352. );
  353. while (NULL != hItem)
  354. {
  355. HTREEITEM hNewItem;
  356. ITCallInfo * pCallInfo;
  357. item.hItem = hItem;
  358. TreeView_GetItem(
  359. ghSelectedCallsWnd,
  360. &item
  361. );
  362. pCallInfo = (ITCallInfo *)item.lParam;
  363. pCallInfo->Release();
  364. hNewItem = TreeView_GetNextSibling(
  365. ghSelectedCallsWnd,
  366. hItem
  367. );
  368. TreeView_DeleteItem(
  369. ghSelectedCallsWnd,
  370. hItem
  371. );
  372. hItem = hNewItem;
  373. }
  374. }
  375. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  376. //
  377. // ReleaseCreatedTerminals
  378. //
  379. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
  380. void CT3testDlg::ReleaseCreatedTerminals()
  381. {
  382. HTREEITEM hItem;
  383. TV_ITEM item;
  384. item.mask = TVIF_HANDLE | TVIF_PARAM;
  385. //
  386. // go through all the created terminals
  387. // and release and delete
  388. //
  389. hItem = TreeView_GetChild(
  390. ghCreatedWnd,
  391. ghCreatedRoot
  392. );
  393. while (NULL != hItem)
  394. {
  395. HTREEITEM hNewItem;
  396. ITTerminal * pTerminal;
  397. item.hItem = hItem;
  398. TreeView_GetItem(
  399. ghCreatedWnd,
  400. &item
  401. );
  402. pTerminal = (ITTerminal *)item.lParam;
  403. pTerminal->Release();
  404. hNewItem = TreeView_GetNextSibling(
  405. ghCreatedWnd,
  406. hItem
  407. );
  408. TreeView_DeleteItem(
  409. ghCreatedWnd,
  410. hItem
  411. );
  412. hItem = hNewItem;
  413. }
  414. }