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
9f7bc109
Commit
9f7bc109
authored
Jun 24, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Avoid returning the same name when GetTempFileName is called twice in a short interval.
parent
7649c75b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
path.c
dlls/kernel32/path.c
+4
-0
No files found.
dlls/kernel32/path.c
View file @
9f7bc109
...
...
@@ -684,7 +684,10 @@ UINT WINAPI GetTempFileNameW( LPCWSTR path, LPCWSTR prefix, UINT unique, LPWSTR
/* get a "random" unique number and try to create the file */
HANDLE
handle
;
UINT
num
=
GetTickCount
()
&
0xffff
;
static
UINT
last
;
/* avoid using the same name twice in a short interval */
if
(
last
-
num
<
10
)
num
=
last
+
1
;
if
(
!
num
)
num
=
1
;
unique
=
num
;
do
...
...
@@ -696,6 +699,7 @@ UINT WINAPI GetTempFileNameW( LPCWSTR path, LPCWSTR prefix, UINT unique, LPWSTR
{
/* We created it */
TRACE
(
"created %s
\n
"
,
debugstr_w
(
buffer
)
);
CloseHandle
(
handle
);
last
=
unique
;
break
;
}
if
(
GetLastError
()
!=
ERROR_FILE_EXISTS
&&
...
...
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