| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/public/common/quarantine.h" | 5 #include "content/public/common/quarantine.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <cguid.h> | 9 #include <cguid.h> |
| 10 #include <objbase.h> | 10 #include <objbase.h> |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // will not be set. | 190 // will not be set. |
| 191 // |client_guid|: the GUID to be set in the IAttachmentExecute client slot. | 191 // |client_guid|: the GUID to be set in the IAttachmentExecute client slot. |
| 192 // Used to identify the app to the system AV function. | 192 // Used to identify the app to the system AV function. |
| 193 // |save_result|: Receives the result of invoking IAttachmentExecute::Save(). | 193 // |save_result|: Receives the result of invoking IAttachmentExecute::Save(). |
| 194 bool InvokeAttachmentServices(const base::FilePath& full_path, | 194 bool InvokeAttachmentServices(const base::FilePath& full_path, |
| 195 const std::string& source_url, | 195 const std::string& source_url, |
| 196 const std::string& referrer_url, | 196 const std::string& referrer_url, |
| 197 const GUID& client_guid, | 197 const GUID& client_guid, |
| 198 HRESULT* save_result) { | 198 HRESULT* save_result) { |
| 199 base::win::ScopedComPtr<IAttachmentExecute> attachment_services; | 199 base::win::ScopedComPtr<IAttachmentExecute> attachment_services; |
| 200 HRESULT hr = attachment_services.CreateInstance(CLSID_AttachmentServices); | 200 HRESULT hr = ::CoCreateInstance(CLSID_AttachmentServices, nullptr, CLSCTX_ALL, |
| 201 IID_PPV_ARGS(&attachment_services)); |
| 201 *save_result = S_OK; | 202 *save_result = S_OK; |
| 202 | 203 |
| 203 if (FAILED(hr)) { | 204 if (FAILED(hr)) { |
| 204 // The thread must have COM initialized. | 205 // The thread must have COM initialized. |
| 205 DCHECK_NE(CO_E_NOTINITIALIZED, hr); | 206 DCHECK_NE(CO_E_NOTINITIALIZED, hr); |
| 206 RecordAttachmentServicesResult( | 207 RecordAttachmentServicesResult( |
| 207 AttachmentServicesResult::NO_ATTACHMENT_SERVICES); | 208 AttachmentServicesResult::NO_ATTACHMENT_SERVICES); |
| 208 return false; | 209 return false; |
| 209 } | 210 } |
| 210 | 211 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 return QuarantineFileResult::OK; | 343 return QuarantineFileResult::OK; |
| 343 } | 344 } |
| 344 | 345 |
| 345 bool IsFileQuarantined(const base::FilePath& file, | 346 bool IsFileQuarantined(const base::FilePath& file, |
| 346 const GURL& source_url, | 347 const GURL& source_url, |
| 347 const GURL& referrer_url) { | 348 const GURL& referrer_url) { |
| 348 return ZoneIdentifierPresentForFile(file); | 349 return ZoneIdentifierPresentForFile(file); |
| 349 } | 350 } |
| 350 | 351 |
| 351 } // namespace content | 352 } // namespace content |
| OLD | NEW |