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
aefd9b55
Commit
aefd9b55
authored
Jul 03, 2012
by
Aric Stewart
Committed by
Alexandre Julliard
Jul 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Do not use GetDlgItemText to get combo box text during an CBN_SELCHANGE notification.
parent
eec0adac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
printdlg.c
dlls/comdlg32/printdlg.c
+19
-6
No files found.
dlls/comdlg32/printdlg.c
View file @
aefd9b55
...
...
@@ -1783,9 +1783,13 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam,
/* FALLTHROUGH */
case
cmb4
:
/* Printer combobox */
if
(
HIWORD
(
wParam
)
==
CBN_SELCHANGE
)
{
char
PrinterName
[
256
];
GetDlgItemTextA
(
hDlg
,
LOWORD
(
wParam
),
PrinterName
,
255
);
char
*
PrinterName
;
INT
index
=
SendDlgItemMessageW
(
hDlg
,
LOWORD
(
wParam
),
CB_GETCURSEL
,
0
,
0
);
INT
length
=
SendDlgItemMessageW
(
hDlg
,
LOWORD
(
wParam
),
CB_GETLBTEXTLEN
,
index
,
0
);
PrinterName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
length
+
1
);
SendDlgItemMessageA
(
hDlg
,
LOWORD
(
wParam
),
CB_GETLBTEXT
,
index
,
(
LPARAM
)
PrinterName
);
PRINTDLG_ChangePrinterA
(
hDlg
,
PrinterName
,
PrintStructures
);
HeapFree
(
GetProcessHeap
(),
0
,
PrinterName
);
}
break
;
...
...
@@ -1934,9 +1938,14 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam,
/* FALLTHROUGH */
case
cmb4
:
/* Printer combobox */
if
(
HIWORD
(
wParam
)
==
CBN_SELCHANGE
)
{
WCHAR
PrinterName
[
256
];
GetDlgItemTextW
(
hDlg
,
LOWORD
(
wParam
),
PrinterName
,
255
);
WCHAR
*
PrinterName
;
INT
index
=
SendDlgItemMessageW
(
hDlg
,
LOWORD
(
wParam
),
CB_GETCURSEL
,
0
,
0
);
INT
length
=
SendDlgItemMessageW
(
hDlg
,
LOWORD
(
wParam
),
CB_GETLBTEXTLEN
,
index
,
0
);
PrinterName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
(
length
+
1
));
SendDlgItemMessageW
(
hDlg
,
LOWORD
(
wParam
),
CB_GETLBTEXT
,
index
,
(
LPARAM
)
PrinterName
);
PRINTDLG_ChangePrinterW
(
hDlg
,
PrinterName
,
PrintStructures
);
HeapFree
(
GetProcessHeap
(),
0
,
PrinterName
);
}
break
;
...
...
@@ -3378,10 +3387,14 @@ static BOOL pagesetup_wm_command(HWND hDlg, WPARAM wParam, LPARAM lParam, pagese
case
cmb1
:
/* Printer combo */
if
(
msg
==
CBN_SELCHANGE
)
{
WCHAR
name
[
256
];
GetDlgItemTextW
(
hDlg
,
id
,
name
,
sizeof
(
name
)
/
sizeof
(
name
[
0
]));
WCHAR
*
name
;
INT
index
=
SendDlgItemMessageW
(
hDlg
,
id
,
CB_GETCURSEL
,
0
,
0
);
INT
length
=
SendDlgItemMessageW
(
hDlg
,
id
,
CB_GETLBTEXTLEN
,
index
,
0
);
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
(
length
+
1
));
SendDlgItemMessageW
(
hDlg
,
id
,
CB_GETLBTEXT
,
index
,
(
LPARAM
)
name
);
pagesetup_change_printer
(
name
,
data
);
pagesetup_init_combos
(
hDlg
,
data
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
break
;
case
cmb2
:
/* Paper combo */
...
...
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