mirror of
https://github.com/decompals/wibo.git
synced 2025-12-16 08:27:07 +00:00
kernel32/wincon cleanup
This commit is contained in:
@@ -168,13 +168,16 @@ BOOL WINAPI IsProcessorFeaturePresent(DWORD ProcessorFeature) {
|
||||
HOST_CONTEXT_GUARD();
|
||||
DEBUG_LOG("IsProcessorFeaturePresent(%u)\n", ProcessorFeature);
|
||||
if (ProcessorFeature == 0) { // PF_FLOATING_POINT_PRECISION_ERRATA
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
if (ProcessorFeature == 1) { // PF_FLOATING_POINT_EMULATED
|
||||
return FALSE;
|
||||
}
|
||||
if (ProcessorFeature == 10) { // PF_XMMI64_INSTRUCTIONS_AVAILABLE (SSE2)
|
||||
return TRUE;
|
||||
}
|
||||
if (ProcessorFeature == 23) { // PF_FASTFAIL_AVAILABLE (__fastfail() supported)
|
||||
return TRUE;
|
||||
if (ProcessorFeature == 23) { // PF_FASTFAIL_AVAILABLE (__fastfail)
|
||||
return FALSE;
|
||||
}
|
||||
DEBUG_LOG(" IsProcessorFeaturePresent: unknown feature %u, returning TRUE\n", ProcessorFeature);
|
||||
return TRUE;
|
||||
|
||||
@@ -61,7 +61,7 @@ BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE hConsoleOutput, CONSOLE_SCREEN_BUF
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumberOfCharsToWrite,
|
||||
BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCWSTR lpBuffer, DWORD nNumberOfCharsToWrite,
|
||||
LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved) {
|
||||
HOST_CONTEXT_GUARD();
|
||||
DEBUG_LOG("WriteConsoleW(%p, %p, %u, %p, %p)\n", hConsoleOutput, lpBuffer, nNumberOfCharsToWrite,
|
||||
@@ -77,10 +77,14 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber
|
||||
|
||||
auto file = wibo::handles().getAs<FileObject>(hConsoleOutput);
|
||||
if (file->fd == STDOUT_FILENO || file->fd == STDERR_FILENO) {
|
||||
auto str = wideStringToString(static_cast<const uint16_t *>(lpBuffer), static_cast<int>(nNumberOfCharsToWrite));
|
||||
dprintf(file->fd, "%s", str.c_str());
|
||||
auto str = wideStringToString(lpBuffer, static_cast<int>(nNumberOfCharsToWrite));
|
||||
auto io = files::write(file.get(), str.c_str(), str.size(), std::nullopt, true);
|
||||
if (lpNumberOfCharsWritten) {
|
||||
*lpNumberOfCharsWritten = nNumberOfCharsToWrite;
|
||||
*lpNumberOfCharsWritten = io.bytesTransferred;
|
||||
}
|
||||
if (io.unixError != 0) {
|
||||
setLastError(wibo::winErrorFromErrno(io.unixError));
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ UINT WINAPI GetConsoleCP();
|
||||
UINT WINAPI GetConsoleOutputCP();
|
||||
BOOL WINAPI SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add);
|
||||
BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE hConsoleOutput, CONSOLE_SCREEN_BUFFER_INFO *lpConsoleScreenBufferInfo);
|
||||
BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumberOfCharsToWrite,
|
||||
BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCWSTR lpBuffer, DWORD nNumberOfCharsToWrite,
|
||||
LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved);
|
||||
DWORD WINAPI GetConsoleTitleA(LPSTR lpConsoleTitle, DWORD nSize);
|
||||
DWORD WINAPI GetConsoleTitleW(LPWSTR lpConsoleTitle, DWORD nSize);
|
||||
|
||||
Reference in New Issue
Block a user