summaryrefslogtreecommitdiffstats
path: root/base/process/process_info_win.cc
blob: b930ae6dd8864bd0e9954e2794e68328f204127e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// 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 "base/process/process_info.h"

#include <windows.h>

#include "base/basictypes.h"
#include "base/time/time.h"

namespace base {

//static
const Time CurrentProcessInfo::CreationTime() {
  FILETIME creation_time = {};
  FILETIME ignore = {};
  if (::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore,
      &ignore, &ignore) == false)
    return Time();

  return Time::FromFileTime(creation_time);
}

}  // namespace base