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
69089152
Commit
69089152
authored
Feb 09, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Better handling of errors when loading a builtin dll from an
existing file.
parent
f201c9e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
20 deletions
+27
-20
loader.c
dlls/ntdll/loader.c
+27
-20
No files found.
dlls/ntdll/loader.c
View file @
69089152
...
...
@@ -1427,7 +1427,6 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
DWORD
flags
,
WINE_MODREF
**
pwm
)
{
char
error
[
256
],
dllname
[
MAX_PATH
];
int
file_exists
;
const
WCHAR
*
name
,
*
p
;
DWORD
len
,
i
;
void
*
handle
=
NULL
;
...
...
@@ -1456,20 +1455,28 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
if
(
!
RtlDosPathNameToNtPathName_U
(
path
,
&
nt_name
,
NULL
,
NULL
))
return
STATUS_DLL_NOT_FOUND
;
if
(
!
wine_nt_to_unix_file_name
(
&
nt_name
,
&
unix_name
,
FILE_OPEN
,
FALSE
))
if
(
wine_nt_to_unix_file_name
(
&
nt_name
,
&
unix_name
,
FILE_OPEN
,
FALSE
))
{
file_exists
=
1
;
prev_info
=
builtin_load_info
;
info
.
filename
=
nt_name
.
Buffer
+
4
;
/* skip \??\ */
builtin_load_info
=
&
info
;
handle
=
wine_dlopen
(
unix_name
.
Buffer
,
RTLD_NOW
,
error
,
sizeof
(
error
)
);
builtin_load_info
=
prev_info
;
RtlFreeHeap
(
GetProcessHeap
(),
0
,
unix_name
.
Buffer
);
RtlFreeUnicodeString
(
&
nt_name
);
return
STATUS_DLL_NOT_FOUND
;
}
prev_info
=
builtin_load_info
;
info
.
filename
=
nt_name
.
Buffer
+
4
;
/* skip \??\ */
builtin_load_info
=
&
info
;
handle
=
wine_dlopen
(
unix_name
.
Buffer
,
RTLD_NOW
,
error
,
sizeof
(
error
)
);
builtin_load_info
=
prev_info
;
RtlFreeUnicodeString
(
&
nt_name
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
unix_name
.
Buffer
);
if
(
!
handle
)
{
WARN
(
"failed to load .so lib for builtin %s: %s
\n
"
,
debugstr_w
(
path
),
error
);
return
STATUS_INVALID_IMAGE_FORMAT
;
}
}
else
{
int
file_exists
;
/* we don't want to depend on the current codepage here */
len
=
strlenW
(
name
)
+
1
;
if
(
len
>=
sizeof
(
dllname
))
return
STATUS_NAME_TOO_LONG
;
...
...
@@ -1484,20 +1491,20 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
builtin_load_info
=
&
info
;
handle
=
wine_dll_load
(
dllname
,
error
,
sizeof
(
error
),
&
file_exists
);
builtin_load_info
=
prev_info
;
}
if
(
!
handle
)
{
if
(
!
file_exists
)
if
(
!
handle
)
{
/* The file does not exist -> WARN() */
WARN
(
"cannot open .so lib for builtin %s: %s
\n
"
,
debugstr_w
(
name
),
error
);
return
STATUS_DLL_NOT_FOUND
;
if
(
!
file_exists
)
{
/* The file does not exist -> WARN() */
WARN
(
"cannot open .so lib for builtin %s: %s
\n
"
,
debugstr_w
(
name
),
error
);
return
STATUS_DLL_NOT_FOUND
;
}
/* ERR() for all other errors (missing functions, ...) */
ERR
(
"failed to load .so lib for builtin %s: %s
\n
"
,
debugstr_w
(
name
),
error
);
return
STATUS_PROCEDURE_NOT_FOUND
;
}
/* ERR() for all other errors (missing functions, ...) */
ERR
(
"failed to load .so lib for builtin %s: %s
\n
"
,
debugstr_w
(
name
),
error
);
return
STATUS_PROCEDURE_NOT_FOUND
;
}
if
(
info
.
status
!=
STATUS_SUCCESS
)
return
info
.
status
;
if
(
!
info
.
wm
)
...
...
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