Commit e86eb8ef authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

include: Change RPC_STATUS from long to LONG for Win64 compatibility.

Also fix the compiler warnings introduced by this change.
parent 969ef6d3
...@@ -305,7 +305,7 @@ static void CRYPT_CreateMachineGuid(void) ...@@ -305,7 +305,7 @@ static void CRYPT_CreateMachineGuid(void)
'%','0','2','x','%','0','2','x', '%','0','2','x','%','0','2','x',
'%','0','2','x',0 }; '%','0','2','x',0 };
pUuidCreate = GetProcAddress(lib, "UuidCreate"); pUuidCreate = (void *)GetProcAddress(lib, "UuidCreate");
rs = pUuidCreate(&uuid); rs = pUuidCreate(&uuid);
if (rs == S_OK) if (rs == S_OK)
{ {
......
...@@ -568,7 +568,7 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, ...@@ -568,7 +568,7 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
/* save away the message state again */ /* save away the message state again */
msg->Handle = message_state; msg->Handle = message_state;
TRACE("-- %ld\n", status); TRACE("-- %d\n", status);
return HRESULT_FROM_WIN32(status); return HRESULT_FROM_WIN32(status);
} }
...@@ -751,7 +751,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, ...@@ -751,7 +751,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
HeapFree(GetProcessHeap(), 0, channel_hook_data); HeapFree(GetProcessHeap(), 0, channel_hook_data);
TRACE("-- %ld\n", status); TRACE("-- %d\n", status);
return HRESULT_FROM_WIN32(status); return HRESULT_FROM_WIN32(status);
} }
...@@ -771,7 +771,7 @@ static DWORD WINAPI rpc_sendreceive_thread(LPVOID param) ...@@ -771,7 +771,7 @@ static DWORD WINAPI rpc_sendreceive_thread(LPVOID param)
* RPC functions do */ * RPC functions do */
data->status = I_RpcSendReceive((RPC_MESSAGE *)data->msg); data->status = I_RpcSendReceive((RPC_MESSAGE *)data->msg);
TRACE("completed with status 0x%lx\n", data->status); TRACE("completed with status 0x%x\n", data->status);
SetEvent(data->handle); SetEvent(data->handle);
...@@ -893,7 +893,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac ...@@ -893,7 +893,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac
orpcthat.flags = ORPCF_NULL; orpcthat.flags = ORPCF_NULL;
orpcthat.extensions = NULL; orpcthat.extensions = NULL;
TRACE("RPC call status: 0x%lx\n", status); TRACE("RPC call status: 0x%x\n", status);
if (status != RPC_S_OK) if (status != RPC_S_OK)
hr = HRESULT_FROM_WIN32(status); hr = HRESULT_FROM_WIN32(status);
...@@ -967,7 +967,7 @@ static HRESULT WINAPI ServerRpcChannelBuffer_FreeBuffer(LPRPCCHANNELBUFFER iface ...@@ -967,7 +967,7 @@ static HRESULT WINAPI ServerRpcChannelBuffer_FreeBuffer(LPRPCCHANNELBUFFER iface
msg->Handle = message_state; msg->Handle = message_state;
TRACE("-- %ld\n", status); TRACE("-- %d\n", status);
return HRESULT_FROM_WIN32(status); return HRESULT_FROM_WIN32(status);
} }
...@@ -1003,7 +1003,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_FreeBuffer(LPRPCCHANNELBUFFER iface ...@@ -1003,7 +1003,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_FreeBuffer(LPRPCCHANNELBUFFER iface
IRpcChannelBuffer_Release(message_state->params.chan); IRpcChannelBuffer_Release(message_state->params.chan);
HeapFree(GetProcessHeap(), 0, message_state); HeapFree(GetProcessHeap(), 0, message_state);
TRACE("-- %ld\n", status); TRACE("-- %d\n", status);
return HRESULT_FROM_WIN32(status); return HRESULT_FROM_WIN32(status);
} }
...@@ -1104,7 +1104,7 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid, ...@@ -1104,7 +1104,7 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid,
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("Couldn't get binding for endpoint %s, status = %ld\n", debugstr_w(endpoint), status); ERR("Couldn't get binding for endpoint %s, status = %d\n", debugstr_w(endpoint), status);
return HRESULT_FROM_WIN32(status); return HRESULT_FROM_WIN32(status);
} }
...@@ -1536,7 +1536,7 @@ HRESULT RPC_RegisterInterface(REFIID riid) ...@@ -1536,7 +1536,7 @@ HRESULT RPC_RegisterInterface(REFIID riid)
list_add_tail(&registered_interfaces, &rif->entry); list_add_tail(&registered_interfaces, &rif->entry);
else else
{ {
ERR("RpcServerRegisterIfEx failed with error %ld\n", status); ERR("RpcServerRegisterIfEx failed with error %d\n", status);
HeapFree(GetProcessHeap(), 0, rif); HeapFree(GetProcessHeap(), 0, rif);
hr = HRESULT_FROM_WIN32(status); hr = HRESULT_FROM_WIN32(status);
} }
......
...@@ -649,7 +649,7 @@ static void test_QueryPathOfRegTypeLib(void) ...@@ -649,7 +649,7 @@ static void test_QueryPathOfRegTypeLib(void)
BSTR path; BSTR path;
status = UuidCreate(&uid); status = UuidCreate(&uid);
ok(!status || status == RPC_S_UUID_LOCAL_ONLY, "UuidCreate error %08lx\n", status); ok(!status || status == RPC_S_UUID_LOCAL_ONLY, "UuidCreate error %08x\n", status);
StringFromGUID2(&uid, uid_str, 40); StringFromGUID2(&uid, uid_str, 40);
/*trace("GUID: %s\n", wine_dbgstr_w(uid_str));*/ /*trace("GUID: %s\n", wine_dbgstr_w(uid_str));*/
......
...@@ -232,7 +232,7 @@ RPC_STATUS RPC_ENTRY NdrMapCommAndFaultStatus( PMIDL_STUB_MESSAGE pStubMsg, ...@@ -232,7 +232,7 @@ RPC_STATUS RPC_ENTRY NdrMapCommAndFaultStatus( PMIDL_STUB_MESSAGE pStubMsg,
ULONG *pFaultStatus, ULONG *pFaultStatus,
RPC_STATUS Status ) RPC_STATUS Status )
{ {
TRACE("(%p, %p, %p, %ld)\n", pStubMsg, pCommStatus, pFaultStatus, Status); TRACE("(%p, %p, %p, %d)\n", pStubMsg, pCommStatus, pFaultStatus, Status);
switch (Status) switch (Status)
{ {
......
...@@ -240,7 +240,7 @@ static RPC_STATUS RpcAssoc_BindConnection(const RpcAssoc *assoc, RpcConnection * ...@@ -240,7 +240,7 @@ static RPC_STATUS RpcAssoc_BindConnection(const RpcAssoc *assoc, RpcConnection *
status = RPCRT4_ReceiveWithAuth(conn, &response_hdr, &msg, &auth_data, &auth_length); status = RPCRT4_ReceiveWithAuth(conn, &response_hdr, &msg, &auth_data, &auth_length);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("receive failed with error %ld\n", status); ERR("receive failed with error %d\n", status);
return status; return status;
} }
......
...@@ -444,7 +444,7 @@ RPC_STATUS WINAPI RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE ...@@ -444,7 +444,7 @@ RPC_STATUS WINAPI RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE
if (!resolved_endpoint) if (!resolved_endpoint)
{ {
status = TowerExplode(towers[i], NULL, NULL, NULL, &resolved_endpoint, NULL); status = TowerExplode(towers[i], NULL, NULL, NULL, &resolved_endpoint, NULL);
TRACE("status = %ld\n", status); TRACE("status = %d\n", status);
} }
I_RpcFree(towers[i]); I_RpcFree(towers[i]);
} }
......
...@@ -1279,7 +1279,7 @@ RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg) ...@@ -1279,7 +1279,7 @@ RPC_STATUS WINAPI I_RpcReceive(PRPC_MESSAGE pMsg)
conn = pMsg->ReservedForRuntime; conn = pMsg->ReservedForRuntime;
status = RPCRT4_Receive(conn, &hdr, pMsg); status = RPCRT4_Receive(conn, &hdr, pMsg);
if (status != RPC_S_OK) { if (status != RPC_S_OK) {
WARN("receive failed with error %lx\n", status); WARN("receive failed with error %x\n", status);
goto fail; goto fail;
} }
......
...@@ -380,7 +380,7 @@ static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg) ...@@ -380,7 +380,7 @@ static DWORD CALLBACK RPCRT4_io_thread(LPVOID the_arg)
status = RPCRT4_Receive(conn, &hdr, msg); status = RPCRT4_Receive(conn, &hdr, msg);
if (status != RPC_S_OK) { if (status != RPC_S_OK) {
WARN("receive failed with error %lx\n", status); WARN("receive failed with error %x\n", status);
HeapFree(GetProcessHeap(), 0, msg); HeapFree(GetProcessHeap(), 0, msg);
break; break;
} }
......
...@@ -715,7 +715,7 @@ void WINAPI I_RpcFree(void *Object) ...@@ -715,7 +715,7 @@ void WINAPI I_RpcFree(void *Object)
*/ */
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status) LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
{ {
TRACE("(%ld)\n", status); TRACE("(%d)\n", status);
switch (status) switch (status)
{ {
case ERROR_ACCESS_DENIED: return STATUS_ACCESS_DENIED; case ERROR_ACCESS_DENIED: return STATUS_ACCESS_DENIED;
......
...@@ -1945,11 +1945,11 @@ static void test_ndr_buffer(void) ...@@ -1945,11 +1945,11 @@ static void test_ndr_buffer(void)
StubDesc.RpcInterfaceInformation = (void *)&IFoo___RpcServerInterface; StubDesc.RpcInterfaceInformation = (void *)&IFoo___RpcServerInterface;
status = RpcServerUseProtseqEp(ncalrpc, 20, endpoint, NULL); status = RpcServerUseProtseqEp(ncalrpc, 20, endpoint, NULL);
ok(RPC_S_OK == status, "RpcServerUseProtseqEp failed with status %lu\n", status); ok(RPC_S_OK == status, "RpcServerUseProtseqEp failed with status %u\n", status);
status = RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL); status = RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL);
ok(RPC_S_OK == status, "RpcServerRegisterIf failed with status %lu\n", status); ok(RPC_S_OK == status, "RpcServerRegisterIf failed with status %u\n", status);
status = RpcServerListen(1, 20, TRUE); status = RpcServerListen(1, 20, TRUE);
ok(RPC_S_OK == status, "RpcServerListen failed with status %lu\n", status); ok(RPC_S_OK == status, "RpcServerListen failed with status %u\n", status);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
/* Failed to create a server, running client tests is useless */ /* Failed to create a server, running client tests is useless */
...@@ -1957,10 +1957,10 @@ static void test_ndr_buffer(void) ...@@ -1957,10 +1957,10 @@ static void test_ndr_buffer(void)
} }
status = RpcStringBindingCompose(NULL, ncalrpc, NULL, endpoint, NULL, &binding); status = RpcStringBindingCompose(NULL, ncalrpc, NULL, endpoint, NULL, &binding);
ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%lu)\n", status); ok(status == RPC_S_OK, "RpcStringBindingCompose failed (%u)\n", status);
status = RpcBindingFromStringBinding(binding, &Handle); status = RpcBindingFromStringBinding(binding, &Handle);
ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%lu)\n", status); ok(status == RPC_S_OK, "RpcBindingFromStringBinding failed (%u)\n", status);
RpcStringFree(&binding); RpcStringFree(&binding);
NdrClientInitializeNew(&RpcMessage, &StubMsg, &StubDesc, 5); NdrClientInitializeNew(&RpcMessage, &StubMsg, &StubDesc, 5);
...@@ -2003,7 +2003,7 @@ todo_wine ...@@ -2003,7 +2003,7 @@ todo_wine
RpcBindingFree(&Handle); RpcBindingFree(&Handle);
status = RpcServerUnregisterIf(NULL, NULL, FALSE); status = RpcServerUnregisterIf(NULL, NULL, FALSE);
ok(status == RPC_S_OK, "RpcServerUnregisterIf failed (%lu)\n", status); ok(status == RPC_S_OK, "RpcServerUnregisterIf failed (%u)\n", status);
} }
static void test_NdrMapCommAndFaultStatus(void) static void test_NdrMapCommAndFaultStatus(void)
...@@ -2022,7 +2022,7 @@ static void test_NdrMapCommAndFaultStatus(void) ...@@ -2022,7 +2022,7 @@ static void test_NdrMapCommAndFaultStatus(void)
ULONG expected_comm_status = 0; ULONG expected_comm_status = 0;
ULONG expected_fault_status = 0; ULONG expected_fault_status = 0;
status = NdrMapCommAndFaultStatus(&StubMsg, &comm_status, &fault_status, rpc_status); status = NdrMapCommAndFaultStatus(&StubMsg, &comm_status, &fault_status, rpc_status);
ok(status == RPC_S_OK, "NdrMapCommAndFaultStatus failed with error %ld\n", status); ok(status == RPC_S_OK, "NdrMapCommAndFaultStatus failed with error %d\n", status);
switch (rpc_status) switch (rpc_status)
{ {
case ERROR_INVALID_HANDLE: case ERROR_INVALID_HANDLE:
...@@ -2042,9 +2042,9 @@ static void test_NdrMapCommAndFaultStatus(void) ...@@ -2042,9 +2042,9 @@ static void test_NdrMapCommAndFaultStatus(void)
default: default:
expected_fault_status = rpc_status; expected_fault_status = rpc_status;
} }
ok(comm_status == expected_comm_status, "NdrMapCommAndFaultStatus should have mapped %ld to comm status %d instead of %d\n", ok(comm_status == expected_comm_status, "NdrMapCommAndFaultStatus should have mapped %d to comm status %d instead of %d\n",
rpc_status, expected_comm_status, comm_status); rpc_status, expected_comm_status, comm_status);
ok(fault_status == expected_fault_status, "NdrMapCommAndFaultStatus should have mapped %ld to fault status %d instead of %d\n", ok(fault_status == expected_fault_status, "NdrMapCommAndFaultStatus should have mapped %d to fault status %d instead of %d\n",
rpc_status, expected_fault_status, fault_status); rpc_status, expected_fault_status, fault_status);
} }
} }
......
...@@ -36,14 +36,14 @@ static void test_RpcAsyncInitializeHandle(void) ...@@ -36,14 +36,14 @@ static void test_RpcAsyncInitializeHandle(void)
int i; int i;
status = pRpcAsyncInitializeHandle((PRPC_ASYNC_STATE)buffer, sizeof(buffer)); status = pRpcAsyncInitializeHandle((PRPC_ASYNC_STATE)buffer, sizeof(buffer));
ok(status == ERROR_INVALID_PARAMETER, "RpcAsyncInitializeHandle with large Size should have returned ERROR_INVALID_PARAMETER instead of %ld\n", status); ok(status == ERROR_INVALID_PARAMETER, "RpcAsyncInitializeHandle with large Size should have returned ERROR_INVALID_PARAMETER instead of %d\n", status);
status = pRpcAsyncInitializeHandle(&async, sizeof(async) - 1); status = pRpcAsyncInitializeHandle(&async, sizeof(async) - 1);
ok(status == ERROR_INVALID_PARAMETER, "RpcAsyncInitializeHandle with small Size should have returned ERROR_INVALID_PARAMETER instead of %ld\n", status); ok(status == ERROR_INVALID_PARAMETER, "RpcAsyncInitializeHandle with small Size should have returned ERROR_INVALID_PARAMETER instead of %d\n", status);
memset(&async, 0xcc, sizeof(async)); memset(&async, 0xcc, sizeof(async));
status = pRpcAsyncInitializeHandle(&async, sizeof(async)); status = pRpcAsyncInitializeHandle(&async, sizeof(async));
ok(status == RPC_S_OK, "RpcAsyncInitializeHandle failed with error %ld\n", status); ok(status == RPC_S_OK, "RpcAsyncInitializeHandle failed with error %d\n", status);
ok(async.Size == sizeof(async), "async.Size wrong: %d\n", async.Size); ok(async.Size == sizeof(async), "async.Size wrong: %d\n", async.Size);
ok(async.Signature == 0x43595341, "async.Signature should be 0x43595341, but is 0x%x instead\n", async.Signature); ok(async.Signature == 0x43595341, "async.Signature should be 0x43595341, but is 0x%x instead\n", async.Signature);
...@@ -64,16 +64,16 @@ static void test_RpcAsyncGetCallStatus(void) ...@@ -64,16 +64,16 @@ static void test_RpcAsyncGetCallStatus(void)
RPC_STATUS status; RPC_STATUS status;
status = pRpcAsyncInitializeHandle(&async, sizeof(async)); status = pRpcAsyncInitializeHandle(&async, sizeof(async));
ok(status == RPC_S_OK, "RpcAsyncInitializeHandle failed with error %ld\n", status); ok(status == RPC_S_OK, "RpcAsyncInitializeHandle failed with error %d\n", status);
status = pRpcAsyncGetCallStatus(&async); status = pRpcAsyncGetCallStatus(&async);
todo_wine todo_wine
ok(status == RPC_S_INVALID_BINDING, "RpcAsyncGetCallStatus should have returned RPC_S_INVALID_BINDING instead of %ld\n", status); ok(status == RPC_S_INVALID_BINDING, "RpcAsyncGetCallStatus should have returned RPC_S_INVALID_BINDING instead of %d\n", status);
memset(&async, 0, sizeof(async)); memset(&async, 0, sizeof(async));
status = pRpcAsyncGetCallStatus(&async); status = pRpcAsyncGetCallStatus(&async);
todo_wine todo_wine
ok(status == RPC_S_INVALID_BINDING, "RpcAsyncGetCallStatus should have returned RPC_S_INVALID_BINDING instead of %ld\n", status); ok(status == RPC_S_INVALID_BINDING, "RpcAsyncGetCallStatus should have returned RPC_S_INVALID_BINDING instead of %d\n", status);
} }
START_TEST( rpc_async ) START_TEST( rpc_async )
......
...@@ -1294,12 +1294,12 @@ server(void) ...@@ -1294,12 +1294,12 @@ server(void)
DWORD ret; DWORD ret;
iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL); iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL);
ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %ld\n", iptcp_status); ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %d\n", iptcp_status);
np_status = RpcServerUseProtseqEp(np, 0, pipe, NULL); np_status = RpcServerUseProtseqEp(np, 0, pipe, NULL);
if (np_status == RPC_S_PROTSEQ_NOT_SUPPORTED) if (np_status == RPC_S_PROTSEQ_NOT_SUPPORTED)
skip("Protocol sequence ncacn_np is not supported\n"); skip("Protocol sequence ncacn_np is not supported\n");
else else
ok(np_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %ld\n", np_status); ok(np_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %d\n", np_status);
if (pRpcServerRegisterIfEx) if (pRpcServerRegisterIfEx)
{ {
...@@ -1310,9 +1310,9 @@ server(void) ...@@ -1310,9 +1310,9 @@ server(void)
} }
else else
status = RpcServerRegisterIf(s_IServer_v0_0_s_ifspec, NULL, NULL); status = RpcServerRegisterIf(s_IServer_v0_0_s_ifspec, NULL, NULL);
ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %ld\n", status); ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %d\n", status);
status = RpcServerListen(1, 20, TRUE); status = RpcServerListen(1, 20, TRUE);
ok(status == RPC_S_OK, "RpcServerListen failed with status %ld\n", status); ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status);
stop_event = CreateEvent(NULL, FALSE, FALSE, NULL); stop_event = CreateEvent(NULL, FALSE, FALSE, NULL);
ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError()); ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError());
...@@ -1338,7 +1338,7 @@ server(void) ...@@ -1338,7 +1338,7 @@ server(void)
{ {
status = RpcMgmtWaitServerListen(); status = RpcMgmtWaitServerListen();
todo_wine { todo_wine {
ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %ld\n", status); ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %d\n", status);
} }
} }
} }
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#define __RPC_STUB __stdcall #define __RPC_STUB __stdcall
#define RPC_ENTRY __stdcall #define RPC_ENTRY __stdcall
#define RPCRTAPI #define RPCRTAPI
typedef long RPC_STATUS; typedef LONG RPC_STATUS;
typedef void* I_RPC_HANDLE; typedef void* I_RPC_HANDLE;
......
...@@ -120,7 +120,7 @@ void ept_insert(handle_t h, ...@@ -120,7 +120,7 @@ void ept_insert(handle_t h,
&entry->address); &entry->address);
if (rpc_status != RPC_S_OK) if (rpc_status != RPC_S_OK)
{ {
WINE_WARN("TowerExplode failed %lu\n", rpc_status); WINE_WARN("TowerExplode failed %u\n", rpc_status);
*status = rpc_status; *status = rpc_status;
break; /* FIXME: more cleanup? */ break; /* FIXME: more cleanup? */
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment