Reactos

[NTDLL_APITEST] Fix some tests

- Fix DllLoadNotification test on Vista (which seems to be broken)
- Fix NtAcceptConnectPort test on 64 bit
- Fix NtAllocateVirtualMemory test on Vista+
- Fix NtMapViewOfSection test on 64 bit
- Fix NtSetDefaultLocale test on Vista+
- Fix RtlBitmapApi test on Vista
- Fix RtlCaptureContext test

+242 -128
+3 -1
modules/rostests/apitests/ntdll/DllLoadNotification.c
··· 187 187 Status = pfnLdrRegisterDllNotification(0, DllLoadCallback, &hNotifiedDllBase, &Cookie2); 188 188 ok_eq_bool(NT_SUCCESS(Status), TRUE); 189 189 ok(Cookie2 != NULL, "Cookie2 is NULL\n"); 190 + ok(Cookie2 != Cookie1, "Cookie2 is equal to Cookie1\n"); 190 191 191 192 /* Load the test DLL */ 192 193 hTestDll = LoadLibraryW(g_szDllPath); ··· 219 220 if (FreeLibrary(hTestDll)) 220 221 { 221 222 /* The count will decrease 1 because the last callback still there */ 222 - ok_eq_long(g_lDllLoadCount, 1L); 223 + ok(g_lDllLoadCount == 1L || /* Vista */ broken(g_lDllLoadCount == 2L), 224 + "Wrong g_lDllLoadCount: %lu, expected 1\n", g_lDllLoadCount); 223 225 } 224 226 else 225 227 {
+19 -3
modules/rostests/apitests/ntdll/NtAcceptConnectPort.c
··· 108 108 &Message.Header); 109 109 ok_hex(Status, STATUS_SUCCESS); 110 110 111 - ok(Message.Header.u1.s1.TotalLength == sizeof(Message), 112 - "TotalLength = %u, expected %Iu\n", 113 - Message.Header.u1.s1.TotalLength, sizeof(Message)); 111 + #ifdef _WIN64 112 + /* On 64 bit systems TotalLength does not include the padding bytes in the TEST_MESSAGE structure. */ 113 + ok_eq_ulong(Message.Header.u1.s1.TotalLength, RTL_SIZEOF_THROUGH_FIELD(TEST_MESSAGE, Message)); 114 + #else 115 + /* On native 32 bit systems TotalLength includes the padding that comes from the 8 byte alignment of PORT_MESSAGE */ 116 + ok_eq_ulong(Message.Header.u1.s1.TotalLength, sizeof(Message)); 117 + #endif 118 + 114 119 ok(Message.Header.u1.s1.DataLength == sizeof(Message.Message), 115 120 "DataLength = %u\n", Message.Header.u1.s1.DataLength); 116 121 ok(Message.Header.u2.s2.Type == LPC_DATAGRAM, ··· 140 145 ULONG ConnectInfoLength; 141 146 SECURITY_QUALITY_OF_SERVICE SecurityQos; 142 147 TEST_MESSAGE Message; 148 + ULONG MaxMessageLength; 143 149 144 150 SecurityQos.Length = sizeof(SecurityQos); 145 151 SecurityQos.ImpersonationLevel = SecurityIdentification; ··· 150 156 ConnectInfo.Signature = TEST_CONNECTION_INFO_SIGNATURE1; 151 157 ConnectInfoLength = sizeof(ConnectInfo); 152 158 PortHandle = (PVOID)(ULONG_PTR)0x55555555; 159 + MaxMessageLength = 0xAAAAAAAA; 153 160 Status = NtConnectPort(&PortHandle, 154 161 &PortName, 155 162 &SecurityQos, ··· 160 167 &ConnectInfoLength); 161 168 ok_hex(Status, STATUS_PORT_CONNECTION_REFUSED); 162 169 ok(PortHandle == (PVOID)(ULONG_PTR)0x55555555, "PortHandle = %p\n", PortHandle); 170 + ok_eq_ulong(MaxMessageLength, 0xAAAAAAAA); 163 171 164 172 /* Try again, this time it will be accepted */ 165 173 ConnectInfo.Signature = TEST_CONNECTION_INFO_SIGNATURE2; ··· 199 207 OBJECT_ATTRIBUTES ObjectAttributes; 200 208 HANDLE PortHandle; 201 209 HANDLE ThreadHandles[2]; 210 + BOOL bIsWow64; 211 + 212 + IsWow64Process(GetCurrentProcess(), &bIsWow64); 213 + if (bIsWow64) 214 + { 215 + skip("Skipping NtAcceptConnectPort on WOW64, due to LPC message layout differences.\n"); 216 + return; 217 + } 202 218 203 219 InitializeObjectAttributes(&ObjectAttributes, 204 220 &PortName,
+152 -102
modules/rostests/apitests/ntdll/NtAllocateVirtualMemory.c
··· 4 4 * PURPOSE: Test for NtAllocateVirtualMemory 5 5 * COPYRIGHT: Copyright 2011 Thomas Faber <thomas.faber@reactos.org> 6 6 * Copyright 2013 Timo Kreuzer <timo.kreuzer@reactos.org> 7 - * Copyright 2015 J�r�me Gardou <jerome.gardou@reactos.org> 7 + * Copyright 2015 Jérôme Gardou <jerome.gardou@reactos.org> 8 8 * Copyright 2018 Serge Gautherie <reactos-git_serge_171003@gautherie.fr> 9 9 */ 10 10 ··· 591 591 Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 592 592 ok_ntstatus(Status, STATUS_SUCCESS); 593 593 594 - // 0x00000000, 64k: Free. 595 - 596 - /* Reserve and commit memory at 0x00000000, after round down */ 597 - BaseAddress = UlongToPtr(0x00000000 + 0x0FFF); 594 + /* Try to reserve memory at the shared user page */ 595 + BaseAddress = (PVOID)USER_SHARED_DATA; 598 596 Size = 0x1000; 599 597 Status = NtAllocateVirtualMemory(NtCurrentProcess(), 600 598 &BaseAddress, 601 599 0, 602 600 &Size, 603 - MEM_RESERVE | MEM_COMMIT, 601 + MEM_RESERVE, 604 602 PAGE_READWRITE); 605 - ok_ntstatus(Status, STATUS_SUCCESS); 606 - ok_ptr(BaseAddress, 0x00000000); 607 - 608 - // Double-check that it is not forbidden "in order to catch null pointer accesses". 609 - StartSeh() 610 - *(int*)UlongToPtr(0x00000000) = 1; 611 - EndSeh(STATUS_SUCCESS) 612 - 613 - Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 614 - ok_ntstatus(Status, STATUS_SUCCESS); 603 + ok_ntstatus(Status, (GetNTVersion() >= _WIN32_WINNT_VISTA) ? STATUS_CONFLICTING_ADDRESSES : STATUS_INVALID_PARAMETER_2); 615 604 616 - /* Reserve memory above 0x00000000 */ 617 - BaseAddress = UlongToPtr(0x00000000 + 0x1000); 605 + /* Try to unmap the shared user page */ 606 + BaseAddress = (PVOID)USER_SHARED_DATA; 618 607 Size = 0x1000; 619 - Status = NtAllocateVirtualMemory(NtCurrentProcess(), 620 - &BaseAddress, 621 - 0, 622 - &Size, 623 - MEM_RESERVE, 624 - PAGE_READWRITE); 625 - ok_ntstatus(Status, STATUS_SUCCESS); 626 608 Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 627 - ok_ntstatus(Status, STATUS_SUCCESS); 609 + ok_ntstatus(Status, (GetNTVersion() >= _WIN32_WINNT_VISTA) ? STATUS_INVALID_PAGE_PROTECTION : STATUS_MEMORY_NOT_ALLOCATED); 628 610 629 - /* The following checks assume very default addresses, 630 - * no address space layout randomization (ASLR). */ 631 - #ifdef _WIN64 632 - ok(FALSE, "ToDo, 64-bit: Check/Adapt 32-bit results\n"); 633 - #endif 634 - 635 - // 0x00010000, 4k: Private Data. 636 - // 0x00011000, 60k: Unusable. 611 + // 0x00000000, 64k: Free on XP/2K3, reserved later. 637 612 638 - /* Reserve memory below 0x00010000 */ 639 - BaseAddress = UlongToPtr(0x00010000 - 0x1000); 613 + /* Reserve and commit memory at 0x00000000, after round down */ 614 + BaseAddress = UlongToPtr(0x00000000 + 0x0FFF); 640 615 Size = 0x1000; 641 616 Status = NtAllocateVirtualMemory(NtCurrentProcess(), 642 617 &BaseAddress, 643 618 0, 644 619 &Size, 645 - MEM_RESERVE, 620 + MEM_RESERVE | MEM_COMMIT, 646 621 PAGE_READWRITE); 647 - ok_ntstatus(Status, STATUS_SUCCESS); 648 - Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 649 - ok_ntstatus(Status, STATUS_SUCCESS); 622 + if (GetNTVersion() >= _WIN32_WINNT_WIN10) 623 + { 624 + ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES); 625 + } 626 + else if (GetNTVersion() >= _WIN32_WINNT_VISTA) 627 + { 628 + ok_ntstatus(Status, STATUS_INVALID_PARAMETER_2); 629 + } 630 + else 631 + { 632 + ok_ntstatus(Status, GetNTVersion() >= _WIN32_WINNT_VISTA ? STATUS_INVALID_PARAMETER_2 : STATUS_SUCCESS); 633 + ok_ptr(BaseAddress, 0x00000000); 650 634 651 - /* Reserve memory at 0x00010000: 652 - * Windows NT legacy default executable image base */ 653 - BaseAddress = UlongToPtr(0x00010000); 635 + // Double-check that it is not forbidden "in order to catch null pointer accesses". 636 + StartSeh() 637 + *(int*)UlongToPtr(0x00000000) = 1; 638 + EndSeh(STATUS_SUCCESS) 639 + 640 + Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 641 + ok_ntstatus(Status, STATUS_SUCCESS); 642 + } 643 + 644 + /* Reserve memory above 0x00000000 */ 645 + BaseAddress = UlongToPtr(0x00000000 + 0x1000); 654 646 Size = 0x1000; 655 647 Status = NtAllocateVirtualMemory(NtCurrentProcess(), 656 648 &BaseAddress, ··· 658 650 &Size, 659 651 MEM_RESERVE, 660 652 PAGE_READWRITE); 661 - ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES); 662 - if (NT_SUCCESS(Status)) 663 - { // Unexpected, cleanup. 653 + if (GetNTVersion() >= _WIN32_WINNT_WIN10) 654 + { 655 + ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES); 656 + } 657 + else if (GetNTVersion() >= _WIN32_WINNT_VISTA) 658 + { 659 + ok_ntstatus(Status, STATUS_INVALID_PARAMETER_2); 660 + } 661 + else 662 + { 663 + ok_ntstatus(Status, STATUS_SUCCESS); 664 664 Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 665 665 ok_ntstatus(Status, STATUS_SUCCESS); 666 666 } 667 667 668 - // 0x00400000: Image base. 668 + // 0x00010000, 4k: Private Data. 669 + // 0x00011000, 60k: Unusable. 669 670 670 - /* Reserve memory below 0x00400000 */ 671 - BaseAddress = UlongToPtr(0x00400000 - 0x1000); 671 + /* Reserve memory below 0x00010000 */ 672 + BaseAddress = UlongToPtr(0x00010000 - 0x1000); 672 673 Size = 0x1000; 673 674 Status = NtAllocateVirtualMemory(NtCurrentProcess(), 674 675 &BaseAddress, ··· 676 677 &Size, 677 678 MEM_RESERVE, 678 679 PAGE_READWRITE); 679 - if (NT_SUCCESS(Status)) 680 + if (GetNTVersion() >= _WIN32_WINNT_WIN10) 680 681 { 681 - trace("Below 0x00400000 is available, as on ReactOS and Windows S03\n"); 682 - // 0x003F0000, 64k: Free. 682 + ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES); 683 + } 684 + else if (GetNTVersion() >= _WIN32_WINNT_VISTA) 685 + { 686 + ok_ntstatus(Status, STATUS_INVALID_PARAMETER_2); 687 + } 688 + else 689 + { 683 690 ok_ntstatus(Status, STATUS_SUCCESS); 684 691 Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 685 692 ok_ntstatus(Status, STATUS_SUCCESS); 686 693 } 694 + 695 + /* The following checks assume very default addresses, 696 + * no address space layout randomization (ASLR). */ 697 + if (GetNTVersion() >= _WIN32_WINNT_VISTA) 698 + { 699 + skip("Skipping default address checks on Vista+\n"); 700 + } 687 701 else 688 702 { 689 - trace("Below 0x00400000 is not available, as on Windows XP\n"); 690 - // 0x003F0000, 4k: Shareable. 691 - // 0x003F1000, 60k: Unusable. 703 + 704 + /* Reserve memory at 0x00010000: 705 + * Windows NT legacy default executable image base */ 706 + BaseAddress = UlongToPtr(0x00010000); 707 + Size = 0x1000; 708 + Status = NtAllocateVirtualMemory(NtCurrentProcess(), 709 + &BaseAddress, 710 + 0, 711 + &Size, 712 + MEM_RESERVE, 713 + PAGE_READWRITE); 692 714 ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES); 693 - } 715 + if (NT_SUCCESS(Status)) 716 + { // Unexpected, cleanup. 717 + Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 718 + ok_ntstatus(Status, STATUS_SUCCESS); 719 + } 694 720 695 - /* Reserve memory at 0x00400000: 696 - * Windows NT legacy default DLL image base, 697 - * (ReactOS and) Windows 95 new default executable image base */ 698 - BaseAddress = UlongToPtr(0x00400000); 699 - Size = 0x1000; 700 - Status = NtAllocateVirtualMemory(NtCurrentProcess(), 701 - &BaseAddress, 702 - 0, 703 - &Size, 704 - MEM_RESERVE, 705 - PAGE_READWRITE); 706 - ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES); 707 - if (NT_SUCCESS(Status)) 708 - { // Unexpected, cleanup. 709 - Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 710 - ok_ntstatus(Status, STATUS_SUCCESS); 711 - } 721 + // 0x00400000: Image base. 712 722 713 - // 0x10000000: Free. 723 + /* Reserve memory below 0x00400000 */ 724 + BaseAddress = UlongToPtr(0x00400000 - 0x1000); 725 + Size = 0x1000; 726 + Status = NtAllocateVirtualMemory(NtCurrentProcess(), 727 + &BaseAddress, 728 + 0, 729 + &Size, 730 + MEM_RESERVE, 731 + PAGE_READWRITE); 732 + if (NT_SUCCESS(Status)) 733 + { 734 + trace("Below 0x00400000 is available, as on ReactOS and Windows S03\n"); 735 + // 0x003F0000, 64k: Free. 736 + ok_ntstatus(Status, STATUS_SUCCESS); 737 + Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 738 + ok_ntstatus(Status, STATUS_SUCCESS); 739 + } 740 + else 741 + { 742 + trace("Below 0x00400000 is not available, as on Windows XP\n"); 743 + // 0x003F0000, 4k: Shareable. 744 + // 0x003F1000, 60k: Unusable. 745 + ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES); 746 + } 714 747 715 - /* Reserve memory below 0x10000000 */ 716 - BaseAddress = UlongToPtr(0x10000000 - 0x1000); 717 - Size = 0x1000; 718 - Status = NtAllocateVirtualMemory(NtCurrentProcess(), 719 - &BaseAddress, 720 - 0, 721 - &Size, 722 - MEM_RESERVE, 723 - PAGE_READWRITE); 724 - ok_ntstatus(Status, STATUS_SUCCESS); 725 - Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 726 - ok_ntstatus(Status, STATUS_SUCCESS); 748 + /* Reserve memory at 0x00400000: 749 + * Windows NT legacy default DLL image base, 750 + * (ReactOS and) Windows 95 new default executable image base */ 751 + BaseAddress = UlongToPtr(0x00400000); 752 + Size = 0x1000; 753 + Status = NtAllocateVirtualMemory(NtCurrentProcess(), 754 + &BaseAddress, 755 + 0, 756 + &Size, 757 + MEM_RESERVE, 758 + PAGE_READWRITE); 759 + ok_ntstatus(Status, STATUS_CONFLICTING_ADDRESSES); 760 + if (NT_SUCCESS(Status)) 761 + { // Unexpected, cleanup. 762 + Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 763 + ok_ntstatus(Status, STATUS_SUCCESS); 764 + } 727 765 728 - /* Reserve memory at 0x10000000: 729 - * Windows new default non-OS DLL image base */ 730 - BaseAddress = UlongToPtr(0x10000000); 731 - Size = 0x1000; 732 - Status = NtAllocateVirtualMemory(NtCurrentProcess(), 733 - &BaseAddress, 734 - 0, 735 - &Size, 736 - MEM_RESERVE, 737 - PAGE_READWRITE); 738 - ok_ntstatus(Status, STATUS_SUCCESS); 739 - Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 740 - ok_ntstatus(Status, STATUS_SUCCESS); 766 + // 0x10000000: Free. 767 + 768 + /* Reserve memory below 0x10000000 */ 769 + BaseAddress = UlongToPtr(0x10000000 - 0x1000); 770 + Size = 0x1000; 771 + Status = NtAllocateVirtualMemory(NtCurrentProcess(), 772 + &BaseAddress, 773 + 0, 774 + &Size, 775 + MEM_RESERVE, 776 + PAGE_READWRITE); 777 + ok_ntstatus(Status, STATUS_SUCCESS); 778 + Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 779 + ok_ntstatus(Status, STATUS_SUCCESS); 741 780 742 - #ifdef _WIN64 743 - skip("ToDo, 64-bit: Add 0x140000000/Exe and 0x180000000/DLL checks\n"); 744 - #endif 781 + /* Reserve memory at 0x10000000: 782 + * Windows new default non-OS DLL image base */ 783 + BaseAddress = UlongToPtr(0x10000000); 784 + Size = 0x1000; 785 + Status = NtAllocateVirtualMemory(NtCurrentProcess(), 786 + &BaseAddress, 787 + 0, 788 + &Size, 789 + MEM_RESERVE, 790 + PAGE_READWRITE); 791 + ok_ntstatus(Status, STATUS_SUCCESS); 792 + Status = NtFreeVirtualMemory(NtCurrentProcess(), &BaseAddress, &Size, MEM_RELEASE); 793 + ok_ntstatus(Status, STATUS_SUCCESS); 794 + } 745 795 } 746 796 747 797 #define RUNS 32
+31 -7
modules/rostests/apitests/ntdll/NtMapViewOfSection.c
··· 10 10 11 11 #include <pseh/pseh2.h> 12 12 13 + #ifdef _M_IX86 14 + #define IsX86() TRUE 15 + #else 16 + #define IsX86() FALSE 17 + #endif 18 + 13 19 void 14 20 Test_PageFileSection(void) 15 21 { ··· 641 647 Status = NtProtectVirtualMemory(NtCurrentProcess(), &BaseAddress2, &ViewSize, PAGE_READWRITE, &OldProtect); 642 648 ok_ntstatus(Status, STATUS_SECTION_PROTECTION); 643 649 #ifdef _WIN64 644 - ok(OldProtect == 0, "Wrong protection returned: 0x%lx\n", OldProtect); 650 + ok(OldProtect == PAGE_NOACCESS, "Wrong protection returned: 0x%lx\n", OldProtect); 645 651 #else 646 652 // Windows 2003 returns bogus 647 653 #endif ··· 1171 1177 { 1172 1178 IMAGE_DOS_HEADER doshdr; 1173 1179 WORD stub[32]; 1174 - IMAGE_NT_HEADERS32 nthdrs; 1180 + IMAGE_NT_HEADERS nthdrs; 1175 1181 IMAGE_SECTION_HEADER text_header; 1176 1182 IMAGE_SECTION_HEADER rossym_header; 1177 1183 IMAGE_SECTION_HEADER rsrc_header; 1178 1184 IMAGE_SECTION_HEADER clc_header; 1185 + #ifdef _WIN64 1186 + BYTE pad[472]; 1187 + #else 1179 1188 BYTE pad[488]; 1189 + #endif 1180 1190 BYTE text_data[0x400]; 1181 1191 BYTE rossym_data[0x400]; 1182 1192 BYTE rsrc_data[0x400]; ··· 1195 1205 0x7220, 0x6E75, 0x6920, 0x206E, 0x4F44, 0x2053, 0x6F6D, 0x6564, 0x0D2E, 1196 1206 0x0A0D, 0x0024, 0x0000, 0x0000, 0x0000 1197 1207 }, 1198 - /* IMAGE_NT_HEADERS32 */ 1208 + /* IMAGE_NT_HEADERS */ 1199 1209 { 1200 1210 IMAGE_NT_SIGNATURE, /* Signature */ 1201 1211 /* IMAGE_FILE_HEADER */ 1202 1212 { 1203 - IMAGE_FILE_MACHINE_I386, /* Machine */ 1213 + IMAGE_FILE_MACHINE_NATIVE, /* Machine */ 1204 1214 4, /* NumberOfSections */ 1205 1215 0x47EFDF09, /* TimeDateStamp */ 1206 1216 0, /* PointerToSymbolTable */ 1207 1217 0, /* NumberOfSymbols */ 1218 + #ifdef _WIN64 1219 + 0xF0, /* SizeOfOptionalHeader */ 1220 + #else 1208 1221 0xE0, /* SizeOfOptionalHeader */ 1222 + #endif 1209 1223 IMAGE_FILE_32BIT_MACHINE | IMAGE_FILE_LOCAL_SYMS_STRIPPED | 1210 1224 IMAGE_FILE_LINE_NUMS_STRIPPED | IMAGE_FILE_EXECUTABLE_IMAGE | 1211 1225 IMAGE_FILE_DLL, /* Characteristics */ 1212 1226 }, 1213 - /* IMAGE_OPTIONAL_HEADER32 */ 1227 + /* IMAGE_OPTIONAL_HEADER */ 1214 1228 { 1229 + #ifdef _WIN64 1230 + IMAGE_NT_OPTIONAL_HDR64_MAGIC, /* Magic */ 1231 + #else 1215 1232 IMAGE_NT_OPTIONAL_HDR32_MAGIC, /* Magic */ 1233 + #endif 1216 1234 8, /* MajorLinkerVersion */ 1217 1235 0, /* MinorLinkerVersion */ 1218 1236 0x400, /* SizeOfCode */ ··· 1220 1238 0, /* SizeOfUninitializedData */ 1221 1239 0x2000, /* AddressOfEntryPoint */ 1222 1240 0x2000, /* BaseOfCode */ 1241 + #ifndef _WIN64 1223 1242 0x0000, /* BaseOfData */ 1243 + #endif 1224 1244 0x400000, /* ImageBase */ 1225 1245 0x2000, /* SectionAlignment */ 1226 1246 0x200, /* FileAlignment */ ··· 1399 1419 } 1400 1420 if (Relocate) 1401 1421 { 1422 + #ifdef _WIN64 1423 + ok((ULONG_PTR)GetModuleHandle(NULL) <= 0x00007FFFFFFFFFFF, "Module at %p\n", GetModuleHandle(NULL)); 1424 + #else 1402 1425 ok((ULONG_PTR)GetModuleHandle(NULL) <= 0x80000000, "Module at %p\n", GetModuleHandle(NULL)); 1403 - SectionContentsImageFile.nthdrs.OptionalHeader.ImageBase = (ULONG)(ULONG_PTR)GetModuleHandle(NULL); 1426 + #endif 1427 + SectionContentsImageFile.nthdrs.OptionalHeader.ImageBase = (ULONG_PTR)GetModuleHandle(NULL); 1404 1428 } 1405 1429 else 1406 1430 { ··· 1800 1824 ViewShare, 1801 1825 0, 1802 1826 PAGE_READWRITE); 1803 - ok_ntstatus(Status, STATUS_SUCCESS); 1827 + ok_ntstatus(Status, IsX86() ? STATUS_SUCCESS : STATUS_IMAGE_MACHINE_TYPE_MISMATCH); 1804 1828 if (NT_SUCCESS(Status)) 1805 1829 { 1806 1830 PUCHAR Bytes = BaseAddress;
+30 -8
modules/rostests/apitests/ntdll/NtSetDefaultLocale.c
··· 9 9 10 10 START_TEST(NtSetDefaultLocale) 11 11 { 12 - NTSTATUS Status; 12 + NTSTATUS Status, ExpectedStatus; 13 + 14 + if (GetNTVersion() >= _WIN32_WINNT_WIN10) 15 + { 16 + ExpectedStatus = STATUS_SUCCESS; 17 + } 18 + else if (GetNTVersion() >= _WIN32_WINNT_VISTA) 19 + { 20 + ExpectedStatus = STATUS_OBJECT_NAME_NOT_FOUND; 21 + } 22 + else 23 + { 24 + ExpectedStatus = STATUS_INVALID_PARAMETER; 25 + } 13 26 14 27 Status = NtSetDefaultLocale(TRUE, 0xffffffff); 15 - ok_ntstatus(Status, STATUS_INVALID_PARAMETER); 28 + ok_ntstatus(Status, ExpectedStatus); 16 29 17 30 Status = NtSetDefaultLocale(TRUE, 0xfffffffe); 18 - ok_ntstatus(Status, STATUS_INVALID_PARAMETER); 31 + ok_ntstatus(Status, ExpectedStatus); 19 32 20 33 Status = NtSetDefaultLocale(TRUE, 0x7fffffff); 21 - ok_ntstatus(Status, STATUS_INVALID_PARAMETER); 34 + ok_ntstatus(Status, ExpectedStatus); 22 35 23 36 Status = NtSetDefaultLocale(TRUE, 0x7ffffffe); 24 - ok_ntstatus(Status, STATUS_INVALID_PARAMETER); 37 + ok_ntstatus(Status, ExpectedStatus); 25 38 26 39 Status = NtSetDefaultLocale(TRUE, 0x80000000); 27 - ok_ntstatus(Status, STATUS_INVALID_PARAMETER); 40 + ok_ntstatus(Status, ExpectedStatus); 28 41 29 42 Status = NtSetDefaultLocale(TRUE, 0x80000001); 30 - ok_ntstatus(Status, STATUS_INVALID_PARAMETER); 43 + ok_ntstatus(Status, ExpectedStatus); 31 44 32 45 Status = NtSetDefaultLocale(TRUE, 0x10000); 33 - ok_ntstatus(Status, STATUS_INVALID_PARAMETER); 46 + ok_ntstatus(Status, ExpectedStatus); 47 + 48 + if (GetNTVersion() >= _WIN32_WINNT_WIN10) 49 + { 50 + ExpectedStatus = STATUS_SUCCESS; 51 + } 52 + else 53 + { 54 + ExpectedStatus = STATUS_OBJECT_NAME_NOT_FOUND; 55 + } 34 56 35 57 Status = NtSetDefaultLocale(TRUE, 1); 36 58 ok_ntstatus(Status, STATUS_OBJECT_NAME_NOT_FOUND);
+1 -1
modules/rostests/apitests/ntdll/RtlBitmap.c
··· 603 603 START_TEST(RtlBitmap) 604 604 { 605 605 /* Windows 2003 has broken bitmap code that modifies the buffer */ 606 - if (!IsWindows7OrGreater() && !IsReactOS()) 606 + if (!IsWindowsVistaOrGreater() && !IsReactOS()) 607 607 { 608 608 IsBroken = TRUE; 609 609 }
+6 -6
modules/rostests/apitests/rtl/amd64/RtlCaptureContext.c
··· 124 124 ok_eq_hex(CapturedContext.FltSave.StatusWord, OriginalContext.FltSave.StatusWord); 125 125 ok_eq_hex(CapturedContext.FltSave.TagWord, OriginalContext.FltSave.TagWord); 126 126 ok_eq_hex(CapturedContext.FltSave.Reserved1, 0x00); 127 - ok_eq_hex(CapturedContext.FltSave.MxCsr_Mask, 0xffff); 128 - ok_eq_hex(CapturedContext.FltSave.ErrorOpcode, 0x00000083); 129 - ok_eq_hex(CapturedContext.FltSave.ErrorOffset, 0x00850084); 130 - ok_eq_hex(CapturedContext.FltSave.ErrorSelector, 0x0086); 127 + ok_eq_hex(CapturedContext.FltSave.MxCsr_Mask, 0x2ffff); 128 + ok_eq_hex(CapturedContext.FltSave.ErrorOpcode, 0x0000); 129 + ok_eq_hex(CapturedContext.FltSave.ErrorOffset, 0x00000000); 130 + ok_eq_hex(CapturedContext.FltSave.ErrorSelector, 0x0000); 131 131 ok_eq_hex(CapturedContext.FltSave.Reserved2, 0x0000); 132 - ok_eq_hex(CapturedContext.FltSave.DataOffset, 0x00890088); 133 - ok_eq_hex(CapturedContext.FltSave.DataSelector, 0x008a); 132 + ok_eq_hex(CapturedContext.FltSave.DataOffset, 0x00000000); 133 + ok_eq_hex(CapturedContext.FltSave.DataSelector, 0x0000); 134 134 ok_eq_hex(CapturedContext.FltSave.Reserved3, 0x0000); 135 135 136 136 /* We get the value from OriginalContext.MxCsr, since we set that later in the wrapper */