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.

53 lines
1.7 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Non-network I/O support.
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000-2002.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef __PORTIO_H__
  9. #define __PORTIO_H__
  10. enum COM_PORT_TYPE
  11. {
  12. COM_PORT_STANDARD,
  13. COM_PORT_MODEM,
  14. COM_PORT_PIPE,
  15. COM_PORT_SOCKET,
  16. };
  17. #define NET_COM_PORT(Type) \
  18. ((Type) == COM_PORT_PIPE || (Type) == COM_PORT_SOCKET)
  19. typedef struct _COM_PORT_PARAMS
  20. {
  21. COM_PORT_TYPE Type;
  22. PSTR PortName;
  23. ULONG BaudRate;
  24. ULONG Timeout;
  25. ULONG IpPort;
  26. } COM_PORT_PARAMS, *PCOM_PORT_PARAMS;
  27. HRESULT CreateOverlappedPair(LPOVERLAPPED Read, LPOVERLAPPED Write);
  28. BOOL ComPortRead(HANDLE Port, COM_PORT_TYPE Type, ULONG Timeout,
  29. PVOID Buffer, ULONG Len, PULONG Done,
  30. LPOVERLAPPED Olap);
  31. BOOL ComPortWrite(HANDLE Port, COM_PORT_TYPE Type,
  32. PVOID Buffer, ULONG Len, PULONG Done,
  33. LPOVERLAPPED Olap);
  34. BOOL SetComPortName(PCSTR Name, PSTR Buffer, ULONG BufferSize);
  35. ULONG SelectComPortBaud(ULONG NewRate);
  36. HRESULT SetComPortBaud(HANDLE Port, ULONG NewRate, PULONG RateSet);
  37. HRESULT OpenComPort(PCOM_PORT_PARAMS Params,
  38. PHANDLE Handle, PULONG BaudSet);
  39. HRESULT Create1394Channel(PSTR Symlink, ULONG Channel,
  40. PSTR Name, ULONG NameSize, PHANDLE Handle);
  41. HRESULT Open1394Channel(PSTR Symlink, ULONG Channel,
  42. PSTR Name, ULONG NameSize, PHANDLE Handle);
  43. HRESULT InitIpAddress(PCSTR MachineName, ULONG Port,
  44. PSOCKADDR_STORAGE Addr, int* AddrLen);
  45. #endif // #ifndef __PORTIO_H__