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.

58 lines
1.3 KiB

  1. // OBJMNGR.H: Definition of help object manager
  2. #ifndef __OBJMNGR_H__
  3. #define __OBJMNGR_H__
  4. #include <windows.h>
  5. #define OBJINST_BASE 10
  6. #define OBJINST_INCREMENT 10
  7. typedef struct tagObjInstMemRec
  8. {
  9. IUnknown *pUnknown;
  10. CLSID clsid;
  11. } OBJINSTMEMREC, *POBJINSTMEMREC;
  12. class CObjectInstHandler
  13. {
  14. public:
  15. CObjectInstHandler();
  16. ~CObjectInstHandler();
  17. STDMETHOD(AddObject)(REFCLSID clsid, DWORD *pdwObjInstance);
  18. STDMETHOD(GetObject)(DWORD dwObjInstance, REFIID riid, void **ppv);
  19. STDMETHOD(Close)(void);
  20. // Persistance Methods - IPersistStreamInit
  21. STDMETHOD(Load)(LPSTREAM pStm);
  22. STDMETHOD(Save)(LPSTREAM pStm, BOOL fClearDirty);
  23. STDMETHOD(InitNew)(void);
  24. STDMETHOD(IsDirty)(void);
  25. private:
  26. POBJINSTMEMREC m_pObjects;
  27. DWORD m_iMaxItem, m_iCurItem;
  28. HANDLE m_hMemory;
  29. BOOL m_fInitNew, m_fIsDirty;;
  30. };
  31. typedef struct tagObjInstRecord
  32. {
  33. DWORD dwOffset, dwSize;
  34. } OBJ_INSTANCE_RECORD, *POBJ_INSTANCE_RECORD;
  35. typedef struct tagObjInstHeader
  36. {
  37. DWORD dwVersion;
  38. DWORD dwEntries;
  39. }OBJ_INSTANCE_HEADER, *POBJ_INSTANCE_HEADER;
  40. typedef struct tagObjInstCache
  41. {
  42. struct tagObjInstHeader Header;
  43. HANDLE hRecords;
  44. struct tagObjInstRecord *pRecords;
  45. } OBJ_INSTANCE_CACHE, *POBJ_INSTANCE_CACHE;
  46. #endif // __OBJMNGR_H__