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.

52 lines
1.0 KiB

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