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
b0c3dc35
Commit
b0c3dc35
authored
Nov 07, 2010
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implemented the _(w)getenv_s functions.
parent
2e7dc357
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
7 deletions
+62
-7
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+2
-2
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+2
-2
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
environ.c
dlls/msvcrt/environ.c
+55
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+2
-2
No files found.
dlls/msvcr100/msvcr100.spec
View file @
b0c3dc35
...
...
@@ -1356,7 +1356,7 @@
@ cdecl _wgetdcwd(long wstr long) msvcrt._wgetdcwd
@ stub _wgetdcwd_nolock
@ cdecl _wgetenv(wstr) msvcrt._wgetenv
@
stub
_wgetenv_s
@
cdecl _wgetenv_s(ptr ptr long wstr) msvcrt.
_wgetenv_s
@ cdecl _wmakepath(ptr wstr wstr wstr wstr) msvcrt._wmakepath
@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) msvcrt._wmakepath_s
@ cdecl _wmkdir(wstr) msvcrt._wmkdir
...
...
@@ -1483,7 +1483,7 @@
@ cdecl getc(ptr) msvcrt.getc
@ cdecl getchar() msvcrt.getchar
@ cdecl getenv(str) msvcrt.getenv
@
stub
getenv_s
@
cdecl getenv_s(ptr ptr long str) msvcrt.
getenv_s
@ cdecl gets(str) msvcrt.gets
@ stub gets_s
@ cdecl getwc(ptr) msvcrt.getwc
...
...
dlls/msvcr80/msvcr80.spec
View file @
b0c3dc35
...
...
@@ -1209,7 +1209,7 @@
@ cdecl _wgetdcwd(long wstr long) msvcrt._wgetdcwd
@ stub _wgetdcwd_nolock
@ cdecl _wgetenv(wstr) msvcrt._wgetenv
@
stub
_wgetenv_s
@
cdecl _wgetenv_s(ptr ptr long wstr) msvcrt.
_wgetenv_s
@ extern _winmajor msvcrt._winmajor
@ extern _winminor msvcrt._winminor
@ extern _winver msvcrt._winver
...
...
@@ -1339,7 +1339,7 @@
@ cdecl getc(ptr) msvcrt.getc
@ cdecl getchar() msvcrt.getchar
@ cdecl getenv(str) msvcrt.getenv
@
stub
getenv_s
@
cdecl getenv_s(ptr ptr long str) msvcrt.
getenv_s
@ cdecl gets(str) msvcrt.gets
@ stub gets_s
@ cdecl getwc(ptr) msvcrt.getwc
...
...
dlls/msvcr90/msvcr90.spec
View file @
b0c3dc35
...
...
@@ -1196,7 +1196,7 @@
@ cdecl _wgetdcwd(long wstr long) msvcrt._wgetdcwd
@ stub _wgetdcwd_nolock
@ cdecl _wgetenv(wstr) msvcrt._wgetenv
@
stub
_wgetenv_s
@
cdecl _wgetenv_s(ptr ptr long wstr) msvcrt.
_wgetenv_s
@ cdecl _wmakepath(ptr wstr wstr wstr wstr) msvcrt._wmakepath
@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) msvcrt._wmakepath_s
@ cdecl _wmkdir(wstr) msvcrt._wmkdir
...
...
dlls/msvcrt/environ.c
View file @
b0c3dc35
...
...
@@ -261,3 +261,58 @@ int _wdupenv_s(MSVCRT_wchar_t **buffer, MSVCRT_size_t *numberOfElements,
if
(
numberOfElements
)
*
numberOfElements
=
sz
;
return
0
;
}
/******************************************************************
* getenv_s (MSVCRT.@)
*/
int
getenv_s
(
MSVCRT_size_t
*
pReturnValue
,
char
*
buffer
,
MSVCRT_size_t
numberOfElements
,
const
char
*
varname
)
{
char
*
e
;
if
(
!
MSVCRT_CHECK_PMT
(
pReturnValue
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
!
(
buffer
==
NULL
&&
numberOfElements
>
0
))
||
!
MSVCRT_CHECK_PMT
(
varname
!=
NULL
))
{
return
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
}
if
(
!
(
e
=
MSVCRT_getenv
(
varname
)))
{
*
pReturnValue
=
0
;
return
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
}
*
pReturnValue
=
strlen
(
e
)
+
1
;
if
(
numberOfElements
<
*
pReturnValue
)
{
return
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
strcpy
(
buffer
,
e
);
return
0
;
}
/******************************************************************
* _wgetenv_s (MSVCRT.@)
*/
int
_wgetenv_s
(
MSVCRT_size_t
*
pReturnValue
,
MSVCRT_wchar_t
*
buffer
,
MSVCRT_size_t
numberOfElements
,
const
MSVCRT_wchar_t
*
varname
)
{
MSVCRT_wchar_t
*
e
;
if
(
!
MSVCRT_CHECK_PMT
(
pReturnValue
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
!
(
buffer
==
NULL
&&
numberOfElements
>
0
))
||
!
MSVCRT_CHECK_PMT
(
varname
!=
NULL
))
{
return
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
}
if
(
!
(
e
=
_wgetenv
(
varname
)))
{
*
pReturnValue
=
0
;
return
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
}
*
pReturnValue
=
strlenW
(
e
)
+
1
;
if
(
numberOfElements
<
*
pReturnValue
)
{
return
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
strcpyW
(
buffer
,
e
);
return
0
;
}
dlls/msvcrt/msvcrt.spec
View file @
b0c3dc35
...
...
@@ -1128,7 +1128,7 @@
@ cdecl _wgetcwd(wstr long)
@ cdecl _wgetdcwd(long wstr long)
@ cdecl _wgetenv(wstr)
# stub _wgetenv_s
@ cdecl _wgetenv_s(ptr ptr long wstr)
@ extern _winmajor MSVCRT__winmajor
@ extern _winminor MSVCRT__winminor
# stub _winput_s
...
...
@@ -1273,7 +1273,7 @@
@ cdecl getc(ptr) MSVCRT_getc
@ cdecl getchar() MSVCRT_getchar
@ cdecl getenv(str) MSVCRT_getenv
# stub getenv_s
@ cdecl getenv_s(ptr ptr long str)
@ cdecl gets(str) MSVCRT_gets
@ cdecl getwc(ptr) MSVCRT_getwc
@ cdecl getwchar() MSVCRT_getwchar
...
...
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