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.

65 lines
2.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 CIntelliName *pIntelliName, IN LPCTSTR szName, NETCON_MEDIATYPE *pncm, NETCON_SUBMEDIATYPE *pncms);
  21. class CIntelliName
  22. {
  23. FNDuplicateNameCheck* m_pFNDuplicateNameCheck;
  24. HINSTANCE m_hInstance;
  25. private:
  26. BOOL NameExists(IN LPCWSTR szName, IN OUT NETCON_MEDIATYPE *pncm, IN NETCON_SUBMEDIATYPE *pncms);
  27. HRESULT GenerateNameRenameOnConflict(IN REFGUID guid, IN NETCON_MEDIATYPE ncm, IN DWORD dwCharacteristics, IN LPCWSTR szHintName, IN LPCWSTR szHintType, OUT LPWSTR * szName);
  28. HRESULT GenerateNameFromResource(IN REFGUID guid, IN NETCON_MEDIATYPE ncm, IN DWORD dwCharacteristics, IN LPCWSTR szHint, IN UINT uiNameID, IN UINT uiTypeId, OUT LPWSTR *szName);
  29. BOOL IsReservedName(LPCWSTR szName);
  30. public:
  31. HRESULT HrGetPseudoMediaTypes(IN REFGUID guid, OUT NETCON_MEDIATYPE *pncm, OUT NETCON_SUBMEDIATYPE *pncms);
  32. // Pass NULL for no Duplicate Check
  33. CIntelliName(HINSTANCE hInstance, FNDuplicateNameCheck *pFNDuplicateNameCheck);
  34. // Must LocalFree szName for these:
  35. HRESULT GenerateName(IN REFGUID guid, IN NETCON_MEDIATYPE ncm, IN DWORD dwCharacteristics, IN LPCWSTR szHint, OUT LPWSTR * szName);
  36. HRESULT GenerateInternetName(IN REFGUID guid, IN NETCON_MEDIATYPE ncm, IN DWORD dwCharacteristics, OUT LPWSTR * szName);
  37. HRESULT GenerateHomeNetName(IN REFGUID guid, IN NETCON_MEDIATYPE ncm, IN DWORD dwCharacteristics, OUT LPWSTR * szName);
  38. };
  39. BOOL IsMediaWireless(NETCON_MEDIATYPE ncm, const GUID &gdDevice);
  40. BOOL IsMedia1394(NETCON_MEDIATYPE ncm, const GUID &gdDevice);
  41. #ifndef _NTDDNDIS_
  42. typedef ULONG NDIS_OID, *PNDIS_OID;
  43. #endif
  44. HRESULT HrQueryDeviceOIDByName(IN LPCWSTR szDeviceName,
  45. IN DWORD dwIoControlCode,
  46. IN ULONG Oid,
  47. IN OUT LPDWORD pnSize,
  48. OUT LPVOID pbValue);
  49. HRESULT HrQueryNDISAdapterOID(IN REFGUID guidId,
  50. IN NDIS_OID Oid,
  51. IN OUT LPDWORD pnSize,
  52. OUT LPVOID pbValue);