105{
116 DWORD dwComputerNameLength;
118
119 DPRINT(
"ProcessPortMessage() called\n");
120
122
124 {
129
131 {
132 DPRINT1(
"NtReplyWaitReceivePort() failed (Status %lx)\n",
Status);
133 break;
134 }
135
136 DPRINT(
"Received message\n");
137
139 {
142 }
143
145 {
146 DPRINT(
"Received request\n");
147 }
149 {
150 DPRINT(
"Received datagram (0x%x, 0x%x)\n",
153
154
155
158 {
162 }
163
164 dwComputerNameLength =
ARRAYSIZE(szComputerName);
166 szComputerName[0] =
L'\0';
167
169
171
172
175 {
177 }
179 {
181 }
183 {
185 }
187 {
189 }
190 else
191 {
192
194 }
195
196
197
198
199
201 &RecSize,
207 &ComputerName,
208 0,
216 if (LogBuffer ==
NULL)
217 {
218 DPRINT1(
"LogfAllocAndBuildNewRecord failed!\n");
219
220 continue;
221 }
222
224 {
227 {
228 DPRINT1(
"ERROR writing to event log `%S' (Status 0x%08lx)\n",
230 }
231 }
232 else
233 {
234 DPRINT1(
"\n--- EVENTLOG RECORD ---\n");
237 }
238
240 }
241 }
242
244}
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
VOID PRINT_RECORD(PEVENTLOGRECORD pRec)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
static const WCHAR Message[]
#define STATUS_SEVERITY_WARNING
#define STATUS_SEVERITY_ERROR
#define STATUS_SEVERITY_INFORMATIONAL
#define STATUS_SEVERITY_SUCCESS
PLOGFILE LogfListItemByName(LPCWSTR Name)
NTSTATUS LogfWriteRecord(PLOGFILE LogFile, PEVENTLOGRECORD Record, SIZE_T BufSize)
PEVENTLOGRECORD LogfAllocAndBuildNewRecord(PSIZE_T pRecSize, ULONG Time, USHORT wType, USHORT wCategory, ULONG dwEventId, PUNICODE_STRING SourceName, PUNICODE_STRING ComputerName, ULONG dwSidLength, PSID pUserSid, USHORT wNumStrings, PWSTR pStrings, ULONG dwDataSize, PVOID pRawData)
static __inline void LogfFreeRecord(PEVENTLOGRECORD Record)
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
struct _ELF_API_MSG * PELF_API_MSG
static PLARGE_INTEGER Time
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE EventType
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtReplyWaitReceivePort(IN HANDLE PortHandle, OUT PVOID *PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage OPTIONAL, OUT PPORT_MESSAGE ReceiveMessage)
#define FIELD_OFFSET(t, f)
#define MAX_COMPUTERNAME_LENGTH
#define EVENTLOG_ERROR_TYPE
#define EVENTLOG_INFORMATION_TYPE
#define EVENTLOG_WARNING_TYPE