mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-14 15:52:47 -05:00
dll: FspDebugLogSD
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <dll/library.h>
|
||||
#include <sddl.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
FSP_API VOID FspDebugLog(const char *format, ...)
|
||||
@ -18,3 +19,21 @@ FSP_API VOID FspDebugLog(const char *format, ...)
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
OutputDebugStringA(buf);
|
||||
}
|
||||
|
||||
FSP_API VOID FspDebugLogSD(const char *format, PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||
{
|
||||
char *Sddl;
|
||||
|
||||
if (0 == SecurityDescriptor)
|
||||
FspDebugLog(format, "null security descriptor");
|
||||
else if (ConvertSecurityDescriptorToStringSecurityDescriptorA(SecurityDescriptor, SDDL_REVISION_1,
|
||||
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
|
||||
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION,
|
||||
&Sddl, 0))
|
||||
{
|
||||
FspDebugLog(format, Sddl);
|
||||
LocalFree(Sddl);
|
||||
}
|
||||
else
|
||||
FspDebugLog(format, "invalid security descriptor");
|
||||
}
|
||||
|
@ -18,8 +18,11 @@
|
||||
#if !defined(NDEBUG)
|
||||
#define DEBUGLOG(fmt, ...) \
|
||||
FspDebugLog("[U] " LIBRARY_NAME "!" __FUNCTION__ ": " fmt "\n", __VA_ARGS__)
|
||||
#define DEBUGLOGSD(fmt, SD) \
|
||||
FspDebugLogSD("[U] " LIBRARY_NAME "!" __FUNCTION__ ": " fmt "\n", SD)
|
||||
#else
|
||||
#define DEBUGLOG(fmt, ...) ((void)0)
|
||||
#define DEBUGLOGSD(fmt, SD) ((void)0)
|
||||
#endif
|
||||
|
||||
static inline PVOID MemAlloc(SIZE_T Size)
|
||||
|
Reference in New Issue
Block a user