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
44f0a67b
Commit
44f0a67b
authored
Apr 06, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regsvr32: Don't use GetBinaryType() on DLL files.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
89db25af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
regsvr32.c
programs/regsvr32/regsvr32.c
+7
-6
No files found.
programs/regsvr32/regsvr32.c
View file @
44f0a67b
...
...
@@ -23,6 +23,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winternl.h>
#include <ole2.h>
#include "regsvr32.h"
#include "wine/debug.h"
...
...
@@ -166,9 +167,9 @@ static void reexec_self(void)
}
#ifdef _WIN64
# define ALT_
BINARY_TYPE SCS_32BIT_BINARY
# define ALT_
MACHINE IMAGE_FILE_MACHINE_I386
#else
# define ALT_
BINARY_TYPE SCS_64BIT_BINARY
# define ALT_
MACHINE IMAGE_FILE_MACHINE_AMD64
#endif
/**
...
...
@@ -187,12 +188,12 @@ static VOID *LoadProc(const WCHAR* strDll, const char* procName, HMODULE* DllHan
*
DllHandle
=
LoadLibraryExW
(
strDll
,
0
,
LOAD_WITH_ALTERED_SEARCH_PATH
);
if
(
!*
DllHandle
)
{
DWORD
binary_typ
e
;
HMODULE
modul
e
;
if
(
firstDll
&&
GetLastError
()
==
ERROR_BAD_EXE_FORMAT
&&
GetBinaryTypeW
(
strDll
,
&
binary_type
)
&&
binary_type
==
ALT_BINARY_TYPE
)
(
module
=
LoadLibraryExW
(
strDll
,
0
,
LOAD_LIBRARY_AS_IMAGE_RESOURCE
)))
{
reexec_self
();
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
(
HMODULE
)((
ULONG_PTR
)
module
&
~
3
)
);
if
(
nt
->
FileHeader
.
Machine
==
ALT_MACHINE
)
reexec_self
();
}
output_write
(
STRING_DLL_LOAD_FAILED
,
strDll
);
ExitProcess
(
LOADLIBRARY_FAILED
);
...
...
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