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.

98 lines
4.4 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1987-1990 **/
  4. /********************************************************************/
  5. #define const
  6. //
  7. // msgdata.c - Contains all the global data used by the support functions
  8. // of the message server API.
  9. //
  10. #include <netcons.h> // needed by service.h
  11. #include <neterr.h> // Status code definitions.
  12. #include <error.h> // Status code definitions.
  13. #include <service.h> // defines for service API usage
  14. #include <ncb.h> // NCB defines
  15. #include <smb.h> // SMB defines
  16. #include <msrv.h> // General message server defines
  17. #include <srvparam.h> // General server type defines
  18. unsigned short smbret; // SMB return code
  19. unsigned char smbretclass; // SMB return class
  20. short mgid; // Message group i.d.
  21. NCB g_ncb; // NCB used for all send functions
  22. ulfp semPtr; // Pointer to data semaphore
  23. ucfp dataPtr; // Pointer to shared data area
  24. // Support Arrays
  25. //
  26. // These arrays (single dimensioned) contain one entry for each managed
  27. // network. This allows each thread (network) to have its own set of
  28. // "global" data. They are all in the same segment, the size of which is
  29. // computed by the following formula:
  30. //
  31. // size = NumNets * (sizeof(unsigned short) + sizeof(unsigned char) +
  32. // sizeof(ulfp))
  33. //
  34. unsigned short far * NetBios_Hdl; // NetBios handles, one per net
  35. unsigned char far * net_lana_num; // Lan adaptor numbers
  36. ul far * wakeupSem; // Semaphores to clear on NCB completion
  37. unsigned long MsgSegSem = 0L; // Protecting the per process data
  38. // declared in this file.
  39. // Too avoid having an abundance of net errors to confuse the user, most of the
  40. * net errors now map to NERR_NetworkError.
  41. DWORD const mpnetmes[] =
  42. {
  43. 0x23, // 00 Number of messages
  44. NERR_NetworkError, // 01 NRC_BUFLEN -> invalid length
  45. -1, // 02 NRC_BFULL , not expected
  46. NERR_NetworkError, // 03 NRC_ILLCMD -> invalid command
  47. -1, // 04 not defined
  48. NERR_NetworkError, // 05 NRC_CMDTMO -> network busy
  49. NERR_NetworkError, // 06 NRC_INCOMP -> messgae incomplete
  50. -1, // 07 NRC_BADDR , not expected
  51. NERR_NetworkError, // 08 NRC_SNUMOUT -> bad session
  52. NERR_NoNetworkResource, // 09 NRC_NORES -> network busy
  53. NERR_NetworkError, // 0a NRC_SCLOSED -> session closed
  54. NERR_NetworkError, // 0b NRC_CMDCAN -> command cancelled
  55. -1, // 0c NRC_DMAFAIL, unexpected
  56. NERR_AlreadyExists, // 0d NRC_DUPNAME -> already exists
  57. NERR_TooManyNames, // 0e NRC_NAMTFUL -> too many names
  58. NERR_DeleteLater, // 0f NRC_ACTSES -> delete later
  59. -1, // 10 NRC_INVALID , unexpected
  60. NERR_NetworkError, // 11 NRC_LOCTFUL -> too many sessions
  61. ERROR_REM_NOT_LIST, // 12 NRC_REMTFUL -> remote not listening*/
  62. NERR_NetworkError, // 13 NRC_ILLNN -> bad name
  63. NERR_NameNotFound, // 14 NRC_NOCALL -> name not found
  64. ERROR_INVALID_PARAMETER, // 15 NRC_NOWILD -> bad parameter
  65. NERR_DuplicateName, // 16 NRC_INUSE -> name in use, retry
  66. ERROR_INVALID_PARAMETER, // 17 NRC_NAMERR -> bad parameter
  67. NERR_NetworkError, // 18 NRC_SABORT -> session ended
  68. NERR_DuplicateName, // 19 NRC_NAMCONF -> duplicate name
  69. -1, // 1a not defined
  70. -1, // 1b not defined
  71. -1, // 1c not defined
  72. -1, // 1d not defined
  73. -1, // 1e not defined
  74. -1, // 1f not defined
  75. -1, // 20 not defined
  76. NERR_NetworkError, // 21 NRC_IFBUSY -> network busy
  77. NERR_NetworkError, // 22 NRC_TOOMANY -> retry later
  78. NERR_NetworkError // 23 NRC_BRIDGE -> bridge error
  79. };
  80. LPTSTR MessageFileName;
  81.