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.

73 lines
1.5 KiB

  1. // OpenF.h : Declaration of the COpenF
  2. #ifndef __OPENF_H_
  3. #define __OPENF_H_
  4. #include "resource.h" // main symbols
  5. #include <asptlb.h> // Active Server Pages Definitions
  6. #include "OpenFilesDef.h"
  7. /////////////////////////////////////////////////////////////////////////////
  8. // COpenF
  9. class ATL_NO_VTABLE COpenF :
  10. public CComObjectRootEx<CComMultiThreadModel>,
  11. public CComCoClass<COpenF, &CLSID_OpenF>,
  12. public IDispatchImpl<IOpenF, &IID_IOpenF, &LIBID_OPENFILESLib>
  13. {
  14. public:
  15. COpenF()
  16. {
  17. hNwModule = NULL;
  18. hMacModule = NULL;
  19. FpnwFileEnum = NULL;
  20. AfpAdminConnect = NULL;
  21. AfpAdminFileEnum = NULL;
  22. }
  23. ~COpenF()
  24. {
  25. if(hNwModule!=NULL)
  26. ::FreeLibrary (hNwModule);
  27. if(hMacModule!=NULL)
  28. ::FreeLibrary (hMacModule);
  29. }
  30. public:
  31. DECLARE_REGISTRY_RESOURCEID(IDR_OPENF)
  32. DECLARE_PROTECT_FINAL_CONSTRUCT()
  33. BEGIN_COM_MAP(COpenF)
  34. COM_INTERFACE_ENTRY(IOpenF)
  35. COM_INTERFACE_ENTRY(IDispatch)
  36. END_COM_MAP()
  37. // IOpenF
  38. public:
  39. STDMETHOD(getOpenFiles)(/*[out, retval]*/ VARIANT *pOpenFiles);
  40. private:
  41. SAFEARRAYBOUND pSab[2];
  42. SAFEARRAY* pSa;
  43. HMODULE hMacModule;
  44. HMODULE hNwModule;
  45. FILEENUMPROC FpnwFileEnum;
  46. CONNECTPROC AfpAdminConnect;
  47. FILEENUMPROCMAC AfpAdminFileEnum;
  48. protected:
  49. DWORD GetNwOpenF( SAFEARRAY* pSa, DWORD dwIndex );
  50. DWORD GetNwOpenFileCount( LPDWORD lpdwCount );
  51. DWORD GetMacOpenF(SAFEARRAY * psa, DWORD dwIndex);
  52. DWORD GetMacOpenFileCount(LPDWORD count);
  53. };
  54. #endif //__OPENF_H_