/[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 657 by astrand, Fri Apr 16 11:28:34 2004 UTC revision 673 by astrand, Mon Apr 19 08:24:54 2004 UTC
# Line 112  convert_to_unix_filename(char *filename) Line 112  convert_to_unix_filename(char *filename)
112          }          }
113  }  }
114    
115  BOOL  static BOOL
116  rdpdr_handle_ok(int device, int handle)  rdpdr_handle_ok(int device, int handle)
117  {  {
118          switch (g_rdpdr_device[device].device_type)          switch (g_rdpdr_device[device].device_type)
# Line 133  rdpdr_handle_ok(int device, int handle) Line 133  rdpdr_handle_ok(int device, int handle)
133  }  }
134    
135  /* 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 */
136  BOOL  static BOOL
137  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,
138                      DEVICE_FNS * fns, uint32 total_timeout, uint32 interval_timeout, uint8 * buffer,                      DEVICE_FNS * fns, uint32 total_timeout, uint32 interval_timeout, uint8 * buffer,
139                      uint32 offset)                      uint32 offset)
# Line 179  add_async_iorequest(uint32 device, uint3 Line 179  add_async_iorequest(uint32 device, uint3
179          return True;          return True;
180  }  }
181    
182  void  static void
183  rdpdr_send_connect(void)  rdpdr_send_connect(void)
184  {  {
185          uint8 magic[4] = "rDCC";          uint8 magic[4] = "rDCC";
# Line 195  rdpdr_send_connect(void) Line 195  rdpdr_send_connect(void)
195  }  }
196    
197    
198  void  static void
199  rdpdr_send_name(void)  rdpdr_send_name(void)
200  {  {
201          uint8 magic[4] = "rDNC";          uint8 magic[4] = "rDNC";
# Line 220  rdpdr_send_name(void) Line 220  rdpdr_send_name(void)
220  }  }
221    
222  /* Returns the size of the payload of the announce packet */  /* Returns the size of the payload of the announce packet */
223  int  static int
224  announcedata_size()  announcedata_size()
225  {  {
226          int size, i;          int size, i;
# Line 247  announcedata_size() Line 247  announcedata_size()
247          return size;          return size;
248  }  }
249    
250  void  static void
251  rdpdr_send_available(void)  rdpdr_send_available(void)
252  {  {
253    
# Line 305  rdpdr_send_available(void) Line 305  rdpdr_send_available(void)
305          channel_send(s, rdpdr_channel);          channel_send(s, rdpdr_channel);
306  }  }
307    
308  void  static void
309  rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer,  rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer,
310                        uint32 length)                        uint32 length)
311  {  {
# Line 658  rdpdr_process_irp(STREAM s) Line 658  rdpdr_process_irp(STREAM s)
658                          result = buffer_len = out.p - out.data;                          result = buffer_len = out.p - out.data;
659                          break;                          break;
660    
661    
662                    case IRP_MJ_LOCK_CONTROL:
663    
664                            if (g_rdpdr_device[device].device_type != DEVICE_TYPE_DISK)
665                            {
666                                    status = STATUS_INVALID_HANDLE;
667                                    break;
668                            }
669    
670                            in_uint32_le(s, info_level);
671    
672                            out.data = out.p = buffer;
673                            out.size = sizeof(buffer);
674                            /* FIXME: Perhaps consider actually *do*
675                               something here :-) */
676                            status = STATUS_SUCCESS;
677                            result = buffer_len = out.p - out.data;
678                            break;
679    
680                  default:                  default:
681                          unimpl("IRP major=0x%x minor=0x%x\n", major, minor);                          unimpl("IRP major=0x%x minor=0x%x\n", major, minor);
682                          break;                          break;
# Line 672  rdpdr_process_irp(STREAM s) Line 691  rdpdr_process_irp(STREAM s)
691          buffer = NULL;          buffer = NULL;
692  }  }
693    
694  void  static void
695  rdpdr_send_clientcapabilty(void)  rdpdr_send_clientcapabilty(void)
696  {  {
697          uint8 magic[4] = "rDPC";          uint8 magic[4] = "rDPC";
# Line 790  rdpdr_add_fds(int *n, fd_set * rfds, fd_ Line 809  rdpdr_add_fds(int *n, fd_set * rfds, fd_
809  {  {
810          uint32 select_timeout = 0;      // Timeout value to be used for select() (in millisecons).          uint32 select_timeout = 0;      // Timeout value to be used for select() (in millisecons).
811          struct async_iorequest *iorq;          struct async_iorequest *iorq;
812            char c;
813    
814          iorq = g_iorequest;          iorq = g_iorequest;
815          while (iorq != NULL)          while (iorq != NULL)
# Line 799  rdpdr_add_fds(int *n, fd_set * rfds, fd_ Line 819  rdpdr_add_fds(int *n, fd_set * rfds, fd_
819                          switch (iorq->major)                          switch (iorq->major)
820                          {                          {
821                                  case IRP_MJ_READ:                                  case IRP_MJ_READ:
822                                            /* Is this FD valid? FDs will
823                                               be invalid when
824                                               reconnecting. FIXME: Real
825                                               support for reconnects. */
826    
827                                            if (read(iorq->fd, &c, 0) != 0)
828                                                    break;
829    
830                                          FD_SET(iorq->fd, rfds);                                          FD_SET(iorq->fd, rfds);
831                                            *n = MAX(*n, iorq->fd);
832    
833                                          // Check if io request timeout is smaller than current (but not 0).                                          // Check if io request timeout is smaller than current (but not 0).
834                                          if (iorq->timeout                                          if (iorq->timeout
# Line 814  rdpdr_add_fds(int *n, fd_set * rfds, fd_ Line 842  rdpdr_add_fds(int *n, fd_set * rfds, fd_
842                                                  tv->tv_usec = (select_timeout % 1000) * 1000;                                                  tv->tv_usec = (select_timeout % 1000) * 1000;
843                                                  *timeout = True;                                                  *timeout = True;
844                                          }                                          }
845    
846                                          break;                                          break;
847    
848                                  case IRP_MJ_WRITE:                                  case IRP_MJ_WRITE:
849                                            /* FD still valid? See above. */
850                                            if (write(iorq->fd, &c, 0) != 0)
851                                                    break;
852    
853                                          FD_SET(iorq->fd, wfds);                                          FD_SET(iorq->fd, wfds);
854                                            *n = MAX(*n, iorq->fd);
855                                          break;                                          break;
856    
857                          }                          }
858                          *n = MAX(*n, iorq->fd);  
859                  }                  }
860    
861                  iorq = iorq->next;                  iorq = iorq->next;

Legend:
Removed from v.657  
changed lines
  Added in v.673

  ViewVC Help
Powered by ViewVC 1.1.26