Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: chrome/installer/mini_installer/mini_installer.cc

Issue 1662683002: Fix compile error for gn build of mini_installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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())) &&
grt (UTC plus 2) 2016/02/03 14:54:11 ah, the size_t -> DWORD conversion was the problem
gab 2016/02/03 16:21:45 Right, sorry forgot to add that to description (an
531 NULL, 0) && (flags & FILE_PERSISTENT_ACLS); 531 ::GetVolumeInformation(volume.get(), nullptr, 0, nullptr, nullptr,
grt (UTC plus 2) 2016/02/03 14:54:11 we have to stick with C++-03 for a little longer i
gab 2016/02/03 16:21:45 Done.
532 &flags, nullptr, 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
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"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698