#ifndef __FUNC_H__
#define __FUNC_H__

//rules type
#define RULE_TYPE_PROCESS_PROTECTION    0x00000001

//errors
#define ERROR_RULE_EXISTS               0x80000001
#define ERROR_RULE_DOES_NOT_EXIST       0x80000002

//structure of rules list
typedef struct FUNC_RULE
{
  struct FUNC_RULE *prev;
  struct FUNC_RULE *next;

  ULONG type;

  union
  {
    struct
    {
      ULONG pid;
    } process;
  };
} FUNC_RULE,*PFUNC_RULE;


//device extenstion structure
typedef struct DEVICE_EXTENSION
{
  KMUTEX rules_mutex;
  PFUNC_RULE first_rule,last_rule;
} DEVICE_EXTENSION,*PDEVICE_EXTENSION;


int func_protect_process(PDEVICE_EXTENSION dev_ext,ULONG pid,int enable);
int func_check_process_protection(ULONG pid);
int func_is_good_read_ptr(PVOID buf,ULONG size);
int func_free_list(PDEVICE_EXTENSION dev_ext);

extern PDEVICE_EXTENSION global_dev_ext;

#endif
