From: Eric Biggers Date: Wed, 25 Nov 2015 04:14:51 +0000 (-0600) Subject: win32_common.c: get NTSTATUS error messages from ntdll X-Git-Tag: v1.9.0~48 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=b133e26b2ee707d188e2320d5e1983fcabe48751 win32_common.c: get NTSTATUS error messages from ntdll --- diff --git a/src/win32_common.c b/src/win32_common.c index 30f7d623..b25871a3 100644 --- a/src/win32_common.c +++ b/src/win32_common.c @@ -449,9 +449,11 @@ retry: if (n >= buflen) goto realloc; - ret = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - is_ntstatus ? (*func_RtlNtStatusToDosError)(code) : code, + ret = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS | + (is_ntstatus ? FORMAT_MESSAGE_FROM_HMODULE : 0), + (is_ntstatus ? ntdll_spec.handle : NULL), + code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &buf[n], buflen - n,