From: <mi...@ca...> - 2003-09-21 14:05:36
|
Hello! I am trying to do a kernel driver. The problem is that the driver seems to be very fond of including kernel32.dll and msvcrt.dll! The problem is that those files are not in use in the kernel. I use the following Makefile: all: g++ -c -I/cygdrive/d/mingw/include -Intddk -notstdlib -nostartfiles -nodefaultlibs -static -DBUILD_DLL parport.cpp -o parport.o dllwrap --dllname=parport.sys --driver-name=g++ --entry=_DriverEntry parport.o strip parport.sys When I analyze the result file, it seems like the following functions (in some strange way) is used inside the module: kernel32.dll: AddAtomA FindAtomA GetAtomNameA msvcrt.dll: __dllonext errno abort fflush free malloc However, I know that I dont use them, because here is my code: #include <ddk/ntddk.h> NTSTATUS AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo) { return STATUS_SUCCESS; } VOID DriverUnload(PDRIVER_OBJECT DriverObject) { } extern "C" { NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { DriverObject->DriverUnload = (void *)DriverUnload; DriverObject->DriverExtension->AddDevice = (void *)AddDevice; return STATUS_SUCCESS; } } /best regards Anders Lindén |