mirror of
https://github.com/decompals/wibo.git
synced 2025-12-12 22:56:13 +00:00
use wideStringToString
This commit is contained in:
@@ -899,20 +899,10 @@ namespace kernel32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int WIN_FUNC GetFileAttributesW(const wchar_t* lpFileName) {
|
unsigned int WIN_FUNC GetFileAttributesW(const wchar_t* lpFileName) {
|
||||||
DEBUG_LOG("GetFileAttributesW\n");
|
DEBUG_LOG("GetFileAttributesW(");
|
||||||
size_t len = std::wcstombs(nullptr, lpFileName, 0);
|
std::string str = wideStringToString((const unsigned short*)lpFileName, wcslen(lpFileName));
|
||||||
if(len != (size_t)-1){
|
DEBUG_LOG("%s)\n", str.c_str());
|
||||||
char* converted = new char[len + 1];
|
return GetFileAttributesA(str.c_str());
|
||||||
std::wcstombs(converted, lpFileName, len + 1);
|
|
||||||
unsigned int ret = GetFileAttributesA(converted);
|
|
||||||
delete [] converted;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
DEBUG_LOG("Could not convert filename for GetFileAttributesW!\n");
|
|
||||||
wibo::lastError = 2;
|
|
||||||
return 0xFFFFFFFF;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short WIN_FUNC GetUserDefaultUILanguage(){
|
unsigned short WIN_FUNC GetUserDefaultUILanguage(){
|
||||||
|
|||||||
Reference in New Issue
Block a user