/[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 609 by stargo, Mon Feb 16 20:28:09 2004 UTC revision 612 by n-ki, Mon Feb 23 09:58:16 2004 UTC
# Line 89  add_async_iorequest(uint32 device, uint3 Line 89  add_async_iorequest(uint32 device, uint3
89          if (g_iorequest == NULL)          if (g_iorequest == NULL)
90          {          {
91                  g_iorequest = (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));                  g_iorequest = (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));
92                    if (!g_iorequest)
93                            return False;
94                  g_iorequest->fd = 0;                  g_iorequest->fd = 0;
95                  g_iorequest->next = NULL;                  g_iorequest->next = NULL;
96          }          }
# Line 102  add_async_iorequest(uint32 device, uint3 Line 104  add_async_iorequest(uint32 device, uint3
104                  {                  {
105                          iorq->next =                          iorq->next =
106                                  (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));                                  (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));
107                            if (!iorq->next)
108                                    return False;
109                          iorq->next->fd = 0;                          iorq->next->fd = 0;
110                          iorq->next->next = NULL;                          iorq->next->next = NULL;
111                  }                  }
# Line 388  rdpdr_process_irp(STREAM s) Line 392  rdpdr_process_irp(STREAM s)
392                          if (rw_blocking)        // Complete read immediately                          if (rw_blocking)        // Complete read immediately
393                          {                          {
394                                  buffer = (uint8 *) xrealloc((void *) buffer, length);                                  buffer = (uint8 *) xrealloc((void *) buffer, length);
395                                    if (!buffer)
396                                    {
397                                            status = STATUS_CANCELLED;
398                                            break;
399                                    }
400                                  status = fns->read(file, buffer, length, offset, &result);                                  status = fns->read(file, buffer, length, offset, &result);
401                                  buffer_len = result;                                  buffer_len = result;
402                                  break;                                  break;
# Line 395  rdpdr_process_irp(STREAM s) Line 404  rdpdr_process_irp(STREAM s)
404    
405                          // Add request to table                          // Add request to table
406                          pst_buf = (uint8 *) xmalloc(length);                          pst_buf = (uint8 *) xmalloc(length);
407                            if (!pst_buf)
408                            {
409                                    status = STATUS_CANCELLED;
410                                    break;
411                            }
412                          serial_get_timeout(file, length, &total_timeout, &interval_timeout);                          serial_get_timeout(file, length, &total_timeout, &interval_timeout);
413                          if (add_async_iorequest                          if (add_async_iorequest
414                              (device, file, id, major, length, fns, total_timeout, interval_timeout,                              (device, file, id, major, length, fns, total_timeout, interval_timeout,
# Line 430  rdpdr_process_irp(STREAM s) Line 444  rdpdr_process_irp(STREAM s)
444    
445                          // Add to table                          // Add to table
446                          pst_buf = (uint8 *) xmalloc(length);                          pst_buf = (uint8 *) xmalloc(length);
447                            if (!pst_buf)
448                            {
449                                    status = STATUS_CANCELLED;
450                                    break;
451                            }
452    
453                          in_uint8a(s, pst_buf, length);                          in_uint8a(s, pst_buf, length);
454    
455                          if (add_async_iorequest                          if (add_async_iorequest
# Line 553  rdpdr_process_irp(STREAM s) Line 573  rdpdr_process_irp(STREAM s)
573                          in_uint8s(s, 0x14);                          in_uint8s(s, 0x14);
574    
575                          buffer = (uint8 *) xrealloc((void *) buffer, bytes_out + 0x14);                          buffer = (uint8 *) xrealloc((void *) buffer, bytes_out + 0x14);
576                            if (!buffer)
577                            {
578                                    status = STATUS_CANCELLED;
579                                    break;
580                            }
581    
582                          out.data = out.p = buffer;                          out.data = out.p = buffer;
583                          out.size = sizeof(buffer);                          out.size = sizeof(buffer);
584                          status = fns->device_control(file, request, s, &out);                          status = fns->device_control(file, request, s, &out);
# Line 568  rdpdr_process_irp(STREAM s) Line 594  rdpdr_process_irp(STREAM s)
594          {          {
595                  rdpdr_send_completion(device, id, status, result, buffer, buffer_len);                  rdpdr_send_completion(device, id, status, result, buffer, buffer_len);
596          }          }
597          xfree(buffer);          if (buffer)
598                    xfree(buffer);
599            buffer = NULL;
600  }  }
601    
602  void  void

Legend:
Removed from v.609  
changed lines
  Added in v.612

  ViewVC Help
Powered by ViewVC 1.1.26