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.

74 lines
3.0 KiB

  1. //---------------------------------------------------------------------------
  2. // CursorBase.h : CVDCursorBase header file
  3. //
  4. // Copyright (c) 1996 Microsoft Corporation, All Rights Reserved
  5. // Developed by Sheridan Software Systems, Inc.
  6. //---------------------------------------------------------------------------
  7. #ifndef __CVDCURSORBASE__
  8. #define __CVDCURSORBASE__
  9. class CVDCursorBase : public ICursorScroll,
  10. public ISupportErrorInfo
  11. {
  12. protected:
  13. // Construction/Destruction
  14. CVDCursorBase();
  15. virtual ~CVDCursorBase();
  16. void DestroyCursorBindings(CURSOR_DBCOLUMNBINDING** ppCursorBindings,
  17. ULONG* pcBindings);
  18. protected:
  19. // Data members
  20. ULONG m_ulCursorBindings; // number of cursor column bindings
  21. CURSOR_DBCOLUMNBINDING * m_pCursorBindings; // pointer to an array of cursor column bindings
  22. VARIANT_BOOL m_fNeedVarData; // do the cursor column bindings required variable length buffer?
  23. ULONG m_cbRowLength; // fixed length buffer single row length
  24. ULONG m_cbVarRowLength; // variable length buffer single row length
  25. CVDResourceDLL * m_pResourceDLL; // pointer which keeps track of resource DLL
  26. public:
  27. // Helper functions
  28. static BOOL IsValidCursorType(DWORD dwCursorType);
  29. static BOOL DoesCursorTypeNeedVarData(DWORD dwCursorType);
  30. static ULONG GetCursorTypeLength(DWORD dwCursorType, ULONG cbMaxLen);
  31. static BOOL IsEqualCursorColumnID(const CURSOR_DBCOLUMNID& cursorColumnID1, const CURSOR_DBCOLUMNID& cursorColumnID2);
  32. static ULONG GetCursorColumnIDNameLength(const CURSOR_DBCOLUMNID& cursorColumnID);
  33. HRESULT ValidateCursorBindings(ULONG ulColumns, CVDRowsetColumn * pColumns,
  34. ULONG ulBindings, CURSOR_DBCOLUMNBINDING * pCursorBindings, ULONG cbRequestedRowLength, DWORD dwFlags,
  35. ULONG * pcbNewRowLength, ULONG * pcbNewVarRowLength);
  36. HRESULT ValidateFetchParams(CURSOR_DBFETCHROWS *pFetchParams, REFIID riid);
  37. BOOL DoCursorBindingsNeedVarData();
  38. // Other
  39. virtual BOOL SupportsScroll() {return TRUE;}
  40. //=--------------------------------------------------------------------------=
  41. // IUnknown methods implemented
  42. //
  43. STDMETHOD(QueryInterface)(REFIID riid, void **ppvObjOut);
  44. STDMETHOD_(ULONG, AddRef)(void);
  45. STDMETHOD_(ULONG, Release)(void);
  46. //=--------------------------------------------------------------------------=
  47. // ICursor methods implemented
  48. //
  49. STDMETHOD(SetBindings)(ULONG cCol, CURSOR_DBCOLUMNBINDING rgBoundColumns[], ULONG cbRowLength, DWORD dwFlags);
  50. STDMETHOD(GetBindings)(ULONG *pcCol, CURSOR_DBCOLUMNBINDING *prgBoundColumns[], ULONG *pcbRowLength);
  51. //=--------------------------------------------------------------------------=
  52. // ISupportErrorInfo methods
  53. //
  54. STDMETHOD(InterfaceSupportsErrorInfo)(THIS_ REFIID riid);
  55. };
  56. #endif //__CVDCURSORBASE__