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
77feb693
Commit
77feb693
authored
Dec 22, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add _wtmpnam_s implementation.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9b6c93f6
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
77 additions
and
35 deletions
+77
-35
api-ms-win-crt-stdio-l1-1-0.spec
...-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec
+1
-1
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+2
-2
msvcr110.spec
dlls/msvcr110/msvcr110.spec
+2
-2
msvcr120.spec
dlls/msvcr120/msvcr120.spec
+2
-2
msvcr120_app.spec
dlls/msvcr120_app/msvcr120_app.spec
+1
-1
msvcr70.spec
dlls/msvcr70/msvcr70.spec
+1
-1
msvcr71.spec
dlls/msvcr71/msvcr71.spec
+1
-1
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+2
-2
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+2
-2
file.c
dlls/msvcrt/file.c
+59
-17
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+2
-2
ucrtbase.spec
dlls/ucrtbase/ucrtbase.spec
+2
-2
No files found.
dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec
View file @
77feb693
...
...
@@ -111,7 +111,7 @@
@ cdecl _wsopen_s(ptr wstr long long long) ucrtbase._wsopen_s
@ cdecl _wtempnam(wstr wstr) ucrtbase._wtempnam
@ cdecl _wtmpnam(ptr) ucrtbase._wtmpnam
@
stub
_wtmpnam_s
@
cdecl _wtmpnam_s(ptr long) ucrtbase.
_wtmpnam_s
@ cdecl clearerr(ptr) ucrtbase.clearerr
@ stub clearerr_s
@ cdecl fclose(ptr) ucrtbase.fclose
...
...
dlls/msvcr100/msvcr100.spec
View file @
77feb693
...
...
@@ -1607,8 +1607,8 @@
@ cdecl _wstrtime_s(ptr long)
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
@
stub
_wtmpnam_s
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@
cdecl _wtmpnam_s(ptr long) MSVCRT_
_wtmpnam_s
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l
@ cdecl _wtoi(wstr) MSVCRT__wtoi
...
...
dlls/msvcr110/msvcr110.spec
View file @
77feb693
...
...
@@ -1965,8 +1965,8 @@
@ cdecl _wstrtime_s(ptr long)
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
@
stub
_wtmpnam_s
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@
cdecl _wtmpnam_s(ptr long) MSVCRT_
_wtmpnam_s
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l
@ cdecl _wtoi(wstr) MSVCRT__wtoi
...
...
dlls/msvcr120/msvcr120.spec
View file @
77feb693
...
...
@@ -1989,8 +1989,8 @@
@ cdecl _wstrtime_s(ptr long)
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
@
stub
_wtmpnam_s
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@
cdecl _wtmpnam_s(ptr long) MSVCRT_
_wtmpnam_s
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l
@ cdecl _wtoi(wstr) MSVCRT__wtoi
...
...
dlls/msvcr120_app/msvcr120_app.spec
View file @
77feb693
...
...
@@ -1656,7 +1656,7 @@
@ cdecl _wstrtime_s(ptr long) msvcr120._wstrtime_s
@ cdecl _wtempnam(wstr wstr) msvcr120._wtempnam
@ cdecl _wtmpnam(ptr) msvcr120._wtmpnam
@
stub
_wtmpnam_s
@
cdecl _wtmpnam_s(ptr long) msvcr120.
_wtmpnam_s
@ cdecl _wtof(wstr) msvcr120._wtof
@ cdecl _wtof_l(wstr ptr) msvcr120._wtof_l
@ cdecl _wtoi(wstr) msvcr120._wtoi
...
...
dlls/msvcr70/msvcr70.spec
View file @
77feb693
...
...
@@ -668,7 +668,7 @@
@ cdecl _wstrtime(ptr) MSVCRT__wstrtime
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtoi(wstr) MSVCRT__wtoi
@ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64
...
...
dlls/msvcr71/msvcr71.spec
View file @
77feb693
...
...
@@ -664,7 +664,7 @@
@ cdecl _wstrtime(ptr) MSVCRT__wstrtime
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtoi(wstr) MSVCRT__wtoi
@ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64
...
...
dlls/msvcr80/msvcr80.spec
View file @
77feb693
...
...
@@ -1290,8 +1290,8 @@
@ cdecl _wstrtime_s(ptr long)
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
@
stub
_wtmpnam_s
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@
cdecl _wtmpnam_s(ptr long) MSVCRT_
_wtmpnam_s
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l
@ cdecl _wtoi(wstr) MSVCRT__wtoi
...
...
dlls/msvcr90/msvcr90.spec
View file @
77feb693
...
...
@@ -1262,8 +1262,8 @@
@ cdecl _wstrtime_s(ptr long)
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
@
stub
_wtmpnam_s
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@
cdecl _wtmpnam_s(ptr long) MSVCRT_
_wtmpnam_s
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l
@ cdecl _wtoi(wstr) MSVCRT__wtoi
...
...
dlls/msvcrt/file.c
View file @
77feb693
...
...
@@ -4852,15 +4852,68 @@ char * CDECL MSVCRT_tmpnam(char *s)
return
tmpnam_helper
(
s
,
-
1
,
&
tmpnam_unique
,
MSVCRT_TMP_MAX
)
?
NULL
:
s
;
}
static
int
wtmpnam_helper
(
MSVCRT_wchar_t
*
s
,
MSVCRT_size_t
size
,
int
*
tmpnam_unique
,
int
tmp_max
)
{
MSVCRT_wchar_t
tmpstr
[
8
];
MSVCRT_wchar_t
*
p
=
s
;
int
digits
;
if
(
!
MSVCRT_CHECK_PMT
(
s
!=
NULL
))
return
MSVCRT_EINVAL
;
if
(
size
<
3
)
{
if
(
size
)
*
s
=
0
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
MSVCRT_ERANGE
;
}
*
p
++
=
'\\'
;
*
p
++
=
's'
;
size
-=
2
;
digits
=
msvcrt_int_to_base32_w
(
GetCurrentProcessId
(),
tmpstr
);
if
(
digits
+
1
>
size
)
{
*
s
=
0
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
MSVCRT_ERANGE
;
}
memcpy
(
p
,
tmpstr
,
digits
*
sizeof
(
tmpstr
[
0
]));
p
+=
digits
;
*
p
++
=
'.'
;
size
-=
digits
+
1
;
while
(
1
)
{
while
((
digits
=
*
tmpnam_unique
)
+
1
<
tmp_max
)
{
if
(
InterlockedCompareExchange
(
tmpnam_unique
,
digits
+
1
,
digits
)
==
digits
)
break
;
}
digits
=
msvcrt_int_to_base32_w
(
digits
,
tmpstr
);
if
(
digits
+
1
>
size
)
{
*
s
=
0
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
MSVCRT_ERANGE
;
}
memcpy
(
p
,
tmpstr
,
digits
*
sizeof
(
tmpstr
[
0
]));
p
[
digits
]
=
0
;
if
(
GetFileAttributesW
(
s
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
)
break
;
}
return
0
;
}
/*********************************************************************
* _wtmpnam_s (MSVCRT.@)
*/
int
CDECL
MSVCRT__wtmpnam_s
(
MSVCRT_wchar_t
*
s
,
MSVCRT_size_t
size
)
{
return
wtmpnam_helper
(
s
,
size
,
&
tmpnam_s_unique
,
MSVCRT_TMP_MAX_S
);
}
/*********************************************************************
* _wtmpnam (MSVCRT.@)
*/
MSVCRT_wchar_t
*
CDECL
MSVCRT_wtmpnam
(
MSVCRT_wchar_t
*
s
)
MSVCRT_wchar_t
*
CDECL
MSVCRT_
_
wtmpnam
(
MSVCRT_wchar_t
*
s
)
{
static
const
MSVCRT_wchar_t
format
[]
=
{
'\\'
,
's'
,
'%'
,
's'
,
'.'
,
0
};
MSVCRT_wchar_t
tmpstr
[
16
];
MSVCRT_wchar_t
*
p
;
int
count
,
size
;
if
(
!
s
)
{
thread_data_t
*
data
=
msvcrt_get_thread_data
();
...
...
@@ -4870,18 +4923,7 @@ MSVCRT_wchar_t * CDECL MSVCRT_wtmpnam(MSVCRT_wchar_t *s)
s
=
data
->
wtmpnam_buffer
;
}
msvcrt_int_to_base32_w
(
GetCurrentProcessId
(),
tmpstr
);
p
=
s
+
MSVCRT__snwprintf
(
s
,
MAX_PATH
,
format
,
tmpstr
);
for
(
count
=
0
;
count
<
MSVCRT_TMP_MAX
;
count
++
)
{
size
=
msvcrt_int_to_base32_w
(
tmpnam_unique
++
,
tmpstr
);
memcpy
(
p
,
tmpstr
,
size
*
sizeof
(
MSVCRT_wchar_t
));
p
[
size
]
=
'\0'
;
if
(
GetFileAttributesW
(
s
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
)
break
;
}
return
s
;
return
wtmpnam_helper
(
s
,
-
1
,
&
tmpnam_unique
,
MSVCRT_TMP_MAX
)
?
NULL
:
s
;
}
/*********************************************************************
...
...
dlls/msvcrt/msvcrt.spec
View file @
77feb693
...
...
@@ -1224,8 +1224,8 @@
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
# stub _wtempnam_dbg(wstr wstr long str long)
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
# stub _wtmpnam_s(ptr long)
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@ cdecl _wtmpnam_s(ptr long) MSVCRT__wtmpnam_s
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l
@ cdecl _wtoi(wstr) MSVCRT__wtoi
...
...
dlls/ucrtbase/ucrtbase.spec
View file @
77feb693
...
...
@@ -2131,8 +2131,8 @@
@ cdecl _wstrtime_s(ptr long)
@ cdecl _wsystem(wstr)
@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam
@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam
@
stub
_wtmpnam_s
@ cdecl _wtmpnam(ptr) MSVCRT_
_
wtmpnam
@
cdecl _wtmpnam_s(ptr long) MSVCRT_
_wtmpnam_s
@ cdecl _wtof(wstr) MSVCRT__wtof
@ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l
@ cdecl _wtoi(wstr) MSVCRT__wtoi
...
...
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