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.

116 lines
3.1 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1999
  5. //
  6. // File: odbc.h
  7. //
  8. // Contents: Cert Server DB includes
  9. //
  10. // History: 06-JAN-97 larrys created
  11. //
  12. //---------------------------------------------------------------------------
  13. #include <sql.h>
  14. #include <sqlext.h>
  15. #include <sqltypes.h>
  16. typedef DWORD REQID;
  17. typedef DWORD NAMEID;
  18. typedef DWORD STATUS;
  19. typedef struct _DBTABLE_RED
  20. {
  21. WCHAR const *pwszPropName;
  22. WCHAR const *pwszPropNameObjId;
  23. DWORD dwFlags;
  24. DWORD dwcbMax; // maximum allowed strlen/wcslen(value string)
  25. DWORD dwTable;
  26. WCHAR const *pwszFieldName;
  27. SWORD wCType;
  28. SWORD wSqlType;
  29. } DBTABLE_RED, *PDBTABLE_RED;
  30. /////
  31. typedef struct _DUPTABLE
  32. {
  33. CHAR const *pszFieldName;
  34. BOOL fDup;
  35. SWORD wCType;
  36. SWORD wSqlType;
  37. WCHAR const *pwszPropName;
  38. } DUPTABLE;
  39. #define TABLE_SUBJECT_NAME 105
  40. #define TABLE_ISSUER_NAME 106
  41. #define TABLE_REQUESTSUBJECT_NAME 107
  42. #define ADD_TO_ITEMSCLEAN 1
  43. #define ADD_TO_ITEMSDIRTY 2
  44. RETCODE MapPropID(
  45. IN WCHAR const *pwszPropName,
  46. IN DWORD dwFlags,
  47. OUT DBTABLE_RED *pdtout);
  48. STATUS DBStatus(RETCODE rc);
  49. void DBCheck(
  50. #if DBG_CERTSRV
  51. DWORD Line,
  52. #endif
  53. DWORD hr,
  54. void * extra);
  55. STATUS odbcInitRequestQueue(
  56. UCHAR *dsn,
  57. UCHAR *user,
  58. UCHAR *pwd);
  59. void odbcFinishRequestQueue();
  60. RETCODE odbcSPExtensionOrAttributeDB(DWORD id, DBTABLE_RED *pdtOut, UCHAR *pquery,
  61. DWORD cbInProp, BYTE const *pbInProp);
  62. RETCODE odbcGPDataFromDB(REQID ReqId, DWORD dwTable, SWORD wCType,
  63. BYTE *pbData, DWORD cbData, UCHAR *szQuery,
  64. NAMEID *pnameid, SQLLEN *poutlen);
  65. STATUS DBStatus(RETCODE rc);
  66. VOID
  67. DBCheck(
  68. RETCODE rc
  69. DBGPARM(char const *pszFile)
  70. DBGPARM(DWORD Line),
  71. HSTMT hstmt);
  72. #define ITEMINSERT(l,i) (i).itemPrev = &(l), \
  73. (i).itemNext = (l).itemNext, \
  74. (l).itemNext = (i).itemNext->itemPrev = &(i)
  75. #define ITEMREMOVE(i) (i).itemNext->itemPrev = (i).itemPrev, \
  76. (i).itemPrev->itemNext = (i).itemNext
  77. #define CDNTRTABLE (sizeof(db_dntr) / sizeof(db_dntr[0]))
  78. #define DBCHECKLINE(rc, hstmt) \
  79. DBCheck((rc) DBGPARM(__myFILE__) DBGPARM(__LINE__), (hstmt))
  80. HRESULT odbcDBEnumSetup(REQID ReqId, DWORD fExtOrAttr, HANDLE *phEnum);
  81. HRESULT odbcDBEnum(HANDLE hEnum, DWORD *pcb, WCHAR *pb);
  82. HRESULT odbcDBEnumClose(HANDLE hEnum);
  83. //DWORD odbcDBGetReqIdFromSerialNumber(char *pszSerialNumber, DWORD *ReqId);
  84. extern DBTABLE_RED const db_adtRequests[];
  85. extern DBTABLE_RED const db_adtCertificates[];
  86. extern DBTABLE_RED const db_adtNames[];
  87. extern DBTABLE_RED const db_dtExtensionFlags;
  88. extern DBTABLE_RED const db_dtExtensionValue;
  89. extern DBTABLE_RED const db_attrib;