/[rdesktop]/sourceforge.net/trunk/rdesktop/rdpdr.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdpdr.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 585 by n-ki, Tue Jan 27 21:15:18 2004 UTC revision 647 by astrand, Mon Apr 5 19:23:08 2004 UTC
# Line 1  Line 1 
1  #include <unistd.h>  #include <unistd.h>
2  #include <sys/types.h>  #include <sys/types.h>
3    #include <sys/time.h>
4    #include <dirent.h>             /* opendir, closedir, readdir */
5  #include <time.h>  #include <time.h>
6  #include "rdesktop.h"  #include "rdesktop.h"
7    
# Line 22  Line 24 
24  #define IRP_MN_QUERY_DIRECTORY          0x01  #define IRP_MN_QUERY_DIRECTORY          0x01
25  #define IRP_MN_NOTIFY_CHANGE_DIRECTORY  0x02  #define IRP_MN_NOTIFY_CHANGE_DIRECTORY  0x02
26    
 #define MAX_ASYNC_IO_REQUESTS   10  
   
27  extern char hostname[16];  extern char hostname[16];
28  extern DEVICE_FNS serial_fns;  extern DEVICE_FNS serial_fns;
29  extern DEVICE_FNS printer_fns;  extern DEVICE_FNS printer_fns;
30  extern DEVICE_FNS parallel_fns;  extern DEVICE_FNS parallel_fns;
31  extern DEVICE_FNS disk_fns;  extern DEVICE_FNS disk_fns;
32    extern FILEINFO g_fileinfo[];
33    
34  static VCHANNEL *rdpdr_channel;  static VCHANNEL *rdpdr_channel;
35    
# Line 39  uint32 g_num_devices; Line 39  uint32 g_num_devices;
39    
40  /* Table with information about rdpdr devices */  /* Table with information about rdpdr devices */
41  RDPDR_DEVICE g_rdpdr_device[RDPDR_MAX_DEVICES];  RDPDR_DEVICE g_rdpdr_device[RDPDR_MAX_DEVICES];
42    char * g_rdpdr_clientname = NULL;
43    
44  /* Used to store incoming io request, until they are ready to be completed */  /* Used to store incoming io request, until they are ready to be completed */
45    /* using a linked list ensures that they are processed in the right order, */
46    /* if multiple ios are being done on the same fd */
47  struct async_iorequest  struct async_iorequest
48  {  {
49          uint32 fd, major, minor, offset, device, id, length;          uint32 fd, major, minor, offset, device, id, length, partial_len;
50          long timeout,           /* Total timeout */          long timeout,           /* Total timeout */
51            itv_timeout;          /* Interval timeout (between serial characters) */            itv_timeout;          /* Interval timeout (between serial characters) */
52          uint8 *buffer;          uint8 *buffer;
53          DEVICE_FNS *fns;          DEVICE_FNS *fns;
54  } g_iorequest[MAX_ASYNC_IO_REQUESTS];  
55            struct async_iorequest *next;   /* next element in list */
56    };
57    
58    struct async_iorequest *g_iorequest;
59    
60  /* Return device_id for a given handle */  /* Return device_id for a given handle */
61  int  int
# Line 75  convert_to_unix_filename(char *filename) Line 82  convert_to_unix_filename(char *filename)
82          }          }
83  }  }
84    
85    BOOL
86    rdpdr_handle_ok(int device, int handle)
87    {
88            switch (g_rdpdr_device[device].device_type)
89            {
90                    case DEVICE_TYPE_PARALLEL:
91                    case DEVICE_TYPE_SERIAL:
92                    case DEVICE_TYPE_PRINTER:
93                    case DEVICE_TYPE_SCARD:
94                            if (g_rdpdr_device[device].handle != handle)
95                                    return False;
96                            break;
97                    case DEVICE_TYPE_DISK:
98                            if (g_fileinfo[handle].device_id != device)
99                                    return False;
100                            break;
101            }
102            return True;
103    }
104    
105  /* Add a new io request to the table containing pending io requests so it won't block rdesktop */  /* Add a new io request to the table containing pending io requests so it won't block rdesktop */
106  BOOL  BOOL
107  add_async_iorequest(uint32 device, uint32 file, uint32 id, uint32 major, uint32 length,  add_async_iorequest(uint32 device, uint32 file, uint32 id, uint32 major, uint32 length,
108                      DEVICE_FNS * fns, long total_timeout, long interval_timeout, uint8 * buffer)                      DEVICE_FNS * fns, uint32 total_timeout, uint32 interval_timeout, uint8 * buffer,
109                        uint32 offset)
110  {  {
         int i;  
111          struct async_iorequest *iorq;          struct async_iorequest *iorq;
112    
113          for (i = 0; i < MAX_ASYNC_IO_REQUESTS; i++)          if (g_iorequest == NULL)
114          {          {
115                  iorq = &g_iorequest[i];                  g_iorequest = (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));
116                    if (!g_iorequest)
117                  if (iorq->fd == 0)                          return False;
118                  {                  g_iorequest->fd = 0;
119                          iorq->device = device;                  g_iorequest->next = NULL;
120                          iorq->fd = file;          }
121                          iorq->id = id;  
122                          iorq->major = major;          iorq = g_iorequest;
123                          iorq->length = length;  
124                          iorq->fns = fns;          while (iorq->fd != 0)
125                          iorq->timeout = total_timeout;          {
126                          iorq->itv_timeout = interval_timeout;                  // create new element if needed
127                          iorq->buffer = buffer;                  if (iorq->next == NULL)
128                          return True;                  {
129                  }                          iorq->next =
130          }                                  (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));
131          error("IO request table full. Increase MAX_ASYNC_IO_REQUESTS in rdpdr.c!\n");                          if (!iorq->next)
132          return False;                                  return False;
133                            iorq->next->fd = 0;
134                            iorq->next->next = NULL;
135                    }
136                    iorq = iorq->next;
137            }
138            iorq->device = device;
139            iorq->fd = file;
140            iorq->id = id;
141            iorq->major = major;
142            iorq->length = length;
143            iorq->partial_len = 0;
144            iorq->fns = fns;
145            iorq->timeout = total_timeout;
146            iorq->itv_timeout = interval_timeout;
147            iorq->buffer = buffer;
148            iorq->offset = offset;
149            return True;
150  }  }
151    
   
152  void  void
153  rdpdr_send_connect(void)  rdpdr_send_connect(void)
154  {  {
# Line 126  void Line 169  void
169  rdpdr_send_name(void)  rdpdr_send_name(void)
170  {  {
171          uint8 magic[4] = "rDNC";          uint8 magic[4] = "rDNC";
         uint32 hostlen = (strlen(hostname) + 1) * 2;  
172          STREAM s;          STREAM s;
173            uint32 hostlen;
174    
175            if (NULL == g_rdpdr_clientname) {
176              g_rdpdr_clientname = hostname;
177            }
178            hostlen = (strlen(g_rdpdr_clientname) + 1) * 2;
179    
180          s = channel_init(rdpdr_channel, 16 + hostlen);          s = channel_init(rdpdr_channel, 16 + hostlen);
181          out_uint8a(s, magic, 4);          out_uint8a(s, magic, 4);
# Line 135  rdpdr_send_name(void) Line 183  rdpdr_send_name(void)
183          out_uint16_le(s, 0x72);          out_uint16_le(s, 0x72);
184          out_uint32(s, 0);          out_uint32(s, 0);
185          out_uint32_le(s, hostlen);          out_uint32_le(s, hostlen);
186          rdp_out_unistr(s, hostname, hostlen - 2);          rdp_out_unistr(s, g_rdpdr_clientname, hostlen - 2);
187          s_mark_end(s);          s_mark_end(s);
188          channel_send(s, rdpdr_channel);          channel_send(s, rdpdr_channel);
189  }  }
# Line 207  rdpdr_send_available(void) Line 255  rdpdr_send_available(void)
255                                  rdp_out_unistr(s, printerinfo->printer, printerlen - 2);                                  rdp_out_unistr(s, printerinfo->printer, printerlen - 2);
256                                  out_uint8a(s, printerinfo->blob, bloblen);                                  out_uint8a(s, printerinfo->blob, bloblen);
257    
258                                  xfree(printerinfo->blob);       /* Blob is sent twice if reconnecting */                                  if (printerinfo->blob)
259                                            xfree(printerinfo->blob);       /* Blob is sent twice if reconnecting */
260                                  break;                                  break;
261                          default:                          default:
262                                  out_uint32(s, 0);                                  out_uint32(s, 0);
# Line 282  rdpdr_process_irp(STREAM s) Line 331  rdpdr_process_irp(STREAM s)
331          buffer = (uint8 *) xmalloc(1024);          buffer = (uint8 *) xmalloc(1024);
332          buffer[0] = 0;          buffer[0] = 0;
333    
   
334          switch (g_rdpdr_device[device].device_type)          switch (g_rdpdr_device[device].device_type)
335          {          {
336                  case DEVICE_TYPE_SERIAL:                  case DEVICE_TYPE_SERIAL:
337    
338                          fns = &serial_fns;                          fns = &serial_fns;
339                          /* should be async when aio is finished */                          rw_blocking = False;
                         /*rw_blocking = False; */  
340                          break;                          break;
341    
342                  case DEVICE_TYPE_PARALLEL:                  case DEVICE_TYPE_PARALLEL:
343    
344                          fns = &parallel_fns;                          fns = &parallel_fns;
345                          /* should be async when aio is finished */                          rw_blocking = False;
                         /*rw_blocking = False; */  
346                          break;                          break;
347    
348                  case DEVICE_TYPE_PRINTER:                  case DEVICE_TYPE_PRINTER:
# Line 307  rdpdr_process_irp(STREAM s) Line 353  rdpdr_process_irp(STREAM s)
353                  case DEVICE_TYPE_DISK:                  case DEVICE_TYPE_DISK:
354    
355                          fns = &disk_fns;                          fns = &disk_fns;
356                            rw_blocking = False;
357                          break;                          break;
358    
359                  case DEVICE_TYPE_SCARD:                  case DEVICE_TYPE_SCARD:
# Line 372  rdpdr_process_irp(STREAM s) Line 419  rdpdr_process_irp(STREAM s)
419  #if WITH_DEBUG_RDP5  #if WITH_DEBUG_RDP5
420                          DEBUG(("RDPDR IRP Read (length: %d, offset: %d)\n", length, offset));                          DEBUG(("RDPDR IRP Read (length: %d, offset: %d)\n", length, offset));
421  #endif  #endif
422                            if (!rdpdr_handle_ok(device, file))
423                            {
424                                    status = STATUS_INVALID_HANDLE;
425                                    break;
426                            }
427    
428                          if (rw_blocking)        // Complete read immediately                          if (rw_blocking)        // Complete read immediately
429                          {                          {
430                                  buffer = (uint8 *) xrealloc((void *) buffer, length);                                  buffer = (uint8 *) xrealloc((void *) buffer, length);
431                                    if (!buffer)
432                                    {
433                                            status = STATUS_CANCELLED;
434                                            break;
435                                    }
436                                  status = fns->read(file, buffer, length, offset, &result);                                  status = fns->read(file, buffer, length, offset, &result);
437                                  buffer_len = result;                                  buffer_len = result;
438                                  break;                                  break;
# Line 382  rdpdr_process_irp(STREAM s) Line 440  rdpdr_process_irp(STREAM s)
440    
441                          // Add request to table                          // Add request to table
442                          pst_buf = (uint8 *) xmalloc(length);                          pst_buf = (uint8 *) xmalloc(length);
443                            if (!pst_buf)
444                            {
445                                    status = STATUS_CANCELLED;
446                                    break;
447                            }
448                          serial_get_timeout(file, length, &total_timeout, &interval_timeout);                          serial_get_timeout(file, length, &total_timeout, &interval_timeout);
449                          if (add_async_iorequest                          if (add_async_iorequest
450                              (device, file, id, major, length, fns, total_timeout, interval_timeout,                              (device, file, id, major, length, fns, total_timeout, interval_timeout,
451                               pst_buf))                               pst_buf, offset))
452                          {                          {
453                                  status = STATUS_PENDING;                                  status = STATUS_PENDING;
454                                  break;                                  break;
# Line 393  rdpdr_process_irp(STREAM s) Line 456  rdpdr_process_irp(STREAM s)
456    
457                          status = STATUS_CANCELLED;                          status = STATUS_CANCELLED;
458                          break;                          break;
   
459                  case IRP_MJ_WRITE:                  case IRP_MJ_WRITE:
460    
461                          buffer_len = 1;                          buffer_len = 1;
# Line 410  rdpdr_process_irp(STREAM s) Line 472  rdpdr_process_irp(STREAM s)
472  #if WITH_DEBUG_RDP5  #if WITH_DEBUG_RDP5
473                          DEBUG(("RDPDR IRP Write (length: %d)\n", result));                          DEBUG(("RDPDR IRP Write (length: %d)\n", result));
474  #endif  #endif
475                            if (!rdpdr_handle_ok(device, file))
476                            {
477                                    status = STATUS_INVALID_HANDLE;
478                                    break;
479                            }
480    
481                          if (rw_blocking)        // Complete immediately                          if (rw_blocking)        // Complete immediately
482                          {                          {
483                                  status = fns->write(file, s->p, length, offset, &result);                                  status = fns->write(file, s->p, length, offset, &result);
# Line 418  rdpdr_process_irp(STREAM s) Line 486  rdpdr_process_irp(STREAM s)
486    
487                          // Add to table                          // Add to table
488                          pst_buf = (uint8 *) xmalloc(length);                          pst_buf = (uint8 *) xmalloc(length);
489                            if (!pst_buf)
490                            {
491                                    status = STATUS_CANCELLED;
492                                    break;
493                            }
494    
495                          in_uint8a(s, pst_buf, length);                          in_uint8a(s, pst_buf, length);
496    
497                          if (add_async_iorequest                          if (add_async_iorequest
498                              (device, file, id, major, length, fns, 0, 0, pst_buf))                              (device, file, id, major, length, fns, 0, 0, pst_buf, offset))
499                          {                          {
500                                  status = STATUS_PENDING;                                  status = STATUS_PENDING;
501                                  break;                                  break;
# Line 541  rdpdr_process_irp(STREAM s) Line 615  rdpdr_process_irp(STREAM s)
615                          in_uint8s(s, 0x14);                          in_uint8s(s, 0x14);
616    
617                          buffer = (uint8 *) xrealloc((void *) buffer, bytes_out + 0x14);                          buffer = (uint8 *) xrealloc((void *) buffer, bytes_out + 0x14);
618                            if (!buffer)
619                            {
620                                    status = STATUS_CANCELLED;
621                                    break;
622                            }
623    
624                          out.data = out.p = buffer;                          out.data = out.p = buffer;
625                          out.size = sizeof(buffer);                          out.size = sizeof(buffer);
626                          status = fns->device_control(file, request, s, &out);                          status = fns->device_control(file, request, s, &out);
# Line 556  rdpdr_process_irp(STREAM s) Line 636  rdpdr_process_irp(STREAM s)
636          {          {
637                  rdpdr_send_completion(device, id, status, result, buffer, buffer_len);                  rdpdr_send_completion(device, id, status, result, buffer, buffer_len);
638          }          }
639          xfree(buffer);          if (buffer)
640                    xfree(buffer);
641            buffer = NULL;
642  }  }
643    
644  void  void
# Line 676  rdpdr_init() Line 757  rdpdr_init()
757  void  void
758  rdpdr_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout)  rdpdr_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout)
759  {  {
760          int i;          uint32 select_timeout = 0;      // Timeout value to be used for select() (in millisecons).
         long select_timeout = 0;        // Timeout value to be used for select() (in millisecons).  
761          struct async_iorequest *iorq;          struct async_iorequest *iorq;
762    
763          for (i = 0; i < MAX_ASYNC_IO_REQUESTS; i++)          iorq = g_iorequest;
764            while (iorq != NULL)
765          {          {
766                  iorq = &g_iorequest[i];                  if (iorq->fd != 0)
   
                 if (iorq->fd != 0)      // Found a pending io request  
767                  {                  {
768                          switch (iorq->major)                          switch (iorq->major)
769                          {                          {
# Line 707  rdpdr_add_fds(int *n, fd_set * rfds, fd_ Line 786  rdpdr_add_fds(int *n, fd_set * rfds, fd_
786                                          break;                                          break;
787    
788                                  case IRP_MJ_WRITE:                                  case IRP_MJ_WRITE:
   
789                                          FD_SET(iorq->fd, wfds);                                          FD_SET(iorq->fd, wfds);
790                                          break;                                          break;
791    
792                          }                          }
793                          *n = MAX(*n, iorq->fd);                          *n = MAX(*n, iorq->fd);
794                  }                  }
795    
796                    iorq = iorq->next;
797            }
798    }
799    
800    struct async_iorequest *
801    rdpdr_remove_iorequest(struct async_iorequest *prev, struct async_iorequest *iorq)
802    {
803            if (!iorq)
804                    return NULL;
805    
806            if (iorq->buffer)
807                    xfree(iorq->buffer);
808            if (prev)
809            {
810                    prev->next = iorq->next;
811                    xfree(iorq);
812                    iorq = prev->next;
813            }
814            else
815            {
816                    // Even if NULL
817                    g_iorequest = iorq->next;
818                    xfree(iorq);
819                    iorq = NULL;
820          }          }
821            return iorq;
822  }  }
823    
824  /* Check if select() returned with one of the rdpdr file descriptors, and complete io if it did */  /* Check if select() returned with one of the rdpdr file descriptors, and complete io if it did */
825  void  void
826  rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)  rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)
827  {  {
         int i;  
828          NTSTATUS status;          NTSTATUS status;
829          uint32 result = 0, buffer_len = 0;          uint32 result = 0;
830          DEVICE_FNS *fns;          DEVICE_FNS *fns;
831          struct async_iorequest *iorq;          struct async_iorequest *iorq;
832            struct async_iorequest *prev;
833            uint32 req_size = 0;
834    
835          if (timed_out)          if (timed_out)
836          {          {
# Line 733  rdpdr_check_fds(fd_set * rfds, fd_set * Line 838  rdpdr_check_fds(fd_set * rfds, fd_set *
838                  return;                  return;
839          }          }
840    
841          // Walk through array of pending io_rq's          iorq = g_iorequest;
842          for (i = 0; i < MAX_ASYNC_IO_REQUESTS; i++)          prev = NULL;
843            while (iorq != NULL)
844          {          {
                 iorq = &g_iorequest[i];  
   
845                  if (iorq->fd != 0)                  if (iorq->fd != 0)
846                  {                  {
847                          switch (iorq->major)                          switch (iorq->major)
848                          {                          {
   
849                                  case IRP_MJ_READ:                                  case IRP_MJ_READ:
   
850                                          if (FD_ISSET(iorq->fd, rfds))                                          if (FD_ISSET(iorq->fd, rfds))
851                                          {                                          {
852                                                  // Read, and send data.                                                  /* Read the data */
853                                                  fns = iorq->fns;                                                  fns = iorq->fns;
854                                                  status = fns->read(iorq->fd, iorq->buffer,  
855                                                                     iorq->length, 0, &result);                                                  req_size =
856                                                  buffer_len = result;                                                          (iorq->length - iorq->partial_len) >
857                                                            8192 ? 8192 : (iorq->length -
858                                                  rdpdr_send_completion(iorq->device, iorq->id,                                                                         iorq->partial_len);
859                                                                        status, result, iorq->buffer,                                                  /* never read larger chunks than 8k - chances are that it will block */
860                                                                        buffer_len);                                                  status = fns->read(iorq->fd,
861                                                                       iorq->buffer + iorq->partial_len,
862                                                                       req_size, iorq->offset, &result);
863    
864                                                    if (result > 0)
865                                                    {
866                                                            iorq->partial_len += result;
867                                                            iorq->offset += result;
868                                                    }
869  #if WITH_DEBUG_RDP5  #if WITH_DEBUG_RDP5
870                                                  DEBUG(("RDPDR: %d bytes of data read\n", result));                                                  DEBUG(("RDPDR: %d bytes of data read\n", result));
871  #endif  #endif
872                                                  xfree(iorq->buffer);                                                  /* only delete link if all data has been transfered */
873                                                  iorq->fd = 0;                                                  /* or if result was 0 and status success - EOF      */
874                                                    if ((iorq->partial_len == iorq->length) ||
875                                                        (result == 0))
876                                                    {
877    #if WITH_DEBUG_RDP5
878                                                            DEBUG(("RDPDR: AIO total %u bytes read of %u\n", iorq->partial_len, iorq->length));
879    #endif
880                                                            rdpdr_send_completion(iorq->device,
881                                                                                  iorq->id, status,
882                                                                                  iorq->partial_len,
883                                                                                  iorq->buffer,
884                                                                                  iorq->partial_len);
885                                                            iorq = rdpdr_remove_iorequest(prev, iorq);
886                                                    }
887                                          }                                          }
888                                          break;                                          break;
   
889                                  case IRP_MJ_WRITE:                                  case IRP_MJ_WRITE:
   
890                                          if (FD_ISSET(iorq->fd, wfds))                                          if (FD_ISSET(iorq->fd, wfds))
891                                          {                                          {
892                                                  // Write data and send completion.                                                  /* Write data. */
893                                                  fns = iorq->fns;                                                  fns = iorq->fns;
                                                 status = fns->write(iorq->fd, iorq->buffer,  
                                                                     iorq->length, 0, &result);  
                                                 rdpdr_send_completion(iorq->device, iorq->id,  
                                                                       status, result, "", 1);  
894    
895                                                  xfree(iorq->buffer);                                                  req_size =
896                                                  iorq->fd = 0;                                                          (iorq->length - iorq->partial_len) >
897                                                            8192 ? 8192 : (iorq->length -
898                                                                           iorq->partial_len);
899    
900                                                    /* never write larger chunks than 8k - chances are that it will block */
901                                                    status = fns->write(iorq->fd,
902                                                                        iorq->buffer +
903                                                                        iorq->partial_len, req_size,
904                                                                        iorq->offset, &result);
905    
906                                                    if (result > 0)
907                                                    {
908                                                            iorq->partial_len += result;
909                                                            iorq->offset += result;
910                                                    }
911    
912    #if WITH_DEBUG_RDP5
913                                                    DEBUG(("RDPDR: %d bytes of data written\n",
914                                                           result));
915    #endif
916                                                    /* only delete link if all data has been transfered */
917                                                    /* or we couldn't write */
918                                                    if ((iorq->partial_len == iorq->length)
919                                                        || (result == 0))
920                                                    {
921    #if WITH_DEBUG_RDP5
922                                                            DEBUG(("RDPDR: AIO total %u bytes written of %u\n", iorq->partial_len, iorq->length));
923    #endif
924                                                            rdpdr_send_completion(iorq->device,
925                                                                                  iorq->id, status,
926                                                                                  iorq->partial_len,
927                                                                                  (uint8 *) "", 1);
928    
929                                                            iorq = rdpdr_remove_iorequest(prev, iorq);
930                                                    }
931                                          }                                          }
932                                          break;                                          break;
933                          }                          }
934    
935                  }                  }
936                    prev = iorq;
937                    if (iorq)
938                            iorq = iorq->next;
939          }          }
940    
941  }  }
942    
943  /* Abort a pending io request for a given handle and major */  /* Abort a pending io request for a given handle and major */
# Line 789  BOOL Line 945  BOOL
945  rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status)  rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status)
946  {  {
947          uint32 result;          uint32 result;
         int i;  
948          struct async_iorequest *iorq;          struct async_iorequest *iorq;
949            struct async_iorequest *prev;
950    
951          for (i = 0; i < MAX_ASYNC_IO_REQUESTS; i++)          iorq = g_iorequest;
952            prev = NULL;
953            while (iorq != NULL)
954          {          {
                 iorq = &g_iorequest[i];  
   
955                  // Only remove from table when major is not set, or when correct major is supplied.                  // Only remove from table when major is not set, or when correct major is supplied.
956                  // Abort read should not abort a write io request.                  // Abort read should not abort a write io request.
957                  if ((iorq->fd == fd) && (major == 0 || iorq->major == major))                  if ((iorq->fd == fd) && (major == 0 || iorq->major == major))
958                  {                  {
959                          result = 0;                          result = 0;
960                          rdpdr_send_completion(iorq->device, iorq->id, status, result, "", 1);                          rdpdr_send_completion(iorq->device, iorq->id, status, result, (uint8 *) "",
961                          xfree(iorq->buffer);                                                1);
962                          iorq->fd = 0;  
963                            iorq = rdpdr_remove_iorequest(prev, iorq);
964                          return True;                          return True;
965                  }                  }
966    
967                    prev = iorq;
968                    iorq = iorq->next;
969          }          }
970    
971          return False;          return False;
972  }  }

Legend:
Removed from v.585  
changed lines
  Added in v.647

  ViewVC Help
Powered by ViewVC 1.1.26