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.

87 lines
3.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2001.
  5. //
  6. // File: N A M I N G . H
  7. //
  8. // Contents: Generates Connection Names Automatically
  9. //
  10. // Notes:
  11. //
  12. // Author: deonb 27 Feb 2001
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "nameres.h"
  17. #include "netconp.h"
  18. using namespace std;
  19. class CIntelliName;
  20. typedef BOOL FNDuplicateNameCheck(IN const CIntelliName* pIntelliName,
  21. IN LPCTSTR szName,
  22. OUT NETCON_MEDIATYPE* pncm,
  23. OUT NETCON_SUBMEDIATYPE* pncms);
  24. class CIntelliName : CNetCfgDebug<CIntelliName>
  25. {
  26. FNDuplicateNameCheck* m_pFNDuplicateNameCheck;
  27. HINSTANCE m_hInstance;
  28. private:
  29. BOOL NameExists(IN LPCWSTR szName,
  30. IN OUT NETCON_MEDIATYPE* pncm,
  31. IN NETCON_SUBMEDIATYPE* pncms) const;
  32. HRESULT GenerateNameRenameOnConflict(IN REFGUID guid,
  33. IN NETCON_MEDIATYPE ncm,
  34. IN DWORD dwCharacteristics,
  35. IN LPCWSTR szHintName,
  36. IN LPCWSTR szHintType,
  37. OUT LPWSTR * szName) const;
  38. HRESULT GenerateNameFromResource(IN REFGUID guid,
  39. IN NETCON_MEDIATYPE ncm,
  40. IN DWORD dwCharacteristics,
  41. IN LPCWSTR szHint,
  42. IN UINT uiNameID,
  43. IN UINT uiTypeId,
  44. OUT LPWSTR * szName) const;
  45. BOOL IsReservedName(LPCWSTR szName) const;
  46. public:
  47. HRESULT HrGetPseudoMediaTypes(IN REFGUID guid,
  48. OUT NETCON_MEDIATYPE * pncm,
  49. OUT NETCON_SUBMEDIATYPE* pncms) const;
  50. // Pass NULL to pFNDuplicateNameCheck for no Duplicate Check
  51. CIntelliName(IN HINSTANCE hInstance, IN FNDuplicateNameCheck *pFNDuplicateNameCheck);
  52. // Must LocalFree szName for these:
  53. HRESULT GenerateName(IN REFGUID guid,
  54. IN NETCON_MEDIATYPE ncm,
  55. IN DWORD dwCharacteristics,
  56. IN LPCWSTR szHint,
  57. OUT LPWSTR * szName) const;
  58. };
  59. BOOL IsMediaWireless(NETCON_MEDIATYPE ncm, const GUID &gdDevice);
  60. BOOL IsMedia1394(NETCON_MEDIATYPE ncm, const GUID &gdDevice);
  61. #ifndef _NTDDNDIS_
  62. typedef ULONG NDIS_OID, *PNDIS_OID;
  63. #endif
  64. HRESULT HrQueryDeviceOIDByName(IN LPCWSTR szDeviceName,
  65. IN DWORD dwIoControlCode,
  66. IN ULONG Oid,
  67. IN OUT LPDWORD pnSize,
  68. OUT LPVOID pbValue);
  69. HRESULT HrQueryNDISAdapterOID(IN REFGUID guidId,
  70. IN NDIS_OID Oid,
  71. IN OUT LPDWORD pnSize,
  72. OUT LPVOID pbValue);