24 #define WIN32_NO_STATUS 33 #ifndef __WINE_WINTERNL_H 92 #define UNUSED_MSG_TYPE 0 95 #define LPC_DATAGRAM 3 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" 108 #define REPLY "Reply" 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");
UCHAR Data[ANYSIZE_ARRAY]
static void ProcessLpcRequest(HANDLE PortHandle, union lpc_message *LpcMessage)
#define LPC_CONNECTION_REQUEST
ACPI_SIZE strlen(const char *String)
USHORT VirtualRangesOffset
#define STATUS_INVALID_HANDLE
static void test_ports_server(HANDLE PortHandle)
SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
GLsizei GLsizei GLuint * obj
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
return STATUS_NOT_IMPLEMENTED
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
struct _LPC_MESSAGE LPC_MESSAGE
struct _LPC_SECTION_WRITE * PLPC_SECTION_WRITE
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 _LPC_SECTION_WRITE LPC_SECTION_WRITE
USHORT VirtualRangesOffset
struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES
static DWORD WINAPI test_ports_client(LPVOID arg)
_Out_ PCLIENT_ID ClientId
struct _LPC_SECTION_READ * PLPC_SECTION_READ
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static POBJECT_ATTRIBUTES
static void ProcessConnectionRequest(union lpc_message *LpcMessage, PHANDLE pAcceptPortHandle)
static BOOL(WINAPI *pIsWow64Process)(HANDLE
#define STATUS_ACCESS_DENIED
struct _CLIENT_ID * PCLIENT_ID
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
#define GetCurrentProcess()
static BOOL init_function_ptrs(void)
static NTSTATUS(WINAPI *pNtCompleteConnectPort)(HANDLE)
struct _LPC_SECTION_READ LPC_SECTION_READ
UCHAR Data[ANYSIZE_ARRAY]
#define SECURITY_STATIC_TRACKING
#define FIELD_OFFSET(t, f)
struct _SECURITY_QUALITY_OF_SERVICE SECURITY_QUALITY_OF_SERVICE
struct _LPC_MESSAGE * PLPC_MESSAGE
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
static PSECURITY_QUALITY_OF_SERVICE
char * strcpy(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
#define GetProcAddress(x, y)
struct _CLIENT_ID CLIENT_ID
static SERVICE_STATUS status
#define HeapFree(x, y, z)
static const WCHAR PORTNAME[]
static UNICODE_STRING port