81 DPRINT1(
"NtAcceptConnectPort() failed (Status %lx)\n",
Status);
88 DPRINT1(
"NtCompleteConnectPort() failed (Status %lx)\n",
Status);
116 DWORD dwComputerNameLength;
119 DPRINT(
"ProcessPortMessage() called\n");
132 DPRINT1(
"NtReplyWaitReceivePort() failed (Status %lx)\n",
Status);
136 DPRINT(
"Received message\n");
146 DPRINT(
"Received request\n");
150 DPRINT(
"Received datagram (0x%x, 0x%x)\n",
164 dwComputerNameLength =
ARRAYSIZE(szComputerName);
166 szComputerName[0] =
L'\0';
216 if (LogBuffer ==
NULL)
218 DPRINT1(
"LogfAllocAndBuildNewRecord failed!\n");
228 DPRINT1(
"ERROR writing to event log `%S' (Status 0x%08lx)\n",
234 DPRINT1(
"\n--- EVENTLOG RECORD ---\n");
static UNICODE_STRING PortName
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
VOID PRINT_RECORD(PEVENTLOGRECORD pRec)
NTSTATUS NTAPI NtAcceptConnectPort(OUT PHANDLE PortHandle, IN PVOID PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage, IN BOOLEAN AcceptConnection, IN OUT PPORT_VIEW ServerView OPTIONAL, OUT PREMOTE_PORT_VIEW ClientView OPTIONAL)
NTSTATUS NTAPI NtCompleteConnectPort(IN HANDLE PortHandle)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
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
NTSTATUS ProcessPortMessage(VOID)
static HANDLE ConnectPortHandle
NTSTATUS InitLogPort(VOID)
static HANDLE MessagePortHandle
NTSTATUS WINAPI PortThreadRoutine(PVOID Param)
#define InitializeObjectAttributes(p, n, a, r, s)
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 NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtCreatePort(OUT PHANDLE PortHandle, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG MaxConnectInfoLength, IN ULONG MaxDataLength, IN ULONG MaxPoolUsage)
NTSTATUS NTAPI NtListenPort(IN HANDLE PortHandle, OUT PPORT_MESSAGE ConnectMessage)
NTSTATUS NTAPI NtReplyWaitReceivePort(IN HANDLE PortHandle, OUT PVOID *PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage OPTIONAL, OUT PPORT_MESSAGE ReceiveMessage)
#define RTL_CONSTANT_STRING(s)
#define FIELD_OFFSET(t, f)
#define MAX_COMPUTERNAME_LENGTH
#define EVENTLOG_ERROR_TYPE
#define EVENTLOG_INFORMATION_TYPE
#define EVENTLOG_WARNING_TYPE
#define PORT_MAXIMUM_MESSAGE_LENGTH