LoggerNameOffset represents offset (in bytes) from the start of the prop
to the beginning of the null-terminated string that contains the session
name. Hence, the prop must be cast from EVENT_TRACE_PROPERTIES* to char*
or BYTE* first, to calculate address properly.
Reference: https://docs.microsoft.com/en-us/windows/win32/api/evntrace/ns-evntrace-event_trace_propertiesFixes: #1
Signed-off-by: Simon Rozman <simon@rozman.si>
Other than having a convenient framework to test our helpers, this
allows CodeQL code analysis GitHub action.
Signed-off-by: Simon Rozman <simon@rozman.si>
Marking all global functions and templates as static made Doxygen hide
them from the documentation. However, they were marked as static because
of the portable nature of WinStd. Not to isolate them.
Signed-off-by: Simon Rozman <simon@rozman.si>
The helper methods, which are so simple they merely assign the pointer/
handle to the class instance, were simply marked depreciated.
The helper methods, which require extra variable to store the output
pointer/handle before assigning it to the class instance, were replaced
with function overloads named by the original function helpers initially
wrapped. This allows easy porting of the legacy code to use WinStd
classes.
This commit also splits the helper functions to A and W (_UNICODE)
variants.
Signed-off-by: Simon Rozman <simon@rozman.si>
Being portable means not interfering with *any* user project settings.
Adapt user projects accordingly when sockets are used.
Signed-off-by: Simon Rozman <simon@rozman.si>
Although, most of the Windows handles may be duplicated with
DuplicateHandle(), this requires knowledge of the processes, desired
access and what not. The dplhandle<> supports only trivial duplication.
Hence win_handle is not a child of dplhandle<>, but handle<> instead.
Signed-off-by: Simon Rozman <simon@rozman.si>
Using template type for string type could potentially allow mixup of
MBCS and UCS-2/UTF-16 strings. Fortunately, MSVC errors where char*/
wchar_t* are not aligned with LPSTR/LPWSTR.
Signed-off-by: Simon Rozman <simon@rozman.si>
Depending on the settings, compiler inlines the free_internal() call
inside the destructor. No need to copy&paste code.
Signed-off-by: Simon Rozman <simon@rozman.si>
This is library to be used by other projects and we cannot/do not want
to know in advance which functions will be used and which not.
Signed-off-by: Simon Rozman <simon@rozman.si>
Thou linker can locate the output .lib file of referenced projects
wherever .lib is just fine, this helps us to gather all .pdb files in
the output folder.
Signed-off-by: Simon Rozman <simon@rozman.si>
As we no longer explicitly set WindowsTargetPlatformVersion property,
AppVeyor Visual Studio 2017 builders assume 8.1 SDK for ARM64 too,
resulting in an unknown platform.
Signed-off-by: Simon Rozman <simon@rozman.si>