From 33784c5568f07bd408f18ec22afd21eb1b312f17 Mon Sep 17 00:00:00 2001 From: sletz Date: Mon, 27 Aug 2007 16:22:37 +0000 Subject: [PATCH] Server/library protocol checking implementation. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1539 0c269be4-1314-0410-8aa9-9f06e86f4224 --- ChangeLog | 4 ++ common/JackChannel.h | 2 +- common/JackConstants.h | 2 + common/JackEngine.cpp | 8 ++- common/JackEngine.h | 2 +- common/JackInternalClient.cpp | 8 ++- common/JackInternalClientChannel.h | 4 +- common/JackLibAPI.cpp | 2 + common/JackRequest.h | 5 +- common/JackServerAPI.cpp | 2 + common/JackSocketClientChannel.cpp | 12 ++-- common/JackSocketClientChannel.h | 2 +- common/JackSocketServerChannel.cpp | 2 +- macosx/JackMacEngineRPC.cpp | 4 +- macosx/JackMachClientChannel.cpp | 12 ++-- macosx/JackMachClientChannel.h | 2 +- macosx/JackMachServerChannel.cpp | 4 +- macosx/JackMachServerChannel.h | 2 +- macosx/RPC/JackRPCClientServer.c | 2 +- macosx/RPC/JackRPCClientUser.c | 2 +- macosx/RPC/JackRPCEngine.defs | 1 + macosx/RPC/JackRPCEngine.h | 2 + macosx/RPC/JackRPCEngineServer.c | 81 ++++++++++++++++++++++- macosx/RPC/JackRPCEngineUser.c | 6 +- windows/JackWinNamedPipeClientChannel.cpp | 4 +- windows/JackWinNamedPipeClientChannel.h | 2 +- 26 files changed, 146 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82afeea7..d2dbb9e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ Jackdmp changes log --------------------------- +2007-08-27 Stephane Letz + + * Server/library protocol checking implementation. + 2007-08-26 Stephane Letz * Make "Rename" a method of JackPort class, call it from driver Attach method. diff --git a/common/JackChannel.h b/common/JackChannel.h index f12e1392..b2349a93 100644 --- a/common/JackChannel.h +++ b/common/JackChannel.h @@ -72,7 +72,7 @@ class JackClientChannelInterface return -1; } - virtual void ClientCheck(const char* name, char* name_res, int options, int* status, int* result) + virtual void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) {} virtual void ClientOpen(const char* name, int* shared_engine, int* shared_client, int* shared_graph, int* result) {} diff --git a/common/JackConstants.h b/common/JackConstants.h index 5a0f1368..4d0edfe1 100644 --- a/common/JackConstants.h +++ b/common/JackConstants.h @@ -60,3 +60,5 @@ #define jack_client_entry "jack_client" #define ALL_CLIENTS -1 // for notification + +#define JACK_PROTOCOL_VERSION 1 diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp index 910ca41b..91d9841d 100644 --- a/common/JackEngine.cpp +++ b/common/JackEngine.cpp @@ -377,10 +377,16 @@ void JackEngine::NotifyActivate(int refnum) // Client management //------------------- -int JackEngine::ClientCheck(const char* name, char* name_res, int options, int* status) +int JackEngine::ClientCheck(const char* name, char* name_res, int protocol, int options, int* status) { strcpy(name_res, name); + if (protocol != JACK_PROTOCOL_VERSION) { + *status |= (JackFailure|JackVersionError); + jack_error ("JACK protocol mismatch (%d vs %d)", protocol, JACK_PROTOCOL_VERSION); + return -1; + } + if (ClientCheckName(name)) { *status |= JackNameNotUnique; diff --git a/common/JackEngine.h b/common/JackEngine.h index 7752f455..2ce6f3ae 100644 --- a/common/JackEngine.h +++ b/common/JackEngine.h @@ -81,7 +81,7 @@ class JackEngine // Client management - int ClientCheck(const char* name, char* name_res, int options, int* status); + int ClientCheck(const char* name, char* name_res, int protocol, int options, int* status); int ClientExternalOpen(const char* name, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager); int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client); diff --git a/common/JackInternalClient.cpp b/common/JackInternalClient.cpp index 9f3a100f..8b8b87dc 100644 --- a/common/JackInternalClient.cpp +++ b/common/JackInternalClient.cpp @@ -71,9 +71,13 @@ int JackInternalClient::Open(const char* name, jack_options_t options, jack_stat char name_res[JACK_CLIENT_NAME_SIZE]; JackLog("JackInternalClient::Open name = %s\n", name); - fChannel->ClientCheck(name, name_res, (int)options, (int*)status, &result); + fChannel->ClientCheck(name, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); if (result < 0) { - jack_error("Client name = %s conflits with another running client", name); + int status1 = *status; + if (status1 & JackVersionError) + jack_error("JACK protocol mismatch %d", JACK_PROTOCOL_VERSION); + else + jack_error("Client name = %s conflits with another running client", name); goto error; } diff --git a/common/JackInternalClientChannel.h b/common/JackInternalClientChannel.h index eaad0d9c..8c72e2a7 100644 --- a/common/JackInternalClientChannel.h +++ b/common/JackInternalClientChannel.h @@ -50,9 +50,9 @@ class JackInternalClientChannel : public JackClientChannelInterface return 0; } - void ClientCheck(const char* name, char* name_res, int options, int* status, int* result) + void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) { - *result = fEngine->ClientCheck(name, name_res, options, status); + *result = fEngine->ClientCheck(name, name_res, protocol, options, status); } void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) { diff --git a/common/JackLibAPI.cpp b/common/JackLibAPI.cpp index b09198ff..f6934e7a 100644 --- a/common/JackLibAPI.cpp +++ b/common/JackLibAPI.cpp @@ -104,6 +104,8 @@ static jack_client_t* jack_client_open_aux(const char* client_name, jack_options if (res < 0) { delete client; JackLibGlobals::Destroy(); // jack library destruction + int my_status1 = (JackFailure|JackServerError); + *status = (jack_status_t)my_status1; return NULL; } else { return (jack_client_t*)client; diff --git a/common/JackRequest.h b/common/JackRequest.h index d94f7fed..a572834c 100644 --- a/common/JackRequest.h +++ b/common/JackRequest.h @@ -124,11 +124,12 @@ struct JackClientCheckRequest : public JackRequest { char fName[JACK_CLIENT_NAME_SIZE + 1]; + int fProtocol; int fOptions; JackClientCheckRequest() {} - JackClientCheckRequest(const char* name, int options): JackRequest(JackRequest::kClientCheck),fOptions(options) + JackClientCheckRequest(const char* name,int protocol, int options): JackRequest(JackRequest::kClientCheck),fProtocol(protocol),fOptions(options) { snprintf(fName, sizeof(fName), "%s", name); } @@ -136,6 +137,7 @@ struct JackClientCheckRequest : public JackRequest int Read(JackChannelTransaction* trans) { CheckRes(trans->Read(&fName, JACK_CLIENT_NAME_SIZE + 1)); + CheckRes(trans->Read(&fProtocol, sizeof(int))); return trans->Read(&fOptions, sizeof(int)); } @@ -143,6 +145,7 @@ struct JackClientCheckRequest : public JackRequest { CheckRes(JackRequest::Write(trans)); CheckRes(trans->Write(&fName, JACK_CLIENT_NAME_SIZE + 1)); + CheckRes(trans->Write(&fProtocol, sizeof(int))); return trans->Write(&fOptions, sizeof(int)); } }; diff --git a/common/JackServerAPI.cpp b/common/JackServerAPI.cpp index eab942ed..4ec49773 100644 --- a/common/JackServerAPI.cpp +++ b/common/JackServerAPI.cpp @@ -159,6 +159,8 @@ EXPORT jack_client_t* jack_client_open(const char* client_name, jack_options_t o if (res < 0) { delete client; JackServerGlobals::Destroy(); // jack server destruction + int my_status1 = (JackFailure|JackServerError); + *status = (jack_status_t)my_status1; return NULL; } else { return (jack_client_t*)client; diff --git a/common/JackSocketClientChannel.cpp b/common/JackSocketClientChannel.cpp index 683ad900..1d5c3bb7 100644 --- a/common/JackSocketClientChannel.cpp +++ b/common/JackSocketClientChannel.cpp @@ -63,9 +63,13 @@ int JackSocketClientChannel::Open(const char* name, char* name_res, JackClient* } // Check name in server - ClientCheck(name, name_res, (int)options, (int*)status, &result); + ClientCheck(name, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); if (result < 0) { - jack_error("Client name = %s conflits with another running client", name); + int status1 = *status; + if (status1 & JackVersionError) + jack_error("JACK protocol mismatch %d", JACK_PROTOCOL_VERSION); + else + jack_error("Client name = %s conflits with another running client", name); goto error; } @@ -135,9 +139,9 @@ void JackSocketClientChannel::ServerAsyncCall(JackRequest* req, JackResult* res, } } -void JackSocketClientChannel::ClientCheck(const char* name, char* name_res, int options, int* status, int* result) +void JackSocketClientChannel::ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) { - JackClientCheckRequest req(name, options); + JackClientCheckRequest req(name, protocol, options); JackClientCheckResult res; ServerSyncCall(&req, &res, result); *status = res.fStatus; diff --git a/common/JackSocketClientChannel.h b/common/JackSocketClientChannel.h index ac84e393..8d948f92 100644 --- a/common/JackSocketClientChannel.h +++ b/common/JackSocketClientChannel.h @@ -59,7 +59,7 @@ class JackSocketClientChannel : public JackClientChannelInterface, public JackRu int ServerCheck(const char* server_name); - void ClientCheck(const char* name, char* name_res, int options, int* status, int* result); + void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result); void ClientOpen(const char* name, int* shared_engine, int* shared_client, int* shared_graph, int* result); void ClientClose(int refnum, int* result); diff --git a/common/JackSocketServerChannel.cpp b/common/JackSocketServerChannel.cpp index 946c7894..3cc5723f 100644 --- a/common/JackSocketServerChannel.cpp +++ b/common/JackSocketServerChannel.cpp @@ -156,7 +156,7 @@ int JackSocketServerChannel::HandleRequest(int fd) JackClientCheckRequest req; JackClientCheckResult res; if (req.Read(socket) == 0) - res.fResult = fServer->GetEngine()->ClientCheck(req.fName, res.fName, req.fOptions, &res.fStatus); + res.fResult = fServer->GetEngine()->ClientCheck(req.fName, res.fName, req.fProtocol, req.fOptions, &res.fStatus); res.Write(socket); break; } diff --git a/macosx/JackMacEngineRPC.cpp b/macosx/JackMacEngineRPC.cpp index 6a5e115e..0ad7451b 100644 --- a/macosx/JackMacEngineRPC.cpp +++ b/macosx/JackMacEngineRPC.cpp @@ -31,12 +31,12 @@ using namespace Jack; #define rpc_type kern_return_t // for astyle -rpc_type server_rpc_jack_client_check(mach_port_t private_port, client_name_t name, client_name_t name_res, int options, int* status, int* result) +rpc_type server_rpc_jack_client_check(mach_port_t private_port, client_name_t name, client_name_t name_res, int protocol, int options, int* status, int* result) { JackLog("rpc_jack_client_check\n"); JackMachServerChannel* channel = JackMachServerChannel::fPortTable[private_port]; assert(channel); - channel->ClientCheck((char*)name, (char*)name_res, options, status, result); + channel->ClientCheck((char*)name, (char*)name_res, protocol, options, status, result); return KERN_SUCCESS; } diff --git a/macosx/JackMachClientChannel.cpp b/macosx/JackMachClientChannel.cpp index cd3f0937..947cf155 100644 --- a/macosx/JackMachClientChannel.cpp +++ b/macosx/JackMachClientChannel.cpp @@ -66,9 +66,13 @@ int JackMachClientChannel::Open(const char* name, char* name_res, JackClient* cl // Check name in server int result = 0; - ClientCheck(name, name_res, (int)options, (int*)status, &result); + ClientCheck(name, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); if (result < 0) { - jack_error("Client name = %s conflits with another running client", name); + int status1 = *status; + if (status1 & JackVersionError) + jack_error("JACK protocol mismatch %d", JACK_PROTOCOL_VERSION); + else + jack_error("Client name = %s conflits with another running client", name); return -1; } @@ -116,9 +120,9 @@ void JackMachClientChannel::Stop() fThread->Kill(); } -void JackMachClientChannel::ClientCheck(const char* name, char* name_res, int options, int* status, int* result) +void JackMachClientChannel::ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) { - kern_return_t res = rpc_jack_client_check(fServerPort.GetPort(), (char*)name, name_res, options, status, result); + kern_return_t res = rpc_jack_client_check(fServerPort.GetPort(), (char*)name, name_res, protocol, options, status, result); if (res != KERN_SUCCESS) { *result = -1; jack_error("JackMachClientChannel::ClientCheck err = %s", mach_error_string(res)); diff --git a/macosx/JackMachClientChannel.h b/macosx/JackMachClientChannel.h index be2d9cfa..0411798a 100644 --- a/macosx/JackMachClientChannel.h +++ b/macosx/JackMachClientChannel.h @@ -56,7 +56,7 @@ class JackMachClientChannel : public JackClientChannelInterface, public JackRunn int ServerCheck(const char* server_name); - void ClientCheck(const char* name, char* name_res, int options, int* status, int* result); + void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result); void ClientOpen(const char* name, int* shared_engine, int* shared_client, int* shared_graph, int* result); void ClientClose(int refnum, int* result); diff --git a/macosx/JackMachServerChannel.cpp b/macosx/JackMachServerChannel.cpp index 5ccdf3d9..846e74b5 100644 --- a/macosx/JackMachServerChannel.cpp +++ b/macosx/JackMachServerChannel.cpp @@ -78,9 +78,9 @@ JackServer* JackMachServerChannel::GetServer() return fServer; } -void JackMachServerChannel::ClientCheck(char* name, char* name_res, int options, int* status, int* result) +void JackMachServerChannel::ClientCheck(char* name, char* name_res, int protocol, int options, int* status, int* result) { - *result = GetEngine()->ClientCheck(name, name_res, options, status); + *result = GetEngine()->ClientCheck(name, name_res, protocol, options, status); } void JackMachServerChannel::ClientOpen(char* name, mach_port_t* private_port, int* shared_engine, int* shared_client, int* shared_graph, int* result) diff --git a/macosx/JackMachServerChannel.h b/macosx/JackMachServerChannel.h index 87c6df3b..f46ea029 100644 --- a/macosx/JackMachServerChannel.h +++ b/macosx/JackMachServerChannel.h @@ -58,7 +58,7 @@ class JackMachServerChannel : public JackServerChannelInterface, public JackRunn JackEngine* GetEngine(); JackServer* GetServer(); - void ClientCheck(char* name, char* name_res, int options, int* status, int* result); + void ClientCheck(char* name, char* name_res, int protocol, int options, int* status, int* result); void ClientOpen(char* name, mach_port_t* private_port, int* shared_engine, int* shared_client, int* shared_graph, int* result); void ClientClose(mach_port_t private_port, int refnum); void ClientKill(mach_port_t private_port); diff --git a/macosx/RPC/JackRPCClientServer.c b/macosx/RPC/JackRPCClientServer.c index c649c79a..c0811e99 100644 --- a/macosx/RPC/JackRPCClientServer.c +++ b/macosx/RPC/JackRPCClientServer.c @@ -1,6 +1,6 @@ /* * IDENTIFICATION: - * stub generated Wed Aug 15 17:00:32 2007 + * stub generated Mon Aug 27 17:58:23 2007 * with a MiG generated Mon Sep 11 19:11:05 PDT 2006 by root@b09.apple.com * OPTIONS: */ diff --git a/macosx/RPC/JackRPCClientUser.c b/macosx/RPC/JackRPCClientUser.c index 76cc25ff..96d9bd90 100644 --- a/macosx/RPC/JackRPCClientUser.c +++ b/macosx/RPC/JackRPCClientUser.c @@ -1,6 +1,6 @@ /* * IDENTIFICATION: - * stub generated Wed Aug 15 17:00:32 2007 + * stub generated Mon Aug 27 17:58:23 2007 * with a MiG generated Mon Sep 11 19:11:05 PDT 2006 by root@b09.apple.com * OPTIONS: */ diff --git a/macosx/RPC/JackRPCEngine.defs b/macosx/RPC/JackRPCEngine.defs index a7a88eab..1b1aead2 100644 --- a/macosx/RPC/JackRPCEngine.defs +++ b/macosx/RPC/JackRPCEngine.defs @@ -41,6 +41,7 @@ routine rpc_jack_client_check( server_port : mach_port_t; client_name : client_name_t; out client_name_res : client_name_t; + protocol : int; options : int; out status : int; out result : int); diff --git a/macosx/RPC/JackRPCEngine.h b/macosx/RPC/JackRPCEngine.h index 64c920b3..ca9763e8 100644 --- a/macosx/RPC/JackRPCEngine.h +++ b/macosx/RPC/JackRPCEngine.h @@ -71,6 +71,7 @@ kern_return_t rpc_jack_client_check mach_port_t server_port, client_name_t client_name, client_name_t client_name_res, + int protocol, int options, int *status, int *result @@ -311,6 +312,7 @@ __END_DECLS mach_msg_header_t Head; NDR_record_t NDR; client_name_t client_name; + int protocol; int options; } __Request__rpc_jack_client_check_t; #ifdef __MigPackStructs diff --git a/macosx/RPC/JackRPCEngineServer.c b/macosx/RPC/JackRPCEngineServer.c index 2a884dac..04d65aa5 100644 --- a/macosx/RPC/JackRPCEngineServer.c +++ b/macosx/RPC/JackRPCEngineServer.c @@ -1,6 +1,6 @@ /* * IDENTIFICATION: - * stub generated Wed Aug 15 17:00:32 2007 + * stub generated Mon Aug 27 17:58:23 2007 * with a MiG generated Mon Sep 11 19:11:05 PDT 2006 by root@b09.apple.com * OPTIONS: */ @@ -123,6 +123,7 @@ mach_msg_header_t Head; NDR_record_t NDR; client_name_t client_name; + int protocol; int options; } __Request__rpc_jack_client_check_t; #ifdef __MigPackStructs @@ -834,6 +835,26 @@ mig_internal novalue _Xrpc_jack_client_open #endif /* defined(__NDR_convert__*__defined) */ #endif /* __NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name__defined */ +#ifndef __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined +#if defined(__NDR_convert__int_rep__JackRPCEngine__int__defined) +#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__int_rep__JackRPCEngine__int((int *)(a), f) +#elif defined(__NDR_convert__int_rep__int__defined) +#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__int_rep__int((int *)(a), f) +#elif defined(__NDR_convert__int_rep__JackRPCEngine__int32_t__defined) +#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__int_rep__JackRPCEngine__int32_t((int32_t *)(a), f) +#elif defined(__NDR_convert__int_rep__int32_t__defined) +#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__int_rep__int32_t((int32_t *)(a), f) +#endif /* defined(__NDR_convert__*__defined) */ +#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined */ + #ifndef __NDR_convert__int_rep__Request__rpc_jack_client_check_t__options__defined #if defined(__NDR_convert__int_rep__JackRPCEngine__int__defined) #define __NDR_convert__int_rep__Request__rpc_jack_client_check_t__options__defined @@ -874,6 +895,26 @@ mig_internal novalue _Xrpc_jack_client_open #endif /* defined(__NDR_convert__*__defined) */ #endif /* __NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name__defined */ +#ifndef __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined +#if defined(__NDR_convert__char_rep__JackRPCEngine__int__defined) +#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__char_rep__JackRPCEngine__int((int *)(a), f) +#elif defined(__NDR_convert__char_rep__int__defined) +#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__char_rep__int((int *)(a), f) +#elif defined(__NDR_convert__char_rep__JackRPCEngine__int32_t__defined) +#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__char_rep__JackRPCEngine__int32_t((int32_t *)(a), f) +#elif defined(__NDR_convert__char_rep__int32_t__defined) +#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__char_rep__int32_t((int32_t *)(a), f) +#endif /* defined(__NDR_convert__*__defined) */ +#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined */ + #ifndef __NDR_convert__char_rep__Request__rpc_jack_client_check_t__options__defined #if defined(__NDR_convert__char_rep__JackRPCEngine__int__defined) #define __NDR_convert__char_rep__Request__rpc_jack_client_check_t__options__defined @@ -914,6 +955,26 @@ mig_internal novalue _Xrpc_jack_client_open #endif /* defined(__NDR_convert__*__defined) */ #endif /* __NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name__defined */ +#ifndef __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined +#if defined(__NDR_convert__float_rep__JackRPCEngine__int__defined) +#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__float_rep__JackRPCEngine__int((int *)(a), f) +#elif defined(__NDR_convert__float_rep__int__defined) +#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__float_rep__int((int *)(a), f) +#elif defined(__NDR_convert__float_rep__JackRPCEngine__int32_t__defined) +#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__float_rep__JackRPCEngine__int32_t((int32_t *)(a), f) +#elif defined(__NDR_convert__float_rep__int32_t__defined) +#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined +#define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol(a, f) \ + __NDR_convert__float_rep__int32_t((int32_t *)(a), f) +#endif /* defined(__NDR_convert__*__defined) */ +#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined */ + #ifndef __NDR_convert__float_rep__Request__rpc_jack_client_check_t__options__defined #if defined(__NDR_convert__float_rep__JackRPCEngine__int__defined) #define __NDR_convert__float_rep__Request__rpc_jack_client_check_t__options__defined @@ -946,11 +1007,15 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_check_t(__Reque #endif /* __MigTypeCheck */ #if defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name__defined) || \ + defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined) || \ defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__options__defined) if (In0P->NDR.int_rep != NDR_record.int_rep) { #if defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name__defined) __NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name(&In0P->client_name, In0P->NDR.int_rep); #endif /* __NDR_convert__int_rep__Request__rpc_jack_client_check_t__client_name__defined */ +#if defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined) + __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol(&In0P->protocol, In0P->NDR.int_rep); +#endif /* __NDR_convert__int_rep__Request__rpc_jack_client_check_t__protocol__defined */ #if defined(__NDR_convert__int_rep__Request__rpc_jack_client_check_t__options__defined) __NDR_convert__int_rep__Request__rpc_jack_client_check_t__options(&In0P->options, In0P->NDR.int_rep); #endif /* __NDR_convert__int_rep__Request__rpc_jack_client_check_t__options__defined */ @@ -958,11 +1023,15 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_check_t(__Reque #endif /* defined(__NDR_convert__int_rep...) */ #if defined(__NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name__defined) || \ + defined(__NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined) || \ defined(__NDR_convert__char_rep__Request__rpc_jack_client_check_t__options__defined) if (In0P->NDR.char_rep != NDR_record.char_rep) { #if defined(__NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name__defined) __NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name(&In0P->client_name, In0P->NDR.char_rep); #endif /* __NDR_convert__char_rep__Request__rpc_jack_client_check_t__client_name__defined */ +#if defined(__NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined) + __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol(&In0P->protocol, In0P->NDR.char_rep); +#endif /* __NDR_convert__char_rep__Request__rpc_jack_client_check_t__protocol__defined */ #if defined(__NDR_convert__char_rep__Request__rpc_jack_client_check_t__options__defined) __NDR_convert__char_rep__Request__rpc_jack_client_check_t__options(&In0P->options, In0P->NDR.char_rep); #endif /* __NDR_convert__char_rep__Request__rpc_jack_client_check_t__options__defined */ @@ -970,11 +1039,15 @@ mig_internal kern_return_t __MIG_check__Request__rpc_jack_client_check_t(__Reque #endif /* defined(__NDR_convert__char_rep...) */ #if defined(__NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name__defined) || \ + defined(__NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined) || \ defined(__NDR_convert__float_rep__Request__rpc_jack_client_check_t__options__defined) if (In0P->NDR.float_rep != NDR_record.float_rep) { #if defined(__NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name__defined) __NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name(&In0P->client_name, In0P->NDR.float_rep); #endif /* __NDR_convert__float_rep__Request__rpc_jack_client_check_t__client_name__defined */ +#if defined(__NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined) + __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol(&In0P->protocol, In0P->NDR.float_rep); +#endif /* __NDR_convert__float_rep__Request__rpc_jack_client_check_t__protocol__defined */ #if defined(__NDR_convert__float_rep__Request__rpc_jack_client_check_t__options__defined) __NDR_convert__float_rep__Request__rpc_jack_client_check_t__options(&In0P->options, In0P->NDR.float_rep); #endif /* __NDR_convert__float_rep__Request__rpc_jack_client_check_t__options__defined */ @@ -999,6 +1072,7 @@ kern_return_t server_rpc_jack_client_check mach_port_t server_port, client_name_t client_name, client_name_t client_name_res, + int protocol, int options, int *status, int *result @@ -1016,6 +1090,7 @@ mig_internal novalue _Xrpc_jack_client_check mach_msg_header_t Head; NDR_record_t NDR; client_name_t client_name; + int protocol; int options; mach_msg_trailer_t trailer; } Request; @@ -1048,7 +1123,7 @@ mig_internal novalue _Xrpc_jack_client_check { MIG_RETURN_ERROR(OutP, check_result); } #endif /* defined(__MIG_check__Request__rpc_jack_client_check_t__defined) */ - OutP->RetCode = server_rpc_jack_client_check(In0P->Head.msgh_request_port, In0P->client_name, OutP->client_name_res, In0P->options, &OutP->status, &OutP->result); + OutP->RetCode = server_rpc_jack_client_check(In0P->Head.msgh_request_port, In0P->client_name, OutP->client_name_res, In0P->protocol, In0P->options, &OutP->status, &OutP->result); if (OutP->RetCode != KERN_SUCCESS) { MIG_RETURN_ERROR(OutP, OutP->RetCode); } @@ -4626,7 +4701,7 @@ const struct server_JackRPCEngine_subsystem { { (mig_impl_routine_t) 0, (mig_stub_routine_t) _Xrpc_jack_client_open, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_open_t)}, { (mig_impl_routine_t) 0, - (mig_stub_routine_t) _Xrpc_jack_client_check, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_check_t)}, + (mig_stub_routine_t) _Xrpc_jack_client_check, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_check_t)}, { (mig_impl_routine_t) 0, (mig_stub_routine_t) _Xrpc_jack_client_close, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__rpc_jack_client_close_t)}, { (mig_impl_routine_t) 0, diff --git a/macosx/RPC/JackRPCEngineUser.c b/macosx/RPC/JackRPCEngineUser.c index 0ae4c31f..8f296c79 100644 --- a/macosx/RPC/JackRPCEngineUser.c +++ b/macosx/RPC/JackRPCEngineUser.c @@ -1,6 +1,6 @@ /* * IDENTIFICATION: - * stub generated Wed Aug 15 17:00:32 2007 + * stub generated Mon Aug 27 17:58:23 2007 * with a MiG generated Mon Sep 11 19:11:05 PDT 2006 by root@b09.apple.com * OPTIONS: */ @@ -904,6 +904,7 @@ mig_external kern_return_t rpc_jack_client_check mach_port_t server_port, client_name_t client_name, client_name_t client_name_res, + int protocol, int options, int *status, int *result @@ -918,6 +919,7 @@ mig_external kern_return_t rpc_jack_client_check mach_msg_header_t Head; NDR_record_t NDR; client_name_t client_name; + int protocol; int options; } Request; #ifdef __MigPackStructs @@ -982,6 +984,8 @@ mig_external kern_return_t rpc_jack_client_check (void) mig_strncpy(InP->client_name, client_name, 128); + InP->protocol = protocol; + InP->options = options; InP->Head.msgh_bits = diff --git a/windows/JackWinNamedPipeClientChannel.cpp b/windows/JackWinNamedPipeClientChannel.cpp index b9a85949..2687dcb5 100644 --- a/windows/JackWinNamedPipeClientChannel.cpp +++ b/windows/JackWinNamedPipeClientChannel.cpp @@ -142,9 +142,9 @@ void JackWinNamedPipeClientChannel::ServerAsyncCall(JackRequest* req, JackResult } } -void JackWinNamedPipeClientChannel::ClientCheck(const char* name, char* name_res, int options, int* status, int* result) +void JackWinNamedPipeClientChannel::ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result) { - JackClientCheckRequest req(name, options); + JackClientCheckRequest req(name, protocol, options); JackClientCheckResult res; ServerSyncCall(&req, &res, result); *status = res.fStatus; diff --git a/windows/JackWinNamedPipeClientChannel.h b/windows/JackWinNamedPipeClientChannel.h index b77387be..1c01a5d8 100644 --- a/windows/JackWinNamedPipeClientChannel.h +++ b/windows/JackWinNamedPipeClientChannel.h @@ -58,7 +58,7 @@ class JackWinNamedPipeClientChannel : public JackClientChannelInterface, public int ServerCheck(const char* server_name); - void ClientCheck(const char* name, char* name_res, int options, int* status, int* result); + void ClientCheck(const char* name, char* name_res, int protocol, int options, int* status, int* result); void ClientOpen(const char* name, int* shared_engine, int* shared_client, int* shared_graph, int* result); void ClientClose(int refnum, int* result);