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
5ec4d1be
Commit
5ec4d1be
authored
Sep 24, 2017
by
Martin Payne
Committed by
Alexandre Julliard
Sep 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user.exe16: Support Windows 2 menus.
Signed-off-by:
Martin Payne
<
development@martinpayne.me.uk
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c91a5319
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
12 deletions
+34
-12
krnl386.exe16.spec
dlls/krnl386.exe16/krnl386.exe16.spec
+1
-0
user.c
dlls/user.exe16/user.c
+32
-12
user_private.h
dlls/user.exe16/user_private.h
+1
-0
No files found.
dlls/krnl386.exe16/krnl386.exe16.spec
View file @
5ec4d1be
...
...
@@ -706,6 +706,7 @@
@ stdcall -arch=win32 GetCurrentTask()
@ stdcall -arch=win32 GetDOSEnvironment16()
@ stdcall -arch=win32 GetExePtr(long)
@ stdcall -arch=win32 GetExeVersion16()
@ stdcall -arch=win32 GetExpWinVer16(long)
@ stdcall -arch=win32 GetModuleHandle16(str)
@ stdcall -arch=win32 GlobalReAlloc16(long long long)
...
...
dlls/user.exe16/user.c
View file @
5ec4d1be
...
...
@@ -1428,7 +1428,7 @@ HMENU16 WINAPI LookupMenuHandle16( HMENU16 hmenu, INT16 id )
}
static
LPCSTR
parse_menu_resource
(
LPCSTR
res
,
HMENU
hMenu
)
static
LPCSTR
parse_menu_resource
(
LPCSTR
res
,
HMENU
hMenu
,
BOOL
oldFormat
)
{
WORD
flags
,
id
=
0
;
LPCSTR
str
;
...
...
@@ -1436,11 +1436,21 @@ static LPCSTR parse_menu_resource( LPCSTR res, HMENU hMenu )
do
{
flags
=
GET_WORD
(
res
);
/* Windows 3.00 and later use a WORD for the flags, whereas 1.x and 2.x use a BYTE. */
if
(
oldFormat
)
{
flags
=
GET_BYTE
(
res
);
res
+=
sizeof
(
BYTE
);
}
else
{
flags
=
GET_WORD
(
res
);
res
+=
sizeof
(
WORD
);
}
end_flag
=
flags
&
MF_END
;
/* Remove MF_END because it has the same value as MF_HILITE */
flags
&=
~
MF_END
;
res
+=
sizeof
(
WORD
);
if
(
!
(
flags
&
MF_POPUP
))
{
id
=
GET_WORD
(
res
);
...
...
@@ -1452,7 +1462,7 @@ static LPCSTR parse_menu_resource( LPCSTR res, HMENU hMenu )
{
HMENU
hSubMenu
=
CreatePopupMenu
();
if
(
!
hSubMenu
)
return
NULL
;
if
(
!
(
res
=
parse_menu_resource
(
res
,
hSubMenu
)))
return
NULL
;
if
(
!
(
res
=
parse_menu_resource
(
res
,
hSubMenu
,
oldFormat
)))
return
NULL
;
AppendMenuA
(
hMenu
,
flags
,
(
UINT_PTR
)
hSubMenu
,
str
);
}
else
/* Not a popup */
...
...
@@ -1468,22 +1478,32 @@ static LPCSTR parse_menu_resource( LPCSTR res, HMENU hMenu )
*/
HMENU16
WINAPI
LoadMenuIndirect16
(
LPCVOID
template
)
{
BOOL
oldFormat
;
HMENU
hMenu
;
WORD
version
,
offset
;
LPCSTR
p
=
template
;
TRACE
(
"(%p)
\n
"
,
template
);
version
=
GET_WORD
(
p
);
p
+=
sizeof
(
WORD
);
if
(
version
)
/* Windows 1.x and 2.x menus have a slightly different menu format from 3.x menus */
oldFormat
=
(
GetExeVersion16
()
<
0x0300
);
/* Windows 3.00 and later menu items are preceded by a MENUITEMTEMPLATEHEADER structure */
if
(
!
oldFormat
)
{
WARN
(
"version must be 0 for Win16
\n
"
);
return
0
;
version
=
GET_WORD
(
p
);
p
+=
sizeof
(
WORD
);
if
(
version
)
{
WARN
(
"version must be 0 for Win16 >= 3.00 applications
\n
"
);
return
0
;
}
offset
=
GET_WORD
(
p
);
p
+=
sizeof
(
WORD
)
+
offset
;
}
offset
=
GET_WORD
(
p
);
p
+=
sizeof
(
WORD
)
+
offset
;
if
(
!
(
hMenu
=
CreateMenu
()))
return
0
;
if
(
!
parse_menu_resource
(
p
,
hMenu
))
if
(
!
parse_menu_resource
(
p
,
hMenu
,
oldFormat
))
{
DestroyMenu
(
hMenu
);
return
0
;
...
...
dlls/user.exe16/user_private.h
View file @
5ec4d1be
...
...
@@ -95,6 +95,7 @@ extern LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd
extern
void
call_WH_CALLWNDPROC_hook
(
HWND16
hwnd
,
UINT16
msg
,
WPARAM16
wp
,
LPARAM
lp
)
DECLSPEC_HIDDEN
;
#define GET_BYTE(ptr) (*(const BYTE *)(ptr))
#define GET_WORD(ptr) (*(const WORD *)(ptr))
#define GET_DWORD(ptr) (*(const DWORD *)(ptr))
...
...
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