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
79ab7152
Commit
79ab7152
authored
Sep 28, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Sep 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implement _get_errno.
parent
b7a74d24
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
4 deletions
+42
-4
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+1
-1
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
errno.c
dlls/msvcrt/errno.c
+12
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
misc.c
dlls/msvcrt/tests/misc.c
+25
-0
stdlib.h
include/msvcrt/stdlib.h
+1
-0
No files found.
dlls/msvcr100/msvcr100.spec
View file @
79ab7152
...
...
@@ -679,7 +679,7 @@
@ stub _get_daylight
@ stub _get_doserrno
@ stub _get_dstbias
@
stub
_get_errno
@
cdecl _get_errno(ptr) msvcrt.
_get_errno
@ stub _get_fmode
@ cdecl _get_heap_handle() msvcrt._get_heap_handle
@ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler
...
...
dlls/msvcr80/msvcr80.spec
View file @
79ab7152
...
...
@@ -521,7 +521,7 @@
@ stub _get_daylight
@ stub _get_doserrno
@ stub _get_dstbias
@
stub
_get_errno
@
cdecl _get_errno(ptr) msvcrt.
_get_errno
@ stub _get_fmode
@ cdecl _get_heap_handle() msvcrt._get_heap_handle
@ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler
...
...
dlls/msvcr90/msvcr90.spec
View file @
79ab7152
...
...
@@ -513,7 +513,7 @@
@ stub _get_daylight
@ stub _get_doserrno
@ stub _get_dstbias
@
stub
_get_errno
@
cdecl _get_errno(ptr) msvcrt.
_get_errno
@ stub _get_fmode
@ cdecl _get_heap_handle() msvcrt._get_heap_handle
@ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler
...
...
dlls/msvcrt/errno.c
View file @
79ab7152
...
...
@@ -204,6 +204,18 @@ MSVCRT_ulong* CDECL MSVCRT___doserrno(void)
}
/*********************************************************************
* _get_errno (MSVCRT.@)
*/
int
CDECL
_get_errno
(
int
*
pValue
)
{
if
(
!
pValue
)
return
MSVCRT_EINVAL
;
*
pValue
=
*
MSVCRT__errno
();
return
0
;
}
/*********************************************************************
* strerror (MSVCRT.@)
*/
char
*
CDECL
MSVCRT_strerror
(
int
err
)
...
...
dlls/msvcrt/msvcrt.spec
View file @
79ab7152
...
...
@@ -464,7 +464,7 @@
@ cdecl _gcvt_s(ptr long double long)
# stub _get_doserrno
# stub _get_environ
# stub _get_errno
@ cdecl _get_errno(ptr)
# stub _get_fileinfo
# stub _get_fmode
@ cdecl _get_heap_handle()
...
...
dlls/msvcrt/tests/misc.c
View file @
79ab7152
...
...
@@ -26,6 +26,7 @@ static int (__cdecl *prand_s)(unsigned int *);
static
int
(
__cdecl
*
pmemcpy_s
)(
void
*
,
MSVCRT_size_t
,
void
*
,
MSVCRT_size_t
);
static
int
(
__cdecl
*
pI10_OUTPUT
)(
long
double
,
int
,
int
,
void
*
);
static
int
(
__cdecl
*
pstrerror_s
)(
char
*
,
MSVCRT_size_t
,
int
);
static
int
(
__cdecl
*
p_get_errno
)(
int
*
);
static
void
init
(
void
)
{
...
...
@@ -35,6 +36,7 @@ static void init(void)
pmemcpy_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"memcpy_s"
);
pI10_OUTPUT
=
(
void
*
)
GetProcAddress
(
hmod
,
"$I10_OUTPUT"
);
pstrerror_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"strerror_s"
);
p_get_errno
=
(
void
*
)
GetProcAddress
(
hmod
,
"_get_errno"
);
}
static
void
test_rand_s
(
void
)
...
...
@@ -241,6 +243,28 @@ static void test_strerror_s(void)
ok
(
ret
==
0
,
"Expected strerror_s to return 0, got %d
\n
"
,
ret
);
}
static
void
test__get_errno
(
void
)
{
int
ret
,
out
;
if
(
!
p_get_errno
)
{
win_skip
(
"_get_errno is not available
\n
"
);
return
;
}
errno
=
EBADF
;
ret
=
p_get_errno
(
NULL
);
ok
(
ret
==
EINVAL
,
"Expected _get_errno to return EINVAL, got %d
\n
"
,
ret
);
ok
(
errno
==
EBADF
,
"Expected errno to be EBADF, got %d
\n
"
,
errno
);
errno
=
EBADF
;
out
=
0xdeadbeef
;
ret
=
p_get_errno
(
&
out
);
ok
(
ret
==
0
,
"Expected _get_errno to return 0, got %d
\n
"
,
ret
);
ok
(
out
==
EBADF
,
"Expected output variable to be EBADF, got %d
\n
"
,
out
);
}
START_TEST
(
misc
)
{
init
();
...
...
@@ -249,4 +273,5 @@ START_TEST(misc)
test_memcpy_s
();
test_I10_OUTPUT
();
test_strerror_s
();
test__get_errno
();
}
include/msvcrt/stdlib.h
View file @
79ab7152
...
...
@@ -128,6 +128,7 @@ extern int* __cdecl _errno(void);
* char** _sys_errlist;
*/
errno_t
__cdecl
_get_errno
(
int
*
);
typedef
int
(
__cdecl
*
_onexit_t
)(
void
);
...
...
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