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

Side by Side Diff: cloud_print/service/win/service_utils.cc

Issue 12676018: Moved GetCurrentUserName to service_utils.* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cloud_print/service/win/service_utils.h ('k') | 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cloud_print/service/win/service_utils.h"
6
7 #include <windows.h>
8 #include <security.h> // NOLINT
9
10 string16 GetCurrentUserName() {
11 ULONG size = 0;
12 string16 result;
13 ::GetUserNameEx(::NameSamCompatible, NULL, &size);
14 result.resize(size);
15 if (result.empty())
16 return result;
17 if (!::GetUserNameEx(::NameSamCompatible, &result[0], &size))
18 result.clear();
19 result.resize(size);
20 return result;
21 }
22
23
OLDNEW
« no previous file with comments | « cloud_print/service/win/service_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698