Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
da9c5237
Commit
da9c5237
authored
Nov 15, 2009
by
Ilya Shpigor
Committed by
Alexandre Julliard
Nov 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Destroy EDITSTATE structure in the WM_NCDESTROY message processing.
parent
1eb07756
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
5 deletions
+45
-5
edit.c
dlls/user32/edit.c
+5
-5
edit.c
dlls/user32/tests/edit.c
+40
-0
No files found.
dlls/user32/edit.c
View file @
da9c5237
...
...
@@ -4691,10 +4691,10 @@ static LRESULT EDIT_WM_Create(EDITSTATE *es, LPCWSTR name)
/*********************************************************************
*
* WM_DESTROY
* WM_
NC
DESTROY
*
*/
static
LRESULT
EDIT_WM_Destroy
(
EDITSTATE
*
es
)
static
LRESULT
EDIT_WM_
NC
Destroy
(
EDITSTATE
*
es
)
{
LINEDEF
*
pc
,
*
pp
;
...
...
@@ -4762,7 +4762,7 @@ static LRESULT EditWndProc_common( HWND hwnd, UINT msg,
if
(
!
es
&&
msg
!=
WM_NCCREATE
)
return
DefWindowProcT
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
if
(
es
&&
(
msg
!=
WM_DESTROY
))
EDIT_LockBuffer
(
es
);
if
(
es
&&
(
msg
!=
WM_
NC
DESTROY
))
EDIT_LockBuffer
(
es
);
switch
(
msg
)
{
case
EM_GETSEL16
:
...
...
@@ -5102,8 +5102,8 @@ static LRESULT EditWndProc_common( HWND hwnd, UINT msg,
result
=
EDIT_WM_NCCreate
(
hwnd
,
(
LPCREATESTRUCTW
)
lParam
,
unicode
);
break
;
case
WM_DESTROY
:
result
=
EDIT_WM_Destroy
(
es
);
case
WM_
NC
DESTROY
:
result
=
EDIT_WM_
NC
Destroy
(
es
);
es
=
NULL
;
break
;
...
...
dlls/user32/tests/edit.c
View file @
da9c5237
...
...
@@ -1239,6 +1239,45 @@ static void test_edit_control_5(void)
DestroyWindow
(
hWnd
);
}
/* Test WM_GETTEXT processing
* after destroy messages
*/
static
void
test_edit_control_6
(
void
)
{
static
const
char
*
str
=
"test
\r\n
test"
;
char
buf
[
MAXLEN
];
LONG
ret
;
HWND
hWnd
;
hWnd
=
CreateWindowEx
(
0
,
"EDIT"
,
"Test"
,
0
,
10
,
10
,
1
,
1
,
NULL
,
NULL
,
hinst
,
NULL
);
assert
(
hWnd
);
ret
=
SendMessageA
(
hWnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
str
);
ok
(
ret
==
TRUE
,
"Expected %d, got %d
\n
"
,
TRUE
,
ret
);
ret
=
SendMessageA
(
hWnd
,
WM_GETTEXT
,
MAXLEN
,
(
LPARAM
)
buf
);
ok
(
ret
==
lstrlen
(
str
),
"Expected %s, got len %d
\n
"
,
str
,
ret
);
ok
(
!
lstrcmp
(
buf
,
str
),
"Expected %s, got %s
\n
"
,
str
,
buf
);
buf
[
0
]
=
0
;
ret
=
SendMessageA
(
hWnd
,
WM_DESTROY
,
0
,
0
);
ok
(
ret
==
0
,
"Expected 0, got %d
\n
"
,
ret
);
ret
=
SendMessageA
(
hWnd
,
WM_GETTEXT
,
MAXLEN
,
(
LPARAM
)
buf
);
ok
(
ret
==
lstrlen
(
str
),
"Expected %s, got len %d
\n
"
,
str
,
ret
);
ok
(
!
lstrcmp
(
buf
,
str
),
"Expected %s, got %s
\n
"
,
str
,
buf
);
buf
[
0
]
=
0
;
ret
=
SendMessageA
(
hWnd
,
WM_NCDESTROY
,
0
,
0
);
ok
(
ret
==
0
,
"Expected 0, got %d
\n
"
,
ret
);
ret
=
SendMessageA
(
hWnd
,
WM_GETTEXT
,
MAXLEN
,
(
LPARAM
)
buf
);
ok
(
ret
==
0
,
"Expected 0, got len %d
\n
"
,
ret
);
ok
(
!
lstrcmp
(
buf
,
""
),
"Expected empty string, got %s
\n
"
,
buf
);
DestroyWindow
(
hWnd
);
}
static
void
test_edit_control_limittext
(
void
)
{
HWND
hwEdit
;
...
...
@@ -2270,6 +2309,7 @@ START_TEST(edit)
test_edit_control_3
();
test_edit_control_4
();
test_edit_control_5
();
test_edit_control_6
();
test_edit_control_limittext
();
test_margins
();
test_margins_font_change
();
...
...
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