mirror of https://github.com/x64dbg/TitanEngine
- AStyle
This commit is contained in:
parent
2ac41ffb3c
commit
35d23856fd
|
|
@ -192,20 +192,20 @@ static void SettingGet(const TCHAR* name, TCHAR* value, int value_size)
|
||||||
|
|
||||||
static bool FileExists(LPCTSTR szPath)
|
static bool FileExists(LPCTSTR szPath)
|
||||||
{
|
{
|
||||||
DWORD dwAttrib = GetFileAttributes(szPath);
|
DWORD dwAttrib = GetFileAttributes(szPath);
|
||||||
return (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
|
return (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CreateDummyUnicodeFile(const TCHAR* szFileName)
|
static void CreateDummyUnicodeFile(const TCHAR* szFileName)
|
||||||
{
|
{
|
||||||
//http://www.codeproject.com/Articles/9071/Using-Unicode-in-INI-files
|
//http://www.codeproject.com/Articles/9071/Using-Unicode-in-INI-files
|
||||||
if (!FileExists(szFileName))
|
if (!FileExists(szFileName))
|
||||||
{
|
{
|
||||||
// UTF16-LE BOM(FFFE)
|
// UTF16-LE BOM(FFFE)
|
||||||
WORD wBOM = 0xFEFF;
|
WORD wBOM = 0xFEFF;
|
||||||
DWORD NumberOfBytesWritten;
|
DWORD NumberOfBytesWritten;
|
||||||
HANDLE hFile = CreateFile(szFileName, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
|
HANDLE hFile = CreateFile(szFileName, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
WriteFile(hFile, &wBOM, sizeof(WORD), &NumberOfBytesWritten, NULL);
|
WriteFile(hFile, &wBOM, sizeof(WORD), &NumberOfBytesWritten, NULL);
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue