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.

52 lines
1.5 KiB

  1. // DBIMP.H: Definition of CDatabase
  2. #ifndef __DBIMP_H__
  3. #define __DBIMP_H__
  4. #include "verinfo.h"
  5. #include "objmngr.h"
  6. // DATABASEINFO now defined in wwheel.h
  7. class CITDatabaseLocal :
  8. public IITDatabase,
  9. public IPersistStorage,
  10. public CComObjectRootEx<CComMultiThreadModel>,
  11. public CComCoClass<CITDatabaseLocal,&CLSID_IITDatabaseLocal>
  12. {
  13. public:
  14. CITDatabaseLocal();
  15. virtual ~CITDatabaseLocal();
  16. BEGIN_COM_MAP(CITDatabaseLocal)
  17. COM_INTERFACE_ENTRY(IITDatabase)
  18. COM_INTERFACE_ENTRY(IPersistStorage)
  19. END_COM_MAP()
  20. DECLARE_REGISTRY(CLSID_IITDatabaseLocal, "ITIR.LocalDatabase.4", "ITIR.LocalDatabase", 0, THREADFLAGS_BOTH )
  21. // IITDatabase Methods
  22. STDMETHOD(Open)(LPCWSTR lpszHost, LPCWSTR lpszMoniker, DWORD dwFlags);
  23. STDMETHOD(Close)(void);
  24. STDMETHOD(CreateObject)(REFCLSID rclsid, DWORD *pdwObjInstance);
  25. STDMETHOD(GetObject)(DWORD dwObjInstance, REFIID riid, LPVOID *ppvObj);
  26. STDMETHOD(GetObjectPersistence)(LPCWSTR lpwszObject, DWORD dwObjInstance,
  27. LPVOID *ppvPersistence,
  28. BOOL fStream);
  29. // IPersistStorage Methods
  30. STDMETHOD(GetClassID)(CLSID *pclsid);
  31. STDMETHOD(InitNew)(IStorage *pStorage);
  32. STDMETHOD(IsDirty)(void);
  33. STDMETHOD(Load)(IStorage *pStorage);
  34. STDMETHOD(Save)(IStorage *pStorage, BOOL fSameAsLoad);
  35. STDMETHOD(SaveCompleted)(IStorage *pStorageNew);
  36. STDMETHOD(HandsOffStorage)(void);
  37. private:
  38. CObjectInstHandler m_ObjInst;
  39. IStorage* m_pStorage;
  40. _ThreadModel::AutoCriticalSection m_cs; // Critical section obj.
  41. };
  42. #endif