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
bf464f81
Commit
bf464f81
authored
Oct 17, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Share more code between memory store deleteContext implementations.
parent
4d28e14a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
32 deletions
+22
-32
context.c
dlls/crypt32/context.c
+0
-16
crypt32_private.h
dlls/crypt32/crypt32_private.h
+0
-6
store.c
dlls/crypt32/store.c
+22
-10
No files found.
dlls/crypt32/context.c
View file @
bf464f81
...
...
@@ -110,22 +110,6 @@ void Context_CopyProperties(const void *to, const void *from)
ContextPropertyList_Copy
(
toProperties
,
fromProperties
);
}
BOOL
ContextList_Remove
(
ContextList
*
list
,
CRITICAL_SECTION
*
cs
,
context_t
*
context
)
{
BOOL
inList
=
FALSE
;
EnterCriticalSection
(
cs
);
if
(
!
list_empty
(
&
context
->
u
.
entry
))
{
list_remove
(
&
context
->
u
.
entry
);
list_init
(
&
context
->
u
.
entry
);
inList
=
TRUE
;
}
LeaveCriticalSection
(
cs
);
return
inList
;
}
void
ContextList_Free
(
ContextList
*
list
)
{
context_t
*
context
,
*
next
;
...
...
dlls/crypt32/crypt32_private.h
View file @
bf464f81
...
...
@@ -438,12 +438,6 @@ void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list) DECLSPEC_HIDDEN;
*/
typedef
struct
list
ContextList
;
/* Removes a context from the list. Returns TRUE if the context was removed,
* or FALSE if not. (The context may have been duplicated, so subsequent
* removes have no effect.)
*/
BOOL
ContextList_Remove
(
ContextList
*
list
,
CRITICAL_SECTION
*
cs
,
context_t
*
context
)
DECLSPEC_HIDDEN
;
void
ContextList_Free
(
ContextList
*
list
)
DECLSPEC_HIDDEN
;
extern
WINECRYPT_CERTSTORE
empty_store
;
...
...
dlls/crypt32/store.c
View file @
bf464f81
...
...
@@ -198,6 +198,22 @@ static context_t *MemStore_enumContext(WINE_MEMSTORE *store, struct list *list,
return
ret
;
}
static
BOOL
MemStore_deleteContext
(
WINE_MEMSTORE
*
store
,
context_t
*
context
)
{
BOOL
in_list
=
FALSE
;
EnterCriticalSection
(
&
store
->
cs
);
if
(
!
list_empty
(
&
context
->
u
.
entry
))
{
list_remove
(
&
context
->
u
.
entry
);
list_init
(
&
context
->
u
.
entry
);
in_list
=
TRUE
;
}
LeaveCriticalSection
(
&
store
->
cs
);
if
(
in_list
)
Context_Release
(
context
);
return
TRUE
;
}
static
BOOL
MemStore_addCert
(
WINECRYPT_CERTSTORE
*
store
,
context_t
*
cert
,
context_t
*
toReplace
,
context_t
**
ppStoreContext
,
BOOL
use_link
)
...
...
@@ -205,7 +221,6 @@ static BOOL MemStore_addCert(WINECRYPT_CERTSTORE *store, context_t *cert,
WINE_MEMSTORE
*
ms
=
(
WINE_MEMSTORE
*
)
store
;
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
cert
,
toReplace
,
ppStoreContext
);
return
MemStore_addContext
(
ms
,
&
ms
->
certs
,
cert
,
toReplace
,
ppStoreContext
,
use_link
);
}
...
...
@@ -222,10 +237,9 @@ static BOOL MemStore_deleteCert(WINECRYPT_CERTSTORE *store, context_t *context)
{
WINE_MEMSTORE
*
ms
=
(
WINE_MEMSTORE
*
)
store
;
if
(
ContextList_Remove
(
&
ms
->
certs
,
&
ms
->
cs
,
context
))
Context_Release
(
context
);
TRACE
(
"(%p, %p)
\n
"
,
store
,
context
);
return
TRUE
;
return
MemStore_deleteContext
(
ms
,
context
)
;
}
static
BOOL
MemStore_addCRL
(
WINECRYPT_CERTSTORE
*
store
,
context_t
*
crl
,
...
...
@@ -251,10 +265,9 @@ static BOOL MemStore_deleteCRL(WINECRYPT_CERTSTORE *store, context_t *context)
{
WINE_MEMSTORE
*
ms
=
(
WINE_MEMSTORE
*
)
store
;
if
(
!
ContextList_Remove
(
&
ms
->
crls
,
&
ms
->
cs
,
context
))
Context_Release
(
context
);
TRACE
(
"(%p, %p)
\n
"
,
store
,
context
);
return
TRUE
;
return
MemStore_deleteContext
(
ms
,
context
)
;
}
static
BOOL
MemStore_addCTL
(
WINECRYPT_CERTSTORE
*
store
,
context_t
*
ctl
,
...
...
@@ -280,10 +293,9 @@ static BOOL MemStore_deleteCTL(WINECRYPT_CERTSTORE *store, context_t *context)
{
WINE_MEMSTORE
*
ms
=
(
WINE_MEMSTORE
*
)
store
;
if
(
!
ContextList_Remove
(
&
ms
->
ctls
,
&
ms
->
cs
,
context
))
Context_Release
(
context
);
TRACE
(
"(%p, %p)
\n
"
,
store
,
context
);
return
TRUE
;
return
MemStore_deleteContext
(
ms
,
context
)
;
}
static
void
MemStore_addref
(
WINECRYPT_CERTSTORE
*
store
)
...
...
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