Windows Dev Center

SaferRecordEventLogEntry function

The SaferRecordEventLogEntry function saves messages to an event log.

Syntax


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

Parameters

hLevel [in]

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

szTargetPath [in]

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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

WinSafer.h

Library

Advapi32.lib

DLL

Advapi32.dll

 

 

Community Additions

ADD
Show:
© 2015 Microsoft