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.

268 lines
6.7 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name :
  4. dynodbc.h
  5. Abstract:
  6. This header declares functions for dynamically loading ODBC.
  7. Author:
  8. Murali R. Krishnan ( MuraliK ) 3-Nov-1995
  9. Environment:
  10. Win32 -- User Mode
  11. Project:
  12. Revision History:
  13. kyleg 1/9/96 Added SQLConfigDatasource from odbc installer
  14. currently only used in NEWDSN.C
  15. --*/
  16. # ifndef _DYNODBC_H_
  17. # define _DYNODBC_H_
  18. /************************************************************
  19. * Include Headers
  20. ************************************************************/
  21. //
  22. // SQL-ODBC interface headers
  23. //
  24. # include "sql.h"
  25. # include "sqlext.h"
  26. # include <odbcinst.h>
  27. /************************************************************
  28. * Dynamic Load support
  29. ************************************************************/
  30. BOOL
  31. DynLoadODBC(
  32. VOID
  33. );
  34. //
  35. // Prototypes form sql.h
  36. //
  37. typedef RETCODE (SQL_API * pfnSQLAllocConnect)(
  38. HENV henv,
  39. HDBC FAR *phdbc);
  40. typedef RETCODE (SQL_API * pfnSQLAllocEnv)(
  41. HENV FAR *phenv);
  42. typedef RETCODE (SQL_API * pfnSQLAllocStmt)(
  43. HDBC hdbc,
  44. HSTMT FAR *phstmt);
  45. typedef RETCODE (SQL_API * pfnSQLBindCol)(
  46. HSTMT hstmt,
  47. UWORD icol,
  48. SWORD fCType,
  49. PTR rgbValue,
  50. SDWORD cbValueMax,
  51. SDWORD FAR *pcbValue);
  52. typedef RETCODE (SQL_API * pfnSQLCancel)(
  53. HSTMT hstmt);
  54. typedef RETCODE (SQL_API * pfnSQLColAttributes)(
  55. HSTMT hstmt,
  56. UWORD icol,
  57. UWORD fDescType,
  58. PTR rgbDesc,
  59. SWORD cbDescMax,
  60. SWORD FAR *pcbDesc,
  61. SDWORD FAR *pfDesc);
  62. typedef RETCODE (SQL_API * pfnSQLConnect)(
  63. HDBC hdbc,
  64. UCHAR FAR *szDSN,
  65. SWORD cbDSN,
  66. UCHAR FAR *szUID,
  67. SWORD cbUID,
  68. UCHAR FAR *szAuthStr,
  69. SWORD cbAuthStr);
  70. typedef RETCODE (SQL_API * pfnSQLDescribeCol)(
  71. HSTMT hstmt,
  72. UWORD icol,
  73. UCHAR FAR *szColName,
  74. SWORD cbColNameMax,
  75. SWORD FAR *pcbColName,
  76. SWORD FAR *pfSqlType,
  77. UDWORD FAR *pcbColDef,
  78. SWORD FAR *pibScale,
  79. SWORD FAR *pfNullable);
  80. typedef RETCODE (SQL_API * pfnSQLDisconnect)(
  81. HDBC hdbc);
  82. typedef RETCODE (SQL_API * pfnSQLError)(
  83. HENV henv,
  84. HDBC hdbc,
  85. HSTMT hstmt,
  86. UCHAR FAR *szSqlState,
  87. SDWORD FAR *pfNativeError,
  88. UCHAR FAR *szErrorMsg,
  89. SWORD cbErrorMsgMax,
  90. SWORD FAR *pcbErrorMsg);
  91. typedef RETCODE (SQL_API * pfnSQLExecDirect)(
  92. HSTMT hstmt,
  93. UCHAR FAR *szSqlStr,
  94. SDWORD cbSqlStr);
  95. typedef RETCODE (SQL_API * pfnSQLExecute)(
  96. HSTMT hstmt);
  97. typedef RETCODE (SQL_API * pfnSQLFetch)(
  98. HSTMT hstmt);
  99. typedef RETCODE (SQL_API * pfnSQLFreeConnect)(
  100. HDBC hdbc);
  101. typedef RETCODE (SQL_API * pfnSQLFreeEnv)(
  102. HENV henv);
  103. typedef RETCODE (SQL_API * pfnSQLFreeStmt)(
  104. HSTMT hstmt,
  105. UWORD fOption);
  106. typedef RETCODE (SQL_API * pfnSQLGetCursorName)(
  107. HSTMT hstmt,
  108. UCHAR FAR *szCursor,
  109. SWORD cbCursorMax,
  110. SWORD FAR *pcbCursor);
  111. typedef RETCODE (SQL_API * pfnSQLNumResultCols)(
  112. HSTMT hstmt,
  113. SWORD FAR *pccol);
  114. typedef RETCODE (SQL_API * pfnSQLPrepare)(
  115. HSTMT hstmt,
  116. UCHAR FAR *szSqlStr,
  117. SDWORD cbSqlStr);
  118. typedef RETCODE (SQL_API * pfnSQLRowCount)(
  119. HSTMT hstmt,
  120. SDWORD FAR *pcrow);
  121. typedef RETCODE (SQL_API * pfnSQLSetCursorName)(
  122. HSTMT hstmt,
  123. UCHAR FAR *szCursor,
  124. SWORD cbCursor);
  125. typedef RETCODE (SQL_API * pfnSQLTransact)(
  126. HENV henv,
  127. HDBC hdbc,
  128. UWORD fType);
  129. //
  130. // Prototypes form sqlext.h
  131. //
  132. typedef RETCODE (SQL_API * pfnSQLSetConnectOption)(
  133. HDBC hdbc,
  134. UWORD fOption,
  135. UDWORD vParam);
  136. typedef RETCODE (SQL_API * pfnSQLDrivers)(
  137. HENV henv,
  138. UWORD fDirection,
  139. UCHAR FAR *szDriverDesc,
  140. SWORD cbDriverDescMax,
  141. SWORD FAR *pcbDriverDesc,
  142. UCHAR FAR *szDriverAttributes,
  143. SWORD cbDrvrAttrMax,
  144. SWORD FAR *pcbDrvrAttr);
  145. typedef RETCODE (SQL_API * pfnSQLBindParameter)(
  146. HSTMT hstmt,
  147. UWORD ipar,
  148. SWORD fParamType,
  149. SWORD fCType,
  150. SWORD fSqlType,
  151. UDWORD cbColDef,
  152. SWORD ibScale,
  153. PTR rgbValue,
  154. SDWORD cbValueMax,
  155. SDWORD FAR *pcbValue);
  156. typedef RETCODE (SQL_API * pfnSQLDataSources)(
  157. HENV henv,
  158. UWORD fDirection,
  159. UCHAR FAR *szDSN,
  160. SWORD cbDSNMax,
  161. SWORD FAR *pcbDSN,
  162. UCHAR FAR *szDescription,
  163. SWORD cbDescriptionMax,
  164. SWORD FAR *pcbDescription);
  165. typedef BOOL (INSTAPI * pfnSQLConfigDataSource) (
  166. HWND hwndParent,
  167. WORD fRequest,
  168. LPCSTR lpszDriver,
  169. LPCSTR lpszAttributes);
  170. /************************************************************
  171. * Variables
  172. ************************************************************/
  173. //
  174. // ODBC DLL Entry Points, fill by calling LoadODBC
  175. //
  176. extern pfnSQLAllocConnect pSQLAllocConnect ;
  177. extern pfnSQLAllocEnv pSQLAllocEnv ;
  178. extern pfnSQLAllocStmt pSQLAllocStmt ;
  179. extern pfnSQLBindCol pSQLBindCol ;
  180. extern pfnSQLCancel pSQLCancel ;
  181. extern pfnSQLColAttributes pSQLColAttributes ;
  182. extern pfnSQLConnect pSQLConnect ;
  183. extern pfnSQLDescribeCol pSQLDescribeCol ;
  184. extern pfnSQLDisconnect pSQLDisconnect ;
  185. extern pfnSQLError pSQLError ;
  186. extern pfnSQLExecDirect pSQLExecDirect ;
  187. extern pfnSQLExecute pSQLExecute ;
  188. extern pfnSQLFetch pSQLFetch ;
  189. extern pfnSQLFreeConnect pSQLFreeConnect ;
  190. extern pfnSQLFreeEnv pSQLFreeEnv ;
  191. extern pfnSQLFreeStmt pSQLFreeStmt ;
  192. extern pfnSQLGetCursorName pSQLGetCursorName ;
  193. extern pfnSQLNumResultCols pSQLNumResultCols ;
  194. extern pfnSQLPrepare pSQLPrepare ;
  195. extern pfnSQLRowCount pSQLRowCount ;
  196. extern pfnSQLSetCursorName pSQLSetCursorName ;
  197. extern pfnSQLTransact pSQLTransact ;
  198. extern pfnSQLSetConnectOption pSQLSetConnectOption;
  199. extern pfnSQLDrivers pSQLDrivers ;
  200. extern pfnSQLDataSources pSQLDataSources ;
  201. extern pfnSQLBindParameter pSQLBindParameter ;
  202. /* from odbcinst.h*/
  203. extern pfnSQLConfigDataSource pSQLConfigDataSource;
  204. # endif // _DYNODBC_H_
  205. /************************ End of File ***********************/