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.

190 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 1995-2000 Microsoft Corporation
  3. Module Name:
  4. dnsclip.h
  5. Abstract:
  6. Domain Name System (DNS) Server -- Admin Client API
  7. Main header file for DNS client API library.
  8. Author:
  9. Jim Gilroy (jamesg) September 1995
  10. Revision History:
  11. --*/
  12. #ifndef _DNSCLIP_INCLUDED_
  13. #define _DNSCLIP_INCLUDED_
  14. #pragma warning(disable:4214)
  15. #pragma warning(disable:4514)
  16. #pragma warning(disable:4152)
  17. #include <nt.h>
  18. #include <ntrtl.h>
  19. #include <nturtl.h>
  20. #include <windows.h>
  21. #include <windef.h>
  22. // headers are messed up
  23. // if you bring in nt.h, then don't bring in winnt.h and
  24. // then you miss these
  25. #ifndef MAXWORD
  26. #define MINCHAR 0x80
  27. #define MAXCHAR 0x7f
  28. #define MINSHORT 0x8000
  29. #define MAXSHORT 0x7fff
  30. #define MINLONG 0x80000000
  31. #define MAXLONG 0x7fffffff
  32. #define MAXBYTE 0xff
  33. #define MAXWORD 0xffff
  34. #define MAXDWORD 0xffffffff
  35. #endif
  36. #include <winsock2.h>
  37. #include "dnsrpc_c.h" // MIDL generated RPC interface definitions
  38. #include <dnsrpc.h>
  39. #include <stdio.h>
  40. #include <stdlib.h>
  41. #include <ntdsapi.h>
  42. #define STRSAFE_NO_DEPRECATE // Do not deprecate strcpy, etc.
  43. #include <strsafe.h> // safe string functions
  44. #define NO_DNSAPI_DLL
  45. #include "dnslib.h"
  46. //
  47. // Internal routines
  48. //
  49. #ifdef __cplusplus
  50. extern "C"
  51. {
  52. #endif
  53. VOID
  54. DnssrvCopyRpcNameToBuffer(
  55. IN PSTR pResult,
  56. IN PDNS_RPC_NAME pName
  57. );
  58. PDNS_RPC_RECORD
  59. DnsConvertRecordToRpcBuffer(
  60. IN PDNS_RECORD pRecord
  61. );
  62. PVOID
  63. DnssrvMidlAllocZero(
  64. IN DWORD dwSize
  65. );
  66. PDNS_NODE
  67. DnsConvertRpcBuffer(
  68. OUT PDNS_NODE * ppNodeLast,
  69. IN DWORD dwBufferLength,
  70. IN BYTE abBuffer[],
  71. IN BOOLEAN fUnicode
  72. );
  73. DNS_STATUS
  74. DNS_API_FUNCTION
  75. DnssrvEnumRecordsStub(
  76. IN LPCSTR Server,
  77. IN LPCSTR pszNodeName,
  78. IN LPCSTR pszStartChild,
  79. IN WORD wRecordType,
  80. IN DWORD dwSelectFlag,
  81. IN OUT PDWORD pdwBufferLength,
  82. OUT PBYTE * ppBuffer
  83. );
  84. #ifdef __cplusplus
  85. }
  86. #endif // __cplusplus
  87. //
  88. // Heap routines
  89. // Use dnsapi.dll memory routines
  90. //
  91. #define ALLOCATE_HEAP(iSize) Dns_Alloc(iSize)
  92. #define ALLOCATE_HEAP_ZERO(iSize) Dns_AllocZero(iSize)
  93. #define REALLOCATE_HEAP(pMem,iSize) Dns_Realloc((pMem),(iSize))
  94. #define FREE_HEAP(pMem) Dns_Free(pMem)
  95. //
  96. // Debug stuff
  97. //
  98. #if DBG
  99. #undef ASSERT
  100. #define ASSERT( expr ) DNS_ASSERT( expr )
  101. #define DNSRPC_DEBUG_FLAG_FILE ("dnsrpc.flag")
  102. #define DNSRPC_DEBUG_FILE_NAME ("dnsrpc.log")
  103. #define DNS_DEBUG_EVENTLOG 0x00000010
  104. #define DNS_DEBUG_RPC 0x00000020
  105. #define DNS_DEBUG_STUB 0x00000040
  106. #define DNS_DEBUG_HEAP 0x00010000
  107. #define DNS_DEBUG_HEAP_CHECK 0x00020000
  108. #define DNS_DEBUG_REGISTRY 0x00080000
  109. #endif
  110. //
  111. // If you like having a local variable in functions to hold the function
  112. // name so that you can include it in debug logs without worrying about
  113. // changing all the occurences when the function is renamed, use this
  114. // at the top of the function:
  115. // DBG_FN( "MyFunction" ) <--- NOTE: no semi-colon!!
  116. //
  117. #if DBG
  118. #define DBG_FN( funcName ) static const char * fn = (funcName);
  119. #else
  120. #define DBG_FN( funcName )
  121. #endif
  122. //
  123. // Miscellaneous
  124. //
  125. #define sizeofarray( _ArrayName ) ( sizeof( _ArrayName ) / sizeof( ( _ArrayName ) [ 0 ] ) )
  126. //
  127. // Functions to get/set thread local W2K RPC bind retry flag.
  128. //
  129. VOID
  130. dnsrpcSetW2KBindFlag(
  131. BOOL newFlagValue
  132. );
  133. BOOL
  134. dnsrpcGetW2KBindFlag(
  135. VOID
  136. );
  137. #endif // _DNSCLIP_INCLUDED_