Windows 2000 KMDF MTP Driver - KMODE_EXCEPTION_NOT_HANDLED (WdfDriverCreate) Crash

Hi all,

I'm a beginner working on a Windows 2000 MTP (Media Transfer Protocol) driver using KMDF 1.9. I’m trying to get a basic USB MTP driver working on Windows 2000 SP4, using the official Microsoft hotfix for KMDF 1.9 support. My project is here:
https://github.com/Win2000DevCommunity/Win2000-MTP-KMDF-DRIVER

Problem:
When I load my driver, the system crashes with a KMODE_EXCEPTION_NOT_HANDLED (0x1E) bugcheck. The crash happens inside WdfDriverCreate, and the stack trace always points to this function. The exception code is 0xC0000005 (access violation) at address 0x00000000.

What I’ve tried:

  • INF file is undecorated for Win2K, and I removed the CatalogFile line to allow unsigned install.

  • WdfCoInstaller01009.dll is present, and the KMDF 1.9 hotfix is installed.

  • The driver compiles and loads, but always crashes at WdfDriverCreate in DriverEntry.

  • Debugger shows the crash at the call to WdfDriverCreate, with EIP=0x0 (null pointer dereference).

Stack trace excerpt:

mtp!WdfDriverCreate+0x26
mtp!DriverEntry+0x2b
nt!IopLoadDriver+0x672
...
ExceptionCode: c0000005 (Access violation)
ExceptionAddress: 00000000

My DriverEntry:

NTSTATUS DriverEntry(

IN PDRIVER_OBJECT DriverObject,

IN PUNICODE_STRING RegistryPath

)

{

WDF_DRIVER_CONFIG config;

NTSTATUS status;

WDF_DRIVER_CONFIG_INIT(&config, MtpEvtDeviceAdd);

status = WdfDriverCreate(DriverObject, RegistryPath, WDF_NO_OBJECT_ATTRIBUTES, &config, WDF_NO_HANDLE);

return status;

}

Questions:

  • Is there something special I need to do for KMDF 1.9 on Windows 2000?

  • Is there a known issue with WdfDriverCreate on Win2K, or something I might be missing in my setup?

  • Any tips for debugging this kind of crash as a beginner?

Any help or pointers would be greatly appreciated!
Thank you!