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.

122 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. oledserr.h
  5. Abstract:
  6. Contains the entry point for
  7. ADsGetLastError
  8. ADsSetLastError
  9. ADsFreeAllErrorRecords
  10. Author:
  11. Ram Viswanathan (ramv) 20-Sep-1996
  12. Environment:
  13. User Mode - Win32
  14. ---*/
  15. #ifndef _OLEDSERR_H_INCLUDED_
  16. #define _OLEDSERR_H_INCLUDED_
  17. #ifdef _cplusplus
  18. extern "C" {
  19. #endif
  20. HRESULT
  21. ADsGetLastError(
  22. OUT LPDWORD lpError,
  23. OUT LPWSTR lpErrorBuf,
  24. IN DWORD dwErrorBufLen,
  25. OUT LPWSTR lpNameBuf,
  26. IN DWORD dwNameBufLen
  27. );
  28. VOID
  29. ADsSetLastError(
  30. IN DWORD dwErr,
  31. IN LPCWSTR pszError,
  32. IN LPCWSTR pszProvider
  33. );
  34. VOID
  35. ADsFreeAllErrorRecords(
  36. VOID
  37. );
  38. //=======================
  39. // Data Structures
  40. //=======================
  41. typedef struct _ERROR_RECORD {
  42. struct _ERROR_RECORD *Prev;
  43. struct _ERROR_RECORD *Next;
  44. DWORD dwThreadId;
  45. DWORD dwErrorCode;
  46. LPWSTR pszErrorText; // This is an allocated buffer
  47. LPWSTR pszProviderName; // This is an allocated buffer
  48. } ERROR_RECORD, *LPERROR_RECORD;
  49. //
  50. // Global Data Structures
  51. //
  52. extern
  53. ERROR_RECORD ADsErrorRecList; // Initialized to zeros by loader
  54. extern
  55. CRITICAL_SECTION ADsErrorRecCritSec; // Initialized in libmain.cxx
  56. //=======================
  57. // MACROS
  58. //=======================
  59. #define FIND_END_OF_LIST(record) while(record->Next != NULL) { \
  60. record=record->Next; \
  61. }
  62. #define REMOVE_FROM_LIST(record) record->Prev->Next = record->Next; \
  63. if (record->Next != NULL) { \
  64. record->Next->Prev = record->Prev; \
  65. }
  66. #define ADD_TO_LIST(record, newRec) FIND_END_OF_LIST(record) \
  67. record->Next = newRec; \
  68. newRec->Prev = record; \
  69. newRec->Next = NULL;
  70. //
  71. // Local Functions
  72. //
  73. LPERROR_RECORD
  74. ADsAllocErrorRecord(
  75. VOID);
  76. LPERROR_RECORD
  77. ADsFindErrorRecord(
  78. VOID);
  79. VOID
  80. ADsFreeThreadErrorRecords(
  81. VOID);
  82. #ifdef _cplusplus
  83. }
  84. #endif
  85. #endif