Source code of Windows XP (NT5)
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.

1357 lines
35 KiB

  1. //****************************************************************************
  2. //
  3. // Module: ULS.DLL
  4. // File: callback.cpp
  5. // Content: This file contains the ULS callback routine.
  6. // History:
  7. // Wed 17-Apr-1996 11:13:54 -by- Viroon Touranachun [viroont]
  8. //
  9. // Copyright (c) Microsoft Corporation 1995-1996
  10. //
  11. //****************************************************************************
  12. #include "ulsp.h"
  13. #include "callback.h"
  14. #include "culs.h"
  15. #include "localusr.h"
  16. #include "attribs.h"
  17. #include "localprt.h"
  18. #include "ulsmeet.h"
  19. //****************************************************************************
  20. // void OnRegisterResult(UINT uMsg, ULONG uMsgID, HRESULT hResult)
  21. //
  22. // History:
  23. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  24. // Created.
  25. //****************************************************************************
  26. void OnRegisterResult(UINT uMsg, ULONG uMsgID, HRESULT hResult)
  27. {
  28. COM_REQ_INFO ri;
  29. ReqInfo_Init (&ri);
  30. // Look for the matching request information
  31. //
  32. ri.uReqID = 0;
  33. ri.uMsgID = uMsgID;
  34. if (SUCCEEDED(g_pReqMgr->RequestDone(&ri)))
  35. {
  36. ASSERT(uMsg == ri.uReqType);
  37. CIlsUser *pUser = ReqInfo_GetUser (&ri);
  38. switch(uMsg)
  39. {
  40. case WM_ILS_REGISTER_CLIENT: // lParam = hResult
  41. //
  42. // Call the appropriate object's member
  43. //
  44. ASSERT (pUser != NULL);
  45. if (pUser != NULL)
  46. pUser->InternalRegisterNext(hResult);
  47. break;
  48. case WM_ILS_UNREGISTER_CLIENT: // lParam = hResult
  49. //
  50. // Call the appropriate object's member
  51. //
  52. ASSERT (pUser != NULL);
  53. if (pUser != NULL)
  54. pUser->InternalUnregisterNext(hResult);
  55. break;
  56. default:
  57. ASSERT(0);
  58. break;
  59. };
  60. // Release the objects
  61. //
  62. if (pUser != NULL)
  63. pUser->Release ();
  64. }
  65. else
  66. {
  67. DPRINTF1(TEXT("OnRegisterResult: No pending request for %x"),
  68. uMsgID);
  69. // ASSERT (0);
  70. };
  71. return;
  72. }
  73. //****************************************************************************
  74. // void OnLocalRegisterResult(UINT uMsg, ULONG uReqID, HRESULT hResult)
  75. //
  76. // History:
  77. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  78. // Created.
  79. //****************************************************************************
  80. void OnLocalRegisterResult(UINT uMsg, ULONG uReqID, HRESULT hResult)
  81. {
  82. COM_REQ_INFO ri;
  83. ReqInfo_Init (&ri);
  84. // Look for the matching request information
  85. //
  86. ri.uReqID = uReqID;
  87. ri.uMsgID = 0;
  88. if (SUCCEEDED(g_pReqMgr->RequestDone(&ri)))
  89. {
  90. ASSERT(uMsg == ri.uReqType);
  91. CIlsUser *pUser = ReqInfo_GetUser (&ri);
  92. // Call the appropriate object's member
  93. //
  94. switch(uMsg)
  95. {
  96. case WM_ILS_LOCAL_REGISTER:
  97. ASSERT (pUser != NULL);
  98. if (pUser != NULL)
  99. pUser->RegisterResult(uReqID, hResult);
  100. break;
  101. case WM_ILS_LOCAL_UNREGISTER:
  102. ASSERT (pUser != NULL);
  103. if (pUser != NULL)
  104. pUser->UnregisterResult(uReqID, hResult);
  105. break;
  106. default:
  107. ASSERT(0);
  108. break;
  109. };
  110. // Release the objects
  111. //
  112. if (pUser != NULL)
  113. pUser->Release ();
  114. }
  115. else
  116. {
  117. DPRINTF1(TEXT("OnLocalRegisterResult: No pending request for %x"),
  118. uReqID);
  119. // ASSERT (0);
  120. };
  121. return;
  122. }
  123. //****************************************************************************
  124. // void OnSetUserInfo(UINT uMsg, ULONG uID, HRESULT hResult)
  125. //
  126. // History:
  127. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  128. // Created.
  129. //****************************************************************************
  130. void OnSetUserInfo(UINT uMsg, ULONG uID, HRESULT hResult)
  131. {
  132. COM_REQ_INFO ri;
  133. ReqInfo_Init (&ri);
  134. switch (uMsg)
  135. {
  136. case WM_ILS_SET_CLIENT_INFO:
  137. //
  138. // Look for the matching Ldap Message ID
  139. //
  140. ri.uReqID = 0; // Mark that we are looking for the message ID
  141. ri.uMsgID = uID; // Not the request ID
  142. break;
  143. default:
  144. ASSERT(0);
  145. break;
  146. };
  147. if (SUCCEEDED(g_pReqMgr->RequestDone(&ri)))
  148. {
  149. ASSERT(uMsg == ri.uReqType);
  150. CIlsUser *pUser = ReqInfo_GetUser (&ri);
  151. ASSERT (pUser != NULL);
  152. if (pUser != NULL)
  153. {
  154. // Call the appropriate object's member
  155. //
  156. pUser->UpdateResult(ri.uReqID, hResult);
  157. // Release the objects
  158. //
  159. pUser->Release();
  160. }
  161. }
  162. else
  163. {
  164. DPRINTF1(TEXT("OnSetUserInfo: No pending request for %x"),
  165. uID);
  166. // ASSERT (0);
  167. };
  168. return;
  169. }
  170. //****************************************************************************
  171. // void OnSetProtocol(UINT uMsg, ULONG uID, HRESULT hResult)
  172. //
  173. // History:
  174. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  175. // Created.
  176. //****************************************************************************
  177. void OnSetProtocol(UINT uMsg, ULONG uID, HRESULT hResult)
  178. {
  179. COM_REQ_INFO ri;
  180. ReqInfo_Init (&ri);
  181. APP_CHANGE_PROT uCmd;
  182. switch (uMsg)
  183. {
  184. case WM_ILS_REGISTER_PROTOCOL:
  185. // Look for the matching request information
  186. //
  187. ri.uReqID = 0; // Mark that we are looking for the message ID
  188. ri.uMsgID = uID; // Not the request ID
  189. uCmd = ILS_APP_ADD_PROT;
  190. break;
  191. case WM_ILS_LOCAL_REGISTER_PROTOCOL:
  192. // Look for the matching request information
  193. //
  194. ri.uReqID = uID; // Mark that we are looking for the request ID
  195. ri.uMsgID = 0; // Not the message ID
  196. uCmd = ILS_APP_ADD_PROT;
  197. break;
  198. case WM_ILS_UNREGISTER_PROTOCOL:
  199. // Look for the matching request information
  200. //
  201. ri.uReqID = 0; // Mark that we are looking for the message ID
  202. ri.uMsgID = uID; // Not the request ID
  203. uCmd = ILS_APP_REMOVE_PROT;
  204. break;
  205. case WM_ILS_LOCAL_UNREGISTER_PROTOCOL:
  206. // Look for the matching request information
  207. //
  208. ri.uReqID = uID; // Mark that we are looking for the request ID
  209. ri.uMsgID = 0; // Not the message ID
  210. uCmd = ILS_APP_REMOVE_PROT;
  211. break;
  212. default:
  213. ASSERT(0);
  214. break;
  215. };
  216. if (SUCCEEDED(g_pReqMgr->RequestDone(&ri)))
  217. {
  218. ASSERT(uMsg == ri.uReqType);
  219. CIlsUser *pUser = ReqInfo_GetUser (&ri);
  220. CLocalProt *pProtocol = ReqInfo_GetProtocol (&ri);
  221. // Check the request parameter
  222. //
  223. if (pProtocol == NULL)
  224. {
  225. switch(uMsg)
  226. {
  227. case WM_ILS_REGISTER_PROTOCOL:
  228. // Call the appropriate object's member
  229. //
  230. ASSERT (pUser != NULL);
  231. if (pUser != NULL)
  232. pUser->InternalRegisterNext(hResult);
  233. break;
  234. case WM_ILS_UNREGISTER_PROTOCOL:
  235. // Call the appropriate object's member
  236. //
  237. ASSERT (pUser != NULL);
  238. if (pUser != NULL)
  239. pUser->InternalUnregisterNext(hResult);
  240. break;
  241. default:
  242. // Must be a response from server
  243. //
  244. ASSERT(0);
  245. break;
  246. };
  247. // Release the objects
  248. //
  249. if (pUser != NULL)
  250. pUser->Release();
  251. }
  252. else
  253. {
  254. ASSERT (pUser != NULL && pProtocol != NULL);
  255. if (pUser != NULL && pProtocol != NULL)
  256. {
  257. // Call the appropriate object's member
  258. //
  259. pUser->ProtocolChangeResult(pProtocol,
  260. ri.uReqID, hResult,
  261. uCmd);
  262. // Release the objects
  263. //
  264. pUser->Release();
  265. pProtocol->Release();
  266. }
  267. };
  268. }
  269. else
  270. {
  271. DPRINTF1(TEXT("OnSetProtocol: No pending request for %x"),
  272. uID);
  273. // ASSERT (0);
  274. };
  275. return;
  276. }
  277. //****************************************************************************
  278. // void OnEnumUserNamesResult(ULONG uMsgID, PLDAP_ENUM ple)
  279. //
  280. // History:
  281. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  282. // Created.
  283. //****************************************************************************
  284. void OnEnumUserNamesResult(ULONG uMsgID, PLDAP_ENUM ple)
  285. {
  286. COM_REQ_INFO ri;
  287. ReqInfo_Init (&ri);
  288. // Look for the matching request information
  289. //
  290. ri.uReqID = 0;
  291. ri.uMsgID = uMsgID;
  292. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  293. {
  294. ASSERT(WM_ILS_ENUM_CLIENTS == ri.uReqType);
  295. CIlsMain *pMain = ReqInfo_GetMain (&ri);
  296. // Call the appropriate object's member
  297. //
  298. ASSERT (pMain != NULL);
  299. if (pMain != NULL)
  300. {
  301. pMain->EnumUserNamesResult(ri.uReqID, ple);
  302. }
  303. // If the enumeration was terminated, remove the pending request
  304. //
  305. if ((ple == NULL) ||
  306. (ple->hResult != NOERROR))
  307. {
  308. ri.uReqID = 0;
  309. ri.uMsgID = uMsgID;
  310. g_pReqMgr->RequestDone(&ri);
  311. // Release the objects
  312. //
  313. if (pMain != NULL)
  314. pMain->Release();
  315. };
  316. }
  317. else
  318. {
  319. DPRINTF1(TEXT("OnEnumUserNamesResult: No pending request for %x"),
  320. uMsgID);
  321. // ASSERT (0);
  322. };
  323. // Free the information buffer
  324. //
  325. if (ple != NULL)
  326. {
  327. ::MemFree (ple);
  328. };
  329. return;
  330. }
  331. //****************************************************************************
  332. // void OnEnumMeetingNamesResult(ULONG uMsgID, PLDAP_ENUM ple)
  333. //
  334. // History:
  335. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  336. // Created.
  337. //****************************************************************************
  338. #ifdef ENABLE_MEETING_PLACE
  339. void OnEnumMeetingNamesResult(ULONG uMsgID, PLDAP_ENUM ple)
  340. {
  341. COM_REQ_INFO ri;
  342. ReqInfo_Init (&ri);
  343. // Look for the matching request information
  344. //
  345. ri.uReqID = 0;
  346. ri.uMsgID = uMsgID;
  347. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  348. {
  349. ASSERT(WM_ILS_ENUM_MEETINGS == ri.uReqType);
  350. CIlsMain *pMain = ReqInfo_GetMain (&ri);
  351. ASSERT (pMain != NULL);
  352. if (pMain != NULL)
  353. {
  354. // Call the appropriate object's member
  355. //
  356. pMain->EnumMeetingPlaceNamesResult(ri.uReqID, ple);
  357. }
  358. // If the enumeration was terminated, remove the pending request
  359. //
  360. if ((ple == NULL) ||
  361. (ple->hResult != NOERROR))
  362. {
  363. ri.uReqID = 0;
  364. ri.uMsgID = uMsgID;
  365. g_pReqMgr->RequestDone(&ri);
  366. // Release the objects
  367. //
  368. if (pMain != NULL)
  369. pMain->Release();
  370. };
  371. }
  372. else
  373. {
  374. DPRINTF1(TEXT("OnEnumMeetingNamesResult: No pending request for %x"),
  375. uMsgID);
  376. // ASSERT (0);
  377. };
  378. // Free the information buffer
  379. //
  380. if (ple != NULL)
  381. {
  382. ::MemFree (ple);
  383. };
  384. return;
  385. }
  386. #endif // ENABLE_MEETING_PLACE
  387. //****************************************************************************
  388. // void OnResolveUserResult(ULONG uMsgID, PLDAP_CLIENTINFO_RES puir)
  389. //
  390. // History:
  391. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  392. // Created.
  393. //****************************************************************************
  394. void OnResolveUserResult(ULONG uMsgID, PLDAP_CLIENTINFO_RES puir)
  395. {
  396. COM_REQ_INFO ri;
  397. ReqInfo_Init (&ri);
  398. // Look for the matching request information
  399. //
  400. ri.uReqID = 0;
  401. ri.uMsgID = uMsgID;
  402. if (SUCCEEDED(g_pReqMgr->RequestDone(&ri)))
  403. {
  404. ASSERT(WM_ILS_RESOLVE_CLIENT == ri.uReqType);
  405. CIlsServer *pServer = ReqInfo_GetServer (&ri);
  406. CIlsMain *pMain = ReqInfo_GetMain (&ri);
  407. ASSERT (pMain != NULL && pServer != NULL);
  408. if (pMain != NULL && pServer != NULL)
  409. {
  410. // Call the appropriate object's member
  411. //
  412. pMain->GetUserResult(ri.uReqID, puir, pServer);
  413. // Release the objects
  414. //
  415. pMain->Release();
  416. pServer->Release ();
  417. }
  418. }
  419. else
  420. {
  421. DPRINTF1(TEXT("OnResolveUserResult: No pending request for %x"),
  422. uMsgID);
  423. // ASSERT (0);
  424. };
  425. // Free the information buffer
  426. //
  427. ::MemFree (puir);
  428. return;
  429. }
  430. //****************************************************************************
  431. // void OnEnumUsersResult(ULONG uMsgID, PLDAP_ENUM ple)
  432. //
  433. // History:
  434. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  435. // Created.
  436. //****************************************************************************
  437. void OnEnumUsersResult(ULONG uMsgID, PLDAP_ENUM ple)
  438. {
  439. COM_REQ_INFO ri;
  440. ReqInfo_Init (&ri);
  441. // Look for the matching request information
  442. //
  443. ri.uReqID = 0;
  444. ri.uMsgID = uMsgID;
  445. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  446. {
  447. ASSERT(WM_ILS_ENUM_CLIENTINFOS == ri.uReqType);
  448. // Call the appropriate object's member
  449. //
  450. CIlsServer *pServer = ReqInfo_GetServer (&ri);
  451. CIlsMain *pMain = ReqInfo_GetMain (&ri);
  452. ASSERT (pServer != NULL && pMain != NULL);
  453. if (pServer != NULL && pMain != NULL)
  454. pMain->EnumUsersResult(ri.uReqID, ple, pServer);
  455. // If the enumeration was terminated, remove the pending request
  456. //
  457. if ((ple == NULL) ||
  458. (ple->hResult != NOERROR))
  459. {
  460. ri.uReqID = 0;
  461. ri.uMsgID = uMsgID;
  462. g_pReqMgr->RequestDone(&ri);
  463. // Release the objects
  464. //
  465. if (pMain != NULL)
  466. pMain->Release();
  467. if (pServer != NULL)
  468. pServer->Release ();
  469. };
  470. }
  471. else
  472. {
  473. DPRINTF1(TEXT("EnumUsersResult: No pending request for %x"),
  474. uMsgID);
  475. // ASSERT (0);
  476. };
  477. // Free the information buffer
  478. //
  479. if (ple != NULL)
  480. {
  481. ::MemFree (ple);
  482. };
  483. return;
  484. }
  485. //****************************************************************************
  486. // void OnEnumMeetingsResult(ULONG uMsgID, PLDAP_ENUM ple)
  487. //
  488. // History:
  489. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  490. // Created.
  491. //****************************************************************************
  492. #ifdef ENABLE_MEETING_PLACE
  493. void OnEnumMeetingsResult(ULONG uMsgID, PLDAP_ENUM ple)
  494. {
  495. COM_REQ_INFO ri;
  496. ReqInfo_Init (&ri);
  497. // Look for the matching request information
  498. //
  499. ri.uReqID = 0;
  500. ri.uMsgID = uMsgID;
  501. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  502. {
  503. ASSERT(WM_ILS_ENUM_MEETINGINFOS == ri.uReqType);
  504. // Call the appropriate object's member
  505. //
  506. CIlsServer *pServer = ReqInfo_GetServer (&ri);
  507. CIlsMain *pMain = ReqInfo_GetMain (&ri);
  508. ASSERT (pServer != NULL && pMain != NULL);
  509. if (pServer != NULL && pMain != NULL)
  510. {
  511. pMain->EnumMeetingPlacesResult(ri.uReqID, ple, pServer);
  512. }
  513. // If the enumeration was terminated, remove the pending request
  514. //
  515. if ((ple == NULL) ||
  516. (ple->hResult != NOERROR))
  517. {
  518. ri.uReqID = 0;
  519. ri.uMsgID = uMsgID;
  520. g_pReqMgr->RequestDone(&ri);
  521. // Release the objects
  522. //
  523. if (pMain != NULL)
  524. pMain->Release ();
  525. if (pServer != NULL)
  526. pServer->Release ();
  527. };
  528. }
  529. else
  530. {
  531. DPRINTF1(TEXT("EnumMeetingsResult: No pending request for %x"),
  532. uMsgID);
  533. // ASSERT (0);
  534. };
  535. // Free the information buffer
  536. //
  537. if (ple != NULL)
  538. {
  539. ::MemFree (ple);
  540. };
  541. return;
  542. }
  543. #endif // ENABLE_MEETING_PLACE
  544. //****************************************************************************
  545. // void OnEnumProtocolsResult(ULONG uMsgID, PLDAP_ENUM ple)
  546. //
  547. // History:
  548. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  549. // Created.
  550. //****************************************************************************
  551. void OnEnumProtocolsResult(ULONG uMsgID, PLDAP_ENUM ple)
  552. {
  553. COM_REQ_INFO ri;
  554. ReqInfo_Init (&ri);
  555. // Look for the matching request information
  556. //
  557. ri.uReqID = 0;
  558. ri.uMsgID = uMsgID;
  559. if (SUCCEEDED(g_pReqMgr->RequestDone(&ri)))
  560. {
  561. ASSERT(WM_ILS_ENUM_PROTOCOLS == ri.uReqType);
  562. CIlsUser *pUser = ReqInfo_GetUser (&ri);
  563. ASSERT (pUser != NULL);
  564. if (pUser != NULL)
  565. {
  566. // Call the appropriate object's member
  567. //
  568. pUser->EnumProtocolsResult(ri.uReqID, ple);
  569. // Release the objects
  570. //
  571. pUser->Release();
  572. }
  573. }
  574. else
  575. {
  576. DPRINTF1(TEXT("EnumProtocolsResult: No pending request for %x"),
  577. uMsgID);
  578. // ASSERT (0);
  579. };
  580. // Free the information buffer
  581. //
  582. ::MemFree (ple);
  583. return;
  584. }
  585. //****************************************************************************
  586. // void OnResolveProtocolResult(ULONG uMsgID, PLDAP_PROTINFO_RES ppir)
  587. //
  588. // History:
  589. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  590. // Created.
  591. //****************************************************************************
  592. void OnResolveProtocolResult(ULONG uMsgID, PLDAP_PROTINFO_RES ppir)
  593. {
  594. COM_REQ_INFO ri;
  595. ReqInfo_Init (&ri);
  596. // Look for the matching request information
  597. //
  598. ri.uReqID = 0;
  599. ri.uMsgID = uMsgID;
  600. if (SUCCEEDED(g_pReqMgr->RequestDone(&ri)))
  601. {
  602. ASSERT(WM_ILS_RESOLVE_PROTOCOL == ri.uReqType);
  603. CIlsUser *pUser = ReqInfo_GetUser (&ri);
  604. ASSERT (pUser != NULL);
  605. if (pUser != NULL)
  606. {
  607. // Call the appropriate object's member
  608. //
  609. pUser->GetProtocolResult(ri.uReqID, ppir);
  610. // Release the objects
  611. //
  612. pUser->Release();
  613. }
  614. }
  615. else
  616. {
  617. DPRINTF1(TEXT("OnResolveProtocolResult: No pending request for %x"),
  618. uMsgID);
  619. // ASSERT (0);
  620. };
  621. // Free the information buffer
  622. //
  623. ::MemFree (ppir);
  624. return;
  625. }
  626. //****************************************************************************
  627. // VOID OnClientNeedRelogon ( BOOL fPrimary, VOID *pUnk)
  628. //
  629. // History:
  630. // Thur 07-Nov-1996 12:50:00 -by- Chu, Lon-Chan [lonchanc]
  631. // Created.
  632. //****************************************************************************
  633. VOID OnClientNeedRelogon ( BOOL fPrimary, VOID *pUnk)
  634. {
  635. ASSERT (pUnk != NULL);
  636. ((CIlsUser *)pUnk)->StateChanged (WM_ILS_CLIENT_NEED_RELOGON, fPrimary);
  637. }
  638. //****************************************************************************
  639. // VOID OnClientNetworkDown ( BOOL fPrimary, VOID *pUnk)
  640. //
  641. // History:
  642. // Thur 07-Nov-1996 12:50:00 -by- Chu, Lon-Chan [lonchanc]
  643. // Created.
  644. //****************************************************************************
  645. VOID OnClientNetworkDown ( BOOL fPrimary, VOID *pUnk)
  646. {
  647. ASSERT (pUnk != NULL);
  648. ((CIlsUser *)pUnk)->StateChanged (WM_ILS_CLIENT_NETWORK_DOWN, fPrimary);
  649. }
  650. //****************************************************************************
  651. // void OnResolveUserResult(ULONG uMsgID, PLDAP_CLIENTINFO_RES puir)
  652. //
  653. // History:
  654. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  655. // Created.
  656. //****************************************************************************
  657. #ifdef ENABLE_MEETING_PLACE
  658. void OnResolveMeetingPlaceResult (ULONG uMsgID, PLDAP_MEETINFO_RES pmir)
  659. {
  660. COM_REQ_INFO ri;
  661. ReqInfo_Init (&ri);
  662. // Look for the matching request information
  663. //
  664. ri.uReqID = 0;
  665. ri.uMsgID = uMsgID;
  666. if (SUCCEEDED(g_pReqMgr->RequestDone(&ri)))
  667. {
  668. ASSERT(WM_ILS_RESOLVE_MEETING == ri.uReqType);
  669. CIlsServer *pServer = ReqInfo_GetServer (&ri);
  670. CIlsMain *pMain = ReqInfo_GetMain (&ri);
  671. ASSERT (pMain != NULL && pServer != NULL);
  672. if (pMain != NULL && pServer != NULL)
  673. {
  674. // Call the appropriate object's member
  675. //
  676. pMain->GetMeetingPlaceResult(ri.uReqID, pmir, pIlsServer);
  677. // Release the objects
  678. //
  679. pServer->Release ();
  680. pMain->Release();
  681. }
  682. }
  683. else
  684. {
  685. DPRINTF1(TEXT("OnResolveMeetingPlaceResult: No pending request for %x"),
  686. uMsgID);
  687. // ASSERT (0);
  688. };
  689. // Free the information buffer
  690. //
  691. ::MemFree (pmir);
  692. return;
  693. }
  694. #endif // ENABLE_MEETING_PLACE
  695. //****************************************************************************
  696. // Routine: OnEnumMeetingPlacesResult(ULONG uMsgID, PLDAP_ENUM ple)
  697. //
  698. // Synopsis:
  699. //
  700. // Arguments:
  701. //
  702. // Returns: void
  703. //
  704. // History: 11/27/1996 Shishir Pardikar [shishirp] Created.
  705. //
  706. // Notes:
  707. //
  708. //****************************************************************************
  709. #ifdef ENABLE_MEETING_PLACE
  710. void OnEnumMeetingPlacesResult(ULONG uMsgID, PLDAP_ENUM ple)
  711. {
  712. COM_REQ_INFO ri;
  713. ReqInfo_Init (&ri);
  714. // Look for the matching request information
  715. //
  716. ri.uReqID = 0;
  717. ri.uMsgID = uMsgID;
  718. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  719. {
  720. ASSERT(WM_ILS_ENUM_MEETINGINFOS == ri.uReqType);
  721. CIlsServer *pServer = ReqInfo_GetServer (&ri);
  722. CIlsMain *pMain = ReqInfo_GetMain (&ri);
  723. ASSERT (pServer != NULL && pMain != NULL);
  724. if (pServer != NULL && pMain != NULL)
  725. {
  726. // Call the appropriate object's member
  727. //
  728. pMain->EnumMeetingPlacesResult(ri.uReqID, ple, pServer);
  729. }
  730. // If the enumeration was terminated, remove the pending request
  731. //
  732. if ((ple == NULL) ||
  733. (ple->hResult != NOERROR))
  734. {
  735. ri.uReqID = 0;
  736. ri.uMsgID = uMsgID;
  737. g_pReqMgr->RequestDone(&ri);
  738. // Release the objects
  739. //
  740. if (pMain != NULL)
  741. pMain->Release();
  742. if (pServer != NULL)
  743. pServer->Release ();
  744. };
  745. }
  746. else
  747. {
  748. DPRINTF1(TEXT("EnumMeetingsResult: No pending request for %x"),
  749. uMsgID);
  750. // ASSERT (0);
  751. };
  752. // Free the information buffer
  753. //
  754. if (ple != NULL)
  755. {
  756. ::MemFree (ple);
  757. };
  758. return;
  759. }
  760. #endif // ENABLE_MEETING_PLACE
  761. //****************************************************************************
  762. // Routine: OnEnumMeetingPlaceNamesResult(ULONG uMsgID, PLDAP_ENUM ple)
  763. //
  764. // Synopsis:
  765. //
  766. // Arguments:
  767. //
  768. // Returns: void
  769. //
  770. // History: 11/27/1996 Shishir Pardikar [shishirp] Created.
  771. //
  772. // Notes:
  773. //
  774. //****************************************************************************
  775. #ifdef ENABLE_MEETING_PLACE
  776. void OnEnumMeetingPlaceNamesResult(ULONG uMsgID, PLDAP_ENUM ple)
  777. {
  778. COM_REQ_INFO ri;
  779. ReqInfo_Init (&ri);
  780. // Look for the matching request information
  781. //
  782. ri.uReqID = 0;
  783. ri.uMsgID = uMsgID;
  784. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  785. {
  786. ASSERT(WM_ILS_ENUM_MEETINGS == ri.uReqType);
  787. // Call the appropriate object's member
  788. //
  789. CIlsMain *pMain = ReqInfo_GetMain (&ri);
  790. ASSERT (pMain != NULL);
  791. if (pMain != NULL)
  792. {
  793. pMain->EnumMeetingPlaceNamesResult(ri.uReqID, ple);
  794. }
  795. // If the enumeration was terminated, remove the pending request
  796. //
  797. if ((ple == NULL) ||
  798. (ple->hResult != NOERROR))
  799. {
  800. ri.uReqID = 0;
  801. ri.uMsgID = uMsgID;
  802. g_pReqMgr->RequestDone(&ri);
  803. // Release the objects
  804. //
  805. if (pMain != NULL)
  806. pMain->Release();
  807. };
  808. }
  809. else
  810. {
  811. DPRINTF1(TEXT("OnEnumMeetingPlaceNamesResult: No pending request for %x"),
  812. uMsgID);
  813. // ASSERT (0);
  814. };
  815. // Free the information buffer
  816. //
  817. if (ple != NULL)
  818. {
  819. ::MemFree (ple);
  820. };
  821. return;
  822. }
  823. #endif // ENABLE_MEETING_PLACE
  824. //****************************************************************************
  825. // Routine: OnRegisterMeetingPlaceResult(ULONG uMsgID, HRESULT hr)
  826. //
  827. // Synopsis:
  828. //
  829. // Arguments:
  830. //
  831. // Returns: void
  832. //
  833. // History: 11/27/1996 Shishir Pardikar [shishirp] Created.
  834. //
  835. // Notes:
  836. //
  837. //****************************************************************************
  838. #ifdef ENABLE_MEETING_PLACE
  839. VOID OnRegisterMeetingPlaceResult(ULONG uMsgID, HRESULT hr)
  840. {
  841. COM_REQ_INFO ri;
  842. ReqInfo_Init (&ri);
  843. // Look for the matching request information
  844. //
  845. ri.uReqID = 0;
  846. ri.uMsgID = uMsgID;
  847. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  848. {
  849. ASSERT(WM_ILS_REGISTER_MEETING == ri.uReqType);
  850. CIlsMeetingPlace *pMeeting = ReqInfo_GetMeeting (&ri);
  851. ASSERT (pMeeting != NULL);
  852. if (pMeeting != NULL)
  853. pMeeting->RegisterResult(ri.uReqID, hr);
  854. ri.uReqID = 0;
  855. ri.uMsgID = uMsgID;
  856. g_pReqMgr->RequestDone(&ri);
  857. // Release the objects
  858. //
  859. if (pMeeting != NULL)
  860. pMeeting->Release();
  861. }
  862. }
  863. #endif // ENABLE_MEETING_PLACE
  864. //****************************************************************************
  865. // Routine: OnUnregisterMeetingPlaceResult(ULONG uMsgID, HRESULT hr)
  866. //
  867. // Synopsis:
  868. //
  869. // Arguments:
  870. //
  871. // Returns: void
  872. //
  873. // History: 11/27/1996 Shishir Pardikar [shishirp] Created.
  874. //
  875. // Notes:
  876. //
  877. //****************************************************************************
  878. #ifdef ENABLE_MEETING_PLACE
  879. VOID OnUnregisterMeetingPlaceResult(ULONG uMsgID, HRESULT hr)
  880. {
  881. COM_REQ_INFO ri;
  882. ReqInfo_Init (&ri);
  883. // Look for the matching request information
  884. //
  885. ri.uReqID = 0;
  886. ri.uMsgID = uMsgID;
  887. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  888. {
  889. ASSERT(WM_ILS_UNREGISTER_MEETING == ri.uReqType);
  890. CIlsMeetingPlace *pMeeting = ReqInfo_GetMeeting (&ri);
  891. ASSERT (pMeeting != NULL);
  892. if (pMeeting != NULL)
  893. pMeeting->UnregisterResult(ri.uReqID, hr);
  894. ri.uReqID = 0;
  895. ri.uMsgID = uMsgID;
  896. g_pReqMgr->RequestDone(&ri);
  897. // Release the objects
  898. //
  899. if (pMeeting != NULL)
  900. pMeeting->Release();
  901. }
  902. }
  903. #endif // ENABLE_MEETING_PLACE
  904. //****************************************************************************
  905. // Routine: OnUpdateMeetingResult(ULONG uMsgID, HRESULT hr)
  906. //
  907. // Synopsis:
  908. //
  909. // Arguments:
  910. //
  911. // Returns: void
  912. //
  913. // History: 11/27/1996 Shishir Pardikar [shishirp] Created.
  914. //
  915. // Notes:
  916. //
  917. //****************************************************************************
  918. #ifdef ENABLE_MEETING_PLACE
  919. VOID OnUpdateMeetingResult(ULONG uMsgID, HRESULT hr)
  920. {
  921. COM_REQ_INFO ri;
  922. ReqInfo_Init (&ri);
  923. // Look for the matching request information
  924. //
  925. ri.uReqID = 0;
  926. ri.uMsgID = uMsgID;
  927. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  928. {
  929. ASSERT(WM_ILS_SET_MEETING_INFO == ri.uReqType);
  930. CIlsMeetingPlace *pMeeting = ReqInfo_GetMeeting (&ri);
  931. ASSERT (pMeeting != NULL);
  932. if (pMeeting != NULL)
  933. pMeeting->UpdateResult(ri.uReqID, hr);
  934. ri.uReqID = 0;
  935. ri.uMsgID = uMsgID;
  936. g_pReqMgr->RequestDone(&ri);
  937. // Release the objects
  938. //
  939. if (pMeeting != NULL)
  940. pMeeting->Release();
  941. }
  942. }
  943. #endif // ENABLE_MEETING_PLACE
  944. //****************************************************************************
  945. // Routine: OnAddAttendeeResult(ULONG uMsgID, HRESULT hr)
  946. //
  947. // Synopsis:
  948. //
  949. // Arguments:
  950. //
  951. // Returns: void
  952. //
  953. // History: 11/27/1996 Shishir Pardikar [shishirp] Created.
  954. //
  955. // Notes:
  956. //
  957. //****************************************************************************
  958. #ifdef ENABLE_MEETING_PLACE
  959. VOID OnAddAttendeeResult(ULONG uMsgID, HRESULT hr)
  960. {
  961. COM_REQ_INFO ri;
  962. ReqInfo_Init (&ri);
  963. // Look for the matching request information
  964. //
  965. ri.uReqID = 0;
  966. ri.uMsgID = uMsgID;
  967. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  968. {
  969. ASSERT(WM_ILS_ADD_ATTENDEE == ri.uReqType);
  970. CIlsMeetingPlace *pMeeting = ReqInfo_GetMeeting (&ri);
  971. ASSERT (pMeeting != NULL);
  972. if (pMeeting != NULL)
  973. pMeeting->AddAttendeeResult(ri.uReqID, hr);
  974. ri.uReqID = 0;
  975. ri.uMsgID = uMsgID;
  976. g_pReqMgr->RequestDone(&ri);
  977. // Release the objects
  978. //
  979. if (pMeeting != NULL)
  980. pMeeting->Release();
  981. }
  982. }
  983. #endif // ENABLE_MEETING_PLACE
  984. //****************************************************************************
  985. // Routine: OnRemoveAttendeeResult(ULONG uMsgID, HRESULT hr)
  986. //
  987. // Synopsis:
  988. //
  989. // Arguments:
  990. //
  991. // Returns: void
  992. //
  993. // History: 11/27/1996 Shishir Pardikar [shishirp] Created.
  994. //
  995. // Notes:
  996. //
  997. //****************************************************************************
  998. #ifdef ENABLE_MEETING_PLACE
  999. VOID OnRemoveAttendeeResult(ULONG uMsgID, HRESULT hr)
  1000. {
  1001. COM_REQ_INFO ri;
  1002. ReqInfo_Init (&ri);
  1003. // Look for the matching request information
  1004. //
  1005. ri.uReqID = 0;
  1006. ri.uMsgID = uMsgID;
  1007. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  1008. {
  1009. ASSERT(WM_ILS_REMOVE_ATTENDEE == ri.uReqType);
  1010. CIlsMeetingPlace *pMeeting = ReqInfo_GetMeeting (&ri);
  1011. ASSERT (pMeeting != NULL);
  1012. if (pMeeting != NULL)
  1013. pMeeting->RemoveAttendeeResult(ri.uReqID, hr);
  1014. ri.uReqID = 0;
  1015. ri.uMsgID = uMsgID;
  1016. g_pReqMgr->RequestDone(&ri);
  1017. // Release the objects
  1018. //
  1019. if (pMeeting != NULL)
  1020. pMeeting->Release();
  1021. }
  1022. }
  1023. #endif // ENABLE_MEETING_PLACE
  1024. //****************************************************************************
  1025. // Routine: OnEnumAttendeesResult(ULONG uMsgID, PLDAP_ENUM ple)
  1026. //
  1027. // Synopsis:
  1028. //
  1029. // Arguments:
  1030. //
  1031. // Returns: void
  1032. //
  1033. // History: 11/27/1996 Shishir Pardikar [shishirp] Created.
  1034. //
  1035. // Notes:
  1036. //
  1037. //****************************************************************************
  1038. #ifdef ENABLE_MEETING_PLACE
  1039. VOID OnEnumAttendeesResult(ULONG uMsgID, PLDAP_ENUM ple)
  1040. {
  1041. COM_REQ_INFO ri;
  1042. ReqInfo_Init (&ri);
  1043. // Look for the matching request information
  1044. //
  1045. ri.uReqID = 0;
  1046. ri.uMsgID = uMsgID;
  1047. if (SUCCEEDED(g_pReqMgr->GetRequestInfo(&ri)))
  1048. {
  1049. ASSERT(WM_ILS_ENUM_ATTENDEES == ri.uReqType);
  1050. // Call the appropriate object's member
  1051. //
  1052. CIlsMeetingPlace *pMeeting = ReqInfo_GetMeeting (&ri);
  1053. ASSERT (pMeeting != NULL);
  1054. if (pMeeting != NULL)
  1055. pMeeting->EnumAttendeeNamesResult(ri.uReqID, ple);
  1056. // If the enumeration was terminated, remove the pending request
  1057. //
  1058. if ((ple == NULL) ||
  1059. (ple->hResult != NOERROR))
  1060. {
  1061. ri.uReqID = 0;
  1062. ri.uMsgID = uMsgID;
  1063. g_pReqMgr->RequestDone(&ri);
  1064. // Release the objects
  1065. //
  1066. if (pMeeting != NULL)
  1067. pMeeting->Release();
  1068. };
  1069. }
  1070. else
  1071. {
  1072. DPRINTF1(TEXT("OnEnumUserNamesResult: No pending request for %x"),
  1073. uMsgID);
  1074. // ASSERT (0);
  1075. };
  1076. // Free the information buffer
  1077. //
  1078. if (ple != NULL)
  1079. {
  1080. ::MemFree (ple);
  1081. };
  1082. }
  1083. #endif // ENABLE_MEETING_PLACE
  1084. //****************************************************************************
  1085. // long CALLBACK ULSNotifyProc(HWND hwnd, UINT message, WPARAM wParam,
  1086. // LPARAM lParam)
  1087. //
  1088. // History:
  1089. // Wed 17-Apr-1996 11:14:03 -by- Viroon Touranachun [viroont]
  1090. // Created.
  1091. //****************************************************************************
  1092. LRESULT CALLBACK ULSNotifyProc(HWND hwnd, UINT message, WPARAM wParam,
  1093. LPARAM lParam)
  1094. {
  1095. switch (message)
  1096. {
  1097. #ifdef ENABLE_MEETING_PLACE
  1098. case WM_ILS_REGISTER_MEETING:
  1099. ::OnRegisterMeetingPlaceResult(wParam, lParam);
  1100. break;
  1101. case WM_ILS_UNREGISTER_MEETING:
  1102. ::OnUnregisterMeetingPlaceResult(wParam, lParam);
  1103. break;
  1104. case WM_ILS_SET_MEETING_INFO:
  1105. ::OnUpdateMeetingResult(wParam, lParam);
  1106. break;
  1107. case WM_ILS_ADD_ATTENDEE:
  1108. ::OnAddAttendeeResult(wParam, lParam);
  1109. break;
  1110. case WM_ILS_REMOVE_ATTENDEE:
  1111. ::OnRemoveAttendeeResult(wParam, lParam);
  1112. break;
  1113. case WM_ILS_RESOLVE_MEETING:
  1114. ::OnResolveMeetingPlaceResult (wParam, (PLDAP_MEETINFO_RES) lParam);
  1115. case WM_ILS_ENUM_MEETINGINFOS:
  1116. ::OnEnumMeetingPlacesResult(wParam, (PLDAP_ENUM)lParam);
  1117. break;
  1118. case WM_ILS_ENUM_MEETINGS:
  1119. ::OnEnumMeetingPlaceNamesResult(wParam, (PLDAP_ENUM)lParam);
  1120. break;
  1121. case WM_ILS_ENUM_ATTENDEES:
  1122. ::OnEnumAttendeesResult(wParam, (PLDAP_ENUM)lParam);
  1123. break;
  1124. #endif // ENABLE_MEETING_PLACE
  1125. case WM_ILS_REGISTER_CLIENT: // lParam = hResult
  1126. case WM_ILS_UNREGISTER_CLIENT: // lParam = hResult
  1127. ::OnRegisterResult(message, (ULONG)wParam, (HRESULT)lParam);
  1128. break;
  1129. case WM_ILS_SET_CLIENT_INFO: // lParam = hResult
  1130. ::OnSetUserInfo (message, (ULONG)wParam, (HRESULT)lParam);
  1131. break;
  1132. case WM_ILS_REGISTER_PROTOCOL: // lParam = hResult
  1133. case WM_ILS_UNREGISTER_PROTOCOL: // lParam = hResult
  1134. ::OnSetProtocol (message, (ULONG)wParam, (HRESULT)lParam);
  1135. break;
  1136. case WM_ILS_LOCAL_REGISTER: // lParam = hResult
  1137. case WM_ILS_LOCAL_UNREGISTER: // lParam = hResult
  1138. ::OnLocalRegisterResult(message, (ULONG)wParam, (HRESULT)lParam);
  1139. break;
  1140. case WM_ILS_ENUM_CLIENTS: // lParam = PLDAP_ENUM
  1141. ::OnEnumUserNamesResult((ULONG)wParam, (PLDAP_ENUM)lParam);
  1142. break;
  1143. case WM_ILS_RESOLVE_CLIENT: // lParam = PLDAP_CLIENTINFO_RES
  1144. ::OnResolveUserResult((ULONG)wParam, (PLDAP_CLIENTINFO_RES)lParam);
  1145. break;
  1146. case WM_ILS_ENUM_CLIENTINFOS: // lParam = PLDAP_ENUM
  1147. ::OnEnumUsersResult((ULONG)wParam, (PLDAP_ENUM)lParam);
  1148. break;
  1149. case WM_ILS_ENUM_PROTOCOLS: // lParam = PLDAP_ENUM
  1150. ::OnEnumProtocolsResult((ULONG)wParam, (PLDAP_ENUM)lParam);
  1151. break;
  1152. case WM_ILS_RESOLVE_PROTOCOL: // lParam = PLDAP_PROTINFO_RES
  1153. ::OnResolveProtocolResult((ULONG)wParam, (PLDAP_PROTINFO_RES)lParam);
  1154. break;
  1155. case WM_ILS_CLIENT_NEED_RELOGON: // wParam=fPrimary, lParam=Object Pointer
  1156. ::OnClientNeedRelogon ((BOOL) wParam, (VOID *) lParam);
  1157. break;
  1158. case WM_ILS_CLIENT_NETWORK_DOWN: // wParam=fPrimary, lParam=Object
  1159. ::OnClientNetworkDown ((BOOL) wParam, (VOID *) lParam);
  1160. break;
  1161. default:
  1162. return DefWindowProc(hwnd, message, wParam, lParam);
  1163. }
  1164. return 0L;
  1165. }