forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved GetCurrentUserName to service_utils.*
TBR=gene NOTRY=True Review URL: https://chromiumcodereview.appspot.com/12676018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189880 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
vitalybuka@chromium.org
committed
Mar 22, 2013
1 parent
42814cf
commit d541804
Showing
4 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "cloud_print/service/win/service_utils.h" | ||
|
||
#include <windows.h> | ||
#include <security.h> // NOLINT | ||
|
||
string16 GetCurrentUserName() { | ||
ULONG size = 0; | ||
string16 result; | ||
::GetUserNameEx(::NameSamCompatible, NULL, &size); | ||
result.resize(size); | ||
if (result.empty()) | ||
return result; | ||
if (!::GetUserNameEx(::NameSamCompatible, &result[0], &size)) | ||
result.clear(); | ||
result.resize(size); | ||
return result; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CLOUD_PRINT_SERVICE_SERVICE_UTILS_H_ | ||
#define CLOUD_PRINT_SERVICE_SERVICE_UTILS_H_ | ||
|
||
#include "base/string16.h" | ||
|
||
string16 GetCurrentUserName(); | ||
|
||
#endif // CLOUD_PRINT_SERVICE_SERVICE_UTILS_H_ | ||
|