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.

89 lines
2.0 KiB

  1. //++
  2. //
  3. // Copyright (C) Microsoft Corporation, 1987 - 1999
  4. //
  5. // Module Name:
  6. //
  7. // domutil.c
  8. //
  9. // Abstract:
  10. //
  11. // Test to ensure that a workstation has network (IP) connectivity to
  12. // the outside.
  13. //
  14. // Author:
  15. //
  16. // 15-Dec-1997 (cliffv)
  17. // Anilth - 4-20-1998
  18. //
  19. // Environment:
  20. //
  21. // User mode only.
  22. // Contains NT-specific code.
  23. //
  24. // Revision History:
  25. //
  26. // 1-June-1998 (denisemi) add DnsServerHasDCRecords to check DC dns records
  27. // registration
  28. //
  29. // 26-June-1998 (t-rajkup) add general tcp/ip , dhcp and routing,
  30. // winsock, ipx, wins and netbt information.
  31. //--
  32. //
  33. // Common include files.
  34. //
  35. #include "precomp.h"
  36. #include "nbtutil.h"
  37. /*!--------------------------------------------------------------------------
  38. FindNetbtTransport
  39. Determine if the specified Netbt transport is configured.
  40. Arguments:
  41. TransportName - Name of transport to find.
  42. Return Value:
  43. Pointer to struct describing transport
  44. NULL: Transport is not configured
  45. Author: KennT
  46. ---------------------------------------------------------------------------*/
  47. PNETBT_TRANSPORT
  48. FindNetbtTransport(
  49. NETDIAG_RESULT *pResults,
  50. LPWSTR pswzTransportName
  51. )
  52. {
  53. PLIST_ENTRY ListEntry;
  54. PNETBT_TRANSPORT pNetbtTransport;
  55. //
  56. // Loop through the list of netbt transports finding this one.
  57. //
  58. for ( ListEntry = pResults->NetBt.Transports.Flink ;
  59. ListEntry != &pResults->NetBt.Transports ;
  60. ListEntry = ListEntry->Flink )
  61. {
  62. //
  63. // If the transport names match,
  64. // return the entry
  65. //
  66. pNetbtTransport = CONTAINING_RECORD( ListEntry, NETBT_TRANSPORT, Next );
  67. if ( _wcsicmp( pNetbtTransport->pswzTransportName, pswzTransportName ) == 0 ) {
  68. return pNetbtTransport;
  69. }
  70. }
  71. return NULL;
  72. }