LPWSTR is a pointer, not a string. It's basically a typedef for wchar_t*.
GetWindowModuleFileNameW will write the string data to whatever buffer you provide to it. But your 'name' buffer is not a buffer, but is just a pointer to some random area in memory (and likely read-only memory at that -- so when the function tries to write to it, it could explode).
You need to give the function an actual buffer:
1 2 3 4
wchar_t name; // if you want to be able to have 100 characters, you need a buffer of at least 100
GetWindowModeulFileNameW( hwnd, name, 100 ); // if using wide characters, use the wide
// version of the function (note the W at the end)