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.

136 lines
2.7 KiB

  1. //////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // libbase.h
  7. //
  8. // Abstract:
  9. // Definition that are shared by tdisamp.exe and the library
  10. //
  11. ////////////////////////////////////////////////////////////////////
  12. #if !defined(TDILIB_LIBBASE_H_)
  13. #define TDILIB_LIBBASE_H_
  14. //#define UNICODE
  15. //#define _UNICODE
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif // _MSC_VER > 1000
  19. #define STRICT
  20. #ifndef _WIN32_WINNT
  21. #define _WIN32_WINNT 0x0400
  22. #endif
  23. #include <stdarg.h>
  24. #include <ntstatus.h>
  25. #define WIN32_NO_STATUS
  26. typedef long NTSTATUS;
  27. #include <windef.h>
  28. #include <winbase.h>
  29. //
  30. // required by tdi.h
  31. //
  32. struct UNICODE_STRING
  33. {
  34. USHORT Length;
  35. USHORT MaximumLength;
  36. PWSTR Buffer;
  37. };
  38. #include <tdi.h>
  39. #include <stdio.h>
  40. #include <tchar.h>
  41. //
  42. // definitions from nb30.h, which part of the sdk but not ddk
  43. //
  44. #define NCBNAMSZ 16 // absolute length of a net name
  45. typedef struct _ADAPTER_STATUS
  46. {
  47. UCHAR adapter_address[6];
  48. UCHAR rev_major;
  49. UCHAR reserved0;
  50. UCHAR adapter_type;
  51. UCHAR rev_minor;
  52. WORD duration;
  53. WORD frmr_recv;
  54. WORD frmr_xmit;
  55. WORD iframe_recv_err;
  56. WORD xmit_aborts;
  57. DWORD xmit_success;
  58. DWORD recv_success;
  59. WORD iframe_xmit_err;
  60. WORD recv_buff_unavail;
  61. WORD t1_timeouts;
  62. WORD ti_timeouts;
  63. DWORD reserved1;
  64. WORD free_ncbs;
  65. WORD max_cfg_ncbs;
  66. WORD max_ncbs;
  67. WORD xmit_buf_unavail;
  68. WORD max_dgram_size;
  69. WORD pending_sess;
  70. WORD max_cfg_sess;
  71. WORD max_sess;
  72. WORD max_sess_pkt_size;
  73. WORD name_count;
  74. } ADAPTER_STATUS, *PADAPTER_STATUS;
  75. typedef struct _NAME_BUFFER
  76. {
  77. UCHAR name[NCBNAMSZ];
  78. UCHAR name_num;
  79. UCHAR name_flags;
  80. } NAME_BUFFER, *PNAME_BUFFER;
  81. // values for name_flags bits.
  82. #define NAME_FLAGS_MASK 0x87
  83. #define GROUP_NAME 0x80
  84. #define UNIQUE_NAME 0x00
  85. #define REGISTERING 0x00
  86. #define REGISTERED 0x04
  87. #define DEREGISTERED 0x05
  88. #define DUPLICATE 0x06
  89. #define DUPLICATE_DEREG 0x07
  90. //
  91. // end of defines stolen from nb30.h
  92. //
  93. #include "libprocs.h"
  94. /////////////////////////////////////////////////////////////////////
  95. // some defines
  96. /////////////////////////////////////////////////////////////////////
  97. inline
  98. PVOID
  99. LocalAllocateMemory(ULONG ulLength)
  100. {
  101. return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ulLength);
  102. }
  103. inline
  104. void
  105. LocalFreeMemory(PVOID pvAddr)
  106. {
  107. (VOID)HeapFree(GetProcessHeap(), 0, pvAddr);
  108. }
  109. #endif // !defined(TDILIB_LIBBASE_H_)
  110. ///////////////////////////////////////////////////////////////////////////////
  111. // end of file libbase.h
  112. ///////////////////////////////////////////////////////////////////////////////