Bewerken

Delen via


Enabling Event Categories for a Text Log

SetupAPI writes a log entry in a text log only if the event category for the log entry is enabled for the text log and the event level for the text log is equal to or greater than the event level for the log entry.

The following table lists the event categories that SetupAPI supports, the manifest constants that represent the event categories, and the values of the manifest constants.

Event category operation Event category manifest constant Event category value

Device installation

TXTLOG_DEVINST

0x00000001

Manage INF files

TXTLOG_INF

0x00000002

Manage file queues

TXTLOG_FILEQ

0x00000004

Copy files

TXTLOG_COPYFILES

0x00000008

Manage registry settings

TXTLOG_REGISTRY

0x00000010

Verify digital signatures

TXTLOG_SIGVERIF

0x00000020

Manage device and driver properties

TXTLOG_PROPERTIES

0x00000040

Backup data

TXTLOG_BACKUP

0x00000080

Manage user interface dialog boxes

TXTLOG_UI

0x00000100

New device manager

TXTLOG_NEWDEV

0x01000000

User-mode PnP manager

TXTLOG_UMPNPMGR

0x02000000

Manage the driver store

TXTLOG_DRIVER_STORE

0x04000000

Class installer or co-installer operation

TXTLOG_INSTALLER

0x40000000

Vendor-supplied operation

TXTLOG_VENDOR

0x80000000

To enable event categories for the SetupAPI logs, create (or modify) the following REG_DWORD registry value:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup\LogMask

The LogMask registry value applies to the device installation text log and the application installation text log.

If the LogMask registry value does not exist, SetupAPI enables all event categories for the text logs. If the LogMask registry value is zero, SetupAPI disables all event categories for the text logs.

The LogMask registry value is formatted as 0XVVVVVVVV, where VVVVVVVV is a 32-bitfield. To enable all categories, set LogMask to 0XFFFFFFFF. To enable only specific categories, perform a bitwise OR of the corresponding event category constants. For example:

  • To enable only log entries that are written by device installation operations, set LogMask to the value of TXTLOG_DEVINST (0X00000001)

  • To enable only log entries that are written by device installation operations and driver store operations, set LogMask to (TTXTLOG_DRIVER_STORE | TEXTLOG_DEVINST) (0x04000001).

  • To enable only log entries that are written by custom installation operations, set LogMask to TXTLOG_VENDOR (0x80000000).