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
ce21d918
Commit
ce21d918
authored
Jan 17, 2007
by
Mike McCormack
Committed by
Alexandre Julliard
Jan 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add an exception handler around the WM_GETTEXT handler.
parent
54415368
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
13 deletions
+46
-13
defwnd.c
dlls/user32/defwnd.c
+46
-13
No files found.
dlls/user32/defwnd.c
View file @
ce21d918
...
...
@@ -36,6 +36,7 @@
#include "wine/unicode.h"
#include "wine/winuser16.h"
#include "wine/server.h"
#include "wine/exception.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
win
);
...
...
@@ -726,7 +727,27 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
return
0
;
}
static
LPARAM
DEFWND_GetTextA
(
WND
*
wndPtr
,
LPSTR
dest
,
WPARAM
wParam
)
{
LPARAM
result
=
0
;
__TRY
{
if
(
wndPtr
->
text
)
{
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
wndPtr
->
text
,
-
1
,
dest
,
wParam
,
NULL
,
NULL
))
dest
[
wParam
-
1
]
=
0
;
result
=
strlen
(
dest
);
}
else
dest
[
0
]
=
'\0'
;
}
__EXCEPT_PAGE_FAULT
{
return
0
;
}
__ENDTRY
return
result
;
}
/***********************************************************************
* DefWindowProcA (USER32.@)
...
...
@@ -778,13 +799,8 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
)
break
;
if
(
wndPtr
->
text
)
{
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
wndPtr
->
text
,
-
1
,
dest
,
wParam
,
NULL
,
NULL
))
dest
[
wParam
-
1
]
=
0
;
result
=
strlen
(
dest
);
}
else
dest
[
0
]
=
'\0'
;
result
=
DEFWND_GetTextA
(
wndPtr
,
dest
,
wParam
);
WIN_ReleasePtr
(
wndPtr
);
}
break
;
...
...
@@ -862,6 +878,28 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
}
static
LPARAM
DEFWND_GetTextW
(
WND
*
wndPtr
,
LPWSTR
dest
,
WPARAM
wParam
)
{
LPARAM
result
=
0
;
__TRY
{
if
(
wndPtr
->
text
)
{
lstrcpynW
(
dest
,
wndPtr
->
text
,
wParam
);
result
=
strlenW
(
dest
);
}
else
dest
[
0
]
=
'\0'
;
}
__EXCEPT_PAGE_FAULT
{
return
0
;
}
__ENDTRY
return
result
;
}
/***********************************************************************
* DefWindowProcW (USER32.@) Calls default window message handler
*
...
...
@@ -917,12 +955,7 @@ LRESULT WINAPI DefWindowProcW(
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
)
break
;
if
(
wndPtr
->
text
)
{
lstrcpynW
(
dest
,
wndPtr
->
text
,
wParam
);
result
=
strlenW
(
dest
);
}
else
dest
[
0
]
=
'\0'
;
result
=
DEFWND_GetTextW
(
wndPtr
,
dest
,
wParam
);
WIN_ReleasePtr
(
wndPtr
);
}
break
;
...
...
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