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
63eed79d
Commit
63eed79d
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 addContext implementations.
parent
23884726
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
59 deletions
+32
-59
context.c
dlls/crypt32/context.c
+0
-28
crypt32_private.h
dlls/crypt32/crypt32_private.h
+0
-3
store.c
dlls/crypt32/store.c
+32
-28
No files found.
dlls/crypt32/context.c
View file @
63eed79d
...
...
@@ -110,34 +110,6 @@ void Context_CopyProperties(const void *to, const void *from)
ContextPropertyList_Copy
(
toProperties
,
fromProperties
);
}
context_t
*
ContextList_Add
(
ContextList
*
list
,
CRITICAL_SECTION
*
cs
,
context_t
*
toLink
,
context_t
*
existing
,
struct
WINE_CRYPTCERTSTORE
*
store
,
BOOL
use_link
)
{
context_t
*
context
;
TRACE
(
"(%p, %p, %p)
\n
"
,
list
,
toLink
,
existing
);
context
=
toLink
->
vtbl
->
clone
(
toLink
,
store
,
use_link
);
if
(
context
)
{
TRACE
(
"adding %p
\n
"
,
context
);
EnterCriticalSection
(
cs
);
if
(
existing
)
{
context
->
u
.
entry
.
prev
=
existing
->
u
.
entry
.
prev
;
context
->
u
.
entry
.
next
=
existing
->
u
.
entry
.
next
;
context
->
u
.
entry
.
prev
->
next
=
&
context
->
u
.
entry
;
context
->
u
.
entry
.
next
->
prev
=
&
context
->
u
.
entry
;
list_init
(
&
existing
->
u
.
entry
);
Context_Release
(
existing
);
}
else
list_add_head
(
list
,
&
context
->
u
.
entry
);
LeaveCriticalSection
(
cs
);
}
return
context
;
}
context_t
*
ContextList_Enum
(
ContextList
*
list
,
CRITICAL_SECTION
*
cs
,
context_t
*
prev
)
{
struct
list
*
listNext
;
...
...
dlls/crypt32/crypt32_private.h
View file @
63eed79d
...
...
@@ -438,9 +438,6 @@ void ContextPropertyList_Free(CONTEXT_PROPERTY_LIST *list) DECLSPEC_HIDDEN;
*/
typedef
struct
list
ContextList
;
context_t
*
ContextList_Add
(
ContextList
*
list
,
CRITICAL_SECTION
*
cs
,
context_t
*
toLink
,
context_t
*
toReplace
,
struct
WINE_CRYPTCERTSTORE
*
store
,
BOOL
use_link
)
DECLSPEC_HIDDEN
;
context_t
*
ContextList_Enum
(
ContextList
*
list
,
CRITICAL_SECTION
*
cs
,
context_t
*
prev
)
DECLSPEC_HIDDEN
;
/* Removes a context from the list. Returns TRUE if the context was removed,
...
...
dlls/crypt32/store.c
View file @
63eed79d
...
...
@@ -143,25 +143,47 @@ BOOL WINAPI I_CertUpdateStore(HCERTSTORE store1, HCERTSTORE store2, DWORD unk0,
return
TRUE
;
}
static
BOOL
MemStore_addC
ert
(
WINECRYPT_CERTSTORE
*
store
,
context_t
*
cer
t
,
context_t
*
toReplace
,
context_t
**
ppStoreC
ontext
,
BOOL
use_link
)
static
BOOL
MemStore_addC
ontext
(
WINE_MEMSTORE
*
store
,
struct
list
*
list
,
context_t
*
orig_contex
t
,
context_t
*
existing
,
context_t
**
ret_c
ontext
,
BOOL
use_link
)
{
WINE_MEMSTORE
*
ms
=
(
WINE_MEMSTORE
*
)
store
;
context_t
*
context
;
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
cert
,
toReplace
,
ppStoreContext
);
context
=
ContextList_Add
(
&
ms
->
certs
,
&
ms
->
cs
,
cert
,
toReplace
,
store
,
use_link
);
context
=
orig_context
->
vtbl
->
clone
(
orig_context
,
&
store
->
hdr
,
use_link
);
if
(
!
context
)
return
FALSE
;
if
(
ppStoreContext
)
{
TRACE
(
"adding %p
\n
"
,
context
);
EnterCriticalSection
(
&
store
->
cs
);
if
(
existing
)
{
context
->
u
.
entry
.
prev
=
existing
->
u
.
entry
.
prev
;
context
->
u
.
entry
.
next
=
existing
->
u
.
entry
.
next
;
context
->
u
.
entry
.
prev
->
next
=
&
context
->
u
.
entry
;
context
->
u
.
entry
.
next
->
prev
=
&
context
->
u
.
entry
;
list_init
(
&
existing
->
u
.
entry
);
Context_Release
(
existing
);
}
else
{
list_add_head
(
list
,
&
context
->
u
.
entry
);
}
LeaveCriticalSection
(
&
store
->
cs
);
if
(
ret_context
)
{
Context_AddRef
(
context
);
*
ppStoreC
ontext
=
context
;
*
ret_c
ontext
=
context
;
}
return
TRUE
;
}
static
BOOL
MemStore_addCert
(
WINECRYPT_CERTSTORE
*
store
,
context_t
*
cert
,
context_t
*
toReplace
,
context_t
**
ppStoreContext
,
BOOL
use_link
)
{
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
);
}
static
context_t
*
MemStore_enumCert
(
WINECRYPT_CERTSTORE
*
store
,
context_t
*
prev
)
{
WINE_MEMSTORE
*
ms
=
(
WINE_MEMSTORE
*
)
store
;
...
...
@@ -191,19 +213,10 @@ static BOOL MemStore_addCRL(WINECRYPT_CERTSTORE *store, context_t *crl,
context_t
*
toReplace
,
context_t
**
ppStoreContext
,
BOOL
use_link
)
{
WINE_MEMSTORE
*
ms
=
(
WINE_MEMSTORE
*
)
store
;
context_t
*
context
;
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
crl
,
toReplace
,
ppStoreContext
);
context
=
ContextList_Add
(
&
ms
->
crls
,
&
ms
->
cs
,
crl
,
toReplace
,
store
,
use_link
);
if
(
!
context
)
return
FALSE
;
if
(
ppStoreContext
)
{
Context_AddRef
(
context
);
*
ppStoreContext
=
context
;
}
return
TRUE
;
return
MemStore_addContext
(
ms
,
&
ms
->
crls
,
crl
,
toReplace
,
ppStoreContext
,
use_link
);
}
static
context_t
*
MemStore_enumCRL
(
WINECRYPT_CERTSTORE
*
store
,
context_t
*
prev
)
...
...
@@ -235,19 +248,10 @@ static BOOL MemStore_addCTL(WINECRYPT_CERTSTORE *store, context_t *ctl,
context_t
*
toReplace
,
context_t
**
ppStoreContext
,
BOOL
use_link
)
{
WINE_MEMSTORE
*
ms
=
(
WINE_MEMSTORE
*
)
store
;
context_t
*
context
;
TRACE
(
"(%p, %p, %p, %p)
\n
"
,
store
,
ctl
,
toReplace
,
ppStoreContext
);
context
=
ContextList_Add
(
&
ms
->
ctls
,
&
ms
->
cs
,
ctl
,
toReplace
,
store
,
use_link
);
if
(
!
context
)
return
FALSE
;
if
(
ppStoreContext
)
{
Context_AddRef
(
context
);
*
ppStoreContext
=
context
;
}
return
TRUE
;
return
MemStore_addContext
(
ms
,
&
ms
->
ctls
,
ctl
,
toReplace
,
ppStoreContext
,
use_link
);
}
static
context_t
*
MemStore_enumCTL
(
WINECRYPT_CERTSTORE
*
store
,
context_t
*
prev
)
...
...
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