Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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