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.

161 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Copyright (c) 1991 Nokia Data Systems
  4. Module Name:
  5. dlcdll.h
  6. Abstract:
  7. This module incldes all files needed to compile
  8. the NT DLC DLL API module.
  9. Author:
  10. Antti Saarenheimo (o-anttis) 20-09-1991
  11. Revision History:
  12. --*/
  13. //
  14. // System APIs:
  15. //
  16. #include <nt.h>
  17. #ifndef OS2_EMU_DLC
  18. #include <ntrtl.h>
  19. #include <nturtl.h>
  20. #if !defined(UNICODE)
  21. #define UNICODE // want wide character registry functions
  22. #endif
  23. #include <windows.h>
  24. #include <winreg.h>
  25. #define INCLUDE_IO_BUFFER_SIZE_TABLE // includes the io buffer sizes
  26. #endif // OS2_EMU_DLC
  27. #include <memory.h>
  28. #include <stdlib.h>
  29. #include <stdio.h>
  30. //
  31. // Inlcude the smb macros to handle the unaligned dos ccb and parameter tables
  32. //
  33. #include <smbgtpt.h>
  34. //
  35. // NT DLC API interface files:
  36. //
  37. #include <dlcapi.h> // Official DLC API definition
  38. #include <ntdddlc.h> // IOCTL commands
  39. #include <dlcio.h> // Internal IOCTL API interface structures
  40. //
  41. // Local types and function prototypes:
  42. //
  43. typedef
  44. VOID
  45. (*PFDLC_POST_ROUTINE)(
  46. IN PVOID hApcContext,
  47. IN PLLC_CCB pCcb
  48. );
  49. #define SUPPORT_DEBUG_NAMES 0
  50. //
  51. // In DOS the adapter number and NetBIOS command use the same
  52. // byte in CCB/NCB data structure.
  53. // The smallest NetBIOS command is NCB.CALL (10H), which limits
  54. // the maximum adapter numbers 0 - 15 in DOS (and Windows NT)
  55. // The extra adapter numbers above 15 may be used as extra
  56. // alternate adapter handles to extend the number of available
  57. // link stations. Only the first instance of a SAP can receive
  58. // remote connect requests.
  59. //
  60. #define LLC_MAX_ADAPTER_NUMBER 255
  61. #define LLC_MAX_ADAPTERS 16
  62. #define TR_16Mbps_LINK_SPEED 0x1000000
  63. VOID
  64. QueueCommandCompletion(
  65. PLLC_CCB pCCB
  66. );
  67. VOID
  68. InitializeAcsLan(
  69. VOID
  70. );
  71. LLC_STATUS
  72. OpenDlcApiDriver(
  73. IN PVOID SecurityDescriptor,
  74. OUT HANDLE *pHandle
  75. );
  76. LLC_STATUS
  77. GetAdapterNameAndParameters(
  78. IN UINT AdapterNumber,
  79. OUT PUNICODE_STRING pNdisName,
  80. OUT PUCHAR pTicks,
  81. OUT PLLC_ETHERNET_TYPE pLlcEthernetType
  82. );
  83. VOID
  84. CopyAsciiStringToUnicode(
  85. IN PUNICODE_STRING pUnicodeDest,
  86. IN PSZ pAsciiSrc
  87. );
  88. VOID
  89. BuildDescriptorList(
  90. IN PLLC_TRANSMIT_DESCRIPTOR pDescriptor,
  91. IN PLLC_CCB pCCB,
  92. IN OUT PUINT pCurrentDescriptor
  93. );
  94. LLC_STATUS
  95. DoSyncDeviceIoControl(
  96. IN HANDLE DeviceHandle,
  97. IN ULONG IoctlCommand,
  98. IN PVOID pInputBuffer,
  99. IN UINT InputBufferLength,
  100. OUT PVOID pOutputBuffer,
  101. IN UINT OutputBufferLength
  102. );
  103. LLC_STATUS
  104. DlcGetInfo(
  105. IN HANDLE DriverHandle,
  106. IN UINT InfoClass,
  107. IN USHORT StationId,
  108. IN PVOID pOutputBuffer,
  109. IN UINT OutputBufferLength
  110. );
  111. VOID
  112. CopyToDescriptorBuffer(
  113. IN OUT PLLC_TRANSMIT_DESCRIPTOR pDescriptors,
  114. IN PLLC_BUFFER pDlcBufferQueue,
  115. IN BOOLEAN DeallocateBufferAfterUse,
  116. IN OUT PUINT pIndex,
  117. IN OUT PLLC_BUFFER *ppLastBuffer,
  118. OUT LLC_STATUS *pStatus
  119. );
  120. LLC_STATUS
  121. DlcSetInfo(
  122. IN HANDLE DriverHandle,
  123. IN UINT InfoClass,
  124. IN USHORT StationId,
  125. IN PNT_DLC_SET_INFORMATION_PARMS pSetInfoParms,
  126. IN PVOID DataBuffer,
  127. IN UINT DataBufferLength
  128. );
  129. USHORT
  130. GetCcbStationId(
  131. IN PLLC_CCB pCCB
  132. );