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.

80 lines
2.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: L A N C M N . H
  7. //
  8. // Contents: Declarations of LAN Connection related functions common
  9. // to the shell and netman.
  10. //
  11. // Notes:
  12. //
  13. // Author: danielwe 7 Oct 1997
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. #include "netcfgx.h"
  18. #include "netcon.h"
  19. #include "netconp.h"
  20. #include "iptypes.h"
  21. EXTERN_C const CLSID CLSID_LanConnectionManager;
  22. enum OCC_FLAGS
  23. {
  24. OCCF_NONE = 0x0000,
  25. OCCF_CREATE_IF_NOT_EXIST = 0x0001,
  26. OCCF_DELETE_IF_EXIST = 0x0002,
  27. };
  28. HRESULT HrOpenConnectionKey(const GUID* pguid, PCWSTR pszGuid, REGSAM sam,
  29. OCC_FLAGS occFlags, PCWSTR pszPnpId, HKEY *phkey);
  30. HRESULT HrOpenHwConnectionKey(REFGUID guid, REGSAM sam, OCC_FLAGS occFlags,
  31. HKEY *phkey);
  32. HRESULT HrIsConnectionNameUnique(REFGUID guidExclude,
  33. PCWSTR szwName);
  34. HRESULT HrPnccFromGuid(INetCfg *pnc, const GUID &refGuid,
  35. INetCfgComponent **ppncc);
  36. HRESULT HrIsConnection(INetCfgComponent *pncc);
  37. HRESULT HrGetDeviceGuid(INetConnection *pconn, GUID *pguid);
  38. BOOL FPconnEqualGuid(INetConnection *pconn, REFGUID guid);
  39. HRESULT HrGetPseudoMediaTypeFromConnection(IN REFGUID guidConn, OUT NETCON_SUBMEDIATYPE *pncsm);
  40. inline
  41. BOOL
  42. FIsDeviceFunctioning(ULONG ulProblem)
  43. {
  44. // ulProblem is returned by calling CM_Get_DevNode_Status_Ex
  45. // or INetCfgComponent->GetDeviceStatus
  46. //
  47. // "Functioning" means the device is enabled and started with
  48. // no problem codes, or it is disabled and stopped with no
  49. // problem codes.
  50. return (ulProblem == 0) || (ulProblem == CM_PROB_DISABLED);
  51. };
  52. EXTERN_C HRESULT WINAPI HrPnpInstanceIdFromGuid(const GUID* pguid,
  53. PWSTR szwInstance,
  54. UINT cchInstance);
  55. EXTERN_C HRESULT WINAPI HrGetPnpDeviceStatus(const GUID* pguid,
  56. NETCON_STATUS *pStatus);
  57. EXTERN_C HRESULT WINAPI HrQueryLanMediaState(const GUID* pguid,
  58. BOOL* pfEnabled);
  59. BOOL FIsMediaPresent(const GUID *pguid);
  60. HRESULT HrGetDevInstStatus(DEVINST devinst, const GUID *pguid,
  61. NETCON_STATUS *pStatus);
  62. HRESULT HrGetRegInstanceKeyForAdapter(IN LPGUID pguidId,
  63. OUT LPWSTR lpszRegInstance);
  64. BOOL HasValidAddress(IN PIP_ADAPTER_INFO pAdapterInfo);
  65. HRESULT HrGetAddressStatusForAdapter(IN LPCGUID pguidAdapter,
  66. OUT BOOL* pbValidAddress);