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
712caf35
Commit
712caf35
authored
Aug 03, 2002
by
Juergen Schmied
Committed by
Alexandre Julliard
Aug 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed possible loss of data with given overlapped structure on a
file opened in non overlapped mode. - Fixme for file-lock functions.
parent
7bf07d15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
5 deletions
+55
-5
file.c
files/file.c
+50
-4
winbase.h
include/winbase.h
+5
-1
No files found.
files/file.c
View file @
712caf35
...
...
@@ -1675,11 +1675,27 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
{
case
FD_TYPE_SMB
:
return
SMB_ReadFile
(
hFile
,
buffer
,
bytesToRead
,
bytesRead
,
NULL
);
case
FD_TYPE_CONSOLE
:
return
FILE_ReadConsole
(
hFile
,
buffer
,
bytesToRead
,
bytesRead
,
NULL
);
case
FD_TYPE_DEFAULT
:
/* normal unix files */
if
(
unix_handle
==
-
1
)
return
FALSE
;
if
(
overlapped
)
{
DWORD
highOffset
=
overlapped
->
OffsetHigh
;
if
(
(
INVALID_SET_FILE_POINTER
==
SetFilePointer
(
hFile
,
overlapped
->
Offset
,
&
highOffset
,
FILE_BEGIN
))
&&
(
GetLastError
()
!=
NO_ERROR
)
)
{
close
(
unix_handle
);
return
FALSE
;
}
}
break
;
default:
/* normal unix files */
if
(
unix_handle
==
-
1
)
return
FALSE
;
if
(
overlapped
)
...
...
@@ -1877,9 +1893,33 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite,
TRACE
(
"%d %s %ld %p %p
\n
"
,
hFile
,
debugstr_an
(
buffer
,
bytesToWrite
),
bytesToWrite
,
bytesWritten
,
overlapped
);
return
FILE_WriteConsole
(
hFile
,
buffer
,
bytesToWrite
,
bytesWritten
,
NULL
);
case
FD_TYPE_DEFAULT
:
if
(
unix_handle
==
-
1
)
return
FALSE
;
if
(
overlapped
)
{
DWORD
highOffset
=
overlapped
->
OffsetHigh
;
if
(
(
INVALID_SET_FILE_POINTER
==
SetFilePointer
(
hFile
,
overlapped
->
Offset
,
&
highOffset
,
FILE_BEGIN
))
&&
(
GetLastError
()
!=
NO_ERROR
)
)
{
close
(
unix_handle
);
return
FALSE
;
}
}
break
;
default:
if
(
unix_handle
==
-
1
)
return
FALSE
;
if
(
unix_handle
==
-
1
)
return
FALSE
;
if
(
overlapped
)
{
close
(
unix_handle
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
break
;
}
/* synchronous file write */
...
...
@@ -1975,7 +2015,7 @@ HFILE WINAPI _lcreat( LPCSTR path, INT attr )
DWORD
WINAPI
SetFilePointer
(
HANDLE
hFile
,
LONG
distance
,
LONG
*
highword
,
DWORD
method
)
{
DWORD
ret
=
0xffffffff
;
DWORD
ret
=
INVALID_SET_FILE_POINTER
;
TRACE
(
"handle %d offset %ld high %ld origin %ld
\n
"
,
hFile
,
distance
,
highword
?*
highword
:
0
,
method
);
...
...
@@ -2719,6 +2759,9 @@ BOOL WINAPI LockFile( HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHig
DWORD
nNumberOfBytesToLockLow
,
DWORD
nNumberOfBytesToLockHigh
)
{
BOOL
ret
;
FIXME
(
"not implemented in server
\n
"
);
SERVER_START_REQ
(
lock_file
)
{
req
->
handle
=
hFile
;
...
...
@@ -2770,6 +2813,9 @@ BOOL WINAPI UnlockFile( HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetH
DWORD
nNumberOfBytesToUnlockLow
,
DWORD
nNumberOfBytesToUnlockHigh
)
{
BOOL
ret
;
FIXME
(
"not implemented in server
\n
"
);
SERVER_START_REQ
(
unlock_file
)
{
req
->
handle
=
hFile
;
...
...
include/winbase.h
View file @
712caf35
...
...
@@ -286,7 +286,11 @@ typedef struct
#define PROCESS_HEAP_ENTRY_MOVEABLE 0x0010
#define PROCESS_HEAP_ENTRY_DDESHARE 0x0020
#define INVALID_HANDLE_VALUE ((HANDLE) -1)
#define INVALID_HANDLE_VALUE ((HANDLE) -1)
#define INVALID_FILE_SIZE ((DWORD)0xFFFFFFFF)
#define INVALID_SET_FILE_POINTER ((DWORD)-1)
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
...
...
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