When used in place of void*, typecasting is redundant. In other
situations use reinterpret_cast<true type>() rather than C-style
typecasting.
Signed-off-by: Simon Rozman <simon@rozman.si>
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>