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.1 KiB

  1. // MMComp.cpp : Implementation of DLL Exports.
  2. #include "windows.h"
  3. #include "netres.h"
  4. #include "tchar.h"
  5. #include "getinfo.h"
  6. #include "cdnet.h"
  7. HINSTANCE g_dllInst = NULL;
  8. HINSTANCE g_hURLMon = NULL;
  9. CRITICAL_SECTION g_Critical;
  10. CRITICAL_SECTION g_BatchCrit;
  11. extern "C"
  12. HRESULT WINAPI CDNET_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void ** ppvObj)
  13. {
  14. CCDNet* pObj;
  15. HRESULT hr = E_OUTOFMEMORY;
  16. *ppvObj = NULL;
  17. if (NULL!=pUnkOuter && IID_IUnknown!=riid)
  18. {
  19. return CLASS_E_NOAGGREGATION;
  20. }
  21. pObj = new CCDNet();
  22. if (NULL==pObj)
  23. {
  24. return hr;
  25. }
  26. hr = pObj->QueryInterface(riid, ppvObj);
  27. if (FAILED(hr))
  28. {
  29. delete pObj;
  30. }
  31. return hr;
  32. }
  33. extern "C"
  34. void WINAPI CDNET_Init(HINSTANCE hInst)
  35. {
  36. g_dllInst = hInst;
  37. InitializeCriticalSection(&g_Critical);
  38. InitializeCriticalSection(&g_BatchCrit);
  39. }
  40. extern "C"
  41. void WINAPI CDNET_Uninit()
  42. {
  43. if (g_hURLMon)
  44. {
  45. FreeLibrary(g_hURLMon);
  46. }
  47. DeleteCriticalSection(&g_Critical);
  48. DeleteCriticalSection(&g_BatchCrit);
  49. }