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
2256a728
Commit
2256a728
authored
Oct 14, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Moved store release implementation to vtbl.
parent
b3b1135d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
28 deletions
+48
-28
collectionstore.c
dlls/crypt32/collectionstore.c
+13
-6
crypt32_private.h
dlls/crypt32/crypt32_private.h
+1
-1
provstore.c
dlls/crypt32/provstore.c
+15
-6
store.c
dlls/crypt32/store.c
+19
-15
No files found.
dlls/crypt32/collectionstore.c
View file @
2256a728
...
...
@@ -46,23 +46,30 @@ static void Collection_addref(WINECRYPT_CERTSTORE *store)
TRACE
(
"ref = %d
\n
"
,
ref
);
}
static
void
Collection_closeStore
(
WINECRYPT_CERTSTORE
*
store
,
DWORD
dwF
lags
)
static
DWORD
Collection_release
(
WINECRYPT_CERTSTORE
*
store
,
DWORD
f
lags
)
{
WINE_COLLECTIONSTORE
*
cs
=
(
WINE_COLLECTIONSTORE
*
)
store
;
WINE_STORE_LIST_ENTRY
*
entry
,
*
next
;
LONG
ref
;
TRACE
(
"(%p, %08x)
\n
"
,
store
,
dwFlags
);
if
(
flags
)
FIXME
(
"Unimplemented flags %x
\n
"
,
flags
);
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
next
,
&
cs
->
stores
,
WINE_STORE_LIST_ENTRY
,
entry
)
ref
=
InterlockedDecrement
(
&
cs
->
hdr
.
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
store
,
ref
);
if
(
ref
)
return
ERROR_SUCCESS
;
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
next
,
&
cs
->
stores
,
WINE_STORE_LIST_ENTRY
,
entry
)
{
TRACE
(
"closing %p
\n
"
,
entry
);
CertCloseStore
(
entry
->
store
,
dwF
lags
);
entry
->
store
->
vtbl
->
release
(
entry
->
store
,
f
lags
);
CryptMemFree
(
entry
);
}
cs
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
cs
->
cs
);
CRYPT_FreeStore
(
store
);
return
ERROR_SUCCESS
;
}
static
void
*
CRYPT_CollectionCreateContextFromChild
(
WINE_COLLECTIONSTORE
*
store
,
...
...
@@ -484,7 +491,7 @@ static BOOL Collection_control(WINECRYPT_CERTSTORE *cert_store, DWORD dwFlags,
static
const
store_vtbl_t
CollectionStoreVtbl
=
{
Collection_addref
,
Collection_
closeStor
e
,
Collection_
releas
e
,
Collection_control
};
...
...
dlls/crypt32/crypt32_private.h
View file @
2256a728
...
...
@@ -247,7 +247,7 @@ typedef struct _CONTEXT_PROPERTY_LIST CONTEXT_PROPERTY_LIST;
typedef
struct
{
void
(
*
addref
)(
struct
WINE_CRYPTCERTSTORE
*
);
void
(
*
closeStor
e
)(
struct
WINE_CRYPTCERTSTORE
*
,
DWORD
);
DWORD
(
*
releas
e
)(
struct
WINE_CRYPTCERTSTORE
*
,
DWORD
);
BOOL
(
*
control
)(
struct
WINE_CRYPTCERTSTORE
*
,
DWORD
,
DWORD
,
void
const
*
);
}
store_vtbl_t
;
...
...
dlls/crypt32/provstore.c
View file @
2256a728
...
...
@@ -47,17 +47,26 @@ static void ProvStore_addref(WINECRYPT_CERTSTORE *store)
TRACE
(
"ref = %d
\n
"
,
ref
);
}
static
void
ProvStore_closeStore
(
WINECRYPT_CERTSTORE
*
cert_store
,
DWORD
dwF
lags
)
static
DWORD
ProvStore_release
(
WINECRYPT_CERTSTORE
*
cert_store
,
DWORD
f
lags
)
{
WINE_PROVIDERSTORE
*
store
=
(
WINE_PROVIDERSTORE
*
)
cert_store
;
LONG
ref
;
TRACE
(
"(%p, %08x)
\n
"
,
store
,
dwFlags
);
if
(
flags
)
FIXME
(
"Unimplemented flags %x
\n
"
,
flags
);
ref
=
InterlockedDecrement
(
&
store
->
hdr
.
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
store
,
ref
);
if
(
ref
)
return
ERROR_SUCCESS
;
if
(
store
->
provCloseStore
)
store
->
provCloseStore
(
store
->
hStoreProv
,
dwF
lags
);
store
->
provCloseStore
(
store
->
hStoreProv
,
f
lags
);
if
(
!
(
store
->
dwStoreProvFlags
&
CERT_STORE_PROV_EXTERNAL_FLAG
))
CertCloseStore
(
store
->
memStore
,
dwFlags
);
CRYPT_FreeStore
((
WINECRYPT_CERTSTORE
*
)
store
);
store
->
memStore
->
vtbl
->
release
(
store
->
memStore
,
flags
);
CRYPT_FreeStore
(
&
store
->
hdr
);
return
ERROR_SUCCESS
;
}
static
BOOL
CRYPT_ProvAddCert
(
WINECRYPT_CERTSTORE
*
store
,
void
*
cert
,
...
...
@@ -269,7 +278,7 @@ static BOOL ProvStore_control(WINECRYPT_CERTSTORE *cert_store, DWORD dwFlags, DW
static
const
store_vtbl_t
ProvStoreVtbl
=
{
ProvStore_addref
,
ProvStore_
closeStor
e
,
ProvStore_
releas
e
,
ProvStore_control
};
...
...
dlls/crypt32/store.c
View file @
2256a728
...
...
@@ -108,6 +108,7 @@ void CRYPT_FreeStore(WINECRYPT_CERTSTORE *store)
{
if
(
store
->
properties
)
ContextPropertyList_Free
(
store
->
properties
);
store
->
dwMagic
=
0
;
CryptMemFree
(
store
);
}
...
...
@@ -290,18 +291,24 @@ static void MemStore_addref(WINECRYPT_CERTSTORE *store)
TRACE
(
"ref = %d
\n
"
,
ref
);
}
static
void
MemStore_closeStore
(
WINECRYPT_CERTSTORE
*
cert_store
,
DWORD
dwF
lags
)
static
DWORD
MemStore_release
(
WINECRYPT_CERTSTORE
*
cert_store
,
DWORD
f
lags
)
{
WINE_MEMSTORE
*
store
=
(
WINE_MEMSTORE
*
)
cert_store
;
LONG
ref
;
TRACE
(
"(%p, %08x)
\n
"
,
store
,
dwFlags
);
if
(
dwFlags
)
FIXME
(
"Unimplemented flags: %08x
\n
"
,
dwFlags
);
if
(
flags
)
FIXME
(
"Unimplemented flags %x
\n
"
,
flags
);
ref
=
InterlockedDecrement
(
&
store
->
hdr
.
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
store
,
ref
);
if
(
ref
)
return
ERROR_SUCCESS
;
ContextList_Free
(
store
->
certs
);
ContextList_Free
(
store
->
crls
);
ContextList_Free
(
store
->
ctls
);
CRYPT_FreeStore
((
WINECRYPT_CERTSTORE
*
)
store
);
CRYPT_FreeStore
(
&
store
->
hdr
);
return
ERROR_SUCCESS
;
}
static
BOOL
MemStore_control
(
WINECRYPT_CERTSTORE
*
store
,
DWORD
dwFlags
,
...
...
@@ -313,7 +320,7 @@ static BOOL MemStore_control(WINECRYPT_CERTSTORE *store, DWORD dwFlags,
static
const
store_vtbl_t
MemStoreVtbl
=
{
MemStore_addref
,
MemStore_
closeStor
e
,
MemStore_
releas
e
,
MemStore_control
};
...
...
@@ -1227,6 +1234,7 @@ HCERTSTORE WINAPI CertDuplicateStore(HCERTSTORE hCertStore)
BOOL
WINAPI
CertCloseStore
(
HCERTSTORE
hCertStore
,
DWORD
dwFlags
)
{
WINECRYPT_CERTSTORE
*
hcs
=
hCertStore
;
DWORD
res
;
TRACE
(
"(%p, %08x)
\n
"
,
hCertStore
,
dwFlags
);
...
...
@@ -1236,16 +1244,12 @@ BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
if
(
hcs
->
dwMagic
!=
WINE_CRYPTCERTSTORE_MAGIC
)
return
FALSE
;
if
(
hcs
->
ref
<=
0
)
ERR
(
"%p's ref count is %d
\n
"
,
hcs
,
hcs
->
ref
);
if
(
InterlockedDecrement
(
&
hcs
->
ref
)
==
0
)
{
TRACE
(
"%p's ref count is 0, freeing
\n
"
,
hcs
);
hcs
->
dwMagic
=
0
;
hcs
->
vtbl
->
closeStore
(
hcs
,
dwFlags
);
res
=
hcs
->
vtbl
->
release
(
hcs
,
dwFlags
);
if
(
res
!=
ERROR_SUCCESS
)
{
SetLastError
(
res
);
return
FALSE
;
}
else
TRACE
(
"%p's ref count is %d
\n
"
,
hcs
,
hcs
->
ref
);
return
TRUE
;
}
...
...
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