Do not use the PEB lock as loader lock, use a separate critical section for that (and for the graphics drivers).