The MSDN documentation for LoadLibrary warns not to use normal Unix slash "/":
When specifying a path, be sure to use backslashes (\), not forward slashes (/).
I couldn't find any problems using either forward slashes or backslashes (or both) when calling this API. I tried the following pathnames:
c:/foo/bar/baz.dll
/foo/bar/baz.dll
c:/foo/bar\\baz.dll
/foo/bar\\baz.dll
./bar/baz.dll
All combinations worked as expected. Why does the MSDN recommend against using forward slashes as path separators?
Edit:
Regarding UNC Names, it works perfectly well with "//127.0.0.1/c$/foo/bar/baz.dll" as well.
And yes if you add "\?\" it does not load the library but _wfopen would also fail to open file. How LoadLibraryW is different from any other Windows API accepting/not-accepting forward slashes? Why there are explicit warning regarding LoadLibraryW and not CreateFileW.
CreateFile: https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx
The name of the file or device to be created or opened. You may use either forward slashes (/) or backslashes () in this name.
LoadLibrary: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx
When specifying a path, be sure to use backslashes (), not forward slashes (/).
Is there some other pitfails that may cause LoadLibrary to fail when forward slashes (/) are used, while other Windows API would accept forward slashes without any issue?