Commit graph

80100 commits

Author SHA1 Message Date
Timo Kreuzer 7243503916 [HAL] Rename apic.h to apicp.h and move it back to the apic folder 2021-06-17 23:27:44 +02:00
Hermès Bélusca-Maïto 4864c874a2
[NTOS:IOPNP] Both PNP_PROPERTY_REMOVAL_POLICY_OVERRIDE and PNP_PROPERTY_LOCATION_PATHS are unimplemented, return such status.
Fixes CID 1441387: Uninitialized scalar variable (UNINIT),
in the case of PNP_PROPERTY_LOCATION_PATHS.
2021-06-17 00:35:22 +02:00
Hermès Bélusca-Maïto f2645e48b9
[NTOS:IO] Comment out (and explain why it is there) an unused LdrEntry assignment in IopInitializeBootDrivers(). CID 1237114 2021-06-17 00:35:22 +02:00
Hermès Bélusca-Maïto fe416b67dc
[NTOS:IO] Revert part of commit a82ff90b2: don't do direct ULONG data access: it might be unaligned.
Requested by Victor.
2021-06-17 00:35:21 +02:00
Hermès Bélusca-Maïto 32a82eb123
[NTOS:IO] Fix driverName.Buffer leak in some failure paths in IopGetDriverNames().
driverName.Buffer leaked when the "(!NT_SUCCESS(status) || ServiceName != NULL)"
case is taken because ServiceName != NULL, and some of the functions fail.
2021-06-16 22:18:02 +02:00
Hermès Bélusca-Maïto e09d1dec7a
[NTOS:IO] Fix basicInfo handling in IopGetDriverNames().
- Fix CID 1477246: Uninitialized pointer read (UNINIT) (happens in
  the last ExFreePoolWithTag(basicInfo, TAG_IO) call when the
  "(!NT_SUCCESS(status) || ServiceName != NULL)" case is not taken).

- Centralize all the ExFreePoolWithTag(basicInfo, TAG_IO) cleanups
  at the end of the function.

- Both cases "(driverName.Buffer == NULL)" and "(ServiceName != NULL)"
  can only be taken when basicInfo != NULL, so assert on this fact.
2021-06-16 22:18:02 +02:00
Hermès Bélusca-Maïto 0d28f27156
[NTOS:IO] Fix similar bugs in IopGetDriverNames(), IopInitializeBuiltinDriver() and IopLoadDriver().
- As they are initialized, some registry string values must be NULL-terminated.
- When retrieving REG_DWORD registry values, validate their length.
2021-06-16 22:14:01 +02:00
Hermès Bélusca-Maïto a82ff90b21
[NTOS:IO] Minor code style changes...
- Fix/add comments;
- Reduce indentation level;
- Direct copy for registry integer values;
- Use for-loops for linked lists;
- Use ULONG when the API uses it (sizes for Ob, or REG_DWORD data in registry).
2021-06-16 22:14:01 +02:00
Joachim Henze d042f51838 [LDR] Restore Logging when images overlap CORE-17635
This reverts
0.4.13-dev-284-g 74be88ac47

The logging is helpful to alert us when we should really
recalculate the base addresses for performance reasons.
Spams a bit sometimes, sure, but it's worth it!
2021-06-16 13:38:51 +02:00
Victor Perevertkin 3f601122bc [NTOS:MM] Fix placing entries into MmNonPagedPoolFreeListHead
When freeing pages, free page entries with pages num == 3 were
incorrectly treated as entries with pages num >= 4 and thus
their re-insertion was not triggered. That lead to non paged pool
fragmentation (can be triggered by kmtest:ExPools, for example)

Also, altered the index acquisition code for MmNonPagedPoolFreeList
entries so it looks more clear
2021-06-16 12:14:27 +02:00
Joachim Henze a3cadf630a [COMCTL32] Strip EOL whitespace within ifdef __REACTOS__ section
no functional change.
Make that look beautiful before porting it back further.

Addendum to 0.4.15-dev-534-g 887764e607
(CORE-17062)
2021-06-16 11:41:56 +02:00
Joachim Henze d5265b07bb [MSI] Enumerate only type DRIVE_FIXED CORE-17623 (& CORE-14432)
MSI on 2k3sp2 hides empty CD-ROM, and hides CD-ROM with iso mounted.
MSI on 2k3sp2 hides VBox shares, both: writable and read-only-ones.
MSI on 2k3sp2 hides floppy drives with a floppy img mounted.
MSI on XPSP3 hides a mounted writable USB stick.

Thanks to the patches author Doug Lyons.

This patch supersedes
0.4.15-dev-2651-g 864e20b881 (CORE-14432)
and we are also better than Wines
0dd0d879a1
2021-06-13 15:30:49 +02:00
Victor Perevertkin 05fb0f1c39
[GITIGNORE] Add compile_commands.json and .cache folder for clangd cache 2021-06-13 01:55:52 +03:00
Adam Słaboń 9764fde2d9 [WIN32K] Add x64/arm exports
Checked against Windows XP x64 and Windows 8 ARM.
2021-06-12 14:11:14 +02:00
Victor Perevertkin 34593d933b
[FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
Hermès Bélusca-Maïto 4b4ffa92f5
[NTOS:IO] Modify when 'PartitionBuffer' and how 'DriveLayout' are freed in IopCreateArcNamesDisk().
- Manage the lifetime of the temporary 'PartitionBuffer' buffer where
  it is locally used only, and free it as soon as possible, just after
  calculating the sector checksum. No need to then free it outside of
  the main for-loop.

- When the 'DriveLayout' buffer is freed, ensure the pointer is NULL-ed
  (and assert this at the top of the main for-loop), since it can also
  be freed at cleanup outside this for-loop, and in this case a NULL
  check is performed.
  This will avoid the scenario of possibly double-freeing a pointer,
  in the case the 'DriveLayout' was previously freed (when e.g. reading
  the sector for checksum calculation failed), then the for-loop goes to
  the next disk and stops early.
2021-06-11 02:21:48 +02:00
Hermès Bélusca-Maïto fdd74eb97e
[NTOS:IO/FSTUB] Fix the determination of 'SingleDisk' in IoGetBootDiskInformation().
The purpose of 'SingleDisk' is the same as in the IopCreateArcNames()
function. It is an optimization for that when looking up the
firmware-recognized ARC disks list, in order to match one of these with
the current NT disk being analysed (see e.g. also in IopCreateArcNamesDisk()),
we avoid a possible IopVerifyDiskSignature() call and directly build a
corresponding ARC name NT symbolic link for it.

'SingleDisk' will actually be TRUE, whether the DiskSignatureListHead
list is empty or contains only one element: Indeed in only both these
cases, 'DiskSignatureListHead.Flink->Flink' will refer to the list head.
(If the list is empty but 'SingleDisk' is TRUE, this does not matter,
because the DiskSignatureListHead looking-up loop never starts.)
2021-06-11 02:21:47 +02:00
Hermès Bélusca-Maïto 99078646c3
[NTOS:IO] Avoid hardcoding variable types in sizeofs when possible. 2021-06-11 02:21:47 +02:00
Hermès Bélusca-Maïto 6e65e6b28d
[NTOS:IO] Minor code style fixes (typos; improve comments/DPRINT; IN vs. OUT parameter). 2021-06-11 02:21:47 +02:00
Katayama Hirofumi MZ afd349a93e
[SHELL32_APITEST] Improve ShellExecCmdLine testcase more (#3736)
- Simplify code.
- Loose the condition of success.
- Add some missing tests.
- Close newly opened windows gracefully.
CORE-17351, CORE-16898, CORE-17612
2021-06-11 08:09:18 +09:00
Serge Gautherie c2317d773e [CMAKE] host-tools: Define ROS_SAVED_* for MSVC_IDE only
Addendum to 18e95f5.
ROSBE-174
2021-06-11 02:08:12 +03:00
Oleg Dubinskiy 6e29107f31 [SOUNDS] Add new Recycle Bin system sound
Add new sound for Recycle Bin sound event.
Since this sound event is now working properly after some fixes in shell32 code, it's now possible for user to set the sound for this sound event manually.
But don't enable it by default, since it is also disabled on Windows Server 2003.
CORE-15868
2021-06-11 02:06:11 +03:00
Mark Jansen 675edad96f
[RAPPS] Fix double free when closing rapps 2021-06-10 21:25:34 +02:00
Timo Kreuzer 9229e73f03 [HIDPARSER] Don't include pshpack1.h before including other headers
NEVER DO THIS! It is guaranteed to be wrong. Instead always individually pack single structures that need packing.
This fixes USB mouse on 64 bit builds.
2021-06-10 08:52:22 +02:00
Hermès Bélusca-Maïto 2dbbfe86ab
[MORE] Use positional elements to build the MORE prompt, whose state is controlled by flags. 2021-06-10 04:10:55 +02:00
Hermès Bélusca-Maïto 558908e709
[MORE] Update and complete MORE's help usage.
And add french translation.
2021-06-10 02:36:12 +02:00
Jérôme Gardou e70df4c633 [WIN32K:ENG] In EngLockDriverObj, properly return NULL when locking failed
CORE-15958
2021-06-09 18:27:12 +02:00
Katayama Hirofumi MZ b552901df5
[MORE][CONUTILS] Implement missing features of the MORE command (#3658)
Implement missing features of the MORE command. Special thanks to @HBelusca. CORE-4019
2021-06-09 23:30:30 +09:00
Jérôme Gardou afc27ab1aa [NTOS:MM] Handle PT references for page table faults in MmAccessFault
Idea from Timo Kreuzer
2021-06-09 11:27:18 +02:00
Jérôme Gardou c7e09061ca [NTOS:MM] Get rid of MiQueryPageTableReferences 2021-06-09 11:27:18 +02:00
Timo Kreuzer 6a2eeaa5ae [NTOS] Implement MiIsPageTablePresent as a replacement for the abused MiQueryPageTableReferences 2021-06-09 11:27:18 +02:00
Jérôme Gardou 678923bf4b [NTOS:MM] In MiMakePdeExistAndValid, do not overly check PDE validity
It's "okay" to not #ifdef, but it's useless and confusing.
2021-06-09 11:27:18 +02:00
Jérôme Gardou c8fb3f7514 [NTOS:MM] Implement proper refcounting of page tables on amd64
CORE-17552
2021-06-09 11:27:18 +02:00
Jérôme Gardou 3aa346c21f [NTOS:MM] Make MiIsEntireRangeCommitted 64-bits aware 2021-06-09 11:27:18 +02:00
Jérôme Gardou 8bfba59b3e [NTOS:MM] Add some DPRINTs when incrementing or decrementing PFN share count 2021-06-09 11:27:18 +02:00
Jérôme Gardou a80ae8f2ea [NTOS:MM] Make MiCalculatePageCommitment 64-bits aware 2021-06-09 11:27:18 +02:00
Jérôme Gardou b48e27ada1 [NTOS:MM] Add a few MiP*eToP*e helpers
And turn some of the existing ones into inline functions for the sake of type checking
2021-06-09 11:27:18 +02:00
Jérôme Gardou ed1038ff9c [NTOS:MM] Properly initialize initial process address space on amd64
By applying the same kludge on the relevant MMPFNs than on x86
2021-06-09 11:27:18 +02:00
Jérôme Gardou f9ea58dc97 [NTOS:MM] Unconditionally delete the PFN in MiDeletePte when PTE is in transition
When we will have a modified page writer, it will have to know if the written
page is stale when being done, and act accordingly.

CORE-8552
2021-06-09 11:27:18 +02:00
Jérôme Gardou 82dd1afe33 [NTOS:MM] Remove some dead code from legacy Mm 2021-06-09 11:27:18 +02:00
Jérôme Gardou 521d330d04 [CMD] Use GetFullPathName instead of copying buffers when resolving executable names
This properly strips spaces & dots at the end of the file.

Fixes the infinite loop with CreateProcess calling cmd over and over with e.g. 'cmd /c "some_script.bat   "'
Uncovered by recent ShellExecuteEx tests
Dedicated to Katayama for the trigger & Hermès for the tests
2021-06-09 11:23:39 +02:00
Katayama Hirofumi MZ 94d9e9c2a8
[USER32_APITEST] Add SetFocus testcase (#3732)
Investigate about setting keyboard focus. CORE-17550
2021-06-09 16:14:31 +09:00
Victor Perevertkin d220ea3e3c
[HIVESYS] Use "Primary Disk" writing for this driver load order group 2021-06-08 17:29:47 +03:00
George Bișoc 7ca6bfb994
[NTOS:SE] Use IQS_NONE for the first class which is not existent and barely used 2021-06-08 09:26:11 +02:00
George Bișoc 672c9068bb
[NTOS:PS] Use IQS_NONE for classes that do not exist 2021-06-08 09:26:11 +02:00
George Bișoc bbdb4d6340
[NTOSKRNL] Use CHAR for non existent classes
An alignment of 1 means no alignment required and the class doesn't exist. 0 shouldn't be used for alignment requirement in IQS_NONE!
2021-06-08 09:25:30 +02:00
Katayama Hirofumi MZ c35a84985a
[SHELL32_APITEST] Strengthen ShellExecuteEx testcase (#3731)
Investigate shell32!ShellExecuteEx function more. CORE-17351, CORE-16898, CORE-17612
2021-06-08 08:07:37 +09:00
Jérôme Gardou a5ea259b28 [NTOS:MM] Fix remnants of CORE-17587 2021-06-07 17:04:18 +02:00
Jérôme Gardou 4ddc66f224 [NTOS:MM] Make MI_MAKE_HARDWARE_PTE_KERNEL actually respect the protection it is given
This one would set a page as writable & dirty even if MM_READONLY was passed
CORE-17587
2021-06-07 17:04:18 +02:00
Katayama Hirofumi MZ 46c84779b6 [CPL][APPWIZ] Follow-up of #3726
Sorry, #3726 doesn't fix CORE-5737. CORE-17550
2021-06-07 18:03:49 +09:00