I think it's because of you functions .. ( i think ) But I'm sure you will get X-Trap because of dllmains ..
Try to make a void without any functions and run it in the dllmain if you get a XTRAP error that means your dll main is detected