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.

159 lines
3.2 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. #define NO_DNSAPI_DLL
  42. #include "dnslib.h"
  43. //
  44. // Internal routines
  45. //
  46. #ifdef __cplusplus
  47. extern "C"
  48. {
  49. #endif
  50. VOID
  51. DnssrvCopyRpcNameToBuffer(
  52. IN PSTR pResult,
  53. IN PDNS_RPC_NAME pName
  54. );
  55. PDNS_RPC_RECORD
  56. DnsConvertRecordToRpcBuffer(
  57. IN PDNS_RECORD pRecord
  58. );
  59. PVOID
  60. DnssrvMidlAllocZero(
  61. IN DWORD dwSize
  62. );
  63. PDNS_NODE
  64. DnsConvertRpcBuffer(
  65. OUT PDNS_NODE * ppNodeLast,
  66. IN DWORD dwBufferLength,
  67. IN BYTE abBuffer[],
  68. IN BOOLEAN fUnicode
  69. );
  70. DNS_STATUS
  71. DNS_API_FUNCTION
  72. DnssrvEnumRecordsStub(
  73. IN LPCSTR Server,
  74. IN LPCSTR pszNodeName,
  75. IN LPCSTR pszStartChild,
  76. IN WORD wRecordType,
  77. IN DWORD dwSelectFlag,
  78. IN OUT PDWORD pdwBufferLength,
  79. OUT PBYTE * ppBuffer
  80. );
  81. #ifdef __cplusplus
  82. }
  83. #endif // __cplusplus
  84. //
  85. // Heap routines
  86. // Use dnsapi.dll memory routines
  87. //
  88. #define ALLOCATE_HEAP(iSize) Dns_Alloc(iSize)
  89. #define ALLOCATE_HEAP_ZERO(iSize) Dns_AllocZero(iSize)
  90. #define REALLOCATE_HEAP(pMem,iSize) Dns_Realloc((pMem),(iSize))
  91. #define FREE_HEAP(pMem) Dns_Free(pMem)
  92. //
  93. // Debug stuff
  94. //
  95. #if DBG
  96. #undef ASSERT
  97. #define ASSERT( expr ) DNS_ASSERT( expr )
  98. #define DNSRPC_DEBUG_FLAG_FILE ("dnsrpc.flag")
  99. #define DNSRPC_DEBUG_FILE_NAME ("dnsrpc.log")
  100. #define DNS_DEBUG_EVENTLOG 0x00000010
  101. #define DNS_DEBUG_RPC 0x00000020
  102. #define DNS_DEBUG_STUB 0x00000040
  103. #define DNS_DEBUG_HEAP 0x00010000
  104. #define DNS_DEBUG_HEAP_CHECK 0x00020000
  105. #define DNS_DEBUG_REGISTRY 0x00080000
  106. #endif
  107. //
  108. // If you like having a local variable in functions to hold the function
  109. // name so that you can include it in debug logs without worrying about
  110. // changing all the occurences when the function is renamed, use this
  111. // at the top of the function:
  112. // DBG_FN( "MyFunction" ) <--- NOTE: no semi-colon!!
  113. //
  114. #if DBG
  115. #define DBG_FN( funcName ) static const char * fn = (funcName);
  116. #else
  117. #define DBG_FN( funcName )
  118. #endif
  119. #endif // _DNSCLIP_INCLUDED_