Fixed: Configurator.exe was unable to install APO if device name contained special characters illegal for file names (e.g. S/PDIF)

This commit is contained in:
jthedering committed 2013-01-19 18:42:33 +00:00
1 parent cad3e0ac2a
commit 7758366b58
3 files changed
+32 -1

No files matched your search

+29
View File
@@ -18,6 +18,7 @@
*/
#include <fstream>
#include <sstream>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ObjBase.h>
@@ -211,6 +212,34 @@ wstring RegistryHelper::getGuidString(GUID guid)
return result;
}
wstring RegistryHelper::replaceIllegalCharacters(wstring filename)
{
wstringstream stream;
for(unsigned i=0; i<filename.length(); i++)
{
wchar_t c = filename[i];
switch(c)
{
case L'<':
case L'>':
case L':':
case L'"':
case L'/':
case L'\\':
case L'|':
case L'?':
case L'*':
stream.put(L'_');
break;
default:
stream.put(c);
}
}
return stream.str();
}
wstring RegistryHelper::getSystemErrorString(long status)
{
wchar_t* buf;