Subversion Repositories Kolibri OS

Rev

Rev 8703 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include <ddk.h>
  2. #include <syscall.h>
  3.  
  4. static int __stdcall service_proc(ioctl_t *my_ctl){
  5.     int c = 0;
  6.     int a = *(int*)(my_ctl->input);
  7.     int b = *(int*)(my_ctl->input+4);
  8.     if(my_ctl->io_code==0){
  9.         c = a + b;
  10.     }else{
  11.         return -1;
  12.     }
  13.     *(int*)(my_ctl->output) = c;
  14.     return 0;
  15. }
  16.  
  17. unsigned drvEntry(int action, char *cmdline){
  18.     SysMsgBoardStr("Driver c_drv.dll loaded!\n");
  19.     return RegService("c_drv", service_proc);
  20. }
  21.