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.

132 lines
8.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: cjetblue.hxx
  8. //
  9. // Contents: Microsoft Internet Security Common
  10. //
  11. // History: 23-Oct-1997 pberkman created
  12. //
  13. //--------------------------------------------------------------------------
  14. #ifndef CJETBLUE_HXX
  15. #define CJETBLUE_HXX
  16. #include "jet.h"
  17. typedef JET_ERR (JET_API *td_JetInit)(JET_INSTANCE *pinstance);
  18. typedef JET_ERR (JET_API *td_JetTerm)(JET_INSTANCE instance);
  19. typedef JET_ERR (JET_API *td_JetSetSystemParameter)(JET_INSTANCE *pinstance, JET_SESID sesid, unsigned long paramid,
  20. unsigned long lParam, const char *sz);
  21. typedef JET_ERR (JET_API *td_JetBeginSession)( JET_INSTANCE instance, JET_SESID *psesid, const char *szUserName,
  22. const char *szPassword);
  23. typedef JET_ERR (JET_API *td_JetCreateDatabase)(JET_SESID sesid, const char *szFilename, const char *szConnect,
  24. JET_DBID *pdbid, JET_GRBIT grbit);
  25. typedef JET_ERR (JET_API *td_JetAttachDatabase)(JET_SESID sesid, const char *szFilename, JET_GRBIT grbit);
  26. typedef JET_ERR (JET_API *td_JetDetachDatabase)(JET_SESID sesid, const char *szFilename);
  27. typedef JET_ERR (JET_API *td_JetCreateTable)(JET_SESID sesid, JET_DBID dbid, const char *szTableName,
  28. unsigned long lPages, unsigned long lDensity, JET_TABLEID *ptableid);
  29. typedef JET_ERR (JET_API *td_JetCreateTableColumnIndex)(JET_SESID sesid, JET_DBID dbid, JET_TABLECREATE *ptablecreate);
  30. typedef JET_ERR (JET_API *td_JetCloseDatabase)(JET_SESID sesid, JET_DBID dbid, JET_GRBIT grbit);
  31. typedef JET_ERR (JET_API *td_JetCloseTable)(JET_SESID sesid, JET_TABLEID tableid);
  32. typedef JET_ERR (JET_API *td_JetOpenDatabase)(JET_SESID sesid, const char *szFilename, const char *szConnect,
  33. JET_DBID *pdbid, JET_GRBIT grbit);
  34. typedef JET_ERR (JET_API *td_JetOpenTable)(JET_SESID sesid, JET_DBID dbid, const char *szTableName,
  35. const void *pvParameters, unsigned long cbParameters,
  36. JET_GRBIT grbit, JET_TABLEID *ptableid);
  37. typedef JET_ERR (JET_API *td_JetBeginTransaction)(JET_SESID sesid);
  38. typedef JET_ERR (JET_API *td_JetCommitTransaction)(JET_SESID sesid, JET_GRBIT grbit);
  39. typedef JET_ERR (JET_API *td_JetRetrieveColumns)(JET_SESID sesid, JET_TABLEID tableid,
  40. JET_RETRIEVECOLUMN *pretrievecolumn, unsigned long cretrievecolumn);
  41. typedef JET_ERR (JET_API *td_JetSetColumns)(JET_SESID sesid, JET_TABLEID tableid, JET_SETCOLUMN *psetcolumn,
  42. unsigned long csetcolumn);
  43. typedef JET_ERR (JET_API *td_JetPrepareUpdate)(JET_SESID sesid, JET_TABLEID tableid, unsigned long prep);
  44. typedef JET_ERR (JET_API *td_JetSetCurrentIndex2)(JET_SESID sesid, JET_TABLEID tableid, const char *szIndexName,
  45. JET_GRBIT grbit);
  46. typedef JET_ERR (JET_API *td_JetMove)(JET_SESID sesid, JET_TABLEID tableid, long cRow, JET_GRBIT grbit);
  47. typedef JET_ERR (JET_API *td_JetMakeKey)(JET_SESID sesid, JET_TABLEID tableid, const void *pvData,
  48. unsigned long cbData, JET_GRBIT grbit);
  49. typedef JET_ERR (JET_API *td_JetSeek)(JET_SESID sesid, JET_TABLEID tableid, JET_GRBIT grbit);
  50. class cJetBlue_
  51. {
  52. public:
  53. cJetBlue_(void);
  54. virtual ~cJetBlue_(void);
  55. protected:
  56. JET_ERR JetInit(JET_INSTANCE *pinstance);
  57. JET_ERR JetTerm(JET_INSTANCE instance);
  58. JET_ERR JetSetSystemParameter(JET_INSTANCE *pinstance, JET_SESID sesid,
  59. unsigned long paramid, unsigned long lParam,
  60. const char *sz);
  61. JET_ERR JetBeginSession(JET_INSTANCE instance, JET_SESID *psesid,
  62. const char *szUserName, const char *szPassword);
  63. JET_ERR JetCreateDatabase(JET_SESID sesid, const char *szFilename, const char *szConnect,
  64. JET_DBID *pdbid, JET_GRBIT grbit);
  65. JET_ERR JetAttachDatabase(JET_SESID sesid, const char *szFilename, JET_GRBIT grbit);
  66. JET_ERR JetDetachDatabase(JET_SESID sesid, const char *szFilename);
  67. JET_ERR JetCreateTable(JET_SESID sesid, JET_DBID dbid,
  68. const char *szTableName, unsigned long lPages, unsigned long lDensity,
  69. JET_TABLEID *ptableid);
  70. JET_ERR JetCreateTableColumnIndex(JET_SESID sesid, JET_DBID dbid,
  71. JET_TABLECREATE *ptablecreate);
  72. JET_ERR JetCloseDatabase(JET_SESID sesid, JET_DBID dbid, JET_GRBIT grbit);
  73. JET_ERR JetCloseTable(JET_SESID sesid, JET_TABLEID tableid);
  74. JET_ERR JetOpenDatabase(JET_SESID sesid, const char *szFilename, const char *szConnect,
  75. JET_DBID *pdbid, JET_GRBIT grbit);
  76. JET_ERR JetOpenTable(JET_SESID sesid, JET_DBID dbid, const char *szTableName,
  77. const void *pvParameters, unsigned long cbParameters,
  78. JET_GRBIT grbit, JET_TABLEID *ptableid);
  79. JET_ERR JetBeginTransaction(JET_SESID sesid);
  80. JET_ERR JetCommitTransaction(JET_SESID sesid, JET_GRBIT grbit);
  81. JET_ERR JetRetrieveColumns(JET_SESID sesid, JET_TABLEID tableid,
  82. JET_RETRIEVECOLUMN *pretrievecolumn,
  83. unsigned long cretrievecolumn);
  84. JET_ERR JetSetColumns(JET_SESID sesid, JET_TABLEID tableid, JET_SETCOLUMN *psetcolumn,
  85. unsigned long csetcolumn);
  86. JET_ERR JetPrepareUpdate(JET_SESID sesid, JET_TABLEID tableid, unsigned long prep);
  87. JET_ERR JetSetCurrentIndex2(JET_SESID sesid, JET_TABLEID tableid, const char *szIndexName,
  88. JET_GRBIT grbit);
  89. JET_ERR JetMove(JET_SESID sesid, JET_TABLEID tableid, long cRow, JET_GRBIT grbit);
  90. JET_ERR JetMakeKey(JET_SESID sesid, JET_TABLEID tableid, const void *pvData,
  91. unsigned long cbData, JET_GRBIT grbit);
  92. JET_ERR JetSeek(JET_SESID sesid, JET_TABLEID tableid, JET_GRBIT grbit);
  93. private:
  94. HINSTANCE hJet;
  95. td_JetInit fp_JetInit;
  96. td_JetTerm fp_JetTerm;
  97. td_JetSetSystemParameter fp_JetSetSystemParameter;
  98. td_JetBeginSession fp_JetBeginSession;
  99. td_JetCreateDatabase fp_JetCreateDatabase;
  100. td_JetAttachDatabase fp_JetAttachDatabase;
  101. td_JetDetachDatabase fp_JetDetachDatabase;
  102. td_JetCreateTable fp_JetCreateTable;
  103. td_JetCreateTableColumnIndex fp_JetCreateTableColumnIndex;
  104. td_JetCloseDatabase fp_JetCloseDatabase;
  105. td_JetCloseTable fp_JetCloseTable;
  106. td_JetOpenDatabase fp_JetOpenDatabase;
  107. td_JetOpenTable fp_JetOpenTable;
  108. td_JetBeginTransaction fp_JetBeginTransaction;
  109. td_JetCommitTransaction fp_JetCommitTransaction;
  110. td_JetRetrieveColumns fp_JetRetrieveColumns;
  111. td_JetSetColumns fp_JetSetColumns;
  112. td_JetPrepareUpdate fp_JetPrepareUpdate;
  113. td_JetSetCurrentIndex2 fp_JetSetCurrentIndex2;
  114. td_JetMove fp_JetMove;
  115. td_JetMakeKey fp_JetMakeKey;
  116. td_JetSeek fp_JetSeek;
  117. BOOL CheckOrLoadFunc(void **fp, char *pszfunc);
  118. };
  119. #endif // CJETBLUE_HXX