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
a370ab4e
Commit
a370ab4e
authored
Oct 24, 1998
by
Uwe Bonnes
Committed by
Alexandre Julliard
Oct 24, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File sharing fixes.
parent
23b06a8f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
13 deletions
+39
-13
file.c
files/file.c
+8
-5
file.h
include/file.h
+1
-1
crtdll.c
misc/crtdll.c
+2
-2
vxd.c
msdos/vxd.c
+1
-1
file.c
win32/file.c
+27
-4
No files found.
files/file.c
View file @
a370ab4e
...
...
@@ -603,8 +603,13 @@ HFILE32 FILE_OpenUnixFile( const char *name, int mode )
/***********************************************************************
* FILE_Open
*
* path[I] name of file to open
* mode[I] mode how to open, in unix notation
* shareMode[I] the sharing mode in the win OpenFile notation
*
*/
HFILE32
FILE_Open
(
LPCSTR
path
,
INT32
mode
)
HFILE32
FILE_Open
(
LPCSTR
path
,
INT32
mode
,
INT32
shareMode
)
{
DOS_FULL_NAME
full_name
;
const
char
*
unixName
;
...
...
@@ -640,7 +645,7 @@ HFILE32 FILE_Open( LPCSTR path, INT32 mode )
unixName
=
full_name
.
long_name
;
}
dosMode
=
FILE_UnixToDosMode
(
mode
);
dosMode
=
FILE_UnixToDosMode
(
mode
)
|
shareMode
;
fileInUse
=
FILE_InUse
(
full_name
.
long_name
,
&
oldMode
);
if
(
fileInUse
)
{
...
...
@@ -1409,9 +1414,7 @@ HFILE32 WINAPI _lopen32( LPCSTR path, INT32 mode )
TRACE
(
file
,
"('%s',%04x)
\n
"
,
path
,
mode
);
unixMode
=
FILE_DOSToUnixMode
(
mode
);
unixMode
|=
(
mode
&
0x70
);
/* transfer the OF_SHARE options to handle
them in FILE_Open*/
return
FILE_Open
(
path
,
unixMode
);
return
FILE_Open
(
path
,
unixMode
,
(
mode
&
0x70
));
}
...
...
include/file.h
View file @
a370ab4e
...
...
@@ -67,7 +67,7 @@ extern HFILE32 FILE_DupUnixHandle( int fd );
extern
BOOL32
FILE_Stat
(
LPCSTR
unixName
,
BY_HANDLE_FILE_INFORMATION
*
info
);
extern
HFILE32
FILE_Dup
(
HFILE32
hFile
);
extern
HFILE32
FILE_Dup2
(
HFILE32
hFile1
,
HFILE32
hFile2
);
extern
HFILE32
FILE_Open
(
LPCSTR
path
,
INT32
mode
);
extern
HFILE32
FILE_Open
(
LPCSTR
path
,
INT32
mode
,
INT32
sharemode
);
extern
HFILE32
FILE_OpenUnixFile
(
LPCSTR
path
,
INT32
mode
);
extern
BOOL32
FILE_SetFileType
(
HFILE32
hFile
,
DWORD
type
);
extern
LPVOID
FILE_mmap
(
HFILE32
hFile
,
LPVOID
start
,
...
...
misc/crtdll.c
View file @
a370ab4e
...
...
@@ -295,7 +295,7 @@ DWORD __cdecl CRTDLL_fopen(LPCSTR path, LPCSTR mode)
else
if
(
strchr
(
mode
,
'b'
))
TRACE
(
crtdll
,
"%s in BINARY mode
\n
"
,
path
);
dos_fildes
=
FILE_Open
(
path
,
flagmode
);
dos_fildes
=
FILE_Open
(
path
,
flagmode
,
0
);
unix_fildes
=
FILE_GetUnixHandle
(
dos_fildes
);
file
=
fdopen
(
unix_fildes
,
mode
);
...
...
@@ -1199,7 +1199,7 @@ HFILE32 __cdecl CRTDLL__open(LPCSTR path,INT32 flags)
TRACE
(
crtdll
,
"CRTDLL_open file unsupported flags 0x%04x
\n
"
,
flags
);
/* End Fixme */
ret
=
FILE_Open
(
path
,
wineflags
);
ret
=
FILE_Open
(
path
,
wineflags
,
0
);
TRACE
(
crtdll
,
"CRTDLL_open file %s mode 0x%04x (lccmode 0x%04x) got dfh %d
\n
"
,
path
,
wineflags
,
flags
,
ret
);
return
ret
;
...
...
msdos/vxd.c
View file @
a370ab4e
...
...
@@ -607,7 +607,7 @@ void VXD_Win32s( CONTEXT *context )
IMAGE_NT_HEADERS
*
nt_header
=
PE_HEADER
(
module
->
baseAddr
);
IMAGE_SECTION_HEADER
*
pe_seg
=
PE_SECTIONS
(
module
->
baseAddr
);
HFILE32
image
=
FILE_Open
(
module
->
pathName
,
O_RDONLY
);
HFILE32
image
=
FILE_Open
(
module
->
pathName
,
O_RDONLY
,
0
);
BOOL32
error
=
(
image
==
INVALID_HANDLE_VALUE32
);
UINT32
i
;
...
...
win32/file.c
View file @
a370ab4e
...
...
@@ -27,6 +27,7 @@ DWORD ErrnoToLastError(int errno_num);
static
int
TranslateCreationFlags
(
DWORD
create_flags
);
static
int
TranslateAccessFlags
(
DWORD
access_flags
);
static
int
TranslateShareFlags
(
DWORD
share_flags
);
/***********************************************************************
* WriteFile (KERNEL32.578)
...
...
@@ -129,13 +130,14 @@ HFILE32 WINAPI CreateFile32A(LPCSTR filename, DWORD access, DWORD sharing,
LPSECURITY_ATTRIBUTES
security
,
DWORD
creation
,
DWORD
attributes
,
HANDLE32
template
)
{
int
access_flags
,
create_flags
;
int
access_flags
,
create_flags
,
share_flags
;
HFILE32
to_dup
=
HFILE_ERROR32
;
/* handle to dup */
/* Translate the various flags to Unix-style.
*/
access_flags
=
TranslateAccessFlags
(
access
);
create_flags
=
TranslateCreationFlags
(
creation
);
share_flags
=
TranslateShareFlags
(
sharing
);
if
(
template
)
FIXME
(
file
,
"template handles not supported.
\n
"
);
...
...
@@ -183,7 +185,7 @@ HFILE32 WINAPI CreateFile32A(LPCSTR filename, DWORD access, DWORD sharing,
handle
=
HFILE_ERROR32
;
return
handle
;
}
return
FILE_Open
(
filename
,
access_flags
|
create_flags
);
return
FILE_Open
(
filename
,
access_flags
|
create_flags
,
share_flags
);
}
...
...
@@ -252,8 +254,29 @@ static int TranslateCreationFlags(DWORD create_flags)
return
rc
;
}
static
int
TranslateShareFlags
(
DWORD
share_flags
)
/*
OPEN_SHARE_DENYNONE FILE_SHARE_READ | FILE_SHARE_WRITE
OPEN_SHARE_DENYREAD FILE_SHARE_WRITE
OPEN_SHARE_DENYREADWRITE 0
OPEN_SHARE_DENYWRITE FILE_SHARE_READ
*/
{
switch
(
share_flags
)
{
case
FILE_SHARE_READ
|
FILE_SHARE_WRITE
:
return
OF_SHARE_DENY_NONE
;
case
FILE_SHARE_WRITE
:
return
OF_SHARE_DENY_READ
;
case
FILE_SHARE_READ
:
return
OF_SHARE_DENY_WRITE
;
case
0
:
return
OF_SHARE_EXCLUSIVE
;
default:
}
FIXME
(
file
,
"unknown sharing flags 0x%04lx
\n
"
,
share_flags
);
return
OF_SHARE_EXCLUSIVE
;
}
/**************************************************************************
* SetFileAttributes16 (KERNEL.421)
*/
...
...
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