| 770 | } |
| 771 | |
| 772 | static HANDLE windows_log_open(const wchar_t *path, LARGE_INTEGER *size_out) { |
| 773 | /* windows_private_file_prepare creates or validates the file with IPC's |
| 774 | * explicit protected current-user DACL before this handle is opened. */ |
| 775 | HANDLE file = |
| 776 | CreateFileW(path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, |
| 777 | FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OPEN_REPARSE_POINT, NULL); |
| 778 | if (!windows_log_handle_valid(file, size_out)) { |
| 779 | if (file != INVALID_HANDLE_VALUE) { |
| 780 | (void)CloseHandle(file); |
| 781 | } |
| 782 | return INVALID_HANDLE_VALUE; |
| 783 | } |
| 784 | return file; |
| 785 | } |
| 786 | |
| 787 | typedef struct { |
| 788 | char storage[DAEMON_SERVICE_PATH_CAP]; |
no test coverage detected