Also, your patch correctly defines PRTL_UNLOAD_EVENT_TRACE, but in the implementation please use RTL_UNLOAD_EVENT_TRACE * instead. See https://wiki.winehq.org/Submitting_Patches#Code_guidelines -Alex