/[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 590 by n-ki, Thu Jan 29 12:27:21 2004 UTC
# Line 22  Line 22 
22  #define IRP_MN_QUERY_DIRECTORY          0x01  #define IRP_MN_QUERY_DIRECTORY          0x01
23  #define IRP_MN_NOTIFY_CHANGE_DIRECTORY  0x02  #define IRP_MN_NOTIFY_CHANGE_DIRECTORY  0x02
24    
25  #define MAX_ASYNC_IO_REQUESTS   10  //#define MAX_ASYNC_IO_REQUESTS   10
26    
27  extern char hostname[16];  extern char hostname[16];
28  extern DEVICE_FNS serial_fns;  extern DEVICE_FNS serial_fns;
# Line 40  uint32 g_num_devices; Line 40  uint32 g_num_devices;
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    
43    #if 0
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  struct async_iorequest  struct async_iorequest
46  {  {
# Line 49  struct async_iorequest Line 50  struct async_iorequest
50          uint8 *buffer;          uint8 *buffer;
51          DEVICE_FNS *fns;          DEVICE_FNS *fns;
52  } g_iorequest[MAX_ASYNC_IO_REQUESTS];  } g_iorequest[MAX_ASYNC_IO_REQUESTS];
53    #endif
54    
55  /* Return device_id for a given handle */  /* Return device_id for a given handle */
56  int  int
# Line 75  convert_to_unix_filename(char *filename) Line 77  convert_to_unix_filename(char *filename)
77          }          }
78  }  }
79    
80    #if 0
81  /* 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 */
82  BOOL  BOOL
83  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,
# Line 104  add_async_iorequest(uint32 device, uint3 Line 107  add_async_iorequest(uint32 device, uint3
107          error("IO request table full. Increase MAX_ASYNC_IO_REQUESTS in rdpdr.c!\n");          error("IO request table full. Increase MAX_ASYNC_IO_REQUESTS in rdpdr.c!\n");
108          return False;          return False;
109  }  }
110    #endif
111    
112  void  void
113  rdpdr_send_connect(void)  rdpdr_send_connect(void)
# Line 282  rdpdr_process_irp(STREAM s) Line 285  rdpdr_process_irp(STREAM s)
285          buffer = (uint8 *) xmalloc(1024);          buffer = (uint8 *) xmalloc(1024);
286          buffer[0] = 0;          buffer[0] = 0;
287    
   
288          switch (g_rdpdr_device[device].device_type)          switch (g_rdpdr_device[device].device_type)
289          {          {
290                  case DEVICE_TYPE_SERIAL:                  case DEVICE_TYPE_SERIAL:
# Line 296  rdpdr_process_irp(STREAM s) Line 298  rdpdr_process_irp(STREAM s)
298    
299                          fns = &parallel_fns;                          fns = &parallel_fns;
300                          /* should be async when aio is finished */                          /* should be async when aio is finished */
301                          /*rw_blocking = False; */                          /*rw_blocking = False;*/
302                          break;                          break;
303    
304                  case DEVICE_TYPE_PRINTER:                  case DEVICE_TYPE_PRINTER:
# Line 372  rdpdr_process_irp(STREAM s) Line 374  rdpdr_process_irp(STREAM s)
374  #if WITH_DEBUG_RDP5  #if WITH_DEBUG_RDP5
375                          DEBUG(("RDPDR IRP Read (length: %d, offset: %d)\n", length, offset));                          DEBUG(("RDPDR IRP Read (length: %d, offset: %d)\n", length, offset));
376  #endif  #endif
377                          if (rw_blocking)        // Complete read immediately  //                      if (rw_blocking)        // Complete read immediately
378                          {  //                      {
379                                  buffer = (uint8 *) xrealloc((void *) buffer, length);                                  buffer = (uint8 *) xrealloc((void *) buffer, length);
380                                  status = fns->read(file, buffer, length, offset, &result);                                  status = fns->read(file, buffer, length, offset, &result);
381                                  buffer_len = result;                                  buffer_len = result;
382                                  break;                                  break;
383                          }  //                      }
384    
385    #if 0
386                          // Add request to table                          // Add request to table
387                          pst_buf = (uint8 *) xmalloc(length);                          pst_buf = (uint8 *) xmalloc(length);
388                          serial_get_timeout(file, length, &total_timeout, &interval_timeout);                          serial_get_timeout(file, length, &total_timeout, &interval_timeout);
# Line 393  rdpdr_process_irp(STREAM s) Line 396  rdpdr_process_irp(STREAM s)
396    
397                          status = STATUS_CANCELLED;                          status = STATUS_CANCELLED;
398                          break;                          break;
399    #endif
400                  case IRP_MJ_WRITE:                  case IRP_MJ_WRITE:
401    
402                          buffer_len = 1;                          buffer_len = 1;
# Line 410  rdpdr_process_irp(STREAM s) Line 413  rdpdr_process_irp(STREAM s)
413  #if WITH_DEBUG_RDP5  #if WITH_DEBUG_RDP5
414                          DEBUG(("RDPDR IRP Write (length: %d)\n", result));                          DEBUG(("RDPDR IRP Write (length: %d)\n", result));
415  #endif  #endif
416                          if (rw_blocking)        // Complete immediately  //                      if (rw_blocking)        // Complete immediately
417                          {  //                      {
418                                  status = fns->write(file, s->p, length, offset, &result);                                  status = fns->write(file, s->p, length, offset, &result);
419                                  break;                                  break;
420                          }  //                      }
421    #if 0
422                          // Add to table                          // Add to table
423                          pst_buf = (uint8 *) xmalloc(length);                          pst_buf = (uint8 *) xmalloc(length);
424                          in_uint8a(s, pst_buf, length);                          in_uint8a(s, pst_buf, length);
# Line 429  rdpdr_process_irp(STREAM s) Line 432  rdpdr_process_irp(STREAM s)
432    
433                          status = STATUS_CANCELLED;                          status = STATUS_CANCELLED;
434                          break;                          break;
435    #endif
436    
437                  case IRP_MJ_QUERY_INFORMATION:                  case IRP_MJ_QUERY_INFORMATION:
438    
# Line 672  rdpdr_init() Line 676  rdpdr_init()
676          return (rdpdr_channel != NULL);          return (rdpdr_channel != NULL);
677  }  }
678    
679    #if 0
680  /* Add file descriptors of pending io request to select() */  /* Add file descriptors of pending io request to select() */
681  void  void
682  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)
# Line 717  rdpdr_add_fds(int *n, fd_set * rfds, fd_ Line 722  rdpdr_add_fds(int *n, fd_set * rfds, fd_
722          }          }
723  }  }
724    
725    
726  /* 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 */
727  void  void
728  rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)  rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)
# Line 809  rdpdr_abort_io(uint32 fd, uint32 major, Line 815  rdpdr_abort_io(uint32 fd, uint32 major,
815          }          }
816          return False;          return False;
817  }  }
818    #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26