diff options
author | Tor Lillqvist <tml@iki.fi> | 2009-10-27 14:18:17 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2009-12-01 10:28:11 +0100 |
commit | 9601b11eebf3659141dc4b44d5068a30a5a66789 (patch) | |
tree | 3eb52da98683b636d9a80d1aad48ddfb8ed3fe93 /dbus/dbus-sysdeps-util-win.c | |
parent | fed50076e6e410db08a9d83fac5c1cf40273f5a8 (diff) |
Drop unused complex function
Drop _dbus_user_at_console() from dbus-sysdeps-util-win.c. It is
called only from dbus-userdb-util.c which isn't compiled on Windows.
Diffstat (limited to 'dbus/dbus-sysdeps-util-win.c')
-rw-r--r-- | dbus/dbus-sysdeps-util-win.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/dbus/dbus-sysdeps-util-win.c b/dbus/dbus-sysdeps-util-win.c index 8b9fe7ac..b9ebc82a 100644 --- a/dbus/dbus-sysdeps-util-win.c +++ b/dbus/dbus-sysdeps-util-win.c @@ -224,92 +224,6 @@ _dbus_change_to_daemon_user (const char *user, return TRUE; } -/** Checks if user is at the console -* -* @param username user to check -* @param error return location for errors -* @returns #TRUE is the user is at the consolei and there are no errors -*/ -dbus_bool_t -_dbus_user_at_console(const char *username, - DBusError *error) -{ -#ifdef DBUS_WINCE - return TRUE; -#else - dbus_bool_t retval = FALSE; - wchar_t *wusername; - DWORD sid_length; - PSID user_sid, console_user_sid; - HWINSTA winsta; - - wusername = _dbus_win_utf8_to_utf16 (username, error); - if (!wusername) - return FALSE; - - // TODO remove - if (!_dbus_win_account_to_sid (wusername, &user_sid, error)) - goto out0; - - /* Now we have the SID for username. Get the SID of the - * user at the "console" (window station WinSta0) - */ - if (!(winsta = OpenWindowStation ("WinSta0", FALSE, READ_CONTROL))) - { - _dbus_win_set_error_from_win_error (error, GetLastError ()); - goto out2; - } - - sid_length = 0; - GetUserObjectInformation (winsta, UOI_USER_SID, - NULL, 0, &sid_length); - if (sid_length == 0) - { - /* Nobody is logged on */ - goto out2; - } - - if (sid_length < 0 || sid_length > 1000) - { - dbus_set_error_const (error, DBUS_ERROR_FAILED, "Invalid SID length"); - goto out3; - } - - console_user_sid = dbus_malloc (sid_length); - if (!console_user_sid) - { - _DBUS_SET_OOM (error); - goto out3; - } - - if (!GetUserObjectInformation (winsta, UOI_USER_SID, - console_user_sid, sid_length, &sid_length)) - { - _dbus_win_set_error_from_win_error (error, GetLastError ()); - goto out4; - } - - if (!IsValidSid (console_user_sid)) - { - dbus_set_error_const (error, DBUS_ERROR_FAILED, "Invalid SID"); - goto out4; - } - - retval = EqualSid (user_sid, console_user_sid); - -out4: - dbus_free (console_user_sid); -out3: - CloseWindowStation (winsta); -out2: - dbus_free (user_sid); -out0: - dbus_free (wusername); - - return retval; -#endif //DBUS_WINCE -} - void _dbus_init_system_log (void) { |