Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sam Joan Roque-Worcel
wine
Commits
f76967d2
Commit
f76967d2
authored
23 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Restructured hook mapping functions to avoid most memory
allocations. Got rid of SEGPTR_* macros.
parent
ca737fa4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/winproc.h
+43
-1
43 additions, 1 deletion
include/winproc.h
windows/hook.c
+442
-725
442 additions, 725 deletions
windows/hook.c
with
485 additions
and
726 deletions
include/winproc.h
+
43
−
1
View file @
f76967d2
...
...
@@ -8,7 +8,8 @@
#define __WINE_WINPROC_H
#include
"windef.h"
#include
"wine/windef16.h"
#include
"wine/winbase16.h"
#include
"winnls.h"
typedef
enum
{
...
...
@@ -76,4 +77,45 @@ extern void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam,
LPARAM
lParam
,
MSGPARAM16
*
pm16
);
extern
void
WINPROC_UnmapMsg32WTo16
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
MSGPARAM16
*
pm16
);
/* map a Unicode string to a 16-bit pointer */
inline
static
SEGPTR
map_str_32W_to_16
(
LPCWSTR
str
)
{
LPSTR
ret
;
INT
len
;
if
(
!
HIWORD
(
str
))
return
(
SEGPTR
)
LOWORD
(
str
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
return
MapLS
(
ret
);
}
/* unmap a Unicode string that was converted to a 16-bit pointer */
inline
static
void
unmap_str_32W_to_16
(
SEGPTR
str
)
{
if
(
!
HIWORD
(
str
))
return
;
HeapFree
(
GetProcessHeap
(),
0
,
MapSL
(
str
)
);
UnMapLS
(
str
);
}
/* map a 16-bit pointer to a Unicode string */
inline
static
LPWSTR
map_str_16_to_32W
(
SEGPTR
str
)
{
LPWSTR
ret
;
INT
len
;
if
(
!
HIWORD
(
str
))
return
(
LPWSTR
)(
ULONG_PTR
)
LOWORD
(
str
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
MapSL
(
str
),
-
1
,
NULL
,
0
);
if
((
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
MapSL
(
str
),
-
1
,
ret
,
len
);
return
ret
;
}
/* unmap a 16-bit pointer that was converted to a Unicode string */
inline
static
void
unmap_str_16_to_32W
(
LPCWSTR
str
)
{
if
(
HIWORD
(
str
))
HeapFree
(
GetProcessHeap
(),
0
,
(
void
*
)
str
);
}
#endif
/* __WINE_WINPROC_H */
This diff is collapsed.
Click to expand it.
windows/hook.c
+
442
−
725
View file @
f76967d2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment