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
2f8fd106
Commit
2f8fd106
authored
May 03, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF_CREATE should force write access in OpenFile.
parent
095752a1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
file.c
dlls/kernel/file.c
+14
-4
No files found.
dlls/kernel/file.c
View file @
2f8fd106
...
...
@@ -74,10 +74,18 @@ static WINE_EXCEPTION_FILTER(page_fault)
*
* Wrapper for CreateFile that takes OF_* mode flags.
*/
static
HANDLE
create_file_OF
(
LPCSTR
path
,
INT
mode
,
DWORD
creation
)
static
HANDLE
create_file_OF
(
LPCSTR
path
,
INT
mode
)
{
DWORD
access
,
sharing
;
DWORD
access
,
sharing
,
creation
;
if
(
mode
&
OF_CREATE
)
{
creation
=
CREATE_ALWAYS
;
access
=
GENERIC_READ
|
GENERIC_WRITE
;
}
else
{
creation
=
OPEN_EXISTING
;
switch
(
mode
&
0x03
)
{
case
OF_READ
:
access
=
GENERIC_READ
;
break
;
...
...
@@ -85,6 +93,8 @@ static HANDLE create_file_OF( LPCSTR path, INT mode, DWORD creation )
case
OF_READWRITE
:
access
=
GENERIC_READ
|
GENERIC_WRITE
;
break
;
default:
access
=
0
;
break
;
}
}
switch
(
mode
&
0x70
)
{
case
OF_SHARE_EXCLUSIVE
:
sharing
=
0
;
break
;
...
...
@@ -539,7 +549,7 @@ HFILE WINAPI _lcreat( LPCSTR path, INT attr )
HFILE
WINAPI
_lopen
(
LPCSTR
path
,
INT
mode
)
{
TRACE
(
"(%s,%04x)
\n
"
,
debugstr_a
(
path
),
mode
);
return
(
HFILE
)
create_file_OF
(
path
,
mode
,
OPEN_EXISTING
);
return
(
HFILE
)
create_file_OF
(
path
,
mode
&
~
OF_CREATE
);
}
...
...
@@ -1944,7 +1954,7 @@ HFILE WINAPI OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
if
(
mode
&
OF_CREATE
)
{
if
((
handle
=
create_file_OF
(
name
,
mode
,
CREATE_ALWAYS
))
==
INVALID_HANDLE_VALUE
)
if
((
handle
=
create_file_OF
(
name
,
mode
))
==
INVALID_HANDLE_VALUE
)
goto
error
;
}
else
...
...
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