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.

46 lines
760 B

  1. // DLLMAIN: Entry points for COM object dll
  2. #include "precomp.h"
  3. #include "optres.h"
  4. #include "tchar.h"
  5. #include "cdoptimp.h"
  6. #include "cddata.h"
  7. extern "C"
  8. HRESULT WINAPI CDOPT_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void ** ppvObj)
  9. {
  10. LPUNKNOWN pObj;
  11. HRESULT hr = E_OUTOFMEMORY;
  12. *ppvObj = NULL;
  13. if (NULL!=pUnkOuter && IID_IUnknown!=riid)
  14. {
  15. return CLASS_E_NOAGGREGATION;
  16. }
  17. if (IID_ICDData == riid)
  18. {
  19. pObj = (LPUNKNOWN) new CCDData();
  20. }
  21. else if (IID_ICDOpt == riid)
  22. {
  23. pObj = (LPUNKNOWN) new CCDOpt();
  24. }
  25. if (NULL==pObj)
  26. {
  27. return hr;
  28. }
  29. hr = pObj->QueryInterface(riid, ppvObj);
  30. if (FAILED(hr))
  31. {
  32. delete pObj;
  33. }
  34. return hr;
  35. }