OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/base/test_root_certs.h" | 5 #include "net/base/test_root_certs.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <wincrypt.h> | 8 #include <wincrypt.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // may still be running when ~AtExitManager is called, so the LazyInstance | 84 // may still be running when ~AtExitManager is called, so the LazyInstance |
85 // must be leaky. | 85 // must be leaky. |
86 ~CryptoAPIInjector() { | 86 ~CryptoAPIInjector() { |
87 original_function = NULL; | 87 original_function = NULL; |
88 CryptFreeOIDFunctionAddress(original_handle, NULL); | 88 CryptFreeOIDFunctionAddress(original_handle, NULL); |
89 } | 89 } |
90 }; | 90 }; |
91 | 91 |
92 base::LazyInstance<CryptoAPIInjector, | 92 base::LazyInstance<CryptoAPIInjector, |
93 base::LeakyLazyInstanceTraits<CryptoAPIInjector> > | 93 base::LeakyLazyInstanceTraits<CryptoAPIInjector> > |
94 g_capi_injector(base::LINKER_INITIALIZED); | 94 g_capi_injector = LAZY_INSTANCE_INITIALIZER; |
95 | 95 |
96 BOOL WINAPI InterceptedOpenStoreW(LPCSTR store_provider, | 96 BOOL WINAPI InterceptedOpenStoreW(LPCSTR store_provider, |
97 DWORD encoding, | 97 DWORD encoding, |
98 HCRYPTPROV crypt_provider, | 98 HCRYPTPROV crypt_provider, |
99 DWORD flags, | 99 DWORD flags, |
100 const void* store_name, | 100 const void* store_name, |
101 HCERTSTORE memory_store, | 101 HCERTSTORE memory_store, |
102 PCERT_STORE_PROV_INFO store_info) { | 102 PCERT_STORE_PROV_INFO store_info) { |
103 // If the high word is all zeroes, then |store_provider| is a numeric ID. | 103 // If the high word is all zeroes, then |store_provider| is a numeric ID. |
104 // Otherwise, it's a pointer to a null-terminated ASCII string. See the | 104 // Otherwise, it's a pointer to a null-terminated ASCII string. See the |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 void TestRootCerts::Init() { | 206 void TestRootCerts::Init() { |
207 empty_ = true; | 207 empty_ = true; |
208 temporary_roots_ = CertOpenStore( | 208 temporary_roots_ = CertOpenStore( |
209 CERT_STORE_PROV_MEMORY, 0, NULL, | 209 CERT_STORE_PROV_MEMORY, 0, NULL, |
210 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, NULL); | 210 CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, NULL); |
211 DCHECK(temporary_roots_); | 211 DCHECK(temporary_roots_); |
212 } | 212 } |
213 | 213 |
214 } // namespace net | 214 } // namespace net |
OLD | NEW |