*/
interface ccs_reply {
- const long HSIZE = sizeof(void*);
+ const long HSIZE = 8;
/* The reply from the server to a request from the client: */
void ccs_rpc_request_reply(
typedef int CC_INT32;
typedef unsigned int CC_UINT32;
-const long HSIZE = sizeof(void*);
+const long HSIZE = 8;
void ccs_rpc_request(
[in] const long rpcmsg, /* Message type */
PROCESS_INFORMATION pi = { 0 };
HANDLE replyEvent = 0;
BOOL bCCAPI_Connected= FALSE;
+ unsigned char tspdata_handle[8] = { 0 };
if (!in_request_stream) { err = cci_check_error (ccErrBadParam); }
if (!out_reply_stream ) { err = cci_check_error (ccErrBadParam); }
cci_debug_printf("%s calling remote ccs_rpc_request tsp*:0x%X", __FUNCTION__, ptspdata);
cci_debug_printf(" rpcmsg:%d; UUID[%d]:<%s> SST:%ld", in_msg, lenUUID, uuid, sst);
#endif
+ /* copy ptr into handle; ptr may be 4 or 8 bytes, depending on platform; handle is always 8 */
+ memcpy(tspdata_handle, &ptspdata, sizeof(ptspdata));
ccs_rpc_request( /* make call with user message: */
in_msg, /* Message type */
- (unsigned char*)&ptspdata, /* Our tspdata* will be sent back to the reply proc. */
+ tspdata_handle, /* Our tspdata* will be sent back to the reply proc. */
(unsigned char*)uuid,
krb5int_ipc_stream_size(in_request_stream),
(unsigned char*)krb5int_ipc_stream_data(in_request_stream), /* Data buffer */
HANDLE replyEvent = 0;
RPC_STATUS status = FALSE;
char* uuid = NULL;
+ unsigned char tspdata_handle[8] = {0};
/* Start listening to our uuid before establishing the connection,
* so that when the server tries to call ccapi_listen, we will be ready.
// New code using new RPC procedures for sending the data and receiving a reply:
if (!status) {
+ memcpy(tspdata_handle, &tsp, sizeof(tsp));
RpcTryExcept {
ccs_rpc_connect( /* make call with user message: */
CCMSG_CONNECT, /* Message type */
- (unsigned char*)&tsp, /* Our tspdata* will be sent back to the reply proc. */
+ tspdata_handle, /* Our tspdata* will be sent back to the reply proc. */
(unsigned char*)uuid,
(long*)(&status) ); /* Return code */
}
long* ret_status ) { /* Return code */
HANDLE hEvent = openThreadEvent(uuid, REPLY_SUFFIX);
- DWORD* p = (DWORD*)(tspHandle);
- struct tspdata* tsp = (struct tspdata*)*p;
+ struct tspdata* tsp;
k5_ipc_stream stream;
long status = 0;
#if 0
cci_debug_printf("%s! msg#:%d SST:%ld uuid:%s", __FUNCTION__, rpcmsg, srvStartTime, uuid);
#endif
+ memcpy(&tsp, tspHandle, sizeof(tsp));
if (!status) {
status = krb5int_ipc_stream_new (&stream); /* Create a stream for the request data */
}
cc_int32 err = 0;
char* uuid = ccs_win_pipe_getUuid(in_pipe);
- HANDLE h = ccs_win_pipe_getHandle(in_pipe);
+ UINT64 h = ccs_win_pipe_getHandle(in_pipe);
if (!err) {
err = send_init(uuid); // Sets RPC handle to be used.
RPC_STATUS send_connection_reply(ccs_pipe_t in_pipe) {
char* uuid = ccs_win_pipe_getUuid (in_pipe);
- HANDLE h = ccs_win_pipe_getHandle(in_pipe);
+ UINT64 h = ccs_win_pipe_getHandle(in_pipe);
RPC_STATUS status = send_init(uuid);
RpcTryExcept {
long* return_status ) { /* Return code */
cc_int32 status = 0;
- k5_ipc_stream stream;
- DWORD* p = (DWORD*)(tspHandle);
+ k5_ipc_stream stream;
+ UINT64* p = (UINT64*)(tspHandle);
WIN_PIPE* pipe = NULL;
#if 0
cci_debug_printf("%s rpcmsg:%d; UUID:<%s> SST:<%s>", __FUNCTION__, rpcmsg, pszUUID, serverStartTime);
const char* pszUUID, /* Data buffer */
long* return_status ) { /* Return code */
- DWORD* p = (DWORD*)(tspHandle);
+ UINT64* p = (UINT64*)(tspHandle);
WIN_PIPE* pipe = ccs_win_pipe_new(pszUUID, *p);
#if 0
cci_debug_printf("%s; rpcmsg:%d; UUID: <%s>", __FUNCTION__, rpcmsg, pszUUID);
/* Ref:
struct ccs_win_pipe_t {
char* uuid;
- HANDLE clientHandle;
+ UINT64 clientHandle;
}
*/
/* ------------------------------------------------------------------------ */
-struct ccs_win_pipe_t* ccs_win_pipe_new (const char* uuid, const HANDLE h) {
+struct ccs_win_pipe_t* ccs_win_pipe_new (const char* uuid, const UINT64 h) {
cc_int32 err = ccNoError;
struct ccs_win_pipe_t* out_pipe = NULL;
/* ------------------------------------------------------------------------ */
-HANDLE ccs_win_pipe_getHandle (const WIN_PIPE* in_pipe) {
+UINT64 ccs_win_pipe_getHandle (const WIN_PIPE* in_pipe) {
- HANDLE result = NULL;
+ UINT64 result = 0;
if (!ccs_win_pipe_valid(in_pipe)) {cci_check_error(ccErrBadParam);}
else {result = in_pipe->clientHandle;}
struct ccs_win_pipe_t {
char* uuid;
- HANDLE clientHandle;
+ UINT64 clientHandle;
};
typedef struct ccs_win_pipe_t WIN_PIPE;
-struct ccs_win_pipe_t* ccs_win_pipe_new(const char* uuid, const HANDLE h);
+struct ccs_win_pipe_t* ccs_win_pipe_new(const char* uuid, const UINT64 h);
cc_int32 ccs_win_pipe_release (const WIN_PIPE* io_pipe);
cc_int32 ccs_win_pipe_valid (const WIN_PIPE* in_pipe);
char* ccs_win_pipe_getUuid (const WIN_PIPE* in_pipe);
-HANDLE ccs_win_pipe_getHandle (const WIN_PIPE* in_pipe);
+UINT64 ccs_win_pipe_getHandle (const WIN_PIPE* in_pipe);
#endif // _ccs_win_pipe_h_