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
1d534244
Commit
1d534244
authored
Aug 17, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Aug 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Don't store the crypto provider when it isn't needed.
parent
9be50076
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
36 deletions
+37
-36
collectionstore.c
dlls/crypt32/collectionstore.c
+1
-2
crypt32_private.h
dlls/crypt32/crypt32_private.h
+4
-6
filestore.c
dlls/crypt32/filestore.c
+6
-3
provstore.c
dlls/crypt32/provstore.c
+4
-7
regstore.c
dlls/crypt32/regstore.c
+5
-2
store.c
dlls/crypt32/store.c
+17
-16
No files found.
dlls/crypt32/collectionstore.c
View file @
1d534244
...
...
@@ -357,8 +357,7 @@ PWINECRYPT_CERTSTORE CRYPT_CollectionOpenStore(HCRYPTPROV hCryptProv,
if
(
store
)
{
memset
(
store
,
0
,
sizeof
(
WINE_COLLECTIONSTORE
));
CRYPT_InitStore
(
&
store
->
hdr
,
hCryptProv
,
dwFlags
,
StoreTypeCollection
);
CRYPT_InitStore
(
&
store
->
hdr
,
dwFlags
,
StoreTypeCollection
);
store
->
hdr
.
closeStore
=
CRYPT_CollectionCloseStore
;
store
->
hdr
.
certs
.
addContext
=
CRYPT_CollectionAddCert
;
store
->
hdr
.
certs
.
enumContext
=
CRYPT_CollectionEnumCert
;
...
...
dlls/crypt32/crypt32_private.h
View file @
1d534244
...
...
@@ -222,7 +222,6 @@ typedef struct WINE_CRYPTCERTSTORE
DWORD
dwMagic
;
LONG
ref
;
DWORD
dwOpenFlags
;
HCRYPTPROV
cryptProv
;
CertStoreType
type
;
PFN_CERT_STORE_PROV_CLOSE
closeStore
;
CONTEXT_FUNCS
certs
;
...
...
@@ -231,16 +230,15 @@ typedef struct WINE_CRYPTCERTSTORE
PCONTEXT_PROPERTY_LIST
properties
;
}
WINECRYPT_CERTSTORE
,
*
PWINECRYPT_CERTSTORE
;
void
CRYPT_InitStore
(
WINECRYPT_CERTSTORE
*
store
,
HCRYPTPROV
hCryptProv
,
DWORD
dwFlags
,
CertStoreType
type
);
void
CRYPT_InitStore
(
WINECRYPT_CERTSTORE
*
store
,
DWORD
dwFlags
,
CertStoreType
type
);
void
CRYPT_FreeStore
(
PWINECRYPT_CERTSTORE
store
);
void
CRYPT_EmptyStore
(
HCERTSTORE
store
);
PWINECRYPT_CERTSTORE
CRYPT_CollectionOpenStore
(
HCRYPTPROV
hCryptProv
,
DWORD
dwFlags
,
const
void
*
pvPara
);
PWINECRYPT_CERTSTORE
CRYPT_ProvCreateStore
(
HCRYPTPROV
hCryptProv
,
DWORD
dwFlags
,
PWINECRYPT_CERTSTORE
memStore
,
const
CERT_STORE_PROV_INFO
*
pProvInfo
);
PWINECRYPT_CERTSTORE
CRYPT_ProvCreateStore
(
DWORD
dwFlags
,
PWINECRYPT_CERTSTORE
memStore
,
const
CERT_STORE_PROV_INFO
*
pProvInfo
);
PWINECRYPT_CERTSTORE
CRYPT_ProvOpenStore
(
LPCSTR
lpszStoreProvider
,
DWORD
dwEncodingType
,
HCRYPTPROV
hCryptProv
,
DWORD
dwFlags
,
const
void
*
pvPara
);
...
...
dlls/crypt32/filestore.c
View file @
1d534244
...
...
@@ -167,7 +167,7 @@ PWINECRYPT_CERTSTORE CRYPT_FileOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags,
{
PWINECRYPT_CERTSTORE
memStore
;
memStore
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
hCryptProv
,
memStore
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
if
(
memStore
)
{
...
...
@@ -189,8 +189,11 @@ PWINECRYPT_CERTSTORE CRYPT_FileOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags,
sizeof
(
fileProvFuncs
[
0
]);
provInfo
.
rgpvStoreProvFunc
=
fileProvFuncs
;
provInfo
.
hStoreProv
=
info
;
store
=
CRYPT_ProvCreateStore
(
hCryptProv
,
dwFlags
,
memStore
,
&
provInfo
);
store
=
CRYPT_ProvCreateStore
(
dwFlags
,
memStore
,
&
provInfo
);
/* File store doesn't need crypto provider, so close it */
if
(
hCryptProv
&&
!
(
dwFlags
&
CERT_STORE_NO_CRYPT_RELEASE_FLAG
))
CryptReleaseContext
(
hCryptProv
,
0
);
}
}
}
...
...
dlls/crypt32/provstore.c
View file @
1d534244
...
...
@@ -193,16 +193,14 @@ static BOOL WINAPI CRYPT_ProvControl(HCERTSTORE hCertStore, DWORD dwFlags,
return
ret
;
}
PWINECRYPT_CERTSTORE
CRYPT_ProvCreateStore
(
HCRYPTPROV
hCryptProv
,
DWORD
dwFlags
,
PWINECRYPT_CERTSTORE
memStore
,
const
CERT_STORE_PROV_INFO
*
pProvInfo
)
PWINECRYPT_CERTSTORE
CRYPT_ProvCreateStore
(
DWORD
dwFlags
,
PWINECRYPT_CERTSTORE
memStore
,
const
CERT_STORE_PROV_INFO
*
pProvInfo
)
{
PWINE_PROVIDERSTORE
ret
=
CryptMemAlloc
(
sizeof
(
WINE_PROVIDERSTORE
));
if
(
ret
)
{
CRYPT_InitStore
(
&
ret
->
hdr
,
hCryptProv
,
dwFlags
,
StoreTypeProvider
);
CRYPT_InitStore
(
&
ret
->
hdr
,
dwFlags
,
StoreTypeProvider
);
ret
->
dwStoreProvFlags
=
pProvInfo
->
dwStoreProvFlags
;
if
(
ret
->
dwStoreProvFlags
&
CERT_STORE_PROV_EXTERNAL_FLAG
)
{
...
...
@@ -289,8 +287,7 @@ PWINECRYPT_CERTSTORE CRYPT_ProvOpenStore(LPCSTR lpszStoreProvider,
{
if
(
provOpenFunc
(
lpszStoreProvider
,
dwEncodingType
,
hCryptProv
,
dwFlags
,
pvPara
,
memStore
,
&
provInfo
))
ret
=
CRYPT_ProvCreateStore
(
hCryptProv
,
dwFlags
,
memStore
,
&
provInfo
);
ret
=
CRYPT_ProvCreateStore
(
dwFlags
,
memStore
,
&
provInfo
);
else
CertCloseStore
(
memStore
,
0
);
}
...
...
dlls/crypt32/regstore.c
View file @
1d534244
...
...
@@ -530,8 +530,11 @@ PWINECRYPT_CERTSTORE CRYPT_RegOpenStore(HCRYPTPROV hCryptProv, DWORD dwFlags,
sizeof
(
regProvFuncs
[
0
]);
provInfo
.
rgpvStoreProvFunc
=
regProvFuncs
;
provInfo
.
hStoreProv
=
regInfo
;
store
=
CRYPT_ProvCreateStore
(
hCryptProv
,
dwFlags
,
memStore
,
&
provInfo
);
store
=
CRYPT_ProvCreateStore
(
dwFlags
,
memStore
,
&
provInfo
);
/* Reg store doesn't need crypto provider, so close it */
if
(
hCryptProv
&&
!
(
dwFlags
&
CERT_STORE_NO_CRYPT_RELEASE_FLAG
))
CryptReleaseContext
(
hCryptProv
,
0
);
}
}
}
...
...
dlls/crypt32/store.c
View file @
1d534244
...
...
@@ -100,18 +100,12 @@ typedef struct _WINE_MSGSTOREINFO
HCRYPTMSG
msg
;
}
WINE_MSGSTOREINFO
,
*
PWINE_MSGSTOREINFO
;
void
CRYPT_InitStore
(
WINECRYPT_CERTSTORE
*
store
,
HCRYPTPROV
hCryptProv
,
DWORD
dwFlags
,
CertStoreType
type
)
void
CRYPT_InitStore
(
WINECRYPT_CERTSTORE
*
store
,
DWORD
dwFlags
,
CertStoreType
type
)
{
store
->
ref
=
1
;
store
->
dwMagic
=
WINE_CRYPTCERTSTORE_MAGIC
;
store
->
type
=
type
;
if
(
!
hCryptProv
)
{
hCryptProv
=
CRYPT_GetDefaultProvider
();
dwFlags
|=
CERT_STORE_NO_CRYPT_RELEASE_FLAG
;
}
store
->
cryptProv
=
hCryptProv
;
store
->
dwOpenFlags
=
dwFlags
;
store
->
properties
=
NULL
;
}
...
...
@@ -253,7 +247,7 @@ static WINECRYPT_CERTSTORE *CRYPT_MemOpenStore(HCRYPTPROV hCryptProv,
if
(
store
)
{
memset
(
store
,
0
,
sizeof
(
WINE_MEMSTORE
));
CRYPT_InitStore
(
&
store
->
hdr
,
hCryptProv
,
dwFlags
,
StoreTypeMem
);
CRYPT_InitStore
(
&
store
->
hdr
,
dwFlags
,
StoreTypeMem
);
store
->
hdr
.
closeStore
=
CRYPT_MemCloseStore
;
store
->
hdr
.
certs
.
addContext
=
CRYPT_MemAddCert
;
store
->
hdr
.
certs
.
enumContext
=
CRYPT_MemEnumCert
;
...
...
@@ -266,6 +260,9 @@ static WINECRYPT_CERTSTORE *CRYPT_MemOpenStore(HCRYPTPROV hCryptProv,
sizeof
(
CERT_CONTEXT
));
store
->
crls
=
ContextList_Create
(
pCRLInterface
,
sizeof
(
CRL_CONTEXT
));
/* Mem store doesn't need crypto provider, so close it */
if
(
hCryptProv
&&
!
(
dwFlags
&
CERT_STORE_NO_CRYPT_RELEASE_FLAG
))
CryptReleaseContext
(
hCryptProv
,
0
);
}
}
return
(
PWINECRYPT_CERTSTORE
)
store
;
...
...
@@ -446,7 +443,7 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv,
if
(
ret
)
{
HCERTSTORE
regStore
=
CertOpenStore
(
CERT_STORE_PROV_SYSTEM_REGISTRY_W
,
0
,
hCryptProv
,
dwFlags
,
pvPara
);
0
,
0
,
dwFlags
,
pvPara
);
if
(
regStore
)
{
...
...
@@ -465,7 +462,7 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv,
dwFlags
&=
~
CERT_SYSTEM_STORE_CURRENT_USER
;
dwFlags
|=
CERT_SYSTEM_STORE_LOCAL_MACHINE
;
regStore
=
CertOpenStore
(
CERT_STORE_PROV_SYSTEM_REGISTRY_W
,
0
,
hCryptProv
,
dwFlags
,
pvPara
);
0
,
dwFlags
,
pvPara
);
if
(
regStore
)
{
CertAddStoreToCollection
(
store
,
regStore
,
...
...
@@ -474,6 +471,9 @@ static PWINECRYPT_CERTSTORE CRYPT_SysOpenStoreW(HCRYPTPROV hCryptProv,
CertCloseStore
(
regStore
,
0
);
}
}
/* System store doesn't need crypto provider, so close it */
if
(
hCryptProv
&&
!
(
dwFlags
&
CERT_STORE_NO_CRYPT_RELEASE_FLAG
))
CryptReleaseContext
(
hCryptProv
,
0
);
}
}
return
(
PWINECRYPT_CERTSTORE
)
store
;
...
...
@@ -544,7 +544,7 @@ static PWINECRYPT_CERTSTORE CRYPT_MsgOpenStore(HCRYPTPROV hCryptProv,
TRACE
(
"(%ld, %08x, %p)
\n
"
,
hCryptProv
,
dwFlags
,
pvPara
);
memStore
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
hCryptProv
,
memStore
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
if
(
memStore
)
{
...
...
@@ -609,8 +609,11 @@ static PWINECRYPT_CERTSTORE CRYPT_MsgOpenStore(HCRYPTPROV hCryptProv,
sizeof
(
msgProvFuncs
[
0
]);
provInfo
.
rgpvStoreProvFunc
=
msgProvFuncs
;
provInfo
.
hStoreProv
=
info
;
store
=
CRYPT_ProvCreateStore
(
hCryptProv
,
dwFlags
,
memStore
,
store
=
CRYPT_ProvCreateStore
(
dwFlags
,
memStore
,
&
provInfo
);
/* Msg store doesn't need crypto provider, so close it */
if
(
hCryptProv
&&
!
(
dwFlags
&
CERT_STORE_NO_CRYPT_RELEASE_FLAG
))
CryptReleaseContext
(
hCryptProv
,
0
);
}
else
CertCloseStore
(
memStore
,
0
);
...
...
@@ -657,7 +660,7 @@ static PWINECRYPT_CERTSTORE CRYPT_PKCSOpenStore(HCRYPTPROV hCryptProv,
}
}
if
(
ret
)
store
=
CRYPT_MsgOpenStore
(
hCryptProv
,
dwFlags
,
msg
);
store
=
CRYPT_MsgOpenStore
(
0
,
dwFlags
,
msg
);
CryptMsgClose
(
msg
);
TRACE
(
"returning %p
\n
"
,
store
);
return
store
;
...
...
@@ -1133,8 +1136,6 @@ BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
{
TRACE
(
"%p's ref count is 0, freeing
\n
"
,
hcs
);
hcs
->
dwMagic
=
0
;
if
(
!
(
hcs
->
dwOpenFlags
&
CERT_STORE_NO_CRYPT_RELEASE_FLAG
))
CryptReleaseContext
(
hcs
->
cryptProv
,
0
);
hcs
->
closeStore
(
hcs
,
dwFlags
);
}
else
...
...
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