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.

56 lines
1.2 KiB

  1. #include "priv.h"
  2. #include "atl.h"
  3. #include "nsc.h"
  4. #include "srchasst.h"
  5. //ATL support
  6. CComModule _Module; // ATL module object
  7. BEGIN_OBJECT_MAP(ObjectMap)
  8. OBJECT_ENTRY(CLSID_ShellNameSpace, CNscTree)
  9. OBJECT_ENTRY(CLSID_SearchAssistantOC, CSearchAssistantOC)
  10. END_OBJECT_MAP()
  11. STDAPI_(void) AtlInit(HINSTANCE hinst)
  12. {
  13. _Module.Init(ObjectMap, hinst);
  14. }
  15. STDAPI_(void) AtlTerm()
  16. {
  17. _Module.Term();
  18. }
  19. STDAPI AtlGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
  20. {
  21. *ppv = NULL;
  22. HRESULT hr = _Module.GetClassObject(rclsid, riid, ppv);
  23. #ifdef DEBUG
  24. //this object gets freed on DLL_PROCESS_DETACH, which happens AFTER the
  25. // mem leak check happens on exit.
  26. if (SUCCEEDED(hr))
  27. {
  28. _ASSERTE(_Module.m_pObjMap != NULL);
  29. _ATL_OBJMAP_ENTRY* pEntry = _Module.m_pObjMap;
  30. while (pEntry->pclsid != NULL)
  31. {
  32. if (InlineIsEqualGUID(rclsid, *pEntry->pclsid))
  33. {
  34. ASSERT(pEntry->pCF);
  35. break;
  36. }
  37. pEntry++;
  38. }
  39. }
  40. #endif
  41. return hr;
  42. }
  43. STDAPI_(LONG) AtlGetLockCount()
  44. {
  45. return _Module.GetLockCount();
  46. }