Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47578 Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- MSDN says that this function has been deprecated since Windows XP, so it's not surprising that it always returns FALSE on the test VMs. --- dlls/ntoskrnl.exe/ntoskrnl.c | 7 +++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 92f9afab33..7ff5ab9cb9 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2971,6 +2971,13 @@ PVOID WINAPI MmGetSystemRoutineAddress(PUNICODE_STRING SystemRoutineName) return pFunc; }
+/*********************************************************************** + * MmIsThisAnNtAsSystem (NTOSKRNL.EXE.@) + */ +BOOLEAN WINAPI MmIsThisAnNtAsSystem(void) +{ + return FALSE; +}
/*********************************************************************** * MmQuerySystemSize (NTOSKRNL.EXE.@) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 439cae3097..6f4bd88538 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -699,7 +699,7 @@ @ stub MmIsDriverVerifying @ stub MmIsNonPagedSystemAddressValid @ stub MmIsRecursiveIoFault -@ stub MmIsThisAnNtAsSystem +@ stdcall MmIsThisAnNtAsSystem() @ stub MmIsVerifierEnabled @ stub MmLockPagableDataSection @ stub MmLockPagableImageSection diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 48ddb299cf..5c04ee313c 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -32,11 +32,20 @@
static HANDLE device;
+static BOOLEAN (WINAPI *pMmIsThisAnNtAsSystem)(void); static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)(const WCHAR *, UNICODE_STRING *, WCHAR **, CURDIR *); static BOOL (WINAPI *pRtlFreeUnicodeString)(UNICODE_STRING *); static BOOL (WINAPI *pCancelIoEx)(HANDLE, OVERLAPPED *); static BOOL (WINAPI *pSetFileCompletionNotificationModes)(HANDLE, UCHAR);
+static void test_system(void) +{ + if (!pMmIsThisAnNtAsSystem) /* 32-bit XP/7/8 */ + skip("MmIsThisAnNtAsSystem is not available\n"); + else + ok(!pMmIsThisAnNtAsSystem(), "System reports that it is an old NT Server\n"); +} + static void load_resource(const char *name, char *filename) { static char path[MAX_PATH]; @@ -347,12 +356,15 @@ START_TEST(ntoskrnl) BOOL ret;
HMODULE hntdll = GetModuleHandleA("ntdll.dll"); + pMmIsThisAnNtAsSystem = (void *)GetProcAddress(GetModuleHandleA("ntoskrnl.exe"), "MmIsThisAnNtAsSystem"); pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U"); pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); pCancelIoEx = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "CancelIoEx"); pSetFileCompletionNotificationModes = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "SetFileCompletionNotificationModes");
+ test_system(); + if (!(service = load_driver(filename, "driver.dll", "WineTestDriver"))) return; if (!start_driver(service))
Hello Alex,
On 8/1/19 11:20 PM, Alex Henrie wrote:
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 48ddb299cf..5c04ee313c 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -32,11 +32,20 @@
static HANDLE device;
+static BOOLEAN (WINAPI *pMmIsThisAnNtAsSystem)(void); static BOOL (WINAPI *pRtlDosPathNameToNtPathName_U)(const WCHAR *, UNICODE_STRING *, WCHAR **, CURDIR *); static BOOL (WINAPI *pRtlFreeUnicodeString)(UNICODE_STRING *); static BOOL (WINAPI *pCancelIoEx)(HANDLE, OVERLAPPED *); static BOOL (WINAPI *pSetFileCompletionNotificationModes)(HANDLE, UCHAR);
+static void test_system(void) +{
- if (!pMmIsThisAnNtAsSystem) /* 32-bit XP/7/8 */
skip("MmIsThisAnNtAsSystem is not available\n");
- else
ok(!pMmIsThisAnNtAsSystem(), "System reports that it is an old NT Server\n");
+}
- static void load_resource(const char *name, char *filename) { static char path[MAX_PATH];
@@ -347,12 +356,15 @@ START_TEST(ntoskrnl) BOOL ret;
HMODULE hntdll = GetModuleHandleA("ntdll.dll");
pMmIsThisAnNtAsSystem = (void *)GetProcAddress(GetModuleHandleA("ntoskrnl.exe"), "MmIsThisAnNtAsSystem"); pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U"); pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString"); pCancelIoEx = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "CancelIoEx"); pSetFileCompletionNotificationModes = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "SetFileCompletionNotificationModes");
test_system();
if (!(service = load_driver(filename, "driver.dll", "WineTestDriver"))) return; if (!start_driver(service))
Is the application really calling this function from a user-mode process? If not, I think this test should go in driver.c, instead, somewhere around main_test(). I suspect that will also get rid of the missing function workaround.
ἔρρωσο, Zeb
On Thu, Aug 1, 2019 at 10:27 PM Zebediah Figura z.figura12@gmail.com wrote:
Is the application really calling this function from a user-mode process? If not, I think this test should go in driver.c, instead, somewhere around main_test(). I suspect that will also get rid of the missing function workaround.
Ah, that makes a lot more sense. When I call MmIsThisAnNtAsSystem from within the driver, it returns FALSE on all test VMs except Windows Server 2003. Since there isn't a nice way to write a test that excludes Windows Server 2003, I think I'll just drop the test altogether. Thanks for the help!
-Alex
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=55073
Your paranoid android.
=== debian10 (32 bit report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (32 bit French report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (32 bit Japanese:Japan report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (32 bit Chinese:China report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (32 bit WoW report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (64 bit WoW report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver