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.

164 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. wshatalk.h
  5. Abstract:
  6. Author:
  7. Nikhil Kamkolkar (nikhilk@microsoft.com)
  8. Revision History:
  9. 10 Jul 1992 Initial Version
  10. --*/
  11. #include "atalktdi.h"
  12. #include "atalkwsh.h" // winsock header file for appletalk
  13. #define WSH_ATALK_ADSPSTREAM L"\\Device\\AtalkAdsp\\Stream"
  14. #define WSH_ATALK_ADSPRDM L"\\Device\\AtalkAdsp"
  15. #define WSH_ATALK_PAPRDM L"\\Device\\AtalkPap"
  16. #define WSH_KEYPATH_CODEPAGE \
  17. TEXT("SYSTEM\\CurrentControlSet\\Control\\Nls\\Codepage")
  18. #define WSHREG_VALNAME_CODEPAGE TEXT("MACCP")
  19. //
  20. // Device names for DDP need protocol field at the end - defined in wshdata.h
  21. //
  22. //
  23. // Structure and variables to define the triples supported by Appletalk. The
  24. // first entry of each array is considered the canonical triple for
  25. // that socket type; the other entries are synonyms for the first.
  26. //
  27. typedef struct _MAPPING_TRIPLE {
  28. INT AddressFamily;
  29. INT SocketType;
  30. INT Protocol;
  31. } MAPPING_TRIPLE, *PMAPPING_TRIPLE;
  32. //
  33. // The socket context structure for this DLL. Each open Appletalk socket
  34. // will have one of these context structures, which is used to maintain
  35. // information about the socket.
  36. //
  37. typedef struct _WSHATALK_SOCKET_CONTEXT
  38. {
  39. INT AddressFamily;
  40. INT SocketType;
  41. INT Protocol;
  42. } WSHATALK_SOCKET_CONTEXT, *PWSHATALK_SOCKET_CONTEXT;
  43. //
  44. // Forward declarations of internal routines.
  45. //
  46. BOOL FAR PASCAL
  47. WshDllInitialize(
  48. HINSTANCE hInstance,
  49. DWORD nReason,
  50. LPVOID pReserved);
  51. BOOLEAN
  52. WshRegGetCodePage(
  53. VOID);
  54. BOOLEAN
  55. WshNbpNameToMacCodePage(
  56. IN OUT PWSH_NBP_NAME pNbpName);
  57. BOOLEAN
  58. WshNbpNameToOemCodePage(
  59. IN OUT PWSH_NBP_NAME pNbpName);
  60. BOOLEAN
  61. WshZoneListToOemCodePage(
  62. IN OUT PUCHAR pZoneList,
  63. IN USHORT NumZones);
  64. BOOLEAN
  65. WshConvertStringMacToOem(
  66. IN PUCHAR pSrcMacString,
  67. IN USHORT SrcStringLen,
  68. OUT PUCHAR pDestOemString,
  69. IN PUSHORT pDestStringLen);
  70. BOOLEAN
  71. WshConvertStringOemToMac(
  72. IN PUCHAR pSrcOemString,
  73. IN USHORT SrcStringLen,
  74. OUT PUCHAR pDestMacString,
  75. IN PUSHORT pDestStringLen);
  76. INT
  77. WSHNtStatusToWinsockErr(
  78. IN NTSTATUS Status);
  79. BOOLEAN
  80. IsTripleInList (
  81. IN PMAPPING_TRIPLE List,
  82. IN ULONG ListLength,
  83. IN INT AddressFamily,
  84. IN INT SocketType,
  85. IN INT Protocol);
  86. VOID
  87. CompleteTdiActionApc (
  88. IN PVOID ApcContext,
  89. IN PIO_STATUS_BLOCK IoStatusBlock);
  90. //
  91. // Macros
  92. //
  93. #if DBG
  94. #define DBGPRINT(Fmt) \
  95. { \
  96. DbgPrint("WSHATALK: "); \
  97. DbgPrint Fmt; \
  98. }
  99. #define DBGBRK() \
  100. { \
  101. DbgBreakPoint(); \
  102. }
  103. #else
  104. #define DBGPRINT(Fmt)
  105. #define DBGBRK()
  106. #endif
  107. #define SOCK_TO_TDI_ATALKADDR(tdiAddr, sockAddr) \
  108. { \
  109. (tdiAddr)->TAAddressCount = 1; \
  110. (tdiAddr)->Address[0].AddressLength = sizeof(TDI_ADDRESS_APPLETALK); \
  111. (tdiAddr)->Address[0].AddressType = TDI_ADDRESS_TYPE_APPLETALK; \
  112. (tdiAddr)->Address[0].Address[0].Network = (sockAddr)->sat_net; \
  113. (tdiAddr)->Address[0].Address[0].Node = (sockAddr)->sat_node; \
  114. (tdiAddr)->Address[0].Address[0].Socket = (sockAddr)->sat_socket; \
  115. }
  116. #define TDI_TO_SOCK_ATALKADDR(sockAddr, tdiAddr) \
  117. { \
  118. (sockAddr)->sat_family = AF_APPLETALK; \
  119. (sockAddr)->sat_net = (tdiAddr)->Address[0].Address[0].Network; \
  120. (sockAddr)->sat_node = (tdiAddr)->Address[0].Address[0].Node; \
  121. (sockAddr)->sat_socket = (tdiAddr)->Address[0].Address[0].Socket; \
  122. }