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.

79 lines
3.7 KiB

  1. //---------------------------------------------------------------------------
  2. // MetadataCursor.h : CVDMetadataCursor header file
  3. //
  4. // Copyright (c) 1996 Microsoft Corporation, All Rights Reserved
  5. // Developed by Sheridan Software Systems, Inc.
  6. //---------------------------------------------------------------------------
  7. #ifndef __CVDMETADATACURSOR__
  8. #define __CVDMETADATACURSOR__
  9. class CVDMetadataCursor : public CVDCursorBase
  10. {
  11. protected:
  12. // Construction/Destruction
  13. CVDMetadataCursor();
  14. virtual ~CVDMetadataCursor();
  15. public:
  16. static HRESULT Create(ULONG ulColumns, CVDRowsetColumn * pColumns, ULONG ulMetaColumns, CVDRowsetColumn * pMetaColumns,
  17. CVDMetadataCursor ** ppMetadataCursor, CVDResourceDLL * pResourceDLL);
  18. protected:
  19. // Helper functions
  20. void RowToBookmark(LONG lRow, ULONG * pcbBookmark, void * pBookmark) const;
  21. BOOL BookmarkToRow(ULONG cbBookmark, void * pBookmark, LONG * plRow) const;
  22. ULONG ReturnData_I4(DWORD dwData, CURSOR_DBCOLUMNBINDING * pCursorBinding, BYTE * pData, BYTE * pVarData);
  23. ULONG ReturnData_BOOL(VARIANT_BOOL fData, CURSOR_DBCOLUMNBINDING * pCursorBinding, BYTE * pData, BYTE * pVarData);
  24. ULONG ReturnData_LPWSTR(WCHAR * pwszData, CURSOR_DBCOLUMNBINDING * pCursorBinding, BYTE * pData, BYTE * pVarData);
  25. ULONG ReturnData_DBCOLUMNID(CURSOR_DBCOLUMNID cursorColumnID, CURSOR_DBCOLUMNBINDING * pCursorBinding,
  26. BYTE * pData, BYTE * pVarData);
  27. ULONG ReturnData_Bookmark(LONG lRow, CURSOR_DBCOLUMNBINDING * pCursorBinding, BYTE * pData, BYTE * pVarData);
  28. protected:
  29. // Data members
  30. DWORD m_dwRefCount; // reference count
  31. LONG m_lCurrentRow; // current row in metadata columns
  32. ULONG m_ulColumns; // number of rowset columns
  33. CVDRowsetColumn * m_pColumns; // pointer to array of column objects
  34. ULONG m_ulMetaColumns; // number of rowset meta-columns
  35. CVDRowsetColumn * m_pMetaColumns; // pointer to array of meta-column objects
  36. public:
  37. //=--------------------------------------------------------------------------=
  38. // IUnknown methods implemented
  39. //
  40. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObjOut);
  41. STDMETHOD_(ULONG, AddRef)(void);
  42. STDMETHOD_(ULONG, Release)(void);
  43. //=--------------------------------------------------------------------------=
  44. // ICursor methods implemented
  45. //
  46. STDMETHOD(GetColumnsCursor)(REFIID riid, IUnknown **ppvColumnsCursor, ULONG *pcRows);
  47. STDMETHOD(SetBindings)(ULONG cCol, CURSOR_DBCOLUMNBINDING rgBoundColumns[], ULONG cbRowLength, DWORD dwFlags);
  48. STDMETHOD(GetNextRows)(LARGE_INTEGER udlRowsToSkip, CURSOR_DBFETCHROWS *pFetchParams);
  49. STDMETHOD(Requery)(void);
  50. //=--------------------------------------------------------------------------=
  51. // ICursorMove methods implemented
  52. //
  53. STDMETHOD(Move)(ULONG cbBookmark, void *pBookmark, LARGE_INTEGER dlOffset, CURSOR_DBFETCHROWS *pFetchParams);
  54. STDMETHOD(GetBookmark)(CURSOR_DBCOLUMNID *pBookmarkType, ULONG cbMaxSize, ULONG *pcbBookmark, void *pBookmark);
  55. STDMETHOD(Clone)(DWORD dwFlags, REFIID riid, IUnknown **ppvClonedCursor);
  56. //=--------------------------------------------------------------------------=
  57. // ICursorScroll methods implemented
  58. //
  59. STDMETHOD(Scroll)(ULONG ulNumerator, ULONG ulDenominator, CURSOR_DBFETCHROWS *pFetchParams);
  60. STDMETHOD(GetApproximatePosition)(ULONG cbBookmark, void *pBookmark, ULONG *pulNumerator, ULONG *pulDenominator);
  61. STDMETHOD(GetApproximateCount)(LARGE_INTEGER *pudlApproxCount, DWORD *pdwFullyPopulated);
  62. };
  63. #endif //__CVDMETADATACURSOR__