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.

63 lines
1.0 KiB

  1. /*
  2. * ICLSFACT.CPP
  3. *
  4. *
  5. *
  6. *
  7. *
  8. *
  9. */
  10. #include <windows.h>
  11. #include <hidclass.h>
  12. #include <hidsdi.h>
  13. #include <ole2.h>
  14. #include <ole2ver.h>
  15. #include "..\inc\opos.h"
  16. #include "oposctrl.h"
  17. STDMETHODIMP COPOSControl::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppvObj)
  18. {
  19. HRESULT result;
  20. Report("CreateInstance", 0);
  21. if (pUnkOuter){
  22. result = CLASS_E_NOAGGREGATION;
  23. }
  24. else {
  25. COPOSControl *oposControl = new COPOSControl;
  26. if (oposControl){
  27. /*
  28. * Get the requested interface on this object.
  29. * This also does an AddRef.
  30. */
  31. result = oposControl->QueryInterface(riid, ppvObj);
  32. }
  33. else {
  34. result = E_OUTOFMEMORY;
  35. }
  36. }
  37. Report("CreateInstance", (DWORD)result);
  38. ASSERT(result == S_OK);
  39. return result;
  40. }
  41. STDMETHODIMP COPOSControl::LockServer(int lock)
  42. {
  43. if (lock){
  44. m_serverLockCount++;
  45. }
  46. else {
  47. m_serverLockCount--;
  48. }
  49. return S_OK;
  50. }