| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // mini_installer.exe is the first exe that is run when chrome is being | 5 // mini_installer.exe is the first exe that is run when chrome is being |
| 6 // installed or upgraded. It is designed to be extremely small (~5KB with no | 6 // installed or upgraded. It is designed to be extremely small (~5KB with no |
| 7 // extra resources linked) and it has two main jobs: | 7 // extra resources linked) and it has two main jobs: |
| 8 // 1) unpack the resources (possibly decompressing some) | 8 // 1) unpack the resources (possibly decompressing some) |
| 9 // 2) run the real installer (setup.exe) with appropriate flags. | 9 // 2) run the real installer (setup.exe) with appropriate flags. |
| 10 // | 10 // |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 ::DeleteFile(archive_path); | 519 ::DeleteFile(archive_path); |
| 520 ::DeleteFile(setup_path); | 520 ::DeleteFile(setup_path); |
| 521 // Delete the temp dir (if it is empty, otherwise fail). | 521 // Delete the temp dir (if it is empty, otherwise fail). |
| 522 ::RemoveDirectory(base_path); | 522 ::RemoveDirectory(base_path); |
| 523 } | 523 } |
| 524 | 524 |
| 525 // Returns true if the supplied path supports ACLs. | 525 // Returns true if the supplied path supports ACLs. |
| 526 bool IsAclSupportedForPath(const wchar_t* path) { | 526 bool IsAclSupportedForPath(const wchar_t* path) { |
| 527 PathString volume; | 527 PathString volume; |
| 528 DWORD flags = 0; | 528 DWORD flags = 0; |
| 529 return ::GetVolumePathName(path, volume.get(), volume.capacity()) && | 529 return ::GetVolumePathName(path, volume.get(), |
| 530 ::GetVolumeInformation(volume.get(), NULL, 0, NULL, NULL, &flags, | 530 static_cast<DWORD>(volume.capacity())) && |
| 531 NULL, 0) && (flags & FILE_PERSISTENT_ACLS); | 531 ::GetVolumeInformation(volume.get(), NULL, 0, NULL, NULL, &flags, NULL, |
| 532 0) && |
| 533 (flags & FILE_PERSISTENT_ACLS); |
| 532 } | 534 } |
| 533 | 535 |
| 534 // Retrieves the SID of the default owner for objects created by this user | 536 // Retrieves the SID of the default owner for objects created by this user |
| 535 // token (accounting for different behavior under UAC elevation, etc.). | 537 // token (accounting for different behavior under UAC elevation, etc.). |
| 536 // NOTE: On success the |sid| parameter must be freed with LocalFree(). | 538 // NOTE: On success the |sid| parameter must be freed with LocalFree(). |
| 537 bool GetCurrentOwnerSid(wchar_t** sid) { | 539 bool GetCurrentOwnerSid(wchar_t** sid) { |
| 538 HANDLE token; | 540 HANDLE token; |
| 539 if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &token)) | 541 if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &token)) |
| 540 return false; | 542 return false; |
| 541 | 543 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 #pragma function(memset) | 900 #pragma function(memset) |
| 899 void* memset(void* dest, int c, size_t count) { | 901 void* memset(void* dest, int c, size_t count) { |
| 900 void* start = dest; | 902 void* start = dest; |
| 901 while (count--) { | 903 while (count--) { |
| 902 *reinterpret_cast<char*>(dest) = static_cast<char>(c); | 904 *reinterpret_cast<char*>(dest) = static_cast<char>(c); |
| 903 dest = reinterpret_cast<char*>(dest) + 1; | 905 dest = reinterpret_cast<char*>(dest) + 1; |
| 904 } | 906 } |
| 905 return start; | 907 return start; |
| 906 } | 908 } |
| 907 } // extern "C" | 909 } // extern "C" |
| OLD | NEW |