Commit graph

80824 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 2693a26e3e
[NTVDM] Create the CMOS ram file in NTVDM's own directory, instead of in whatever current directory we are running.
This fixes the age-long annoyance that wherever you ran a DOS program
with NTVDM, its cmos.ram file would be created in the same current
directory the DOS program was being started.

This created at least two problems:
- useless pollution of directories with cmos.ram files;
- for installers, e.g. of Turbo C 1.x that enumerate the install files
  from their directories to be copied/extracted somewhere, the cmos.ram
  file could then be enumerated along and cause the installation to
  interrupt and/or fail.

Now the cmos.ram file is created in the same directory NTVDM resides
(usually in System32...).
Also, debug-print out only loading errors instead of successes as well.
2021-11-28 00:26:46 +01:00
Hermès Bélusca-Maïto e0a272c95b
[NTVDM] DosCreateProcess(): Add failure checks when building the OTVDM command-line.
Addendum to commit 0609db55
2021-11-28 00:26:46 +01:00
Hermès Bélusca-Maïto 1bd0e3f9f9
[NTVDM] Retrieve the full directory of the current running NTVDM instance, to be used as a base path for opening other NTVDM system files. 2021-11-28 00:26:45 +01:00
Hermès Bélusca-Maïto 86eebc2a31
[NTVDM] disk.c: Simplify some code; unmount only present disks during cleanup (avoids useless debug-print errors). 2021-11-28 00:26:45 +01:00
Hermès Bélusca-Maïto 6823878a02
[NTVDM] Sort out some global/emulator header info, and NDK headers inclusions. 2021-11-28 00:26:44 +01:00
Hermès Bélusca-Maïto 695900f51f
[NTVDM] Silence noisy DPRINTs when starting processes; they can be re-enabled by recompiling in "advanced debugging" mode. 2021-11-28 00:26:43 +01:00
Hermès Bélusca-Maïto b849a696ef
[NTVDM] In non-STANDALONE builds, check whether we are started as a VDM and bail out if not. 2021-11-28 00:26:43 +01:00
Hermès Bélusca-Maïto d6d30f9e05
[KERNEL32] Don't hardcode some types in sizeofs, and some flag values. 2021-11-28 00:26:42 +01:00
James Tabor 993eb07654 [User32|API_TEST] Add Get Window Ptr Test
Adding test to verify results from a foreign window process.
See CORE-17856.
2021-11-27 14:47:11 -06:00
James Tabor 9cff384c22 [User32] Add Back Break with Error Message
Add back missing break. See CORE-17856.
2021-11-27 11:35:42 -06:00
Stanislav Motylkov 1897f9f0c0
[FREELDR] Fix release builds for PC-98 and Xbox platforms
Fix error C4013: 'DebugDisableScreenPort' undefined; assuming extern returning int

Addendum to 98c17d31. CORE-16216
2021-11-27 20:22:09 +03:00
Doug Lyons 0609db55d7
[NTVDM] Use strsafe functions for concantenation of strings in otvdm code. (#4124) 2021-11-25 21:06:05 +01:00
Eric Kohl 990ba54537 [NTOS:LPC] NtReplyWaitReceivePortEx returns the correct TotalLength for connect messages
This fixes the NtAcceptConnectPort apitest.
2021-11-24 18:59:16 +01:00
James Tabor a89844f740 [User32] Fix Copy Paste
Pointed out by otya. See CORE-17856.
2021-11-24 09:36:50 -06:00
Eric Kohl 07e19a5e09 [NTOS:IO] Fail, if io completion port and an apc routine are used at the same time
Add checks to NtNotifyChangeDirectoryFile, NtLockFile, NtReadFile and NtWriteFile.
This fixes two ntdll tests.
2021-11-24 13:34:26 +01:00
Jose Carlos Jesus b3c6407d6e
[SYSSETUP][USETUP] [NLS] Update pt-PT translation (#4120)
- NLS: Change weekdays name to capital letter.
- USETUP: Fix typos to pt-PT translation.

- SYSSETUP: Update pt-PT translation.
  + Sync IDS_USER_ADMINISTRATOR_NAME and IDS_ADMINISTRATOR_NAME (in samsrv).
2021-11-24 01:57:11 +01:00
Doug Lyons 0f05abec82
[NTVDM] Add otya128's WineVDM integration code into ReactOS (#4113)
This is an interim solution until a more integrated solution with NTVDM is developed.
CORE-17852
2021-11-23 23:50:05 +01:00
Denis Malikov db810d8e44
[WIN32SS:NTUSER] Fix window state after restoring snapped window (#4119)
InternalPos.NormalRect is a key data for detecting whether a window was snapped.
Keeping it after restore affecting next snap actions.

CORE-16477
2021-11-23 23:34:03 +01:00
Hermès Bélusca-Maïto 6a4ca215ab
[NTVDM] Log the command line used when starting NTVDM. 2021-11-22 03:10:14 +01:00
Doug Lyons b538b9abb8
[WIN32K] Fix 'use after free' in NtGdiStretchDIBitsInternal (#4122)
CORE-17861
2021-11-22 02:57:36 +01:00
Hermès Bélusca-Maïto f766ca5e42
[SMSS] Use NULL for NULL pointers. 2021-11-22 00:16:32 +01:00
Hermès Bélusca-Maïto c17aeec031
[CSRSRV] Update the status.h file with updated information. 2021-11-22 00:13:35 +01:00
Hermès Bélusca-Maïto 7353af1e3d
[NTDLL:CSR][CSRSRV] Start to deprecate CSR functions removed on Windows 2003.
The server-side CsrSrvIdentifyAlertableThread and CsrSrvSetPriorityClass
functions are completely removed in Win2k3+, and are since stubbed by
CsrSrvUnusedFunction instead. They however were present up to Windows XP,
albeit with an extremely minimal implementation.

The corresponding client-side CsrIdentifyAlertableThread and CsrSetPriorityClass
now become just stubs that either trivially succeed or fail, respectively.

See https://www.geoffchappell.com/studies/windows/win32/csrsrv/api/srvinit/apidispatch.htm
for more information.

- Fix typo "al*T*ertable" --> "alertable".
- Remove ROS-specific CSRSS_IDENTIFY_ALERTABLE_THREAD that was
  deprecated since ages (at least before 2005)!
2021-11-22 00:13:34 +01:00
Hermès Bélusca-Maïto d575e828d7
[NTDLL_APITEST] Test that NtQueryInformationProcess(ProcessWx86Information) can work without a ReturnLength pointer. 2021-11-22 00:13:33 +01:00
Thomas Faber 88e3ef5fa0
[NTOS:SE] Don't assert on levels that don't allow impersonation. 2021-11-21 17:19:03 -05:00
Eric Kohl 3e5dcf7937 [NTOS:EX] Fix version specific return value for NtSetSystemInformation:SystemFlagsInformation 2021-11-21 21:42:04 +01:00
Serge Gautherie de33036766
[RICHED20] select_style(): Check font_cache too
Already upstreamed as wine-6.21-347-g177f808.

CORE-17843
2021-11-21 13:07:59 -05:00
Thomas Faber d84022d7fd
[NTOS:SE] Fix always-true assert in SeTokenCanImpersonate.
Courtesy of VS analysis warning C6289:
Incorrect operator:  mutual exclusion over || is always a non-zero constant.  Did you intend to use && instead?
2021-11-21 12:57:50 -05:00
Thomas Faber 0af3689c2e
[REACTOS] Fix traces with missing arguments.
Courtesy of VS Code Analysis warning C6064:
Missing integer argument to 'DbgPrint' that corresponds to conversion specifier 'N'.
2021-11-21 12:57:35 -05:00
Thomas Faber a7b2703479
[NTOS] Fix broken SAL annotations on MmDereferenceSegmentWithLock. 2021-11-21 12:47:46 -05:00
Thomas Faber 2e76fb9fe1
[NTOS:IO] Use a guarded region in IopQueueIrpToThread.
We're protecting against IopCompleteRequest, which is a special
kernel APC. So this is a little bit faster than raising the IRQL.
2021-11-20 14:58:51 -05:00
Serge Gautherie 8d10682307 [CONFIGURE] Add support for 'Visual Studio 2022, v17.x'
CORE-17733
2021-11-20 12:14:32 +03:00
Julio Carchi 9c4397afdf
[USER32] GetQueueStatus() should not return 0 when passing QS_ALLINPUT flag that includes QS_RAWINPUT (#4115)
GTK applications call GetQueueStatus(QS_ALLINPUT), where QS_ALLINPUT
specifies the QS_RAWINPUT flag as well, when these are compiled for
Windows XP+, and they expect the call to succeed on this platform.

On one side, ReactOS does not currently support this flag at all, but
since it claims to be XP/2003-compatible, applications may implicitly
expect the flag to be supported by GetQueueStatus() and the function
*NOT* failing when this flag is set.
(Later GTK apps don't care and just call GetQueueStatus(QS_ALLINPUT)
that includes QS_RAWINPUT, and therefore would fail as well on e.g.
Windows 2000...)

Otherwise, an observable effect is that some versions of libgdk-win32-2.0.0.dll
enter into an infinite loop when calling GetQueueStatus(QS_ALLINPUT),
since this call always failed on ReactOS.

On the other side, however, we should honour our winetests that handle
the presence of the QS_RAWINPUT flag and behave differently accordingly.
But since we do not support QS_RAWINPUT yet, we should keep their old
behaviour where QS_RAWINPUT is unused.

Thus, in order to accomodate both sides, we don't fail the GetQueueStatus()
call, but just set the ERROR_INVALID_FLAGS last error and continue it.


This fixes CORE-15686, CORE-17551 and probably CORE-11850.
Fixes also all user32:TrackMouseEvent tests.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2021-11-20 00:45:35 +01:00
Hermès Bélusca-Maïto 7c8c9e1aba
[WINSPOOL] QS_SENDMESSAGE|QS_ALLEVENTS == QS_ALLINPUT, so use the latter instead. 2021-11-19 21:13:26 +01:00
Hermès Bélusca-Maïto d78a5b6dbf
[PSDK] Sort out the QS_*** definitions. Add the Win7+ QS_TOUCH and QS_POINTER.
In particular, define the compound QS_MOUSE, QS_INPUT, QS_ALLEVENTS
and QS_ALLINPUT flags based on the other elementary QS_*** flags,
instead of having magic values for these.
2021-11-19 18:23:57 +01:00
Serge Gautherie 48d1ecc4df
[PSDK] Unduplicate QS_RAWINPUT (#4116)
Addendum to a7bf412a (r38925).
2021-11-19 17:56:44 +01:00
George Bișoc 009f2c3917
[CODEOWNERS] Add myself as maintainer for Security Manager
From now on I'll take care of this subsystem of the kernel.
2021-11-19 12:01:19 +01:00
Hermès Bélusca-Maïto 2b31977838
[FREELDR] Add RegCloseKey() and use it where registry keys need to be closed.
Actually, RegCloseKey() is here a dummy macro that just "returns"
success. Indeed, the internal implementation of RegOpenKey() doesn't
really allocate internal structures: it just returns a "pointer" to
already existing allocated data. Therefore nothing needs to be closed/freed
later on.
2021-11-19 03:55:21 +01:00
Hermès Bélusca-Maïto 60d4a34892
[FREELDR] Switch to RtlZeroMemory() from memset(). 2021-11-19 02:22:20 +01:00
Hermès Bélusca-Maïto 497fee1622
[FREELDR] Don't hardcode buffer size. 2021-11-19 02:22:18 +01:00
Hermès Bélusca-Maïto 5cad040726
[FDEBUG] Switch to ZeroMemory() from memset(). 2021-11-19 02:22:15 +01:00
Serge Gautherie c5e5e3117c
[FREELDR] Diverse improvements and fixes for CORE-12802. (#3466)
- Move a few lines around.
- Switch to RtlZeroMemory() from memset().
- Make while() more explicit.

For CORE-12802:
- Add/Fix FrLdrHeapAlloc() failure handling and related.
  Especially, add/fix FrLdrHeapFree() calls.

- Add/Improve ERR() to some FrLdrHeapAlloc() failure cases.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2021-11-19 01:49:55 +01:00
Serge Gautherie 0a6750da12
[CRT] stdio/file.c: Import 3 Wine one-liner fixes (#4101)
* [FORMATTING][CRT] stdio/file.c: Reduce diff with Wine.

* [CRT] _wfreopen(): Fix TRACE() format modifier
Import wine-1.4-rc3 f8b29a0 by Eric Pouech.

* [CRT] msvcrt_init_io(): Ignore inherited FDs with invalid handles
Import wine-6.2-32-g611742d by Paul Gofman,
except test part, which shall be WineSync separately.

* [CRT] _dup2(): Fix clearing NOINHERIT flag
Import wine-6.20-44-g1420d28 by Piotr Caban.
2021-11-18 23:23:12 +01:00
Scott Maday 83335d3a81
[SHELL32] Control panel context menu semantic bugfix (#4078) 2021-11-18 22:41:53 +01:00
Hermès Bélusca-Maïto 712f469671
[NTOS:EX] Clarify the situation with the SystemPathInformation class. (#4065)
Since NT 3.51, this information class is trivially implemented.
The path to the NT directory is now stored in KUSER_SHARED_DATA
as the NtSystemRoot member.
Windows Checked builds show the following message and break to
the debugger before failing the function as not implemented:

EX: SystemPathInformation now available via SharedUserData

See https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/sysinfo/query.htm
and https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntexapi_x/kuser_shared_data/index.htm
for more information.
2021-11-18 22:37:54 +01:00
Hermès Bélusca-Maïto 1200561fcc
[NTOS:EX] NtQuerySystemInformation: Use same parameter names as documentation. FStatus --> Status. (#4064) 2021-11-18 22:36:07 +01:00
Hermès Bélusca-Maïto d484a68ccb
[NDK][NTOS:EX] Add/fix SAL annotations for Nt/ZwSetSystemInformation + last parameter type. (#4064) 2021-11-18 22:36:07 +01:00
Hermès Bélusca-Maïto 7692a620e7
[NDK][NTOS:EX] Minor formatting. 2021-11-18 22:36:06 +01:00
Chan Chilung d2382e78ef
[BOOTDATA] Update some time zones for East Europe (#4029)
- Remove Minsk from GMT+02:00 (is now GMT+03:00)
- Change description for all GMT+02:00 time zones
- Add Turkey time GMT+03:00

CORE-12025
2021-11-18 13:26:06 +03:00
Katayama Hirofumi MZ 0f5fb4785b
[SHELL32] Drop a shortcut of the drive (#4072)
- If the Right-dropped item was a drive, then get the display name of the drive and use it.
- Use FAILED_UNEXPECTEDLY instead of FAILED macro.
- Accept ::{GUID}.
CORE-17813
2021-11-18 17:11:24 +09:00