fort/src/driver/fortdrv.h

38 lines
1.6 KiB
C
Raw Normal View History

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
/* WDM for Development in User Mode */
#if !defined(FORT_DRIVER)
# include "wdm/um_aux_klib.h"
# include "wdm/um_fwpmk.h"
# include "wdm/um_fwpsk.h"
# include "wdm/um_ndis.h"
2021-10-31 13:05:44 +00:00
# include "wdm/um_ntddk.h"
# include "wdm/um_ntifs.h"
# include "wdm/um_wdm.h"
#endif
#if defined(FORT_WIN7_COMPAT)
2022-01-29 08:27:01 +00:00
# define fort_mem_alloc(size, tag) ExAllocatePoolWithTag(NonPagedPoolNx, (size), (tag))
2021-11-07 07:47:50 +00:00
# define fort_mem_exec_alloc(size, tag) ExAllocatePoolWithTag(NonPagedPoolExecute, (size), (tag))
#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))
#endif
#define fort_mem_free(p, tag) ExFreePoolWithTag((p), (tag))
2017-08-22 12:47:33 +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