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
410db2ad
Commit
410db2ad
authored
Jun 14, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrote SetFilePointer to use SetFilePointerEx.
parent
e937e469
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
36 deletions
+11
-36
file.c
dlls/kernel/file.c
+10
-36
winbase.h
include/winbase.h
+1
-0
No files found.
dlls/kernel/file.c
View file @
410db2ad
...
...
@@ -815,48 +815,22 @@ BOOL WINAPI SetEndOfFile( HANDLE hFile )
/***********************************************************************
* SetFilePointer (KERNEL32.@)
*/
DWORD
WINAPI
SetFilePointer
(
HANDLE
hFile
,
LONG
distance
,
LONG
*
highword
,
DWORD
method
)
DWORD
WINAPI
SetFilePointer
(
HANDLE
hFile
,
LONG
distance
,
LONG
*
highword
,
DWORD
method
)
{
static
const
int
whence
[
3
]
=
{
SEEK_SET
,
SEEK_CUR
,
SEEK_END
};
DWORD
ret
=
INVALID_SET_FILE_POINTER
;
NTSTATUS
status
;
int
fd
;
TRACE
(
"handle %p offset %ld high %ld origin %ld
\n
"
,
hFile
,
distance
,
highword
?*
highword
:
0
,
method
);
LARGE_INTEGER
dist
,
newpos
;
if
(
method
>
FILE_END
)
if
(
highword
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
)
;
return
ret
;
dist
.
u
.
LowPart
=
distance
;
dist
.
u
.
HighPart
=
*
highword
;
}
else
dist
.
QuadPart
=
distance
;
if
(
!
(
status
=
wine_server_handle_to_fd
(
hFile
,
0
,
&
fd
,
NULL
,
NULL
)))
{
off_t
pos
,
res
;
if
(
highword
)
pos
=
((
off_t
)
*
highword
<<
32
)
|
(
ULONG
)
distance
;
else
pos
=
(
off_t
)
distance
;
if
((
res
=
lseek
(
fd
,
pos
,
whence
[
method
]
))
==
(
off_t
)
-
1
)
{
/* also check EPERM due to SuSE7 2.2.16 lseek() EPERM kernel bug */
if
(((
errno
==
EINVAL
)
||
(
errno
==
EPERM
))
&&
(
method
!=
FILE_BEGIN
)
&&
(
pos
<
0
))
SetLastError
(
ERROR_NEGATIVE_SEEK
);
else
FILE_SetDosError
();
}
else
{
ret
=
(
DWORD
)
res
;
if
(
highword
)
*
highword
=
(
res
>>
32
);
if
(
ret
==
INVALID_SET_FILE_POINTER
)
SetLastError
(
0
);
}
wine_server_release_fd
(
hFile
,
fd
);
}
else
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
if
(
!
SetFilePointerEx
(
hFile
,
dist
,
&
newpos
,
method
))
return
INVALID_SET_FILE_POINTER
;
return
ret
;
if
(
highword
)
*
highword
=
newpos
.
u
.
HighPart
;
if
(
newpos
.
u
.
LowPart
==
INVALID_SET_FILE_POINTER
)
SetLastError
(
0
);
return
newpos
.
u
.
LowPart
;
}
...
...
include/winbase.h
View file @
410db2ad
...
...
@@ -1621,6 +1621,7 @@ BOOL WINAPI SetEvent(HANDLE);
VOID
WINAPI
SetFileApisToANSI
(
void
);
VOID
WINAPI
SetFileApisToOEM
(
void
);
DWORD
WINAPI
SetFilePointer
(
HANDLE
,
LONG
,
LPLONG
,
DWORD
);
BOOL
WINAPI
SetFilePointerEx
(
HANDLE
,
LARGE_INTEGER
,
LARGE_INTEGER
*
,
DWORD
);
BOOL
WINAPI
SetFileSecurityA
(
LPCSTR
,
SECURITY_INFORMATION
,
PSECURITY_DESCRIPTOR
);
BOOL
WINAPI
SetFileSecurityW
(
LPCWSTR
,
SECURITY_INFORMATION
,
PSECURITY_DESCRIPTOR
);
#define SetFileSecurity WINELIB_NAME_AW(SetFileSecurity)
...
...
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