24#define WIN32_NO_STATUS
33#ifndef __WINE_WINTERNL_H
92#define UNUSED_MSG_TYPE 0
96#define LPC_LOST_REPLY 4
97#define LPC_PORT_CLOSED 5
98#define LPC_CLIENT_DIED 6
99#define LPC_EXCEPTION 7
100#define LPC_DEBUG_EVENT 8
101#define LPC_ERROR_EVENT 9
102#define LPC_CONNECTION_REQUEST 10
106#define REQUEST1 "Request1"
107#define REQUEST2 "Request2"
110#define MAX_MESSAGE_LEN 30
149 pNtRegisterThreadTerminatePort = (
void *)
GetProcAddress(
hntdll,
"NtRegisterThreadTerminatePort");
153 if (!pNtCompleteConnectPort || !pNtAcceptConnectPort ||
154 !pNtReplyWaitReceivePort || !pNtCreatePort || !pNtRequestWaitReplyPort ||
155 !pNtRequestPort || !pNtRegisterThreadTerminatePort ||
156 !pNtConnectPort || !pRtlInitUnicodeString)
158 win_skip(
"Needed port functions are not available\n");
175 "Expected LPC_CONNECTION_REQUEST, got %d\n", LpcMessage->
msg64.
MessageType);
176 ok(!*LpcMessage->
msg64.
Data,
"Expected empty string!\n");
181 "Expected LPC_CONNECTION_REQUEST, got %d\n", LpcMessage->
msg.
MessageType);
182 ok(!*LpcMessage->
msg.
Data,
"Expected empty string!\n");
185 status = pNtAcceptConnectPort(pAcceptPortHandle, 0, &LpcMessage->
msg, 1,
NULL,
NULL);
188 status = pNtCompleteConnectPort(*pAcceptPortHandle);
204 status = pNtReplyPort(PortHandle, &LpcMessage->
msg);
219 status = pNtReplyPort(PortHandle, &LpcMessage->
msg);
245 status = pNtRegisterThreadTerminatePort(PortHandle);
258 status = pNtRequestPort(PortHandle, &LpcMessage->
msg);
271 status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->
msg, &
out->msg);
274 ok(
out->msg64.MessageType ==
LPC_REPLY,
"Expected LPC_REPLY, got %d\n",
out->msg64.MessageType);
286 status = pNtRequestPort(PortHandle, &LpcMessage->
msg);
299 status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->
msg, &
out->msg);
302 ok(
out->msg.MessageType ==
LPC_REPLY,
"Expected LPC_REPLY, got %d\n",
out->msg.MessageType);
356 ok(done,
"Expected LPC request to be completed!\n");
361 ok(
FALSE,
"Unexpected message: %d\n",
385 status = pNtCreatePort(&port_handle, &
obj, 100, 100, 0);
393 ok(
thread !=
NULL,
"Expected non-NULL thread handle!\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define STATUS_INVALID_HANDLE
#define STATUS_NOT_IMPLEMENTED
#define GetProcAddress(x, y)
#define GetCurrentProcess()
#define HeapFree(x, y, z)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
struct _SECURITY_QUALITY_OF_SERVICE SECURITY_QUALITY_OF_SERVICE
static POBJECT_ATTRIBUTES
struct _LPC_SECTION_WRITE * PLPC_SECTION_WRITE
static DWORD WINAPI test_ports_client(LPVOID arg)
struct _CLIENT_ID CLIENT_ID
static void ProcessConnectionRequest(union lpc_message *LpcMessage, PHANDLE pAcceptPortHandle)
struct _LPC_MESSAGE * PLPC_MESSAGE
struct _LPC_SECTION_READ * PLPC_SECTION_READ
static void ProcessLpcRequest(HANDLE PortHandle, union lpc_message *LpcMessage)
struct _LPC_MESSAGE LPC_MESSAGE
static void test_ports_server(HANDLE PortHandle)
static const WCHAR PORTNAME[]
static PSECURITY_QUALITY_OF_SERVICE
static BOOL init_function_ptrs(void)
struct _LPC_SECTION_READ LPC_SECTION_READ
#define LPC_CONNECTION_REQUEST
struct _LPC_SECTION_WRITE LPC_SECTION_WRITE
struct _CLIENT_ID * PCLIENT_ID
UCHAR Data[ANYSIZE_ARRAY]
USHORT VirtualRangesOffset
USHORT VirtualRangesOffset
UCHAR Data[ANYSIZE_ARRAY]
SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define FIELD_OFFSET(t, f)
#define STATUS_ACCESS_DENIED
struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES
_Out_ PCLIENT_ID ClientId
#define SECURITY_STATIC_TRACKING