Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
953849f2
Commit
953849f2
authored
Oct 08, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added hack to call CreateFileW through a pointer so that we don't need
to link to kernel functions. Commented out SMB support in NtReadFile for now.
parent
01def427
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
12 deletions
+28
-12
process.c
dlls/kernel/process.c
+2
-1
file.c
dlls/ntdll/file.c
+5
-4
loader.c
dlls/ntdll/loader.c
+4
-3
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+9
-1
path.c
dlls/ntdll/path.c
+7
-2
module.h
include/module.h
+1
-1
No files found.
dlls/kernel/process.c
View file @
953849f2
...
...
@@ -761,7 +761,8 @@ void __wine_process_init( int argc, char *argv[] )
if
(
!
build_command_line
(
argv
))
goto
error
;
/* create 32-bit module for main exe */
if
(
!
(
current_process
.
module
=
BUILTIN32_LoadExeModule
(
current_process
.
module
)))
goto
error
;
if
(
!
(
current_process
.
module
=
BUILTIN32_LoadExeModule
(
current_process
.
module
,
CreateFileW
)))
goto
error
;
stack_size
=
RtlImageNtHeader
(
current_process
.
module
)
->
OptionalHeader
.
SizeOfStackReserve
;
/* allocate main thread stack */
...
...
dlls/ntdll/file.c
View file @
953849f2
...
...
@@ -38,7 +38,6 @@
#include "wine/server.h"
#include "async.h"
#include "ntdll_misc.h"
#include "../files/smb.h"
#include "winternl.h"
#include "winioctl.h"
...
...
@@ -94,8 +93,8 @@ NTSTATUS WINAPI NtOpenFile(
return
STATUS_OBJECT_NAME_NOT_FOUND
;
/* FIXME: this calls SetLastError() -> bad */
*
FileHandle
=
CreateFileW
(
&
filename
[
strlenW
(
szDosDevices
)],
DesiredAccess
,
ShareAccess
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
*
FileHandle
=
p
CreateFileW
(
&
filename
[
strlenW
(
szDosDevices
)],
DesiredAccess
,
ShareAccess
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
(
*
FileHandle
==
INVALID_HANDLE_VALUE
)
return
STATUS_OBJECT_NAME_NOT_FOUND
;
return
STATUS_SUCCESS
;
}
...
...
@@ -415,7 +414,9 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
case
FD_TYPE_SMB
:
FIXME
(
"NIY-SMB
\n
"
);
close
(
unix_handle
);
return
SMB_ReadFile
(
hFile
,
buffer
,
length
,
io_status
);
/* FIXME */
/* return SMB_ReadFile(hFile, buffer, length, io_status); */
return
STATUS_INVALID_HANDLE
;
case
FD_TYPE_DEFAULT
:
/* normal unix files */
...
...
dlls/ntdll/loader.c
View file @
953849f2
...
...
@@ -1313,7 +1313,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
{
if
((
*
pwm
=
find_basename_module
(
file_part
))
!=
NULL
)
return
STATUS_SUCCESS
;
}
*
handle
=
CreateFileW
(
filename
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
*
handle
=
p
CreateFileW
(
filename
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
return
STATUS_SUCCESS
;
}
...
...
@@ -1348,7 +1348,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
strcatW
(
file_part
,
dllW
);
}
if
((
*
pwm
=
find_fullname_module
(
filename
))
!=
NULL
)
return
STATUS_SUCCESS
;
*
handle
=
CreateFileW
(
filename
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
*
handle
=
p
CreateFileW
(
filename
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
return
STATUS_SUCCESS
;
overflow:
...
...
@@ -1881,10 +1881,11 @@ PVOID WINAPI RtlImageRvaToVa( const IMAGE_NT_HEADERS *nt, HMODULE module,
*
* FIXME: this should be done differently once kernel is properly separated.
*/
HMODULE
BUILTIN32_LoadExeModule
(
HMODULE
main
)
HMODULE
BUILTIN32_LoadExeModule
(
HMODULE
main
,
void
*
CreateFileW_ptr
)
{
static
struct
builtin_load_info
default_info
;
pCreateFileW
=
CreateFileW_ptr
;
if
(
!
MODULE_GetSystemDirectory
(
&
system_dir
))
MESSAGE
(
"Couldn't get system dir in process init
\n
"
);
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
=
main
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
953849f2
...
...
@@ -53,13 +53,21 @@ static inline HANDLE ntdll_get_process_heap(void)
{
return
NtCurrentTeb
()
->
Peb
->
ProcessHeap
;
}
#define GetProcessHeap() ntdll_get_process_heap()
/* redefine these to make sure we don't reference kernel symbols */
#define GetProcessHeap() (NtCurrentTeb()->Peb->ProcessHeap)
#define GetCurrentProcessId() ((DWORD)NtCurrentTeb()->ClientId.UniqueProcess)
#define GetCurrentThreadId() ((DWORD)NtCurrentTeb()->ClientId.UniqueThread)
static
inline
RTL_USER_PROCESS_PARAMETERS
*
ntdll_get_process_pmts
(
void
)
{
return
NtCurrentTeb
()
->
Peb
->
ProcessParameters
;
}
/* hack: upcall to kernel */
extern
HANDLE
(
WINAPI
*
pCreateFileW
)(
LPCWSTR
filename
,
DWORD
access
,
DWORD
sharing
,
LPSECURITY_ATTRIBUTES
sa
,
DWORD
creation
,
DWORD
attributes
,
HANDLE
template
);
/* Device IO */
/* ntdll/cdrom.c.c */
extern
NTSTATUS
CDROM_DeviceIoControl
(
DWORD
clientID
,
HANDLE
hDevice
,
...
...
dlls/ntdll/path.c
View file @
953849f2
...
...
@@ -37,6 +37,11 @@ static const WCHAR DeviceRootW[] = {'\\','\\','.','\\',0};
static
const
WCHAR
NTDosPrefixW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
0
};
static
const
WCHAR
UncPfxW
[]
=
{
'U'
,
'N'
,
'C'
,
'\\'
,
0
};
/* FIXME: hack! */
HANDLE
(
WINAPI
*
pCreateFileW
)(
LPCWSTR
filename
,
DWORD
access
,
DWORD
sharing
,
LPSECURITY_ATTRIBUTES
sa
,
DWORD
creation
,
DWORD
attributes
,
HANDLE
template
);
#define IS_SEPARATOR(ch) ((ch) == '\\' || (ch) == '/')
/***********************************************************************
...
...
@@ -67,8 +72,8 @@ DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U( PCWSTR path )
*/
BOOLEAN
WINAPI
RtlDoesFileExists_U
(
LPCWSTR
file_name
)
{
HANDLE
handle
=
CreateFileW
(
file_name
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
HANDLE
handle
=
p
CreateFileW
(
file_name
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
NtClose
(
handle
);
return
TRUE
;
...
...
include/module.h
View file @
953849f2
...
...
@@ -204,6 +204,6 @@ extern void MODULE_GetLoadOrderA( enum loadorder_type plo[], const WCHAR *app_na
const
char
*
path
,
BOOL
win32
);
/* relay32/builtin.c */
extern
HMODULE
BUILTIN32_LoadExeModule
(
HMODULE
main
);
extern
HMODULE
BUILTIN32_LoadExeModule
(
HMODULE
main
,
void
*
CreateFileW_ptr
);
#endif
/* __WINE_MODULE_H */
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