summaryrefslogtreecommitdiffstats
path: root/sync/util/get_session_name_win.cc
blob: c79b7845cb3d81dd93ef4cf8363e507709109571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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 "sync/util/get_session_name_win.h"

#include <windows.h>

namespace csync {
namespace internal {

std::string GetComputerName() {
  char computer_name[MAX_COMPUTERNAME_LENGTH + 1];
  DWORD size = sizeof(computer_name);
  if (GetComputerNameA(computer_name, &size))
    return computer_name;
  return std::string();
}

}  // namespace internal
}  // namespace csync