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 {
...
@@ -578,4 +578,22 @@ typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
#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 */
#endif
/* __WINE_PEEXE_H */
loader/resource.c
View file @
7f95bb7f
...
@@ -931,7 +931,7 @@ INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id,
...
@@ -931,7 +931,7 @@ INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id,
*
*
* (lastentry-firstentry) * stringentry:
* (lastentry-firstentry) * stringentry:
* 0: WORD len (0 marks end)
* 0: WORD len (0 marks end)
* 2: WORD
unknown (flags?)
* 2: WORD
flags
* 4: CHAR[len-4]
* 4: CHAR[len-4]
* (stringentry i of a subentry refers to the ID 'firstentry+i')
* (stringentry i of a subentry refers to the ID 'firstentry+i')
*
*
...
@@ -946,18 +946,10 @@ INT WINAPI LoadMessageA( HMODULE instance, UINT id, WORD lang,
...
@@ -946,18 +946,10 @@ INT WINAPI LoadMessageA( HMODULE instance, UINT id, WORD lang,
{
{
HGLOBAL
hmem
;
HGLOBAL
hmem
;
HRSRC
hrsrc
;
HRSRC
hrsrc
;
BYTE
*
p
;
PMESSAGE_RESOURCE_DATA
mrd
;
int
nrofentries
,
i
,
slen
;
PMESSAGE_RESOURCE_BLOCK
mrb
;
struct
_subentry
{
PMESSAGE_RESOURCE_ENTRY
mre
;
DWORD
firstentry
;
int
i
,
slen
;
DWORD
lastentry
;
DWORD
offset
;
}
*
se
;
struct
_stringentry
{
WORD
len
;
WORD
unknown
;
CHAR
str
[
1
];
}
*
stre
;
TRACE
(
resource
,
"instance = %08lx, id = %08lx, buffer = %p, length = %ld
\n
"
,
(
DWORD
)
instance
,
(
DWORD
)
id
,
buffer
,
(
DWORD
)
buflen
);
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,
...
@@ -967,32 +959,31 @@ INT WINAPI LoadMessageA( HMODULE instance, UINT id, WORD lang,
hmem
=
LoadResource
(
instance
,
hrsrc
);
hmem
=
LoadResource
(
instance
,
hrsrc
);
if
(
!
hmem
)
return
0
;
if
(
!
hmem
)
return
0
;
p
=
LockResource
(
hmem
);
mrd
=
(
PMESSAGE_RESOURCE_DATA
)
LockResource
(
hmem
);
nrofentries
=
*
(
DWORD
*
)
p
;
mre
=
NULL
;
stre
=
NULL
;
mrb
=
&
(
mrd
->
Blocks
[
0
]);
se
=
(
struct
_subentry
*
)(
p
+
4
);
for
(
i
=
mrd
->
NumberOfBlocks
;
i
--
;)
{
for
(
i
=
nrofentries
;
i
--
;)
{
if
((
id
>=
mrb
->
LowId
)
&&
(
id
<=
mrb
->
HighId
))
{
if
((
id
>=
se
->
firstentry
)
&&
(
id
<=
se
->
lastentry
))
{
mre
=
(
PMESSAGE_RESOURCE_ENTRY
)(((
char
*
)
mrd
)
+
mrb
->
OffsetToEntries
);
stre
=
(
struct
_stringentry
*
)(
p
+
se
->
offset
);
id
-=
mrb
->
LowId
;
id
-=
se
->
firstentry
;
break
;
break
;
}
}
se
++
;
mrb
++
;
}
}
if
(
!
st
re
)
if
(
!
m
re
)
return
0
;
return
0
;
for
(
i
=
id
;
i
--
;)
{
for
(
i
=
id
;
i
--
;)
{
if
(
!
(
slen
=
stre
->
len
)
)
if
(
!
mre
->
Length
)
return
0
;
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
);
TRACE
(
resource
,
" - strlen=%d
\n
"
,
slen
);
i
=
MIN
(
buflen
-
1
,
slen
);
i
=
MIN
(
buflen
-
1
,
slen
);
if
(
buffer
==
NULL
)
if
(
buffer
==
NULL
)
return
slen
;
/* different to LoadString */
return
slen
;
/* different to LoadString */
if
(
i
>
0
)
{
if
(
i
>
0
)
{
lstrcpynA
(
buffer
,
stre
->
str
,
i
);
lstrcpynA
(
buffer
,
(
char
*
)
mre
->
Text
,
i
);
buffer
[
i
]
=
0
;
buffer
[
i
]
=
0
;
}
else
{
}
else
{
if
(
buflen
>
1
)
{
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