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
3bb2c117
Commit
3bb2c117
authored
Nov 05, 2013
by
Andrey Zhezherun
Committed by
Alexandre Julliard
Nov 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implemented _chsize_s.
parent
b4360872
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
13 deletions
+25
-13
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr110.spec
dlls/msvcr110/msvcr110.spec
+1
-1
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+1
-1
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
file.c
dlls/msvcrt/file.c
+19
-8
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
io.h
include/msvcrt/io.h
+1
-0
No files found.
dlls/msvcr100/msvcr100.spec
View file @
3bb2c117
...
...
@@ -725,7 +725,7 @@
@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp
@ cdecl _chmod(str long) msvcrt._chmod
@ cdecl _chsize(long long) msvcrt._chsize
@
stub
_chsize_s
@
cdecl _chsize_s(long int64) msvcrt.
_chsize_s
@ cdecl _clearfp() msvcrt._clearfp
@ cdecl _close(long) msvcrt._close
@ cdecl _commit(long) msvcrt._commit
...
...
dlls/msvcr110/msvcr110.spec
View file @
3bb2c117
...
...
@@ -1073,7 +1073,7 @@
@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp
@ cdecl _chmod(str long) msvcrt._chmod
@ cdecl _chsize(long long) msvcrt._chsize
@
stub
_chsize_s
@
cdecl _chsize_s(long int64) msvcrt.
_chsize_s
@ cdecl _clearfp() msvcrt._clearfp
@ cdecl _close(long) msvcrt._close
@ cdecl _commit(long) msvcrt._commit
...
...
dlls/msvcr80/msvcr80.spec
View file @
3bb2c117
...
...
@@ -389,7 +389,7 @@
@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp
@ cdecl _chmod(str long) msvcrt._chmod
@ cdecl _chsize(long long) msvcrt._chsize
@
stub
_chsize_s
@
cdecl _chsize_s(long int64) msvcrt.
_chsize_s
@ cdecl _clearfp() msvcrt._clearfp
@ cdecl _close(long) msvcrt._close
@ cdecl _commit(long) msvcrt._commit
...
...
dlls/msvcr90/msvcr90.spec
View file @
3bb2c117
...
...
@@ -372,7 +372,7 @@
@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp
@ cdecl _chmod(str long) msvcrt._chmod
@ cdecl _chsize(long long) msvcrt._chsize
@
stub
_chsize_s
@
cdecl _chsize_s(long int64) msvcrt.
_chsize_s
@ cdecl _clearfp() msvcrt._clearfp
@ cdecl _close(long) msvcrt._close
@ cdecl _commit(long) msvcrt._commit
...
...
dlls/msvcrt/file.c
View file @
3bb2c117
...
...
@@ -1259,15 +1259,17 @@ int CDECL MSVCRT_fseek(MSVCRT_FILE* file, MSVCRT_long offset, int whence)
}
/*********************************************************************
* _chsize (MSVCRT.@)
* _chsize
_s
(MSVCRT.@)
*/
int
CDECL
MSVCRT__chsize
(
int
fd
,
MSVCRT_long
size
)
int
CDECL
MSVCRT__chsize
_s
(
int
fd
,
__int64
size
)
{
LONG
cur
,
pos
;
__int64
cur
,
pos
;
HANDLE
handle
;
BOOL
ret
=
FALSE
;
TRACE
(
"(fd=%d, size=%d)
\n
"
,
fd
,
size
);
TRACE
(
"(fd=%d, size=%s)
\n
"
,
fd
,
wine_dbgstr_longlong
(
size
));
if
(
!
MSVCRT_CHECK_PMT
(
size
>=
0
))
return
MSVCRT_EINVAL
;
LOCK_FILES
();
...
...
@@ -1275,10 +1277,10 @@ int CDECL MSVCRT__chsize(int fd, MSVCRT_long size)
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
/* save the current file pointer */
cur
=
MSVCRT__lseek
(
fd
,
0
,
SEEK_CUR
);
cur
=
MSVCRT__lseek
i64
(
fd
,
0
,
SEEK_CUR
);
if
(
cur
>=
0
)
{
pos
=
MSVCRT__lseek
(
fd
,
size
,
SEEK_SET
);
pos
=
MSVCRT__lseek
i64
(
fd
,
size
,
SEEK_SET
);
if
(
pos
>=
0
)
{
ret
=
SetEndOfFile
(
handle
);
...
...
@@ -1286,12 +1288,21 @@ int CDECL MSVCRT__chsize(int fd, MSVCRT_long size)
}
/* restore the file pointer */
MSVCRT__lseek
(
fd
,
cur
,
SEEK_SET
);
MSVCRT__lseek
i64
(
fd
,
cur
,
SEEK_SET
);
}
}
UNLOCK_FILES
();
return
ret
?
0
:
-
1
;
return
ret
?
0
:
*
MSVCRT__errno
();
}
/*********************************************************************
* _chsize (MSVCRT.@)
*/
int
CDECL
MSVCRT__chsize
(
int
fd
,
MSVCRT_long
size
)
{
/* _chsize_s returns errno on failure but _chsize should return -1 */
return
MSVCRT__chsize_s
(
fd
,
size
)
==
0
?
0
:
-
1
;
}
/*********************************************************************
...
...
dlls/msvcrt/msvcrt.spec
View file @
3bb2c117
...
...
@@ -356,7 +356,7 @@
@ cdecl -arch=i386 -norelay _chkesp()
@ cdecl _chmod(str long) MSVCRT__chmod
@ cdecl _chsize(long long) MSVCRT__chsize
# stub _chsize_s(long int64)
@ cdecl _chsize_s(long int64) MSVCRT__chsize_s
# stub _chvalidator(long long)
# stub _chvalidator_l(ptr long long)
@ cdecl _clearfp()
...
...
include/msvcrt/io.h
View file @
3bb2c117
...
...
@@ -87,6 +87,7 @@ extern "C" {
int
__cdecl
_access
(
const
char
*
,
int
);
int
__cdecl
_chmod
(
const
char
*
,
int
);
int
__cdecl
_chsize
(
int
,
__msvcrt_ulong
);
int
__cdecl
_chsize_s
(
int
,
__int64
);
int
__cdecl
_close
(
int
);
int
__cdecl
_commit
(
int
);
int
__cdecl
_creat
(
const
char
*
,
int
);
...
...
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