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
4ca7e634
Commit
4ca7e634
authored
Sep 26, 2000
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 26, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid crashes if 16-bit module handle was passed to the 32-bit
resource enumerator.
parent
fc67be9a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
pe_resource.c
loader/pe_resource.c
+10
-0
No files found.
loader/pe_resource.c
View file @
4ca7e634
...
...
@@ -12,10 +12,12 @@
#include <stdlib.h>
#include <sys/types.h>
#include "wine/winestring.h"
#include "wine/unicode.h"
#include "windef.h"
#include "winnls.h"
#include "winerror.h"
#include "module.h"
#include "heap.h"
#include "task.h"
...
...
@@ -24,6 +26,8 @@
#include "neexe.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
resource
);
/**********************************************************************
* get_resdir
*
...
...
@@ -35,6 +39,12 @@ static IMAGE_RESOURCE_DIRECTORY* get_resdir( HMODULE hmod )
IMAGE_RESOURCE_DIRECTORY
*
ret
=
NULL
;
if
(
!
hmod
)
hmod
=
GetModuleHandleA
(
NULL
);
else
if
(
!
HIWORD
(
hmod
))
{
FIXME
(
"Enumeration of 16-bit resources is not supported
\n
"
);
SetLastError
(
ERROR_INVALID_HANDLE
);
return
NULL
;
}
dir
=
&
PE_HEADER
(
hmod
)
->
OptionalHeader
.
DataDirectory
[
IMAGE_DIRECTORY_ENTRY_RESOURCE
];
if
(
dir
->
Size
&&
dir
->
VirtualAddress
)
ret
=
(
IMAGE_RESOURCE_DIRECTORY
*
)((
char
*
)
hmod
+
dir
->
VirtualAddress
);
...
...
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