My goal is to find the size of log files which is present in (%SystemRoot%\System32\winevt\logs) using c++ (For Eg : To get the file size of Application.evtx). I tried with GetFileSizeEx (https://learn.microsoft.com/fr-fr/windows/win32/api/fileapi/nf-fileapi-getfilesizeex) method but i got error like incorrect handle is passed. Passed three handle with (EvtQuery,EvtGetChannelConfigProperty,OpenEventLog) to GetFileSizeEx but i get the same error. Can i know what handle should be passed to get the size:
Find the similar question (How to find the size of log files using EvtQuery function?). Tried this but I got invalid handle as error with GetFileSizeEx.