27#define DEFAULT_BAUD_RATE_INDEX 11
28#define DEFAULT_DATA_BITS_INDEX 4
29#define DEFAULT_PARITY_INDEX 2
30#define DEFAULT_STOP_BITS_INDEX 0
31#define DEFAULT_FLOW_CONTROL_INDEX 2
33DWORD BaudRates[] = {75, 110, 134, 150, 300, 600, 1200, 1800, 2400, 4800,
34 7200, 9600, 14400, 19200, 38400, 57600, 115200, 128000};
75 WCHAR szFlowControl[4];
82 TRACE(
"ReadPortSettings(%p)\n", pPortData);
99 ERR(
"SetupDiOpenDevRegKey() failed\n");
114 ERR(
"RegQueryValueExW failed (Error %lu)\n", lError);
122 L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Ports",
128 ERR(
"RegOpenKeyExW failed (Error %lu)\n", lError);
132 dwSize =
sizeof(szPortData);
143 ERR(
"RegQueryValueExW failed (Error %lu)\n", lError);
147 if ((dwType !=
REG_SZ) || (
dwSize >
sizeof(szPortData)))
149 ERR(
"Wrong type or size\n");
153 TRACE(
"szPortData: '%S'\n", szPortData);
158 if (szPortData[
i] ==
L',')
159 szPortData[
i] =
L' ';
162 TRACE(
"szPortData: '%S'\n", szPortData);
166 L"%lu %3s %3s %3s %3s",
173 TRACE(
"dwBaudRate: %lu\n", dwBaudRate);
174 TRACE(
"szParity: '%S'\n", szParity);
175 TRACE(
"szDataBits: '%S'\n", szDataBits);
176 TRACE(
"szStopBits: '%S'\n", szStopBits);
177 TRACE(
"szFlowControl: '%S'\n", szFlowControl);
233 WCHAR szPortData[32];
239 INT nFlowControlIndex;
243 TRACE(
"WritePortSettings(%p)\n", pPortData);
247 TRACE(
"Nothing changed. Done!\n");
293 if (nFlowControlIndex < 2)
299 TRACE(
"szPortData: '%S'\n", szPortData);
302 L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Ports",
308 ERR(
"RegOpenKeyExW failed (Error %lu)\n", lError);
323 ERR(
"RegSetValueExW failed (Error %lu)\n", lError);
364 TRACE(
"OnInitDialog()\n");
367 if (pPortData ==
NULL)
369 ERR(
"pPortData is NULL\n");
498 TRACE(
"OnCommand()\n");
501 if (pPortData ==
NULL)
503 ERR(
"pPortData is NULL\n");
542 TRACE(
"OnCommand()\n");
545 if (pPortData ==
NULL)
547 ERR(
"pPortData is NULL\n");
553 FIXME(
"PSN_APPLY!\n");
566 TRACE(
"OnDestroy()\n");
569 if (pPortData ==
NULL)
571 ERR(
"pPortData is NULL\n");
588 TRACE(
"SerialSettingsDlgProc()\n");
623 TRACE(
"SerialPortPropPageProvider(%p %p %lx)\n",
624 lpPropSheetPageRequest, lpfnAddPropSheetPageProc,
lParam);
629 if (pPortData ==
NULL)
631 ERR(
"Port data allocation failed!\n");
640 TRACE(
"SPPSR_ENUM_ADV_DEVICE_PROPERTIES\n");
651 if (hPropSheetPage ==
NULL)
653 ERR(
"CreatePropertySheetPageW() failed!\n");
657 if (!(*lpfnAddPropSheetPageProc)(hPropSheetPage,
lParam))
659 ERR(
"lpfnAddPropSheetPageProc() failed!\n");
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define IDD_SERIALSETTINGS
#define IDC_SERIAL_BITSPERSECOND
#define IDC_SERIAL_DATABITS
#define IDC_SERIAL_RESTORE
#define IDC_SERIAL_STOPBITS
#define IDC_SERIAL_ADVANCED
#define IDC_SERIAL_PARITY
#define IDC_SERIAL_FLOWCONTROL
#define DEFAULT_STOP_BITS_INDEX
static VOID WritePortSettings(HWND hwnd, PPORT_DATA pPortData)
static VOID FillComboBox(HWND hwnd, PWSTR szBuffer)
static VOID RestoreDefaultValues(HWND hwnd, PPORT_DATA pPortData)
static VOID OnDestroy(HWND hwnd)
#define DEFAULT_PARITY_INDEX
struct _PORT_DATA PORT_DATA
#define DEFAULT_FLOW_CONTROL_INDEX
#define DEFAULT_DATA_BITS_INDEX
static VOID OnNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
BOOL WINAPI SerialPortPropPageProvider(PSP_PROPSHEETPAGE_REQUEST lpPropSheetPageRequest, LPFNADDPROPSHEETPAGE lpfnAddPropSheetPageProc, LPARAM lParam)
#define DEFAULT_BAUD_RATE_INDEX
struct _PORT_DATA * PPORT_DATA
static VOID OnCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
static BOOL OnInitDialog(HWND hwnd, WPARAM wParam, LPARAM lParam)
static VOID ReadPortSettings(PPORT_DATA pPortData)
static INT_PTR CALLBACK SerialSettingsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
HKEY WINAPI SetupDiOpenDevRegKey(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType, REGSAM samDesired)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
struct _PSP * HPROPSHEETPAGE
struct _PROPSHEETPAGEW PROPSHEETPAGEW
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
struct _SP_CLASSINSTALL_HEADER SP_CLASSINSTALL_HEADER
#define SetupDiSetClassInstallParams
#define DIF_PROPERTYCHANGE
#define SPPSR_ENUM_ADV_DEVICE_PROPERTIES
PSP_DEVINFO_DATA DeviceInfoData
SP_CLASSINSTALL_HEADER ClassInstallHeader
PSP_DEVINFO_DATA DeviceInfoData
#define ComboBox_SetCurSel(hwndCtl, index)
#define ComboBox_GetCurSel(hwndCtl)
#define ComboBox_AddString(hwndCtl, lpsz)
#define HKEY_LOCAL_MACHINE
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)