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.

118 lines
2.7 KiB

  1. /** FILE: ports.c ********** Module Header ********************************
  2. *
  3. * Control panel applet for configuring COM ports. This file contains
  4. * the dialog and utility functions for managing the UI for setting COM
  5. * port parameters
  6. *
  7. * History:
  8. * 12:30 on Tues 23 Apr 1991 -by- Steve Cathcart [stevecat]
  9. * Took base code from Win 3.1 source
  10. * 10:30 on Tues 04 Feb 1992 -by- Steve Cathcart [stevecat]
  11. * Updated code to latest Win 3.1 sources
  12. * 16:30 on Fri 27 Mar 1992 -by- Steve Cathcart [stevecat]
  13. * Changed to allow for unlimited number of NT COM ports
  14. * 18:00 on Tue 06 Apr 1993 -by- Steve Cathcart [stevecat]
  15. * Updated to work seamlessly with NT serial driver
  16. * 19:00 on Wed 05 Jan 1994 -by- Steve Cathcart [stevecat]
  17. * Allow setting COM1 - COM4 advanced parameters
  18. *
  19. * Copyright (C) Microsoft Corporation, 1990 - 1999
  20. *
  21. *************************************************************************/
  22. //==========================================================================
  23. // Include files
  24. //==========================================================================
  25. // C Runtime
  26. #include <stddef.h>
  27. #include <stdlib.h>
  28. #include <string.h>
  29. #include <tchar.h>
  30. // Application specific
  31. #include <windowsx.h>
  32. #include <objbase.h>
  33. #include <setupapi.h>
  34. #include <shellapi.h>
  35. #include <wmium.h>
  36. #include <devguid.h>
  37. #include <devioctl.h>
  38. #include <ntddstor.h>
  39. #include <ntdddisk.h>
  40. #include <ntddscsi.h>
  41. #include <cfgmgr32.h>
  42. #include <assert.h>
  43. #include "resource.h"
  44. //
  45. // Bit Flag Macros
  46. //
  47. #define SET_FLAG(Flags, Bit) ((Flags) |= (Bit))
  48. #define CLEAR_FLAG(Flags, Bit) ((Flags) &= ~(Bit))
  49. #define TEST_FLAG(Flags, Bit) (((Flags) & (Bit)) != 0)
  50. //==========================================================================
  51. // Local Function Prototypes
  52. //==========================================================================
  53. extern HMODULE ModuleInstance;
  54. #define DISKPERF_SERVICE_NAME TEXT("DiskPerf")
  55. #ifdef DebugPrint
  56. #undef DebugPrint
  57. #endif
  58. BOOL CALLBACK
  59. ScsiPropPageProvider(
  60. PSP_PROPSHEETPAGE_REQUEST Request,
  61. LPFNADDPROPSHEETPAGE AddPageRoutine,
  62. LPARAM AddPageContext
  63. );
  64. BOOLEAN
  65. UtilpRestartDevice(
  66. IN HDEVINFO HDevInfo,
  67. IN PSP_DEVINFO_DATA DevInfoData
  68. );
  69. #if DBG
  70. ULONG
  71. _cdecl
  72. DbgPrint(
  73. PCH Format,
  74. ...
  75. );
  76. #define DEBUG_BUFFER_LENGTH 256
  77. #define DebugPrint(x) PropDebugPrint x
  78. #else
  79. #define DebugPrint(x)
  80. #endif // DBG
  81. VOID
  82. PropDebugPrint(
  83. ULONG DebugPrintLevel,
  84. PCHAR DebugMessage,
  85. ...
  86. );
  87. HANDLE
  88. UtilpGetDeviceHandle(
  89. HDEVINFO DevInfo,
  90. PSP_DEVINFO_DATA DevInfoData,
  91. LPGUID ClassGuid,
  92. DWORD DesiredAccess
  93. );