Debian Codegraph @

admin/win/tools/NCMsiHelper/LogResult.h

raw
1 /*
2 * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
3 * SPDX-License-Identifier: GPL-2.0-or-later OR CPOL-1.02
4 *
5 * Parts of this file are based on:
6 * https://www.codeproject.com/articles/570751/devmsi-an-example-cplusplus-msi-wix-deferred-custo
7 *
8 * Licensed under the The Code Project Open License (CPOL):
9 * https://www.codeproject.com/info/cpol10.aspx
10 *
11 */
12
13 /**
14 * Function prototype for LogResult()
15 */
16 #pragma once
17
18 /**
19 * Log a message.
20 *
21 * If the DLL is being used in a WiX MSI environment, LogResult() will
22 * route any log messages to the MSI log file via WcaLog() or WcaLogError().
23 *
24 * If the DLL is NOT being used in a WiX MSI environment, LogResult() will
25 * route any log messages to stdout or stderr.
26 *
27 * If the result is an error code, LogResult will attempt to gather a
28 * text version of the error code and place it in the log. For example,
29 * if the error code means ERROR_FILE_NOT_FOUND, it will look up the appropriate
30 * message ( via FormatMessage() ) and add "The system cannot find the file specified."
31 * to the log.
32 *
33 * @param hr The HRESULT to be interrogated for success or failure.
34 * @param fmt The string format for a user-specified error message.
35 */
36 void LogResult(
37 __in HRESULT hr,
38 __in_z __format_string PCSTR fmt, ...
39 );