Skip to content

Latest commit

 

History

History
148 lines (104 loc) · 6.19 KB

nf-setupapi-setupwritetextlogerror.md

File metadata and controls

148 lines (104 loc) · 6.19 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 f1_keywords dev_langs topic_type api_type api_location api_name
NF:setupapi.SetupWriteTextLogError
SetupWriteTextLogError function (setupapi.h)
The SetupWriteTextLogError function writes information about a SetupAPI-specific error or a Win32 system error to a SetupAPI text log.
SetupWriteTextLogError
SetupWriteTextLogError function [Device and Driver Installation]
devinst.setupwritetextlogerror
setupapi/SetupWriteTextLogError
setupapilog-ref_886f507a-408e-4745-b9d2-ea0cf1bf7250.xml
devinst\setupwritetextlogerror.htm
devinst
9b52d5a7-4a7f-49eb-86c4-cc0434b54232
12/05/2018
SetupWriteTextLogError, SetupWriteTextLogError function [Device and Driver Installation], devinst.setupwritetextlogerror, setupapi/SetupWriteTextLogError, setupapilog-ref_886f507a-408e-4745-b9d2-ea0cf1bf7250.xml
setupapi.h
Setupapi.h
Desktop
Available in Windows Vista and later versions of Windows.
Setupapi.lib
Windows
19H1
SetupWriteTextLogError
setupapi/SetupWriteTextLogError
c++
APIRef
kbSyntax
LibDef
Setupapi.lib
Setupapi.dll
SetupWriteTextLogError

SetupWriteTextLogError function

-description

The SetupWriteTextLogError function writes information about a SetupAPI-specific error or a Win32 system error to 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 value of type DWORD 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 LogFlags [in]

A value of type DWORD 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 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 Error [in]

A SetupAPI-specific error code or a Win32 error code. The SetupAPI-specific error codes are listed in Setupapi.h. The Win32 error codes are listed in Winerror.h.

-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.

-param ...

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

-returns

None

-remarks

If an installation application has a SetupAPI-specific error code or a Win32 error code that is associated with an installation error, the application can call SetupWriteTextLogError instead of SetupWriteTextLog to write two entries into a text log. The first entry will be the same as that written by SetupWriteTextLog and the second entry will log the error code and a user-friendly description of the error.

The log token, event category, and flags that a caller supplies affect the operation of SetupWriteTextLogError is the same manner as that described for SetupWriteTextLog.

SetupWriteTextLogError writes the first log entry in the following format:

entry-prefix  time_stamp categoryindentation  formatted-message

SetupWriteTextLogError writes the second log entry in the following format:

entry-prefix  time_stamp  category  indentation  Error: error-numbererror-description

Where:

  • The entry-prefix, time-stamp, category, indentation, and formatted-message fields are the same as those described in Format of a Text Log Section Body.
  • The error-number field contains the error number.
  • The error-description field contains a user-friendly description of the error.
For general information about writing log entries in the SetupAPI text logs, see SetupAPI Logging (Windows Vista).

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

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

SetupWriteTextLog