Jacek Caban : ntdll: Export RtlNtStatusToDosError from Unix lib.
Alexandre Julliard
julliard at winehq.org
Tue Oct 12 16:12:48 CDT 2021
Module: wine
Branch: master
Commit: 8f31eb1edb06edc1efc81d3c39426aab3b31cbb0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8f31eb1edb06edc1efc81d3c39426aab3b31cbb0
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Oct 12 15:32:12 2021 +0200
ntdll: Export RtlNtStatusToDosError from Unix lib.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/unix/env.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index 13bf85d2eb6..24f4fa5a588 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -59,6 +59,7 @@
#include "wine/condrv.h"
#include "wine/debug.h"
#include "unix_private.h"
+#include "error.h"
WINE_DEFAULT_DEBUG_CHANNEL(environ);
@@ -2461,16 +2462,25 @@ NTSTATUS WINAPI NtQueryInstallUILanguage( LANGID *lang )
return STATUS_SUCCESS;
}
+/**********************************************************************
+ * RtlUpcaseUnicodeChar (ntdll.so)
+ */
WCHAR WINAPI RtlUpcaseUnicodeChar( WCHAR wch )
{
return ntdll_towupper( wch );
}
+/**********************************************************************
+ * RtlDowncaseUnicodeChar (ntdll.so)
+ */
WCHAR WINAPI RtlDowncaseUnicodeChar( WCHAR wch )
{
return ntdll_towlower( wch );
}
+/**********************************************************************
+ * RtlUTF8ToUnicodeN (ntdll.so)
+ */
NTSTATUS WINAPI RtlUTF8ToUnicodeN( WCHAR *dst, DWORD dstlen, DWORD *reslen, const char *src, DWORD srclen )
{
unsigned int res, len;
@@ -2527,3 +2537,20 @@ NTSTATUS WINAPI RtlUTF8ToUnicodeN( WCHAR *dst, DWORD dstlen, DWORD *reslen, cons
*reslen = (dstlen - (dstend - dst)) * sizeof(WCHAR);
return status;
}
+
+/**********************************************************************
+ * RtlNtStatusToDosError (ntdll.so)
+ */
+ULONG WINAPI RtlNtStatusToDosError( NTSTATUS status )
+{
+ NtCurrentTeb()->LastStatusValue = status;
+
+ if (!status || (status & 0x20000000)) return status;
+ if ((status & 0xf0000000) == 0xd0000000) status &= ~0x10000000;
+
+ /* now some special cases */
+ if (HIWORD(status) == 0xc001 || HIWORD(status) == 0x8007 || HIWORD(status) == 0xc007)
+ return LOWORD( status );
+
+ return map_status( status );
+}
More information about the wine-cvs
mailing list