| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_WIN_UTIL_H__ | 5 #ifndef BASE_WIN_UTIL_H__ |
| 6 #define BASE_WIN_UTIL_H__ | 6 #define BASE_WIN_UTIL_H__ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <aclapi.h> | 9 #include <aclapi.h> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Creates a security descriptor with a DACL that has one ace giving full | 44 // Creates a security descriptor with a DACL that has one ace giving full |
| 45 // access to the current logon session. | 45 // access to the current logon session. |
| 46 // The security descriptor returned must be freed using LocalFree. | 46 // The security descriptor returned must be freed using LocalFree. |
| 47 // The function returns true if it succeeds, false otherwise. | 47 // The function returns true if it succeeds, false otherwise. |
| 48 bool GetLogonSessionOnlyDACL(SECURITY_DESCRIPTOR** security_descriptor); | 48 bool GetLogonSessionOnlyDACL(SECURITY_DESCRIPTOR** security_descriptor); |
| 49 | 49 |
| 50 // Useful for subclassing a HWND. Returns the previous window procedure. | 50 // Useful for subclassing a HWND. Returns the previous window procedure. |
| 51 WNDPROC SetWindowProc(HWND hwnd, WNDPROC wndproc); | 51 WNDPROC SetWindowProc(HWND hwnd, WNDPROC wndproc); |
| 52 | 52 |
| 53 // Returns true if the existing window procedure is the same as |subclass_proc|. |
| 54 bool IsSubclassed(HWND window, WNDPROC subclass_proc); |
| 55 |
| 53 // Subclasses a window, replacing its existing window procedure with the | 56 // Subclasses a window, replacing its existing window procedure with the |
| 54 // specified one. Returns true if the current window procedure was replaced, | 57 // specified one. Returns true if the current window procedure was replaced, |
| 55 // false if the window has already been subclassed with the specified | 58 // false if the window has already been subclassed with the specified |
| 56 // subclass procedure. | 59 // subclass procedure. |
| 57 bool Subclass(HWND window, WNDPROC subclass_proc); | 60 bool Subclass(HWND window, WNDPROC subclass_proc); |
| 58 | 61 |
| 59 // Unsubclasses a window subclassed using Subclass. Returns true if | 62 // Unsubclasses a window subclassed using Subclass. Returns true if |
| 60 // the window was subclassed with the specified |subclass_proc| and the window | 63 // the window was subclassed with the specified |subclass_proc| and the window |
| 61 // was successfully unsubclassed, false if the window's window procedure is not | 64 // was successfully unsubclassed, false if the window's window procedure is not |
| 62 // |subclass_proc|. | 65 // |subclass_proc|. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Windows's default Message Compiled resources; ignoring the inserts. | 99 // Windows's default Message Compiled resources; ignoring the inserts. |
| 97 std::wstring FormatMessage(unsigned messageid); | 100 std::wstring FormatMessage(unsigned messageid); |
| 98 | 101 |
| 99 // Uses the last Win32 error to generate a human readable message string. | 102 // Uses the last Win32 error to generate a human readable message string. |
| 100 std::wstring FormatLastWin32Error(); | 103 std::wstring FormatLastWin32Error(); |
| 101 | 104 |
| 102 } // namespace win_util | 105 } // namespace win_util |
| 103 | 106 |
| 104 #endif // BASE_WIN_UTIL_H__ | 107 #endif // BASE_WIN_UTIL_H__ |
| 105 | 108 |
| OLD | NEW |