Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
20a32983
Commit
20a32983
authored
Mar 06, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Mar 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serialui: Fix return type for CommConfigDialog.
parent
2253edb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
42 deletions
+44
-42
comm.c
dlls/kernel32/comm.c
+22
-26
confdlg.c
dlls/serialui/confdlg.c
+22
-16
No files found.
dlls/kernel32/comm.c
View file @
20a32983
...
...
@@ -1194,23 +1194,20 @@ BOOL WINAPI CommConfigDialogA(
HWND
hWnd
,
/* [in] parent window for the dialog */
LPCOMMCONFIG
lpCommConfig
)
/* [out] pointer to struct to fill */
{
FARPROC
lpfnCommDialog
;
HMODULE
hConfigModule
;
BOOL
r
=
FALSE
;
LPWSTR
lpDeviceW
=
NULL
;
DWORD
len
;
BOOL
r
;
TRACE
(
"(%s, %p, %p)
\n
"
,
debugstr_a
(
lpszDevice
),
hWnd
,
lpCommConfig
);
hConfigModule
=
LoadLibraryW
(
lpszSerialUI
);
if
(
!
hConfigModule
)
return
FALSE
;
lpfnCommDialog
=
GetProcAddress
(
hConfigModule
,
"drvCommConfigDialogA"
);
if
(
lpfnCommDialog
)
r
=
lpfnCommDialog
(
lpszDevice
,
hWnd
,
lpCommConfig
);
FreeLibrary
(
hConfigModule
);
if
(
lpszDevice
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszDevice
,
-
1
,
NULL
,
0
);
lpDeviceW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszDevice
,
-
1
,
lpDeviceW
,
len
);
}
r
=
CommConfigDialogW
(
lpDeviceW
,
hWnd
,
lpCommConfig
);
HeapFree
(
GetProcessHeap
(),
0
,
lpDeviceW
);
return
r
;
}
...
...
@@ -1224,24 +1221,23 @@ BOOL WINAPI CommConfigDialogW(
HWND
hWnd
,
/* [in] parent window for the dialog */
LPCOMMCONFIG
lpCommConfig
)
/* [out] pointer to struct to fill */
{
FARPROC
lpfnComm
Dialog
;
FARPROC
pCommConfig
Dialog
;
HMODULE
hConfigModule
;
BOOL
r
=
FALSE
;
DWORD
res
=
ERROR_INVALID_PARAMETER
;
TRACE
(
"(%s, %p, %p)
\n
"
,
debugstr_w
(
lpszDevice
),
hWnd
,
lpCommConfig
);
hConfigModule
=
LoadLibraryW
(
lpszSerialUI
);
if
(
!
hConfigModule
)
return
FALSE
;
lpfnCommDialog
=
GetProcAddress
(
hConfigModule
,
"drvCommConfigDialogW"
);
if
(
lpfnCommDialog
)
r
=
lpfnCommDialog
(
lpszDevice
,
hWnd
,
lpCommConfig
);
FreeLibrary
(
hConfigModule
);
if
(
hConfigModule
)
{
pCommConfigDialog
=
GetProcAddress
(
hConfigModule
,
"drvCommConfigDialogW"
);
if
(
pCommConfigDialog
)
{
res
=
pCommConfigDialog
(
lpszDevice
,
hWnd
,
lpCommConfig
);
}
FreeLibrary
(
hConfigModule
);
}
return
r
;
if
(
res
)
SetLastError
(
res
);
return
(
res
==
ERROR_SUCCESS
);
}
/***********************************************************************
...
...
dlls/serialui/confdlg.c
View file @
20a32983
...
...
@@ -376,10 +376,10 @@ static INT_PTR CALLBACK SERIALUI_ConfigDialogProc(HWND hWnd, UINT uMsg, WPARAM w
{
case
IDOK
:
SERIALUI_DialogInfoToDCB
(
hWnd
,
info
);
EndDialog
(
hWnd
,
1
);
EndDialog
(
hWnd
,
ERROR_SUCCESS
);
return
TRUE
;
case
IDCANCEL
:
EndDialog
(
hWnd
,
0
);
EndDialog
(
hWnd
,
ERROR_CANCELLED
);
return
TRUE
;
/* test code for Get/SetDefaultCommConfig begins */
case
ID_GETDEFAULT
:
...
...
@@ -431,38 +431,44 @@ static VOID SERIALUI_strfree( LPWSTR strW )
/***********************************************************************
* drvCommConfigDialogW (SERIALUI.@)
*
* Used by Win9x KERNEL to show a dialog for configuring a COMM port.
* Show a dialog for configuring a Serial Port.
*
*/
BOOL
WINAPI
drvCommConfigDialogW
(
LPCWSTR
lpszName
,
HWND
hWndParent
,
LPCOMMCONFIG
lpCommConfig
)
{
DWORD
WINAPI
drvCommConfigDialogW
(
LPCWSTR
lpszName
,
HWND
hWndParent
,
LPCOMMCONFIG
lpCommConfig
)
{
SERIALUI_DialogInfo
info
;
INT
res
;
info
.
lpCommConfig
=
lpCommConfig
;
info
.
lpszDevice
=
lpszName
;
info
.
bConvert
=
FALSE
;
info
.
dwFlowControl
=
0
;
if
(
!
lpCommConfig
)
return
FALSE
;
if
((
!
lpCommConfig
)
||
(
!
lpszName
)
)
return
ERROR_INVALID_PARAMETER
;
return
DialogBoxParamW
(
SERIALUI_hModule
,
if
(
lpCommConfig
->
dwSize
<
sizeof
(
COMMCONFIG
))
return
ERROR_INSUFFICIENT_BUFFER
;
if
(
!
lpszName
[
0
])
return
ERROR_BADKEY
;
res
=
DialogBoxParamW
(
SERIALUI_hModule
,
MAKEINTRESOURCEW
(
IDD_SERIALUICONFIG
),
hWndParent
,
SERIALUI_ConfigDialogProc
,
(
LPARAM
)
&
info
);
return
(
res
==
-
1
)
?
GetLastError
()
:
res
;
}
/***********************************************************************
* drvCommConfigDialogA (SERIALUI.@)
*/
BOOL
WINAPI
drvCommConfigDialogA
(
LPCSTR
lpszName
,
HWND
hWndParent
,
LPCOMMCONFIG
lpCommConfig
)
DWORD
WINAPI
drvCommConfigDialogA
(
LPCSTR
lpszName
,
HWND
hWndParent
,
LPCOMMCONFIG
lpCommConfig
)
{
LPWSTR
strW
=
SERIALUI_strdup
(
lpszName
);
BOOL
r
=
drvCommConfigDialogW
(
strW
,
hWndParent
,
lpCommConfig
);
DWORD
r
=
drvCommConfigDialogW
(
strW
,
hWndParent
,
lpCommConfig
);
SERIALUI_strfree
(
strW
);
return
r
;
}
...
...
@@ -560,7 +566,8 @@ DWORD WINAPI drvGetDefaultCommConfigW(
r
=
sizeof
(
comW
)
/
sizeof
(
WCHAR
);
/* len of "com\0" */
lstrcpynW
(
szKeyName
,
lpszDevice
,
r
);
/* simulate a lstrcmpnW */
r
--
;
if
(
lstrcmpW
(
szKeyName
,
comW
)
||
if
(
lstrcmpiW
(
szKeyName
,
comW
)
||
(
lpszDevice
[
r
]
<
'1'
)
||
(
lpszDevice
[
r
]
>
'9'
)
||
lpszDevice
[
r
+
1
])
{
return
ERROR_BADKEY
;
}
...
...
@@ -593,7 +600,6 @@ DWORD WINAPI drvGetDefaultCommConfigW(
else
{
/* FIXME: default to a hardcoded commconfig */
lpCommConfig
->
dcb
.
DCBlength
=
sizeof
(
DCB
);
lpCommConfig
->
dcb
.
BaudRate
=
9600
;
lpCommConfig
->
dcb
.
fBinary
=
TRUE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment