-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.h
53 lines (38 loc) · 966 Bytes
/
logger.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef _LOGGER_H_
#define _LOGGER_H_
EXTERN_C_START
#define LOGGER_STATE_RUNING 0
#define LOGGER_STATE_STOPPING 2
#define LOGGER_STATE_STOPED 3
#define MSG_FORMAT_UNICODE 0
#define MSG_FORMAT_ANSI 1
#define MSG_POOL_MAX_LENGTH (32 * PAGE_SIZE)
typedef struct _MESSAGE_HEADER {
UINT32 Format;
UINT32 Length;
UCHAR Body[1];
} MESSAGE_HEADER, *PMESSAGE_HEADER;
#define MESSAGE_HEADER_LENGTH FIELD_OFFSET(MESSAGE_HEADER, Body)
#define GetMessageFullLength(Header) (MESSAGE_HEADER_LENGTH + Header->Length)
#define GetNextMessage(Header) ((PMESSAGE_HEADER)((PUINT8)(Header) + GetMessageFullLength(Header)))
#define PoolToMessage(Buffer, Offset) ((PMESSAGE_HEADER)((PUCHAR)(Buffer) + Offset))
VOID NTAPI
LogSyncPrint (
IN PCSTR Format,
IN ...
);
VOID NTAPI
LogPrint (
IN PCSTR Format,
IN ...
);
VOID NTAPI
LogUninitialize (
VOID
);
NTSTATUS NTAPI
LogInitialize (
IN UINT32 FlushTime
);
EXTERN_C_END
#endif