GetModuleFileName() fails on LOAD_LIBRARY_AS_DATAFILE causing LoadImage to fail. Use a fake filename for LR_SHARED (with same format as Windows). This may not be a good design, but it does match Windows' behaviour. + Added test.