Index: net/base/test_root_certs_win.cc |
=================================================================== |
--- net/base/test_root_certs_win.cc (revision 102509) |
+++ net/base/test_root_certs_win.cc (working copy) |
@@ -10,6 +10,8 @@ |
#include "base/basictypes.h" |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
+#include "base/win/win_util.h" |
+#include "base/win/windows_version.h" |
#include "net/base/x509_certificate.h" |
namespace net { |
@@ -172,6 +174,14 @@ |
if (IsEmpty()) |
return NULL; // Default chain engine will suffice. |
+ // Windows versions before 7 don't accept the struct size for later versions. |
+ // So, we report the size of the old struct for earlier Vista and earlier. |
+ const DWORD kSizeofCertChainEngineConfig = |
brettw
2011/09/25 06:13:26
Don't give this "k" naming since it's not a consta
jschuh
2011/09/25 20:39:34
I originally had it the other way and switched it
|
+ (base::win::GetVersion() >= base::win::VERSION_WIN7) ? |
+ sizeof(CERT_CHAIN_ENGINE_CONFIG) : |
+ SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER( |
+ CERT_CHAIN_ENGINE_CONFIG, CycleDetectionModulus); |
+ |
// Each HCERTCHAINENGINE caches both the configured system stores and |
// information about each chain that has been built. In order to ensure |
// that changes to |temporary_roots_| are properly propagated and that the |
@@ -180,7 +190,7 @@ |
// should re-open the root store, ensuring the most recent changes are |
// visible. |
CERT_CHAIN_ENGINE_CONFIG engine_config = { |
- sizeof(engine_config) |
+ kSizeofCertChainEngineConfig |
}; |
engine_config.dwFlags = |
CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE | |