ntdll/tests: Enable compilation with long types in port.c.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-22 08:22:58 +01:00 committed by Alexandre Julliard
parent 3a0448f82b
commit df94b7b435
1 changed files with 13 additions and 12 deletions

View File

@ -16,6 +16,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
@ -183,10 +184,10 @@ static void ProcessConnectionRequest(union lpc_message *LpcMessage, PHANDLE pAcc
} }
status = pNtAcceptConnectPort(pAcceptPortHandle, 0, &LpcMessage->msg, 1, NULL, NULL); status = pNtAcceptConnectPort(pAcceptPortHandle, 0, &LpcMessage->msg, 1, NULL, NULL);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
status = pNtCompleteConnectPort(*pAcceptPortHandle); status = pNtCompleteConnectPort(*pAcceptPortHandle);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
} }
static void ProcessLpcRequest(HANDLE PortHandle, union lpc_message *LpcMessage) static void ProcessLpcRequest(HANDLE PortHandle, union lpc_message *LpcMessage)
@ -202,7 +203,7 @@ static void ProcessLpcRequest(HANDLE PortHandle, union lpc_message *LpcMessage)
strcpy((LPSTR)LpcMessage->msg64.Data, REPLY); strcpy((LPSTR)LpcMessage->msg64.Data, REPLY);
status = pNtReplyPort(PortHandle, &LpcMessage->msg); status = pNtReplyPort(PortHandle, &LpcMessage->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
ok(LpcMessage->msg64.MessageType == LPC_REQUEST, ok(LpcMessage->msg64.MessageType == LPC_REQUEST,
"Expected LPC_REQUEST, got %d\n", LpcMessage->msg64.MessageType); "Expected LPC_REQUEST, got %d\n", LpcMessage->msg64.MessageType);
ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REPLY), ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REPLY),
@ -217,7 +218,7 @@ static void ProcessLpcRequest(HANDLE PortHandle, union lpc_message *LpcMessage)
strcpy((LPSTR)LpcMessage->msg.Data, REPLY); strcpy((LPSTR)LpcMessage->msg.Data, REPLY);
status = pNtReplyPort(PortHandle, &LpcMessage->msg); status = pNtReplyPort(PortHandle, &LpcMessage->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
ok(LpcMessage->msg.MessageType == LPC_REQUEST, ok(LpcMessage->msg.MessageType == LPC_REQUEST,
"Expected LPC_REQUEST, got %d\n", LpcMessage->msg.MessageType); "Expected LPC_REQUEST, got %d\n", LpcMessage->msg.MessageType);
ok(!strcmp((LPSTR)LpcMessage->msg.Data, REPLY), ok(!strcmp((LPSTR)LpcMessage->msg.Data, REPLY),
@ -239,11 +240,11 @@ static DWORD WINAPI test_ports_client(LPVOID arg)
sqos.EffectiveOnly = TRUE; sqos.EffectiveOnly = TRUE;
status = pNtConnectPort(&PortHandle, &port, &sqos, 0, 0, &len, NULL, NULL); status = pNtConnectPort(&PortHandle, &port, &sqos, 0, 0, &len, NULL, NULL);
todo_wine ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); todo_wine ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
if (status != STATUS_SUCCESS) return 1; if (status != STATUS_SUCCESS) return 1;
status = pNtRegisterThreadTerminatePort(PortHandle); status = pNtRegisterThreadTerminatePort(PortHandle);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
if (is_wow64) if (is_wow64)
{ {
@ -256,7 +257,7 @@ static DWORD WINAPI test_ports_client(LPVOID arg)
strcpy((LPSTR)LpcMessage->msg64.Data, REQUEST1); strcpy((LPSTR)LpcMessage->msg64.Data, REQUEST1);
status = pNtRequestPort(PortHandle, &LpcMessage->msg); status = pNtRequestPort(PortHandle, &LpcMessage->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
ok(LpcMessage->msg64.MessageType == 0, "Expected 0, got %d\n", LpcMessage->msg64.MessageType); ok(LpcMessage->msg64.MessageType == 0, "Expected 0, got %d\n", LpcMessage->msg64.MessageType);
ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1), ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1),
"Expected %s, got %s\n", REQUEST1, LpcMessage->msg64.Data); "Expected %s, got %s\n", REQUEST1, LpcMessage->msg64.Data);
@ -269,7 +270,7 @@ static DWORD WINAPI test_ports_client(LPVOID arg)
/* Send the message and wait for the reply */ /* Send the message and wait for the reply */
status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->msg, &out->msg); status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->msg, &out->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
ok(!strcmp((LPSTR)out->msg64.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg64.Data); ok(!strcmp((LPSTR)out->msg64.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg64.Data);
ok(out->msg64.MessageType == LPC_REPLY, "Expected LPC_REPLY, got %d\n", out->msg64.MessageType); ok(out->msg64.MessageType == LPC_REPLY, "Expected LPC_REPLY, got %d\n", out->msg64.MessageType);
} }
@ -284,7 +285,7 @@ static DWORD WINAPI test_ports_client(LPVOID arg)
strcpy((LPSTR)LpcMessage->msg.Data, REQUEST1); strcpy((LPSTR)LpcMessage->msg.Data, REQUEST1);
status = pNtRequestPort(PortHandle, &LpcMessage->msg); status = pNtRequestPort(PortHandle, &LpcMessage->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
ok(LpcMessage->msg.MessageType == 0, "Expected 0, got %d\n", LpcMessage->msg.MessageType); ok(LpcMessage->msg.MessageType == 0, "Expected 0, got %d\n", LpcMessage->msg.MessageType);
ok(!strcmp((LPSTR)LpcMessage->msg.Data, REQUEST1), ok(!strcmp((LPSTR)LpcMessage->msg.Data, REQUEST1),
"Expected %s, got %s\n", REQUEST1, LpcMessage->msg.Data); "Expected %s, got %s\n", REQUEST1, LpcMessage->msg.Data);
@ -297,7 +298,7 @@ static DWORD WINAPI test_ports_client(LPVOID arg)
/* Send the message and wait for the reply */ /* Send the message and wait for the reply */
status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->msg, &out->msg); status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->msg, &out->msg);
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %lx\n", status);
ok(!strcmp((LPSTR)out->msg.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg.Data); ok(!strcmp((LPSTR)out->msg.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg.Data);
ok(out->msg.MessageType == LPC_REPLY, "Expected LPC_REPLY, got %d\n", out->msg.MessageType); ok(out->msg.MessageType == LPC_REPLY, "Expected LPC_REPLY, got %d\n", out->msg.MessageType);
} }
@ -324,7 +325,7 @@ static void test_ports_server( HANDLE PortHandle )
status = pNtReplyWaitReceivePort(PortHandle, NULL, NULL, &LpcMessage->msg); status = pNtReplyWaitReceivePort(PortHandle, NULL, NULL, &LpcMessage->msg);
todo_wine todo_wine
{ {
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %d(%x)\n", status, status); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %ld(%lx)\n", status, status);
} }
/* STATUS_INVALID_HANDLE: win2k without admin rights will perform an /* STATUS_INVALID_HANDLE: win2k without admin rights will perform an
* endless loop here * endless loop here
@ -384,7 +385,7 @@ START_TEST(port)
status = pNtCreatePort(&port_handle, &obj, 100, 100, 0); status = pNtCreatePort(&port_handle, &obj, 100, 100, 0);
if (status == STATUS_ACCESS_DENIED) skip("Not enough rights\n"); if (status == STATUS_ACCESS_DENIED) skip("Not enough rights\n");
else ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %d\n", status); else ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %ld\n", status);
if (status == STATUS_SUCCESS) if (status == STATUS_SUCCESS)
{ {