mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
dll: FspDebugLogSetHandle
This commit is contained in:
parent
f8f6d0f1bc
commit
f8cebd1f92
@ -1469,9 +1469,10 @@ FSP_API NTSTATUS FspNtStatusFromWin32(DWORD Error);
|
||||
FSP_API DWORD FspWin32FromNtStatus(NTSTATUS Status);
|
||||
FSP_API VOID FspEventLog(ULONG Type, PWSTR Format, ...);
|
||||
FSP_API VOID FspEventLogV(ULONG Type, PWSTR Format, va_list ap);
|
||||
FSP_API VOID FspDebugLog(const char *format, ...);
|
||||
FSP_API VOID FspDebugLogSD(const char *format, PSECURITY_DESCRIPTOR SecurityDescriptor);
|
||||
FSP_API VOID FspDebugLogFT(const char *format, PFILETIME FileTime);
|
||||
FSP_API VOID FspDebugLogSetHandle(HANDLE Handle);
|
||||
FSP_API VOID FspDebugLog(const char *Format, ...);
|
||||
FSP_API VOID FspDebugLogSD(const char *Format, PSECURITY_DESCRIPTOR SecurityDescriptor);
|
||||
FSP_API VOID FspDebugLogFT(const char *Format, PFILETIME FileTime);
|
||||
FSP_API VOID FspDebugLogRequest(FSP_FSCTL_TRANSACT_REQ *Request);
|
||||
FSP_API VOID FspDebugLogResponse(FSP_FSCTL_TRANSACT_RSP *Response);
|
||||
FSP_API NTSTATUS FspCallNamedPipeSecurely(PWSTR PipeName,
|
||||
|
@ -19,6 +19,13 @@
|
||||
#include <sddl.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
static HANDLE FspDebugLogHandle = INVALID_HANDLE_VALUE;
|
||||
|
||||
FSP_API VOID FspDebugLogSetHandle(HANDLE Handle)
|
||||
{
|
||||
FspDebugLogHandle = Handle;
|
||||
}
|
||||
|
||||
FSP_API VOID FspDebugLog(const char *format, ...)
|
||||
{
|
||||
char buf[1024];
|
||||
@ -28,7 +35,13 @@ FSP_API VOID FspDebugLog(const char *format, ...)
|
||||
wvsprintfA(buf, format, ap);
|
||||
va_end(ap);
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
OutputDebugStringA(buf);
|
||||
if (INVALID_HANDLE_VALUE != FspDebugLogHandle)
|
||||
{
|
||||
DWORD bytes;
|
||||
WriteFile(FspDebugLogHandle, buf, lstrlenA(buf), &bytes, 0);
|
||||
}
|
||||
else
|
||||
OutputDebugStringA(buf);
|
||||
}
|
||||
|
||||
FSP_API VOID FspDebugLogSD(const char *format, PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user