1 // Copyright 2014 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.
5 #include "ui/base/win/lock_state.h"
11 bool IsWorkstationLocked() {
12 bool is_locked
= true;
13 HDESK input_desk
= ::OpenInputDesktop(0, 0, GENERIC_READ
);
15 wchar_t name
[256] = {0};
17 if (::GetUserObjectInformation(
18 input_desk
, UOI_NAME
, name
, sizeof(name
), &needed
)) {
19 is_locked
= lstrcmpi(name
, L
"default") != 0;
21 ::CloseDesktop(input_desk
);