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
dd442faa
Commit
dd442faa
authored
May 18, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Added fast W->A mapping for EM_GETLINE.
parent
b34521c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
45 deletions
+23
-45
winproc.c
dlls/user/winproc.c
+23
-45
No files found.
dlls/user/winproc.c
View file @
dd442faa
...
...
@@ -992,17 +992,6 @@ static INT WINPROC_MapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM
{
switch
(
msg
)
{
/* Multiline edit */
case
EM_GETLINE
:
{
WORD
len
=
(
WORD
)
*
plparam
;
LPARAM
*
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPARAM
)
+
sizeof
(
WORD
)
+
len
*
sizeof
(
CHAR
)
);
if
(
!
ptr
)
return
-
1
;
*
ptr
++
=
*
plparam
;
/* Store previous lParam */
*
((
WORD
*
)
ptr
)
=
len
;
/* Store the length */
*
plparam
=
(
LPARAM
)
ptr
;
}
return
1
;
case
WM_CHARTOITEM
:
case
WM_MENUCHAR
:
case
WM_CHAR
:
...
...
@@ -1040,32 +1029,6 @@ static INT WINPROC_MapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM
}
/**********************************************************************
* WINPROC_UnmapMsg32WTo32A
*
* Unmap a message that was mapped from Unicode to Ansi.
*/
static
LRESULT
WINPROC_UnmapMsg32WTo32A
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
result
)
{
switch
(
msg
)
{
/* Multiline edit */
case
EM_GETLINE
:
{
LPARAM
*
ptr
=
(
LPARAM
*
)
lParam
-
1
;
/* get the old lparam */
WORD
len
=
*
(
WORD
*
)
ptr
;
if
(
len
)
{
result
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPSTR
)
lParam
,
result
,
(
LPWSTR
)
*
ptr
,
len
);
if
(
result
<
len
)
((
LPWSTR
)
*
ptr
)[
result
]
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
break
;
}
return
result
;
}
static
UINT
convert_handle_16_to_32
(
HANDLE16
src
,
unsigned
int
flags
)
{
HANDLE
dst
;
...
...
@@ -3021,6 +2984,29 @@ static LRESULT WINPROC_CallProc32WTo32A( WNDPROC func, HWND hwnd, UINT msg, WPAR
else
ret
=
WINPROC_CallWndProc
(
func
,
hwnd
,
msg
,
wParam
,
lParam
);
break
;
/* Multiline edit */
case
EM_GETLINE
:
{
char
*
ptr
,
buffer
[
512
];
WORD
len
=
*
(
WORD
*
)
lParam
;
DWORD
result
;
if
(
!
(
ptr
=
get_buffer
(
buffer
,
sizeof
(
buffer
),
len
*
2
)))
break
;
*
((
WORD
*
)
ptr
)
=
len
*
2
;
/* store the length */
ret
=
WINPROC_CallWndProc
(
func
,
hwnd
,
msg
,
wParam
,
(
LPARAM
)
ptr
);
result
=
dialog
?
GetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
)
:
ret
;
if
(
result
)
{
RtlMultiByteToUnicodeN
(
(
LPWSTR
)
lParam
,
len
*
sizeof
(
WCHAR
),
&
result
,
buffer
,
result
);
result
/=
sizeof
(
WCHAR
);
if
(
result
<
len
)
((
LPWSTR
)
lParam
)[
result
]
=
0
;
if
(
dialog
)
SetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
,
result
);
else
ret
=
result
;
}
free_buffer
(
buffer
,
ptr
);
}
break
;
default:
if
((
unmap
=
WINPROC_MapMsg32WTo32A
(
hwnd
,
msg
,
&
wParam
,
&
lParam
))
==
-
1
)
{
ERR_
(
msg
)(
"Message translation failed. (msg=%s,wp=%08x,lp=%08lx)
\n
"
,
...
...
@@ -3028,14 +3014,6 @@ static LRESULT WINPROC_CallProc32WTo32A( WNDPROC func, HWND hwnd, UINT msg, WPAR
return
0
;
}
ret
=
WINPROC_CallWndProc
(
func
,
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
unmap
)
break
;
if
(
dialog
)
{
LRESULT
result
=
GetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
);
result
=
WINPROC_UnmapMsg32WTo32A
(
hwnd
,
msg
,
wParam
,
lParam
,
result
);
SetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
,
result
);
}
else
ret
=
WINPROC_UnmapMsg32WTo32A
(
hwnd
,
msg
,
wParam
,
lParam
,
ret
);
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