mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
dll: add eventlog.mc and related files
This commit is contained in:
parent
e53e915a72
commit
12db7cf9dc
@ -42,6 +42,7 @@
|
|||||||
<None Include="..\..\src\dll\ntstatus.i" />
|
<None Include="..\..\src\dll\ntstatus.i" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="..\..\src\dll\eventlog\eventlog.rc" />
|
||||||
<ResourceCompile Include="..\..\src\dll\version.rc">
|
<ResourceCompile Include="..\..\src\dll\version.rc">
|
||||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_UNICODE;UNICODE;%(PreprocessorDefinitions);MyProductName=$(MyProductName);MyDescription=$(MyDescription);MyCompanyName=$(MyCompanyName);MyCopyright=$(MyCopyright);MyVersion=$(MyVersion);MyVersionWithCommas=$(MyVersionWithCommas)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_UNICODE;UNICODE;%(PreprocessorDefinitions);MyProductName=$(MyProductName);MyDescription=$(MyDescription);MyCompanyName=$(MyCompanyName);MyCopyright=$(MyCopyright);MyVersion=$(MyVersion);MyVersionWithCommas=$(MyVersionWithCommas)</PreprocessorDefinitions>
|
||||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_UNICODE;UNICODE;%(PreprocessorDefinitions);MyProductName=$(MyProductName);MyDescription=$(MyDescription);MyCompanyName=$(MyCompanyName);MyCopyright=$(MyCopyright);MyVersion=$(MyVersion);MyVersionWithCommas=$(MyVersionWithCommas)</PreprocessorDefinitions>
|
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_UNICODE;UNICODE;%(PreprocessorDefinitions);MyProductName=$(MyProductName);MyDescription=$(MyDescription);MyCompanyName=$(MyCompanyName);MyCopyright=$(MyCopyright);MyVersion=$(MyVersion);MyVersionWithCommas=$(MyVersionWithCommas)</PreprocessorDefinitions>
|
||||||
|
@ -71,5 +71,8 @@
|
|||||||
<ResourceCompile Include="..\..\src\dll\version.rc">
|
<ResourceCompile Include="..\..\src\dll\version.rc">
|
||||||
<Filter>Source</Filter>
|
<Filter>Source</Filter>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
|
<ResourceCompile Include="..\..\src\dll\eventlog\eventlog.rc">
|
||||||
|
<Filter>Source</Filter>
|
||||||
|
</ResourceCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include <dll/library.h>
|
#include <dll/library.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include "eventlog/eventlog.h"
|
||||||
|
|
||||||
static HANDLE FspEventLogHandle;
|
static HANDLE FspEventLogHandle;
|
||||||
static INIT_ONCE FspEventLogInitOnce = INIT_ONCE_STATIC_INIT;
|
static INIT_ONCE FspEventLogInitOnce = INIT_ONCE_STATIC_INIT;
|
||||||
@ -46,41 +47,18 @@ FSP_API VOID FspEventLogV(ULONG Type, PWSTR Format, va_list ap)
|
|||||||
Buf[(sizeof Buf / sizeof Buf[0]) - 1] = L'\0';
|
Buf[(sizeof Buf / sizeof Buf[0]) - 1] = L'\0';
|
||||||
Strings[0] = Buf;
|
Strings[0] = Buf;
|
||||||
|
|
||||||
/*
|
|
||||||
* Event Identifier Format:
|
|
||||||
*
|
|
||||||
* 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
|
|
||||||
* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
|
|
||||||
* +---+-+-+-----------------------+-------------------------------+
|
|
||||||
* |Sev|C|R| Facility | Code |
|
|
||||||
* +---+-+-+-----------------------+-------------------------------+
|
|
||||||
*
|
|
||||||
* Sev - Severity:
|
|
||||||
* 00 - Success
|
|
||||||
* 01 - Informational
|
|
||||||
* 10 - Warning
|
|
||||||
* 11 - Error
|
|
||||||
*
|
|
||||||
* C - Customer:
|
|
||||||
* 0 - System code
|
|
||||||
* 1 - Customer code
|
|
||||||
*
|
|
||||||
* R - Reserved
|
|
||||||
*
|
|
||||||
* See https://msdn.microsoft.com/en-us/library/windows/desktop/aa363651(v=vs.85).aspx
|
|
||||||
*/
|
|
||||||
switch (Type)
|
switch (Type)
|
||||||
{
|
{
|
||||||
case EVENTLOG_ERROR_TYPE:
|
default:
|
||||||
EventId = 0xd0000001;
|
|
||||||
break;
|
|
||||||
case EVENTLOG_WARNING_TYPE:
|
|
||||||
EventId = 0xc0000001;
|
|
||||||
break;
|
|
||||||
case EVENTLOG_INFORMATION_TYPE:
|
case EVENTLOG_INFORMATION_TYPE:
|
||||||
case EVENTLOG_SUCCESS:
|
case EVENTLOG_SUCCESS:
|
||||||
default:
|
EventId = FSP_EVENTLOG_INFORMATION;
|
||||||
EventId = 0x60000001;
|
break;
|
||||||
|
case EVENTLOG_WARNING_TYPE:
|
||||||
|
EventId = FSP_EVENTLOG_WARNING;
|
||||||
|
break;
|
||||||
|
case EVENTLOG_ERROR_TYPE:
|
||||||
|
EventId = FSP_EVENTLOG_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
63
src/dll/eventlog/eventlog.h
Normal file
63
src/dll/eventlog/eventlog.h
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
//
|
||||||
|
// Values are 32 bit values laid out as follows:
|
||||||
|
//
|
||||||
|
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
|
||||||
|
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
|
||||||
|
// +---+-+-+-----------------------+-------------------------------+
|
||||||
|
// |Sev|C|R| Facility | Code |
|
||||||
|
// +---+-+-+-----------------------+-------------------------------+
|
||||||
|
//
|
||||||
|
// where
|
||||||
|
//
|
||||||
|
// Sev - is the severity code
|
||||||
|
//
|
||||||
|
// 00 - Success
|
||||||
|
// 01 - Informational
|
||||||
|
// 10 - Warning
|
||||||
|
// 11 - Error
|
||||||
|
//
|
||||||
|
// C - is the Customer code flag
|
||||||
|
//
|
||||||
|
// R - is a reserved bit
|
||||||
|
//
|
||||||
|
// Facility - is the facility code
|
||||||
|
//
|
||||||
|
// Code - is the facility's status code
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Define the facility codes
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Define the severity codes
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// MessageId: FSP_EVENTLOG_INFORMATION
|
||||||
|
//
|
||||||
|
// MessageText:
|
||||||
|
//
|
||||||
|
// %1
|
||||||
|
//
|
||||||
|
#define FSP_EVENTLOG_INFORMATION 0x60000001L
|
||||||
|
|
||||||
|
//
|
||||||
|
// MessageId: FSP_EVENTLOG_WARNING
|
||||||
|
//
|
||||||
|
// MessageText:
|
||||||
|
//
|
||||||
|
// %1
|
||||||
|
//
|
||||||
|
#define FSP_EVENTLOG_WARNING 0xA0000001L
|
||||||
|
|
||||||
|
//
|
||||||
|
// MessageId: FSP_EVENTLOG_ERROR
|
||||||
|
//
|
||||||
|
// MessageText:
|
||||||
|
//
|
||||||
|
// %1
|
||||||
|
//
|
||||||
|
#define FSP_EVENTLOG_ERROR 0xE0000001L
|
||||||
|
|
20
src/dll/eventlog/eventlog.mc
Normal file
20
src/dll/eventlog/eventlog.mc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
MessageId=1
|
||||||
|
Severity=Informational
|
||||||
|
SymbolicName=FSP_EVENTLOG_INFORMATION
|
||||||
|
Language=English
|
||||||
|
%1
|
||||||
|
.
|
||||||
|
|
||||||
|
MessageId=1
|
||||||
|
Severity=Warning
|
||||||
|
SymbolicName=FSP_EVENTLOG_WARNING
|
||||||
|
Language=English
|
||||||
|
%1
|
||||||
|
.
|
||||||
|
|
||||||
|
MessageId=1
|
||||||
|
Severity=Error
|
||||||
|
SymbolicName=FSP_EVENTLOG_ERROR
|
||||||
|
Language=English
|
||||||
|
%1
|
||||||
|
.
|
2
src/dll/eventlog/eventlog.rc
Normal file
2
src/dll/eventlog/eventlog.rc
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
LANGUAGE 0x9,0x1
|
||||||
|
1 11 "eventlog_MSG00001.bin"
|
BIN
src/dll/eventlog/eventlog_MSG00001.bin
Normal file
BIN
src/dll/eventlog/eventlog_MSG00001.bin
Normal file
Binary file not shown.
5
src/dll/eventlog/runmc.bat
Normal file
5
src/dll/eventlog/runmc.bat
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
|
||||||
|
mc -b -c eventlog.mc
|
Loading…
x
Reference in New Issue
Block a user