2017-08-22 12:47:33 +00:00
|
|
|
#ifndef FORTDRV_H
|
|
|
|
#define FORTDRV_H
|
|
|
|
|
2020-09-07 04:30:48 +00:00
|
|
|
#include "common/common.h"
|
2017-08-22 12:47:33 +00:00
|
|
|
|
2020-09-19 14:54:44 +00:00
|
|
|
/* WDM for Development in User Mode */
|
|
|
|
#if !defined(FORT_DRIVER)
|
|
|
|
# include "wdm/um_fwpmk.h"
|
2021-09-01 09:59:11 +00:00
|
|
|
# include "wdm/um_fwpsk.h"
|
|
|
|
# include "wdm/um_ndis.h"
|
2021-10-31 13:05:44 +00:00
|
|
|
# include "wdm/um_ntddk.h"
|
2021-09-01 09:59:11 +00:00
|
|
|
# include "wdm/um_wdm.h"
|
2020-09-19 14:54:44 +00:00
|
|
|
#endif
|
|
|
|
|
2021-09-01 09:59:11 +00:00
|
|
|
#if defined(FORT_WIN7_COMPAT)
|
2021-11-07 07:47:50 +00:00
|
|
|
# define fort_mem_alloc(size, tag) ExAllocatePoolWithTag(NonPagedPool, (size), (tag))
|
|
|
|
# define fort_mem_exec_alloc(size, tag) ExAllocatePoolWithTag(NonPagedPoolExecute, (size), (tag))
|
2021-09-01 09:59:11 +00:00
|
|
|
#else
|
|
|
|
# define fort_mem_alloc(size, tag) \
|
|
|
|
ExAllocatePool2(POOL_FLAG_UNINITIALIZED | POOL_FLAG_NON_PAGED, (size), (tag))
|
2021-11-07 07:47:50 +00:00
|
|
|
# define fort_mem_exec_alloc(size, tag) \
|
|
|
|
ExAllocatePool2(POOL_FLAG_UNINITIALIZED | POOL_FLAG_NON_PAGED_EXECUTE, (size), (tag))
|
2021-09-01 09:59:11 +00:00
|
|
|
#endif
|
|
|
|
#define fort_mem_free(p, tag) ExFreePoolWithTag((p), (tag))
|
2017-08-22 12:47:33 +00:00
|
|
|
|
2021-03-16 18:36:12 +00:00
|
|
|
#define fort_request_complete_info(irp, status, info) \
|
|
|
|
do { \
|
|
|
|
(irp)->IoStatus.Status = (status); \
|
|
|
|
(irp)->IoStatus.Information = (info); \
|
|
|
|
IoCompleteRequest((irp), IO_NO_INCREMENT); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define fort_request_complete(irp, status) fort_request_complete_info((irp), (status), 0)
|
|
|
|
|
2020-09-06 12:26:55 +00:00
|
|
|
#endif // FORTDRV_H
|