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.

55 lines
1013 B

  1. //+-------------------------------------------------------------------
  2. //
  3. // File: qisrv.cxx
  4. //
  5. // Contents: This file contins the DLL entry points
  6. // DllGetClassObject
  7. // DllCanUnloadNow
  8. //
  9. // History: 30-Nov-92 Rickhi Created
  10. //
  11. //---------------------------------------------------------------------
  12. #include <common.h>
  13. #include <qicf.hxx>
  14. ULONG gUsage = 0;
  15. extern "C" BOOL WINAPI DllMain (HANDLE hDll,
  16. DWORD dwReason,
  17. LPVOID pvReserved)
  18. {
  19. return TRUE;
  20. }
  21. void GlobalRefs(BOOL fAddRef)
  22. {
  23. if (fAddRef)
  24. {
  25. gUsage++;
  26. }
  27. else
  28. {
  29. gUsage--;
  30. }
  31. }
  32. STDAPI DllCanUnloadNow(void)
  33. {
  34. return (gUsage == 0);
  35. }
  36. STDAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void FAR* FAR* ppv)
  37. {
  38. if (IsEqualCLSID(clsid, CLSID_QI) ||
  39. IsEqualCLSID(clsid, CLSID_QIHANDLER))
  40. {
  41. *ppv = (void *)(IClassFactory *) new CQIClassFactory(clsid);
  42. }
  43. else
  44. {
  45. return E_UNEXPECTED;
  46. }
  47. return S_OK;
  48. }