SaferRecordEventLogEntry function

The SaferRecordEventLogEntry function saves messages to an event log.

Syntax

BOOL SaferRecordEventLogEntry(
  SAFER_LEVEL_HANDLE hLevel,
  LPCWSTR            szTargetPath,
  LPVOID             lpReserved
);

Parameters

hLevel

SAFER_LEVEL_HANDLE that contains the details of the rule to send to the event log.

szTargetPath

Path of the file that attempted to run.

lpReserved

Reserved for future use. This parameter should be set to NULL.

Return Value

TRUE if the function succeeds; otherwise, FALSE. For extended error information, call GetLastError.

Remarks

If SaferIdentifyLevel returns a SAFER_LEVEL_HANDLE with a LevelId that is anything other than SAFER_LEVELID_FULLYTRUSTED (0x40000), SaferRecordEventLogEntry can be called to facilitate troubleshooting. For example, clicking a button in excel.exe might attempt to launch another process that is not fully trusted. This might display an obscure error message because the program remapped the error returned from CreateProcess. To ease troubleshooting, some Safer functions call SaferRecordEventLogEntry to send an event to the event log.

Requirements

   
Windows version Windows XP [desktop apps only] Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winsafer.h
Library Advapi32.lib
DLL Advapi32.dll