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.

66 lines
1.9 KiB

  1. /*****************************************************************************
  2. *
  3. * $Workfile: DevPort.h $
  4. *
  5. * Copyright (C) 1997 Hewlett-Packard Company.
  6. * All rights reserved.
  7. *
  8. * 11311 Chinden Blvd.
  9. * Boise, Idaho 83714
  10. *
  11. *****************************************************************************/
  12. #ifndef INC_DEV_PORT_INFO_H
  13. #define INC_DEV_PORT_INFO_H
  14. // This class' purpose is to store Name and PortNum pairs.
  15. class CDevicePort
  16. {
  17. public:
  18. CDevicePort();
  19. ~CDevicePort();
  20. VOID Set(TCHAR *psztNewName,
  21. DWORD dwNameSize,
  22. TCHAR *psztKeyName = NULL,
  23. DWORD dwKeyNameSize = 0,
  24. DWORD dwPortIndex = 1);
  25. LPCTSTR GetName() {return (LPCTSTR)m_psztName;}
  26. const DWORD GetPortIndex() { return (const DWORD )m_dwPortIndex; }
  27. LPCTSTR GetPortKeyName() {return (LPCTSTR)m_psztPortKeyName;}
  28. VOID ReadPortInfo(LPCTSTR pszAddress, PPORT_DATA_1 pPortInfo, BOOL bBypassNetProbe);
  29. VOID SetNextPtr(CDevicePort *ptr) { m_pNext = ptr; }
  30. CDevicePort *GetNextPtr() { return m_pNext; }
  31. private:
  32. TCHAR *m_psztPortKeyName;
  33. TCHAR *m_psztName;
  34. DWORD m_dwPortIndex;
  35. CDevicePort *m_pNext;
  36. TCHAR m_psztFileName[MAX_PATH];
  37. };
  38. // This class manages the list of DevicePorts.
  39. class CDevicePortList
  40. {
  41. public:
  42. CDevicePortList();
  43. ~CDevicePortList();
  44. VOID DeletePortList();
  45. BOOL GetDevicePortsList(LPTSTR pszDeviceName);
  46. CDevicePort *GetFirst() {m_pCurrent = m_pList; return(m_pCurrent);}
  47. CDevicePort *GetNext() {m_pCurrent = m_pCurrent->GetNextPtr(); return(m_pCurrent);}
  48. CDevicePort *GetCurrent() { return m_pCurrent; }
  49. protected:
  50. BOOL GetSectionNames(LPCTSTR lpFileName, TCHAR **lpszReturnBuffer, DWORD &nSize);
  51. private:
  52. CDevicePort *m_pList;
  53. CDevicePort *m_pCurrent;
  54. };
  55. #endif // INC_DEV_PORT_INFO_H