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
5437c72f
Commit
5437c72f
authored
Nov 02, 2010
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implemented (_)wcserror_s.
parent
71200a98
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
24 deletions
+58
-24
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+2
-2
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+2
-2
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+2
-2
errno.c
dlls/msvcrt/errno.c
+50
-16
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+2
-2
No files found.
dlls/msvcr100/msvcr100.spec
View file @
5437c72f
...
...
@@ -483,7 +483,7 @@
@ stub __vswprintf_l
@ extern __wargv msvcrt.__wargv
@ cdecl __wcserror(wstr) msvcrt.__wcserror
@
stub
__wcserror_s
@
cdecl __wcserror_s(ptr long wstr) msvcrt.
__wcserror_s
@ stub __wcsncnt
@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs
@ extern __winitenv msvcrt.__winitenv
...
...
@@ -1285,7 +1285,7 @@
@ stub _wcscoll_l
@ cdecl _wcsdup(wstr) msvcrt._wcsdup
@ cdecl _wcserror(long) msvcrt._wcserror
@
stub
_wcserror_s
@
cdecl _wcserror_s(ptr long long) msvcrt.
_wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsicmp(wstr wstr) msvcrt._wcsicmp
@ stub _wcsicmp_l
...
...
dlls/msvcr80/msvcr80.spec
View file @
5437c72f
...
...
@@ -307,7 +307,7 @@
@ stub __vswprintf_l
@ extern __wargv msvcrt.__wargv
@ cdecl __wcserror(wstr) msvcrt.__wcserror
@
stub
__wcserror_s
@
cdecl __wcserror_s(ptr long wstr) msvcrt.
__wcserror_s
@ stub __wcsncnt
@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs
@ extern __winitenv msvcrt.__winitenv
...
...
@@ -1138,7 +1138,7 @@
@ stub _wcscoll_l
@ cdecl _wcsdup(wstr) msvcrt._wcsdup
@ cdecl _wcserror(long) msvcrt._wcserror
@
stub
_wcserror_s
@
cdecl _wcserror_s(ptr long long) msvcrt.
_wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsicmp(wstr wstr) msvcrt._wcsicmp
@ stub _wcsicmp_l
...
...
dlls/msvcr90/msvcr90.spec
View file @
5437c72f
...
...
@@ -299,7 +299,7 @@
@ stub __vswprintf_l
@ extern __wargv msvcrt.__wargv
@ cdecl __wcserror(wstr) msvcrt.__wcserror
@
stub
__wcserror_s
@
cdecl __wcserror_s(ptr long wstr) msvcrt.
__wcserror_s
@ stub __wcsncnt
@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs
@ extern __winitenv msvcrt.__winitenv
...
...
@@ -1125,7 +1125,7 @@
@ stub _wcscoll_l
@ cdecl _wcsdup(wstr) msvcrt._wcsdup
@ cdecl _wcserror(long) msvcrt._wcserror
@
stub
_wcserror_s
@
cdecl _wcserror_s(ptr long long) msvcrt.
_wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsicmp(wstr wstr) msvcrt._wcsicmp
@ stub _wcsicmp_l
...
...
dlls/msvcrt/errno.c
View file @
5437c72f
...
...
@@ -328,6 +328,21 @@ void CDECL MSVCRT_perror(const char* str)
}
/*********************************************************************
* _wcserror_s (MSVCRT.@)
*/
int
CDECL
_wcserror_s
(
MSVCRT_wchar_t
*
buffer
,
MSVCRT_size_t
nc
,
int
err
)
{
if
(
!
MSVCRT_CHECK_PMT
(
buffer
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
nc
>
0
))
{
_set_errno
(
MSVCRT_EINVAL
);
return
MSVCRT_EINVAL
;
}
if
(
err
<
0
||
err
>
MSVCRT__sys_nerr
)
err
=
MSVCRT__sys_nerr
;
MultiByteToWideChar
(
CP_ACP
,
0
,
MSVCRT__sys_errlist
[
err
],
-
1
,
buffer
,
nc
);
return
0
;
}
/*********************************************************************
* _wcserror (MSVCRT.@)
*/
MSVCRT_wchar_t
*
CDECL
_wcserror
(
int
err
)
...
...
@@ -336,38 +351,57 @@ MSVCRT_wchar_t* CDECL _wcserror(int err)
if
(
!
data
->
wcserror_buffer
)
if
(
!
(
data
->
wcserror_buffer
=
MSVCRT_malloc
(
256
*
sizeof
(
MSVCRT_wchar_t
))))
return
NULL
;
if
(
err
<
0
||
err
>
MSVCRT__sys_nerr
)
err
=
MSVCRT__sys_nerr
;
MultiByteToWideChar
(
CP_ACP
,
0
,
MSVCRT__sys_errlist
[
err
],
-
1
,
data
->
wcserror_buffer
,
256
);
_wcserror_s
(
data
->
wcserror_buffer
,
256
,
err
);
return
data
->
wcserror_buffer
;
}
/**********************************************************************
* __wcserror (MSVCRT.@)
* __wcserror
_s
(MSVCRT.@)
*/
MSVCRT_wchar_t
*
CDECL
__wcserror
(
const
MSVCRT_wchar_t
*
str
)
int
CDECL
__wcserror_s
(
MSVCRT_wchar_t
*
buffer
,
MSVCRT_size_t
nc
,
const
MSVCRT_wchar_t
*
str
)
{
thread_data_t
*
data
=
msvcrt_get_thread_data
();
int
err
;
static
const
WCHAR
colonW
[]
=
{
':'
,
' '
,
'\0'
};
static
const
WCHAR
nlW
[]
=
{
'\n'
,
'\0'
};
size_t
len
;
if
(
!
data
->
wcserror_buffer
)
if
(
!
(
data
->
wcserror_buffer
=
MSVCRT_malloc
(
256
*
sizeof
(
MSVCRT_wchar_t
))))
return
NULL
;
err
=
data
->
thread_errno
;
err
=
*
MSVCRT__errno
();
if
(
err
<
0
||
err
>
MSVCRT__sys_nerr
)
err
=
MSVCRT__sys_nerr
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
MSVCRT__sys_errlist
[
err
],
-
1
,
NULL
,
0
)
+
1
/* \n */
;
if
(
str
&&
*
str
)
len
+=
lstrlenW
(
str
)
+
2
/* ': ' */
;
if
(
len
>
nc
)
{
MSVCRT_INVALID_PMT
(
"buffer[nc] is too small"
);
_set_errno
(
MSVCRT_ERANGE
);
return
MSVCRT_ERANGE
;
}
if
(
str
&&
*
str
)
{
lstrcpyW
(
data
->
wcserror_
buffer
,
str
);
lstrcatW
(
data
->
wcserror_
buffer
,
colonW
);
lstrcpyW
(
buffer
,
str
);
lstrcatW
(
buffer
,
colonW
);
}
else
data
->
wcserror_buffer
[
0
]
=
'\0'
;
len
=
lstrlenW
(
data
->
wcserror_buffer
);
MultiByteToWideChar
(
CP_ACP
,
0
,
MSVCRT__sys_errlist
[
err
],
-
1
,
data
->
wcserror_buffer
+
len
,
256
-
len
);
lstrcatW
(
data
->
wcserror_buffer
,
nlW
);
else
buffer
[
0
]
=
'\0'
;
len
=
lstrlenW
(
buffer
);
MultiByteToWideChar
(
CP_ACP
,
0
,
MSVCRT__sys_errlist
[
err
],
-
1
,
buffer
+
len
,
256
-
len
);
lstrcatW
(
buffer
,
nlW
);
return
0
;
}
/**********************************************************************
* __wcserror (MSVCRT.@)
*/
MSVCRT_wchar_t
*
CDECL
__wcserror
(
const
MSVCRT_wchar_t
*
str
)
{
thread_data_t
*
data
=
msvcrt_get_thread_data
();
int
err
;
if
(
!
data
->
wcserror_buffer
)
if
(
!
(
data
->
wcserror_buffer
=
MSVCRT_malloc
(
256
*
sizeof
(
MSVCRT_wchar_t
))))
return
NULL
;
err
=
__wcserror_s
(
data
->
wcserror_buffer
,
256
,
str
);
if
(
err
)
FIXME
(
"bad wcserror call (%d)
\n
"
,
err
);
return
data
->
wcserror_buffer
;
}
...
...
dlls/msvcrt/msvcrt.spec
View file @
5437c72f
...
...
@@ -264,7 +264,7 @@
@ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active
@ extern __wargv MSVCRT___wargv
@ cdecl __wcserror(wstr)
# stub __wcserror_s
@ cdecl __wcserror_s(ptr long wstr)
# stub __wcsncnt
@ cdecl __wgetmainargs(ptr ptr ptr long ptr)
@ extern __winitenv MSVCRT___winitenv
...
...
@@ -1058,7 +1058,7 @@
@ cdecl _wcsdup(wstr)
# stub _wcsdup_dbg
@ cdecl _wcserror(long)
# stub _wcserror_s
@ cdecl _wcserror_s(ptr long long)
# stub _wcsftime_l
@ cdecl _wcsicmp(wstr wstr) ntdll._wcsicmp
# stub _wcsicmp_l
...
...
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