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
83d87f3b
Commit
83d87f3b
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 (w)searchenv_s.
parent
fc186c3b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
152 additions
and
8 deletions
+152
-8
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+2
-2
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+2
-2
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+2
-2
dir.c
dlls/msvcrt/dir.c
+144
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+2
-2
No files found.
dlls/msvcr100/msvcr100.spec
View file @
83d87f3b
...
...
@@ -1064,7 +1064,7 @@
@ stub _scwprintf_p
@ stub _scwprintf_p_l
@ cdecl _searchenv(str str ptr) msvcrt._searchenv
@
stub
_searchenv_s
@
cdecl _searchenv_s(str str ptr long) msvcrt.
_searchenv_s
@ stub _seh_longjmp_unwind4
@ stdcall -i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind
@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable
...
...
@@ -1379,7 +1379,7 @@
@ varargs _wscanf_l(wstr ptr) msvcrt._wscanf_l
@ varargs _wscanf_s_l(wstr ptr) msvcrt._wscanf_s_l
@ cdecl _wsearchenv(wstr wstr ptr) msvcrt._wsearchenv
@
stub
_wsearchenv_s
@
cdecl _wsearchenv_s(wstr wstr ptr long) msvcrt.
_wsearchenv_s
@ cdecl _wsetlocale(long wstr) msvcrt._wsetlocale
@ varargs _wsopen(wstr long long) msvcrt._wsopen
@ stub _wsopen_s
...
...
dlls/msvcr80/msvcr80.spec
View file @
83d87f3b
...
...
@@ -916,7 +916,7 @@
@ stub _scwprintf_p
@ stub _scwprintf_p_l
@ cdecl _searchenv(str str ptr) msvcrt._searchenv
@
stub
_searchenv_s
@
cdecl _searchenv_s(str str ptr long) msvcrt.
_searchenv_s
@ stub _seh_longjmp_unwind4
@ stdcall -i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind
@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable
...
...
@@ -1235,7 +1235,7 @@
@ varargs _wscanf_l(wstr ptr) msvcrt._wscanf_l
@ varargs _wscanf_s_l(wstr ptr) msvcrt._wscanf_s_l
@ cdecl _wsearchenv(wstr wstr ptr) msvcrt._wsearchenv
@
stub
_wsearchenv_s
@
cdecl _wsearchenv_s(wstr wstr ptr long) msvcrt.
_wsearchenv_s
@ cdecl _wsetlocale(long wstr) msvcrt._wsetlocale
@ varargs _wsopen(wstr long long) msvcrt._wsopen
@ stub _wsopen_s
...
...
dlls/msvcr90/msvcr90.spec
View file @
83d87f3b
...
...
@@ -902,7 +902,7 @@
@ stub _scwprintf_p
@ stub _scwprintf_p_l
@ cdecl _searchenv(str str ptr) msvcrt._searchenv
@
stub
_searchenv_s
@
cdecl _searchenv_s(str str ptr long) msvcrt.
_searchenv_s
@ stub _seh_longjmp_unwind4
@ stdcall -i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind
@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable
...
...
@@ -1219,7 +1219,7 @@
@ varargs _wscanf_l(wstr ptr) msvcrt._wscanf_l
@ varargs _wscanf_s_l(wstr ptr) msvcrt._wscanf_s_l
@ cdecl _wsearchenv(wstr wstr ptr) msvcrt._wsearchenv
@
stub
_wsearchenv_s
@
cdecl _wsearchenv_s(wstr wstr ptr long) msvcrt.
_wsearchenv_s
@ cdecl _wsetlocale(long wstr) msvcrt._wsetlocale
@ varargs _wsopen(wstr long long) msvcrt._wsopen
@ stub _wsopen_s
...
...
dlls/msvcrt/dir.c
View file @
83d87f3b
...
...
@@ -1472,6 +1472,78 @@ void CDECL _searchenv(const char* file, const char* env, char *buf)
}
/*********************************************************************
* _searchenv_s (MSVCRT.@)
*/
int
CDECL
_searchenv_s
(
const
char
*
file
,
const
char
*
env
,
char
*
buf
,
MSVCRT_size_t
count
)
{
char
*
envVal
,
*
penv
;
char
curPath
[
MAX_PATH
];
if
(
!
MSVCRT_CHECK_PMT
(
file
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
buf
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
count
>
0
))
{
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
MSVCRT_EINVAL
;
}
*
buf
=
'\0'
;
/* Try CWD first */
if
(
GetFileAttributesA
(
file
)
!=
INVALID_FILE_ATTRIBUTES
)
{
if
(
GetFullPathNameA
(
file
,
count
,
buf
,
NULL
))
return
0
;
msvcrt_set_errno
(
GetLastError
());
return
0
;
}
/* Search given environment variable */
envVal
=
MSVCRT_getenv
(
env
);
if
(
!
envVal
)
{
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
return
MSVCRT_ENOENT
;
}
penv
=
envVal
;
TRACE
(
":searching for %s in paths %s
\n
"
,
file
,
envVal
);
do
{
char
*
end
=
penv
;
while
(
*
end
&&
*
end
!=
';'
)
end
++
;
/* Find end of next path */
if
(
penv
==
end
||
!*
penv
)
{
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
return
MSVCRT_ENOENT
;
}
memcpy
(
curPath
,
penv
,
end
-
penv
);
if
(
curPath
[
end
-
penv
]
!=
'/'
&&
curPath
[
end
-
penv
]
!=
'\\'
)
{
curPath
[
end
-
penv
]
=
'\\'
;
curPath
[
end
-
penv
+
1
]
=
'\0'
;
}
else
curPath
[
end
-
penv
]
=
'\0'
;
strcat
(
curPath
,
file
);
TRACE
(
"Checking for file %s
\n
"
,
curPath
);
if
(
GetFileAttributesA
(
curPath
)
!=
INVALID_FILE_ATTRIBUTES
)
{
if
(
strlen
(
curPath
)
+
1
>
count
)
{
MSVCRT_INVALID_PMT
(
"buf[count] is too small"
);
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
MSVCRT_ERANGE
;
}
strcpy
(
buf
,
curPath
);
return
0
;
}
penv
=
*
end
?
end
+
1
:
end
;
}
while
(
1
);
}
/*********************************************************************
* _wsearchenv (MSVCRT.@)
*
* Unicode version of _searchenv
...
...
@@ -1533,3 +1605,75 @@ void CDECL _wsearchenv(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* env, MS
penv
=
*
end
?
end
+
1
:
end
;
}
while
(
1
);
}
/*********************************************************************
* _wsearchenv_s (MSVCRT.@)
*/
int
CDECL
_wsearchenv_s
(
const
MSVCRT_wchar_t
*
file
,
const
MSVCRT_wchar_t
*
env
,
MSVCRT_wchar_t
*
buf
,
MSVCRT_size_t
count
)
{
MSVCRT_wchar_t
*
envVal
,
*
penv
;
MSVCRT_wchar_t
curPath
[
MAX_PATH
];
if
(
!
MSVCRT_CHECK_PMT
(
file
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
buf
!=
NULL
)
||
!
MSVCRT_CHECK_PMT
(
count
>
0
))
{
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
MSVCRT_EINVAL
;
}
*
buf
=
'\0'
;
/* Try CWD first */
if
(
GetFileAttributesW
(
file
)
!=
INVALID_FILE_ATTRIBUTES
)
{
if
(
GetFullPathNameW
(
file
,
count
,
buf
,
NULL
))
return
0
;
msvcrt_set_errno
(
GetLastError
());
return
0
;
}
/* Search given environment variable */
envVal
=
_wgetenv
(
env
);
if
(
!
envVal
)
{
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
return
MSVCRT_ENOENT
;
}
penv
=
envVal
;
TRACE
(
":searching for %s in paths %s
\n
"
,
debugstr_w
(
file
),
debugstr_w
(
envVal
));
do
{
MSVCRT_wchar_t
*
end
=
penv
;
while
(
*
end
&&
*
end
!=
';'
)
end
++
;
/* Find end of next path */
if
(
penv
==
end
||
!*
penv
)
{
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
return
MSVCRT_ENOENT
;
}
memcpy
(
curPath
,
penv
,
(
end
-
penv
)
*
sizeof
(
MSVCRT_wchar_t
));
if
(
curPath
[
end
-
penv
]
!=
'/'
&&
curPath
[
end
-
penv
]
!=
'\\'
)
{
curPath
[
end
-
penv
]
=
'\\'
;
curPath
[
end
-
penv
+
1
]
=
'\0'
;
}
else
curPath
[
end
-
penv
]
=
'\0'
;
strcatW
(
curPath
,
file
);
TRACE
(
"Checking for file %s
\n
"
,
debugstr_w
(
curPath
));
if
(
GetFileAttributesW
(
curPath
)
!=
INVALID_FILE_ATTRIBUTES
)
{
if
(
strlenW
(
curPath
)
+
1
>
count
)
{
MSVCRT_INVALID_PMT
(
"buf[count] is too small"
);
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
MSVCRT_ERANGE
;
}
strcpyW
(
buf
,
curPath
);
return
0
;
}
penv
=
*
end
?
end
+
1
:
end
;
}
while
(
1
);
}
dlls/msvcrt/msvcrt.spec
View file @
83d87f3b
...
...
@@ -846,7 +846,7 @@
# stub _scwprintf_l
# stub _scwprintf_p_l
@ cdecl _searchenv(str str ptr)
# stub _searchenv_s
@ cdecl _searchenv_s(str str ptr long)
# stub _seh_longjmp_unwind4
@ stdcall -i386 _seh_longjmp_unwind(ptr)
@ cdecl _set_SSE2_enable(long) MSVCRT__set_SSE2_enable
...
...
@@ -1154,7 +1154,7 @@
@ varargs _wscanf_l(wstr ptr) MSVCRT__wscanf_l
@ varargs _wscanf_s_l(wstr ptr) MSVCRT__wscanf_s_l
@ cdecl _wsearchenv(wstr wstr ptr)
# stub _wsearchenv_s
@ cdecl _wsearchenv_s(wstr wstr ptr long)
@ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale
@ varargs _wsopen (wstr long long) MSVCRT__wsopen
# stub _wsopen_s
...
...
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