OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/wifi/wifi_service.h" | 5 #include "components/wifi/wifi_service.h" |
6 | 6 |
7 #include <iphlpapi.h> | 7 #include <iphlpapi.h> |
8 #include <objbase.h> | 8 #include <objbase.h> |
9 #include <wlanapi.h> | 9 #include <wlanapi.h> |
10 | 10 |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 if (error == ERROR_SUCCESS) { | 831 if (error == ERROR_SUCCESS) { |
832 error = ::IpRenewAddress(&adapter_index_map); | 832 error = ::IpRenewAddress(&adapter_index_map); |
833 } | 833 } |
834 } | 834 } |
835 return error; | 835 return error; |
836 } | 836 } |
837 | 837 |
838 DWORD WiFiServiceImpl::FindAdapterIndexMapByGUID( | 838 DWORD WiFiServiceImpl::FindAdapterIndexMapByGUID( |
839 const GUID& interface_guid, | 839 const GUID& interface_guid, |
840 IP_ADAPTER_INDEX_MAP* adapter_index_map) { | 840 IP_ADAPTER_INDEX_MAP* adapter_index_map) { |
841 string16 guid_string; | 841 base::string16 guid_string; |
842 const int kGUIDSize = 39; | 842 const int kGUIDSize = 39; |
843 ::StringFromGUID2( | 843 ::StringFromGUID2( |
844 interface_guid, WriteInto(&guid_string, kGUIDSize), kGUIDSize); | 844 interface_guid, WriteInto(&guid_string, kGUIDSize), kGUIDSize); |
845 | 845 |
846 ULONG buffer_length = 0; | 846 ULONG buffer_length = 0; |
847 DWORD error = ::GetInterfaceInfo(NULL, &buffer_length); | 847 DWORD error = ::GetInterfaceInfo(NULL, &buffer_length); |
848 if (error == ERROR_INSUFFICIENT_BUFFER) { | 848 if (error == ERROR_INSUFFICIENT_BUFFER) { |
849 scoped_ptr<unsigned char[]> buffer(new unsigned char[buffer_length]); | 849 scoped_ptr<unsigned char[]> buffer(new unsigned char[buffer_length]); |
850 IP_INTERFACE_INFO* interface_info = | 850 IP_INTERFACE_INFO* interface_info = |
851 reinterpret_cast<IP_INTERFACE_INFO*>(buffer.get()); | 851 reinterpret_cast<IP_INTERFACE_INFO*>(buffer.get()); |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 NetworkGuidList changed_networks(1, network_guid); | 1423 NetworkGuidList changed_networks(1, network_guid); |
1424 message_loop_proxy_->PostTask( | 1424 message_loop_proxy_->PostTask( |
1425 FROM_HERE, | 1425 FROM_HERE, |
1426 base::Bind(networks_changed_observer_, changed_networks)); | 1426 base::Bind(networks_changed_observer_, changed_networks)); |
1427 } | 1427 } |
1428 } | 1428 } |
1429 | 1429 |
1430 WiFiService* WiFiService::Create() { return new WiFiServiceImpl(); } | 1430 WiFiService* WiFiService::Create() { return new WiFiServiceImpl(); } |
1431 | 1431 |
1432 } // namespace wifi | 1432 } // namespace wifi |
OLD | NEW |