Recently I started to play Project Diablo 2 and started to get the following error while closing the game:

Game.exe - An exception (C000000D) occurred during DllEntryPoint or DllMain in module: …\Diablo II\Project D2\glide3x.dll

and followed by when clicking OK:

Diablo II Exception - UNHANDLED EXCEPTION: An invalid parameter was passed to a service or function (c000000d)

Not a big deal at all as it doesn’t affect in-game experience, but it was a bit annoying.

After some researches, here is how I managed to fix the issue:

1) Download IndirectSound_0_20.zip
2) Unarchive the files (dsound.ini and dsound.dll) in your Diablo II\ProjectD2 folder
3) Right click on Game.exe > Properties > Compatibility > Run this program in compatibility mode for: Windows XP (Service Pack 3)

And voila!

Hope this will work for you as well. Enjoy PD2!