Add version info on startup

This commit is contained in:
Zephyr Lykos 2024-03-31 17:31:50 +08:00
parent be34405154
commit da753e9668
No known key found for this signature in database
GPG Key ID: D3E9D31E2F77F04D
2 changed files with 9 additions and 1 deletions

View File

@ -13,12 +13,18 @@ DRVNAME = even
INCLUDES = -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/ddk
INCLUDES +=
# We could in fact just add -DEVEN_DRIVER_NAME=\"$(DRVNAME)\" to CFLAGS,
# but we'd have to be careful to "make clean" after changing
# the driver name here in the makefile...
#CFLAGS = -Wall $(INCLUDES) -DEVEN_DRIVER_NAME=\"$(DRVNAME)\"
CFLAGS = -Wall -Wpedantic -DNDEBUG $(INCLUDES)
ifneq ($(RELEASE),)
VERSION = $(shell git describe --tags --always --dirty)
CFLAGS += -DEVEN_VERSION=\"$(VERSION)\"
endif
# Kernel-mode libs:
# libntoskrnl = basic kernel-mode environment
# libhal = WRITE_PORT_UCHAR et al.

4
even.c
View File

@ -403,7 +403,9 @@ NTSTATUS __stdcall DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRIN
DbgPrint("even.sys"
#ifdef EVEN_VERSION
" (" EVEN_VERSION ") "
" ("
EVEN_VERSION
") "
#else
" "
#endif