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.

144 lines
5.0 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1998-2002 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: Utils.h
  6. * Content: Utilitiy functions
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 11/25/98 jtk Created
  12. ***************************************************************************/
  13. #ifndef __UTILS_H__
  14. #define __UTILS_H__
  15. //**********************************************************************
  16. // Constant definitions
  17. //**********************************************************************
  18. //**********************************************************************
  19. // Macro definitions
  20. //**********************************************************************
  21. //**********************************************************************
  22. // Structure definitions
  23. //**********************************************************************
  24. //
  25. // forward references
  26. //
  27. class CPackedBuffer;
  28. class CSPData;
  29. class CThreadPool;
  30. //**********************************************************************
  31. // Variable definitions
  32. //**********************************************************************
  33. //**********************************************************************
  34. // Function prototypes
  35. //**********************************************************************
  36. BOOL InitProcessGlobals( void );
  37. void DeinitProcessGlobals( void );
  38. BOOL LoadWinsock( void );
  39. void UnloadWinsock( void );
  40. #ifndef DPNBUILD_NONATHELP
  41. BOOL LoadNATHelp( void );
  42. void UnloadNATHelp( void );
  43. #endif // ! DPNBUILD_NONATHELP
  44. #if ((defined(WINNT)) && (! defined(DPNBUILD_NOMULTICAST)))
  45. BOOL LoadMadcap( void );
  46. void UnloadMadcap( void );
  47. #endif // WINNT and not DPNBUILD_NOMULTICAST
  48. HRESULT CreateSPData( CSPData **const ppSPData,
  49. #if ((! defined(DPNBUILD_NOIPV6)) || (! defined(DPNBUILD_NOIPX)))
  50. const short sSPType,
  51. #endif // ! DPNBUILD_NOIPV6 or ! DPNBUILD_NOIPX
  52. #ifdef DPNBUILD_PREALLOCATEDMEMORYMODEL
  53. const XDP8CREATE_PARAMS * const pDP8CreateParams,
  54. #endif // DPNBUILD_PREALLOCATEDMEMORYMODEL
  55. IDP8ServiceProviderVtbl *const pVtbl );
  56. HRESULT InitializeInterfaceGlobals( CSPData *const pSPData );
  57. void DeinitializeInterfaceGlobals( CSPData *const pSPData );
  58. #ifndef DPNBUILD_NOIPV6
  59. LPWSTR DNIpv6AddressToStringW(const struct in6_addr *Addr, LPWSTR S);
  60. #endif // ! DPNBUILD_NOIPV6
  61. HRESULT AddInfoToBuffer( CPackedBuffer *const pPackedBuffer,
  62. const WCHAR *const pwszInfoName,
  63. const GUID *const pInfoGUID,
  64. const DWORD dwFlags );
  65. #ifdef _XBOX
  66. BOOL InitializeRefcountXnKeys(const DWORD dwKeyRegMax);
  67. void WINAPI CleanupRefcountXnKeys(void);
  68. INT WINAPI RegisterRefcountXnKey(const XNKID * pxnkid, const XNKEY * pxnkey);
  69. INT WINAPI UnregisterRefcountXnKey(const XNKID * pxnkid);
  70. #ifdef XBOX_ON_DESKTOP
  71. //
  72. // Emulated Xbox networking library functions
  73. //
  74. INT WINAPI XNetStartup(const XNetStartupParams * pxnsp);
  75. INT WINAPI XNetCleanup(void);
  76. INT WINAPI XNetRegisterKey(const XNKID * pxnkid, const XNKEY * pxnkey);
  77. INT WINAPI XNetUnregisterKey(const XNKID * pxnkid);
  78. INT WINAPI XNetXnAddrToInAddr(const XNADDR * pxna, const XNKID * pxnkid, IN_ADDR * pina);
  79. INT WINAPI XNetInAddrToXnAddr(const IN_ADDR ina, XNADDR * pxna, XNKID * pxnkid);
  80. #define XNET_GET_XNADDR_PENDING 0x0000 // Address acquisition is not yet complete
  81. #define XNET_GET_XNADDR_NONE 0x0001 // XNet is uninitialized or no debugger found
  82. #define XNET_GET_XNADDR_ETHERNET 0x0002 // Host has ethernet address (no IP address)
  83. #define XNET_GET_XNADDR_STATIC 0x0004 // Host has staticically assigned IP address
  84. #define XNET_GET_XNADDR_DHCP 0x0008 // Host has DHCP assigned IP address
  85. #define XNET_GET_XNADDR_PPPOE 0x0010 // Host has PPPoE assigned IP address
  86. #define XNET_GET_XNADDR_GATEWAY 0x0020 // Host has one or more gateways configured
  87. #define XNET_GET_XNADDR_DNS 0x0040 // Host has one or more DNS servers configured
  88. #define XNET_GET_XNADDR_ONLINE 0x0080 // Host is currently connected to online service
  89. #define XNET_GET_XNADDR_TROUBLESHOOT 0x8000 // Network configuration requires troubleshooting
  90. DWORD WINAPI XNetGetTitleXnAddr(XNADDR * pxna);
  91. #define XNET_ETHERNET_LINK_ACTIVE 0x01 // Ethernet cable is connected and active
  92. #define XNET_ETHERNET_LINK_100MBPS 0x02 // Ethernet link is set to 100 Mbps
  93. #define XNET_ETHERNET_LINK_10MBPS 0x04 // Ethernet link is set to 10 Mbps
  94. #define XNET_ETHERNET_LINK_FULL_DUPLEX 0x08 // Ethernet link is in full duplex mode
  95. #define XNET_ETHERNET_LINK_HALF_DUPLEX 0x10 // Ethernet link is in half duplex mode
  96. DWORD WINAPI XNetGetEthernetLinkStatus(void);
  97. //
  98. // Private functions used to improve simulation of real XNet behavior
  99. //
  100. INT WINAPI XNetPrivCreateAssociation(const XNKID * pxnkid, const CSocketAddress * const pSocketAddress);
  101. #endif // XBOX_ON_DESKTOP
  102. #endif // _XBOX
  103. #endif // __UTILS_H__