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
4f893215
Commit
4f893215
authored
Mar 08, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet: Lock cache file while accessing it.
parent
81e48cd0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
cryptnet_main.c
dlls/cryptnet/cryptnet_main.c
+13
-10
No files found.
dlls/cryptnet/cryptnet_main.c
View file @
4f893215
...
...
@@ -503,24 +503,26 @@ static BOOL CRYPT_GetObjectFromCache(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject,
TRACE
(
"(%s, %p, %p)
\n
"
,
debugstr_w
(
pszURL
),
pObject
,
pAuxInfo
);
ret
=
GetUrlCacheEntryInfoW
(
pszURL
,
NULL
,
&
size
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
)
RetrieveUrlCacheEntryFileW
(
pszURL
,
NULL
,
&
size
,
0
);
if
(
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
return
FALSE
;
pCacheInfo
=
CryptMemAlloc
(
size
);
if
(
!
pCacheInfo
)
{
pCacheInfo
=
CryptMemAlloc
(
size
);
if
(
pCacheInfo
)
ret
=
TRUE
;
else
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
if
(
ret
&&
(
ret
=
GetUrlCacheEntryInfoW
(
pszURL
,
pCacheInfo
,
&
size
)))
if
((
ret
=
RetrieveUrlCacheEntryFileW
(
pszURL
,
pCacheInfo
,
&
size
,
0
)))
{
FILETIME
ft
;
GetSystemTimeAsFileTime
(
&
ft
);
if
(
CompareFileTime
(
&
pCacheInfo
->
ExpireTime
,
&
ft
)
>=
0
)
{
HANDLE
hFile
=
CreateFileW
(
pCacheInfo
->
lpszLocalFileName
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
HANDLE
hFile
=
CreateFileW
(
pCacheInfo
->
lpszLocalFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hFile
!=
INVALID_HANDLE_VALUE
)
{
...
...
@@ -547,6 +549,7 @@ static BOOL CRYPT_GetObjectFromCache(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject,
DeleteUrlCacheEntryW
(
pszURL
);
ret
=
FALSE
;
}
UnlockUrlCacheEntryFileW
(
pszURL
,
0
);
}
CryptMemFree
(
pCacheInfo
);
TRACE
(
"returning %d
\n
"
,
ret
);
...
...
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