Skip to content

Latest commit

 

History

History
187 lines (139 loc) · 6.99 KB

nf-setupapi-setupwritetextlog.md

File metadata and controls

187 lines (139 loc) · 6.99 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom req.apiset f1_keywords dev_langs topic_type api_type api_location api_name
NF:setupapi.SetupWriteTextLog
SetupWriteTextLog function (setupapi.h)
The SetupWriteTextLog function writes a log entry in a SetupAPI text log.
SetupWriteTextLog
SetupWriteTextLog function [Device and Driver Installation]
devinst.setupwritetextlog
setupapi/SetupWriteTextLog
setupapilog-ref_42860a5c-0ea7-4185-81eb-76996286cafc.xml
devinst\setupwritetextlog.htm
devinst
8a59c796-1386-495c-9790-8916d677ebd3
12/05/2018
SetupWriteTextLog, SetupWriteTextLog function [Device and Driver Installation], devinst.setupwritetextlog, setupapi/SetupWriteTextLog, setupapilog-ref_42860a5c-0ea7-4185-81eb-76996286cafc.xml
setupapi.h
Setupapi.h
Desktop
Available in Windows Vista and later versions of Windows.
Setupapi.lib
Windows
19H1
ext-ms-win-setupapi-logging-l1-1-0 (introduced in Windows 8)
SetupWriteTextLog
setupapi/SetupWriteTextLog
c++
APIRef
kbSyntax
DllExport
Setupapi.lib
Setupapi.dll
Ext-MS-Win-setupapi-logging-l1-1-0.dll
setupapi.dll
SetupWriteTextLog

SetupWriteTextLog function

-description

The SetupWriteTextLog function writes a log entry in a SetupAPI text log.

-parameters

-param LogToken [in]

A log token that is either a system-defined log token or was returned by SetupGetThreadLogToken.

-param Category [in]

A DWORD-typed value that indicates the event category for the log entry. The event categories that can be specified for a log entry are the same as those that can be enabled for a text log. For a list of event categories, see Enabling Event Categories for a SetupAPI Text Log.

-param Flags [in]

A DWORD-typed value that is a bitwise OR of flag values, which specify the following:

  • The event level for the log entry. The event levels that can be specified for a log entry are the same as those that can be enabled for a text log. For a list of event level flags, see Setting the Event Level for a SetupAPI Text Log.
  • Whether to include a time stamp in the log entry. The time stamp flag value is TXTLOG_TIMESTAMP.
  • The change, if any, to the indentation depth of the section and the current log entry. For information about how to use the indentation flags, see Writing Indented Log Entries.

-param MessageStr [in]

A pointer to a NULL-terminated constant string that contains a printf-compatible format string, which specifies the formatted message to include in the log entry. The comma-separated parameter list that follows MessageStr must match the format specifiers in the format string.

-param ...

A comma-separated parameter list that matches the format specifiers in the format string that is supplied by MessageStr.

-returns

None

-remarks

If the value of LogToken was returned by a call to SetupGetThreadLogToken and the corresponding text log section can be found, SetupWriteTextLog writes the log entry in that text log section. If SetupWriteTextLog cannot locate the section, SetupWriteTextLog writes the log entry in the corresponding text log, but does not include the log entry in a section.

If the value of LogToken is one of the system-defined log tokens listed in the following table, SetupWriteTextLog performs the write operation that is indicated for that log token.

System-defined log token Write operation
LOGTOKEN_NOLOG The log entry is not written to any text log.
LOG_TOKEN_UNSPECIFIED The log entry is written to the application installation text log. The log entry is not included in a text log section.
LOGTOKEN_SETUPAPI_APPLOG The log entry is written to the application installation text log. The log entry is not included in a text log section.
LOGTOKEN_SETUPAPI_DEVLOG The log entry is written to the device installation text log. The log entry is not included in a text log section.
 
Note  Setting the value of LogToken to one of the system-defined log tokens does not change the value of the current log token for the thread.
 
In addition, SetupWriteTextLog does not write a log entry when any of the following are true: The maximum length, in characters, of a log entry is 336.

To write information about a SetupAPI-specific error or a Win32 error in a text log, an application can use SetupWriteTextLogError.

For general information about writing log entries in the SetupAPI text logs, see SetupAPI Logging (Windows Vista and Later).

For more information about the operation of SetupWriteTextLog, see Calling SetupWriteTextLog.

For more information about log tokens, see Log Tokens.

For more information about using log tokens, see Setting and Getting a Log Token for a Thread.

-see-also

SetupGetThreadLogToken

SetupWriteTextLogError