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.

103 lines
2.7 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: oledbutl.hxx
  7. //
  8. // Contents: Utility object versions for ADSI row providers
  9. //
  10. // Functions:
  11. //
  12. // Notes:
  13. //
  14. //
  15. // History: 07/10/96 | RenatoB | Created, lifted most from EricJ code
  16. //-----------------------------------------------------------------------------
  17. #ifndef _OLEDBUTL_H_
  18. #define _OLEDBUTL_H_
  19. class CRowProvider;
  20. class CColumnsInfo;
  21. class CSessionObject;
  22. class CCommandObject;
  23. #ifndef NUMELEM
  24. #define NUMELEM(x) (sizeof(x)/sizeof(*x))
  25. #endif
  26. // Macros to enable catching exceptions and returning E_UNEXPECTED
  27. // for retail versions. Debug versions don't catch exceptions in
  28. // order to generate better stack traces.
  29. #if DBG == 1
  30. #define TRYBLOCK
  31. #define CATCHBLOCKRETURN
  32. #define CATCHBLOCKBAIL(hr)
  33. #else
  34. #define TRYBLOCK try {
  35. #define CATCHBLOCKRETURN } \
  36. catch (...) \
  37. { ADsAssert(false); RRETURN(E_UNEXPECTED); }
  38. #define CATCHBLOCKBAIL(hr) } \
  39. catch (...) \
  40. { ADsAssert(false); BAIL_ON_FAILURE(hr = E_UNEXPECTED); }
  41. #endif
  42. //-----------------------------------------------------------------------------
  43. // Functions
  44. //-----------------------------------------------------------------------------
  45. HRESULT
  46. CpAccessors2Rowset(
  47. IAccessor *pAccessorCommand, //@parm IN |Command's IAccessor
  48. IAccessor *pAccessorRowset, //@parm IN |Rowset's IAccessor
  49. ULONG cAccessors, //@parm IN |Count,Commnands accessors
  50. HACCESSOR rgAccessors[], //@parm IN |Array,Command's accessors
  51. CImpIAccessor *pCAccessor // accessor object of rowset
  52. );
  53. HRESULT
  54. GetDSInterface(
  55. LPWSTR lpszPath,
  56. CCredentials& Credentials,
  57. REFIID iid,
  58. void FAR * FAR * ppObject
  59. );
  60. HRESULT
  61. GetCredentialsFromIAuthenticate(IAuthenticate *pAuthenticate,
  62. CCredentials& refCredentials);
  63. typedef struct _maptype_struct_ {
  64. WORD wType;
  65. ULONG ulSize;
  66. }MAPTYPE_STRUCT;
  67. extern MAPTYPE_STRUCT g_MapADsTypeToDBType[];
  68. extern DWORD g_cMapADsTypeToDBType;
  69. extern MAPTYPE_STRUCT g_MapADsTypeToDBType2[];
  70. extern DWORD g_cMapADsTypeToDBType2;
  71. extern VARTYPE g_MapADsTypeToVarType[];
  72. extern DWORD g_cMapADsTypeToVarType;
  73. extern ADS_SEARCHPREF g_MapDBPropIdToSearchPref[];
  74. extern DWORD g_cMapDBPropToSearchPref;
  75. extern LPWSTR RemoveWhiteSpaces(LPWSTR pszText);
  76. extern STDMETHODIMP
  77. CanConvertHelper(
  78. DBTYPE wSrcType,
  79. DBTYPE wDstType,
  80. DBCONVERTFLAGS dwConvertFlags
  81. );
  82. extern BYTE SetPrecision(DBTYPE dbType);
  83. #endif // _OLEDBUTL_H_