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.

162 lines
6.2 KiB

  1. //---------------------------------------------------------------------------
  2. // ErrorInf.h
  3. //
  4. // Copyright (c) 1996 Microsoft Corporation, All Rights Reserved
  5. // Developed by Sheridan Software Systems, Inc.
  6. //---------------------------------------------------------------------------
  7. #ifndef __VDSETERRORINFO__
  8. #define __VDSETERRORINFO__
  9. //=--------------------------------------------------------------------------=
  10. // CVDResourceDLL
  11. //=--------------------------------------------------------------------------=
  12. // Keeps track of the resource DLL for error strings
  13. //
  14. class CVDResourceDLL
  15. {
  16. public:
  17. CVDResourceDLL(LCID lcid);
  18. virtual ~CVDResourceDLL();
  19. int LoadString(UINT uID, // resource identifier
  20. LPTSTR lpBuffer, // address of buffer for resource
  21. int nBufferMax); // size of buffer
  22. protected:
  23. LCID m_lcid; // passed in to the constructor
  24. HINSTANCE m_hinstance;
  25. };
  26. //=--------------------------------------------------------------------------=
  27. // VDSetErrorInfo
  28. //=--------------------------------------------------------------------------=
  29. // Sets rich error info.
  30. //
  31. // Parameters:
  32. // nErrStringResID - [in] The resource ID of the error string
  33. // riid - [in] The guid of the interface that will used in
  34. // the ICreateErrorInfo::SetGUID method
  35. // pResDLL - [in] A pointer to the CVDResourceDLL object
  36. // that keeps track of the resource DLL
  37. // for error strings
  38. //
  39. void VDSetErrorInfo(UINT nErrStringResID,
  40. REFIID riid,
  41. CVDResourceDLL * pResDLL);
  42. //=--------------------------------------------------------------------------=
  43. // VDCheckErrorInfo
  44. //=--------------------------------------------------------------------------=
  45. // Checks if rich error info is already available, otherwise it supplies it
  46. //
  47. // Parameters:
  48. // nErrStringResID - [in] The resource ID of the error string
  49. // riid - [in] The guid of the interface that will used in
  50. // the ICreateErrorInfo::SetGUID method
  51. // punkSource - [in] The interface that generated the error.
  52. // (e.g. a call to ICursorFind)
  53. // riidSource - [in] The interface ID of the interface that
  54. // generated the error. If punkSource is not
  55. // NULL then this guid is passed into the
  56. // ISupportErrorInfo::InterfaceSupportsErrorInfo
  57. // method.
  58. // pResDLL - [in] A pointer to the CVDResourceDLL object
  59. // that keeps track of the resource DLL
  60. // for error strings
  61. //
  62. void VDCheckErrorInfo(UINT nErrStringResID,
  63. REFIID riid,
  64. LPUNKNOWN punkSource,
  65. REFIID riidSource,
  66. CVDResourceDLL * pResDLL);
  67. //=--------------------------------------------------------------------------=
  68. // VDGetErrorInfo
  69. //=--------------------------------------------------------------------------=
  70. // if available, gets rich error info from supplied interface
  71. //
  72. // Parameters:
  73. // punkSource - [in] The interface that generated the error.
  74. // (e.g. a call to ICursorFind)
  75. // riidSource - [in] The interface ID of the interface that
  76. // generated the error. If punkSource is not
  77. // NULL then this guid is passed into the
  78. // ISupportErrorInfo::InterfaceSupportsErrorInfo
  79. // method.
  80. // pbstrErrorDesc - [out] a pointer to memory in which to return
  81. // error description BSTR.
  82. //
  83. // Note - this function is no longer used, however it might be useful in
  84. // the future so it was not permanently removed.
  85. //
  86. //* HRESULT VDGetErrorInfo(LPUNKNOWN punkSource,
  87. //* REFIID riidSource,
  88. //* BSTR * pbstrErrorDesc);
  89. //=--------------------------------------------------------------------------=
  90. // VDMapCursorHRtoRowsetHR
  91. //=--------------------------------------------------------------------------=
  92. // Translates an ICursor HRESULT to an IRowset HRESULT
  93. //
  94. // Parameters:
  95. // nErrStringResID - [in] ICursor HRESULT
  96. // nErrStringResID - [in] The resource ID of the error string
  97. // riid - [in] The guid of the interface that will used in
  98. // the ICreateErrorInfo::SetGUID method
  99. // punkSource - [in] The interface that generated the error.
  100. // (e.g. a call to ICursorFind)
  101. // riidSource - [in] The interface ID of the interface that
  102. // generated the error. If punkSource is not
  103. // NULL then this guid is passed into the
  104. // ISupportErrorInfo::InterfaceSupportsErrorInfo
  105. // method.
  106. // pResDLL - [in] A pointer to the CVDResourceDLL object
  107. // that keeps track of the resource DLL
  108. // for error strings
  109. //
  110. // Output:
  111. // HRESULT - Translated IRowset HRESULT
  112. //
  113. HRESULT VDMapCursorHRtoRowsetHR(HRESULT hr,
  114. UINT nErrStringResIDFailed,
  115. REFIID riid,
  116. LPUNKNOWN punkSource,
  117. REFIID riidSource,
  118. CVDResourceDLL * pResDLL);
  119. //=--------------------------------------------------------------------------=
  120. // VDMapRowsetHRtoCursorHR
  121. //=--------------------------------------------------------------------------=
  122. // Translates an IRowset HRESULT to an ICursor HRESULT
  123. //
  124. // Parameters:
  125. // hr - [in] IRowset HRESULT
  126. // nErrStringResID - [in] The resource ID of the error string
  127. // riid - [in] The guid of the interface that will used in
  128. // the ICreateErrorInfo::SetGUID method
  129. // punkSource - [in] The interface that generated the error.
  130. // (e.g. a call to IRowsetFind)
  131. // riidSource - [in] The interface ID of the interface that
  132. // generated the error. If punkSource is not
  133. // NULL then this guid is passed into the
  134. // ISupportErrorInfo::InterfaceSupportsErrorInfo
  135. // method.
  136. // pResDLL - [in] A pointer to the CVDResourceDLL object
  137. // that keeps track of the resource DLL
  138. // for error strings
  139. //
  140. // Output:
  141. // HRESULT - Translated ICursor HRESULT
  142. //
  143. HRESULT VDMapRowsetHRtoCursorHR(HRESULT hr,
  144. UINT nErrStringResIDFailed,
  145. REFIID riid,
  146. LPUNKNOWN punkSource,
  147. REFIID riidSource,
  148. CVDResourceDLL * pResDLL);
  149. /////////////////////////////////////////////////////////////////////////////
  150. #endif //__VDSETERRORINFO__