[Pcsclite-cvs-commit] r2060 - trunk/PCSC/src

Ludovic Rousseau rousseau at costa.debian.org
Thu May 25 21:36:01 UTC 2006


Author: rousseau
Date: 2006-05-25 21:35:58 +0000 (Thu, 25 May 2006)
New Revision: 2060

Modified:
   trunk/PCSC/src/winscard_msg.c
   trunk/PCSC/src/winscard_msg.h
Log:
SHMMessageSend() and SHMMessageReceive() use "void *buffer, size_t
buffer_size" instead of psharedSegmentMsg msgStruct with a fixed size


Modified: trunk/PCSC/src/winscard_msg.c
===================================================================
--- trunk/PCSC/src/winscard_msg.c	2006-05-25 21:31:23 UTC (rev 2059)
+++ trunk/PCSC/src/winscard_msg.c	2006-05-25 21:35:58 UTC (rev 2060)
@@ -135,8 +135,8 @@
  * @retval -1 Socket is closed.
  * @retval -1 A signal was received.
  */
-INTERNAL int SHMMessageSend(psharedSegmentMsg msgStruct, int filedes,
-	int blockAmount)
+INTERNAL int SHMMessageSend(void *buffer, size_t buffer_size,
+	int filedes, int blockAmount)
 {
 	/*
 	 * default is success 
@@ -147,13 +147,9 @@
 	 */
 	time_t start = time(0);
 	/*
-	 * data to be written 
-	 */
-	unsigned char *buffer = (unsigned char *) msgStruct;
-	/*
 	 * how many bytes remains to be written 
 	 */
-	size_t remaining = sizeof(sharedSegmentMsg);
+	size_t remaining = buffer_size;
 
 	/*
 	 * repeat until all data is written 
@@ -261,8 +257,8 @@
  * @retval -1 Socket is closed.
  * @retval -1 A signal was received.
  */
-INTERNAL int SHMMessageReceive(psharedSegmentMsg msgStruct, int filedes,
-	int blockAmount)
+INTERNAL int SHMMessageReceive(void *buffer, size_t buffer_size,
+	int filedes, int blockAmount)
 {
 	/*
 	 * default is success 
@@ -273,13 +269,9 @@
 	 */
 	time_t start = time(0);
 	/*
-	 * buffer where we place the readed bytes 
-	 */
-	unsigned char *buffer = (unsigned char *) msgStruct;
-	/*
 	 * how many bytes we must read 
 	 */
-	size_t remaining = sizeof(sharedSegmentMsg);
+	size_t remaining = buffer_size;
 
 	/*
 	 * repeate until we get the whole message 

Modified: trunk/PCSC/src/winscard_msg.h
===================================================================
--- trunk/PCSC/src/winscard_msg.h	2006-05-25 21:31:23 UTC (rev 2059)
+++ trunk/PCSC/src/winscard_msg.h	2006-05-25 21:35:58 UTC (rev 2060)
@@ -313,10 +313,12 @@
 	int SHMInitializeCommonSegment(void);
 	int SHMProcessEventsContext(PDWORD, psharedSegmentMsg, int);
 	int SHMProcessEventsServer(PDWORD, int);
-	int SHMMessageSend(psharedSegmentMsg, int, int);
-	int SHMMessageReceive(psharedSegmentMsg, int, int);
-	int WrapSHMWrite(unsigned int, DWORD, unsigned int,
-		unsigned int, void *);
+	int SHMMessageSend(void *buffer, size_t buffer_size, int filedes,
+		int blockAmount);
+	int SHMMessageReceive(void *buffer, size_t buffer_size,
+		int filedes, int blockAmount);
+	int WrapSHMWrite(unsigned int command, DWORD dwClientID, unsigned int size,
+		unsigned int blockAmount, void *data);
 	void SHMCleanupSharedSegment(int, char *);
 
 #ifdef __cplusplus




More information about the Pcsclite-cvs-commit mailing list