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
7f95bb7f
Commit
7f95bb7f
authored
Mar 15, 1999
by
Marcus Meissner
Committed by
Alexandre Julliard
Mar 15, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use MESSAGE_RESOURCE_* defines from SDK headers, updated LoadMessage*
code.
parent
37130802
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
27 deletions
+36
-27
peexe.h
include/peexe.h
+18
-0
resource.c
loader/resource.c
+18
-27
No files found.
include/peexe.h
View file @
7f95bb7f
...
...
@@ -578,4 +578,22 @@ typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
typedef
struct
tagMESSAGE_RESOURCE_ENTRY
{
WORD
Length
;
WORD
Flags
;
BYTE
Text
[
1
];
}
MESSAGE_RESOURCE_ENTRY
,
*
PMESSAGE_RESOURCE_ENTRY
;
#define MESSAGE_RESOURCE_UNICODE 0x0001
typedef
struct
tagMESSAGE_RESOURCE_BLOCK
{
DWORD
LowId
;
DWORD
HighId
;
DWORD
OffsetToEntries
;
}
MESSAGE_RESOURCE_BLOCK
,
*
PMESSAGE_RESOURCE_BLOCK
;
typedef
struct
tagMESSAGE_RESOURCE_DATA
{
DWORD
NumberOfBlocks
;
MESSAGE_RESOURCE_BLOCK
Blocks
[
1
];
}
MESSAGE_RESOURCE_DATA
,
*
PMESSAGE_RESOURCE_DATA
;
#endif
/* __WINE_PEEXE_H */
loader/resource.c
View file @
7f95bb7f
...
...
@@ -931,7 +931,7 @@ INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id,
*
* (lastentry-firstentry) * stringentry:
* 0: WORD len (0 marks end)
* 2: WORD
unknown (flags?)
* 2: WORD
flags
* 4: CHAR[len-4]
* (stringentry i of a subentry refers to the ID 'firstentry+i')
*
...
...
@@ -946,18 +946,10 @@ INT WINAPI LoadMessageA( HMODULE instance, UINT id, WORD lang,
{
HGLOBAL
hmem
;
HRSRC
hrsrc
;
BYTE
*
p
;
int
nrofentries
,
i
,
slen
;
struct
_subentry
{
DWORD
firstentry
;
DWORD
lastentry
;
DWORD
offset
;
}
*
se
;
struct
_stringentry
{
WORD
len
;
WORD
unknown
;
CHAR
str
[
1
];
}
*
stre
;
PMESSAGE_RESOURCE_DATA
mrd
;
PMESSAGE_RESOURCE_BLOCK
mrb
;
PMESSAGE_RESOURCE_ENTRY
mre
;
int
i
,
slen
;
TRACE
(
resource
,
"instance = %08lx, id = %08lx, buffer = %p, length = %ld
\n
"
,
(
DWORD
)
instance
,
(
DWORD
)
id
,
buffer
,
(
DWORD
)
buflen
);
...
...
@@ -967,32 +959,31 @@ INT WINAPI LoadMessageA( HMODULE instance, UINT id, WORD lang,
hmem
=
LoadResource
(
instance
,
hrsrc
);
if
(
!
hmem
)
return
0
;
p
=
LockResource
(
hmem
);
nrofentries
=
*
(
DWORD
*
)
p
;
stre
=
NULL
;
se
=
(
struct
_subentry
*
)(
p
+
4
);
for
(
i
=
nrofentries
;
i
--
;)
{
if
((
id
>=
se
->
firstentry
)
&&
(
id
<=
se
->
lastentry
))
{
stre
=
(
struct
_stringentry
*
)(
p
+
se
->
offset
);
id
-=
se
->
firstentry
;
mrd
=
(
PMESSAGE_RESOURCE_DATA
)
LockResource
(
hmem
);
mre
=
NULL
;
mrb
=
&
(
mrd
->
Blocks
[
0
]);
for
(
i
=
mrd
->
NumberOfBlocks
;
i
--
;)
{
if
((
id
>=
mrb
->
LowId
)
&&
(
id
<=
mrb
->
HighId
))
{
mre
=
(
PMESSAGE_RESOURCE_ENTRY
)(((
char
*
)
mrd
)
+
mrb
->
OffsetToEntries
);
id
-=
mrb
->
LowId
;
break
;
}
se
++
;
mrb
++
;
}
if
(
!
st
re
)
if
(
!
m
re
)
return
0
;
for
(
i
=
id
;
i
--
;)
{
if
(
!
(
slen
=
stre
->
len
)
)
if
(
!
mre
->
Length
)
return
0
;
stre
=
(
struct
_stringentry
*
)(((
char
*
)
stre
)
+
slen
);
mre
=
(
PMESSAGE_RESOURCE_ENTRY
)(((
char
*
)
mre
)
+
(
mre
->
Length
)
);
}
slen
=
stre
->
len
;
slen
=
mre
->
Length
;
TRACE
(
resource
,
" - strlen=%d
\n
"
,
slen
);
i
=
MIN
(
buflen
-
1
,
slen
);
if
(
buffer
==
NULL
)
return
slen
;
/* different to LoadString */
if
(
i
>
0
)
{
lstrcpynA
(
buffer
,
stre
->
str
,
i
);
lstrcpynA
(
buffer
,
(
char
*
)
mre
->
Text
,
i
);
buffer
[
i
]
=
0
;
}
else
{
if
(
buflen
>
1
)
{
...
...
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