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

Unified Diff: sandbox/win/tools/finder/finder.cc

Issue 1232963002: Sandbox: Make CreateRestrictedToken return a ScopedHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix remoting Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/win/tools/finder/finder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/tools/finder/finder.cc
diff --git a/sandbox/win/tools/finder/finder.cc b/sandbox/win/tools/finder/finder.cc
index 9b829628e3e691c2f65d4dae3453df580a6cced3..7753dd03e374cfd195cc4ab299c811ce3a410ac2 100644
--- a/sandbox/win/tools/finder/finder.cc
+++ b/sandbox/win/tools/finder/finder.cc
@@ -10,15 +10,12 @@ Finder::Finder() {
file_output_ = NULL;
object_type_ = 0;
access_type_ = 0;
- token_handle_ = NULL;
memset(filesystem_stats_, 0, sizeof(filesystem_stats_));
memset(registry_stats_, 0, sizeof(registry_stats_));
memset(kernel_object_stats_, 0, sizeof(kernel_object_stats_));
}
Finder::~Finder() {
- if (token_handle_)
- ::CloseHandle(token_handle_);
}
DWORD Finder::Init(sandbox::TokenLevel token_type,
@@ -35,14 +32,14 @@ DWORD Finder::Init(sandbox::TokenLevel token_type,
access_type_ = access_type;
file_output_ = file_output;
- err_code = sandbox::CreateRestrictedToken(&token_handle_, token_type,
+ err_code = sandbox::CreateRestrictedToken(token_type,
sandbox::INTEGRITY_LEVEL_LAST,
- sandbox::PRIMARY);
+ sandbox::PRIMARY, &token_handle_);
return err_code;
}
DWORD Finder::Scan() {
- if (!token_handle_) {
+ if (!token_handle_.IsValid()) {
return ERROR_NO_TOKEN;
}
« no previous file with comments | « sandbox/win/tools/finder/finder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698