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
f76967d2
Commit
f76967d2
authored
Dec 26, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructured hook mapping functions to avoid most memory
allocations. Got rid of SEGPTR_* macros.
parent
ca737fa4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
winproc.h
include/winproc.h
+43
-1
hook.c
windows/hook.c
+0
-0
No files found.
include/winproc.h
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 */
windows/hook.c
View file @
f76967d2
This diff is collapsed.
Click to expand it.
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