summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 16:06:47 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 16:06:47 +0000
commita89e09411e25b190474b01305fb6e562cd2361ba (patch)
treea61249a7b6e55f4180b9ee7bed9d5c65650674f0 /net
parent33c3f76fb77484e3f5a8b6d1d661defaf23e5efe (diff)
downloadchromium_src-a89e09411e25b190474b01305fb6e562cd2361ba.zip
chromium_src-a89e09411e25b190474b01305fb6e562cd2361ba.tar.gz
chromium_src-a89e09411e25b190474b01305fb6e562cd2361ba.tar.bz2
Update Windows version macros to Win 7
BUG=92941 Review URL: http://codereview.chromium.org/8004004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/test_root_certs_win.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/base/test_root_certs_win.cc b/net/base/test_root_certs_win.cc
index 7862e40..961c7d3 100644
--- a/net/base/test_root_certs_win.cc
+++ b/net/base/test_root_certs_win.cc
@@ -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,12 @@ HCERTCHAINENGINE TestRootCerts::GetChainEngine() const {
if (IsEmpty())
return NULL; // Default chain engine will suffice.
+ // Windows versions before 7 don't accept the struct size for later versions.
+ // We report the size of the old struct since we don't need the new members.
+ static const DWORD kSizeofCertChainEngineConfig =
+ 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 +188,7 @@ HCERTCHAINENGINE TestRootCerts::GetChainEngine() const {
// 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 |