ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2021
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
97 discussions
Start a n
N
ew thread
[reactos] 01/01: [EXPLORER] Fix for Start Button Wrong size when Using Themes (#4121) CORE-16742
by Doug Lyons
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=67ad4e7f60ec52691d0a8…
commit 67ad4e7f60ec52691d0a8b017e3d23b1d889b656 Author: Doug Lyons <douglyons(a)douglyons.com> AuthorDate: Tue Nov 30 15:48:46 2021 -0600 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Nov 30 22:48:46 2021 +0100 [EXPLORER] Fix for Start Button Wrong size when Using Themes (#4121) CORE-16742 The problem once was unhidden by 0.4.7-dev-705-g 85ae8421055f51eac48cb3d8acce47a7cd715982 --- base/shell/explorer/traywnd.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp index e14e805b8f7..2b69e48bb02 100644 --- a/base/shell/explorer/traywnd.cpp +++ b/base/shell/explorer/traywnd.cpp @@ -1562,7 +1562,7 @@ ChangePos: else { WndSize.cx = StartBtnSize.cx; - WndSize.cy = StartBtnSize.cy - EdgeSize.cx; + WndSize.cy = StartBtnSize.cy - EdgeSize.cy; } if (WndSize.cx < g_TaskbarSettings.sr.Size.cx) @@ -1628,14 +1628,13 @@ ChangePos: if (StartSize.cx > rcClient.right) StartSize.cx = rcClient.right; - if (!m_Theme) + HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD); + if (hwndTaskToolbar) { - HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD); - if (hwndTaskToolbar) - { - DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0); - StartSize.cy = HIWORD(size); - } + DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0); + + /* Themed button covers Edge area as well */ + StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0); } if (m_StartButton.m_hWnd != NULL)
3 years
1
0
0
0
[reactos] 01/01: [RICHED20] Fail elegantly if pRow or pPara is NULL on ME_EnsureVisible (#4126)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=915569a8dee35a1d8af3b…
commit 915569a8dee35a1d8af3bf9fab96096b320e2403 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Nov 28 22:23:04 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Nov 28 22:23:04 2021 +0900 [RICHED20] Fail elegantly if pRow or pPara is NULL on ME_EnsureVisible (#4126) CORE-16578 --- dll/win32/riched20/paint.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dll/win32/riched20/paint.c b/dll/win32/riched20/paint.c index 72128072380..05be17e24c5 100644 --- a/dll/win32/riched20/paint.c +++ b/dll/win32/riched20/paint.c @@ -1279,8 +1279,13 @@ void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor) ME_DisplayItem *pPara = pCursor->pPara; int x, y, yheight; +#ifdef __REACTOS__ + if (!pRow || !pPara) + return; +#else assert(pRow); assert(pPara); +#endif if (editor->styleFlags & ES_AUTOHSCROLL) {
3 years
1
0
0
0
[reactos] 08/08: [NTVDM] Create the CMOS ram file in NTVDM's own directory, instead of in whatever current directory we are running.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2693a26e3e9ae7cf22b96…
commit 2693a26e3e9ae7cf22b96da7391612df80b14be7 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Nov 26 20:13:58 2021 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Nov 28 00:26:46 2021 +0100 [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. --- subsystems/mvdm/ntvdm/hardware/cmos.c | 121 ++++++++++++++++++++++++---------- subsystems/mvdm/ntvdm/ntvdm.h | 5 ++ 2 files changed, 93 insertions(+), 33 deletions(-) diff --git a/subsystems/mvdm/ntvdm/hardware/cmos.c b/subsystems/mvdm/ntvdm/hardware/cmos.c index 8482553c08e..60abb6ffef9 100644 --- a/subsystems/mvdm/ntvdm/hardware/cmos.c +++ b/subsystems/mvdm/ntvdm/hardware/cmos.c @@ -22,6 +22,8 @@ /* PRIVATE VARIABLES **********************************************************/ +#define CMOS_RAM_FILE "cmos.ram" + static HANDLE hCmosRam = INVALID_HANDLE_VALUE; static CMOS_MEMORY CmosMemory; @@ -438,41 +440,88 @@ BOOLEAN IsNmiEnabled(VOID) return NmiEnabled; } +static inline BOOL +CmosWriteFile( + _In_ HANDLE FileHandle, + _In_ PVOID Buffer, + _In_ ULONG BufferSize, + _Out_opt_ PULONG BytesWritten) +{ + BOOL Success; + ULONG Written; + + SetFilePointer(FileHandle, 0, NULL, FILE_BEGIN); + Success = WriteFile(FileHandle, Buffer, BufferSize, &Written, NULL); + if (BytesWritten) + *BytesWritten = (Success ? Written : 0); + return Success; +} + VOID CmosInitialize(VOID) { - DWORD CmosSize = sizeof(CmosMemory); + BOOL Success; + WCHAR CmosPath[_countof(NtVdmPath) + _countof("\\" CMOS_RAM_FILE)]; - /* File must not be opened before */ + /* CMOS file must not be opened before */ ASSERT(hCmosRam == INVALID_HANDLE_VALUE); + /* Always open (and if needed, create) a RAM file with shared access */ + Success = NT_SUCCESS(RtlStringCbPrintfW(CmosPath, + sizeof(CmosPath), + L"%s\\" L(CMOS_RAM_FILE), + NtVdmPath)); + if (!Success) + DPRINT1("Could not create CMOS file path!\n"); + + if (Success) + { + SetLastError(ERROR_SUCCESS); + hCmosRam = CreateFileW(CmosPath, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + Success = (hCmosRam != INVALID_HANDLE_VALUE); + if (!Success) + DPRINT1("CMOS opening failed (Error: %u)\n", GetLastError()); + } + /* Clear the CMOS memory */ RtlZeroMemory(&CmosMemory, sizeof(CmosMemory)); - /* Always open (and if needed, create) a RAM file with shared access */ - SetLastError(0); // For debugging purposes - hCmosRam = CreateFileW(L"cmos.ram", - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - DPRINT1("CMOS opening %s (Error: %u)\n", hCmosRam != INVALID_HANDLE_VALUE ? "succeeded" : "failed", GetLastError()); - - if (hCmosRam != INVALID_HANDLE_VALUE) + /* Load the file only if it already existed and was opened, not newly created */ + if (Success) { - BOOL Success; - - /* Attempt to fill the CMOS memory with the RAM file */ - SetLastError(0); // For debugging purposes - Success = ReadFile(hCmosRam, &CmosMemory, CmosSize, &CmosSize, NULL); - if (CmosSize != sizeof(CmosMemory)) + if ((GetLastError() == ERROR_ALREADY_EXISTS) /* || (GetLastError() == ERROR_FILE_EXISTS) */) + { + /* Attempt to load the CMOS memory from the RAM file */ + DWORD CmosSize = sizeof(CmosMemory); + Success = ReadFile(hCmosRam, &CmosMemory, CmosSize, &CmosSize, NULL); + if (!Success) + { + DPRINT1("CMOS loading failed (Error: %u)\n", GetLastError()); + } + else if (CmosSize != sizeof(CmosMemory)) + { + /* Invalid CMOS RAM file; reinitialize the CMOS memory */ + DPRINT1("Invalid CMOS file, read %u bytes, expected %u bytes\n", + CmosSize, sizeof(CmosMemory)); + Success = FALSE; + } + if (!Success) + { + /* Reset the CMOS memory and its RAM file */ + RtlZeroMemory(&CmosMemory, sizeof(CmosMemory)); + CmosWriteFile(hCmosRam, &CmosMemory, sizeof(CmosMemory), NULL); + } + } + else { - /* Bad CMOS RAM file. Reinitialize the CMOS memory. */ - DPRINT1("Invalid CMOS file, read bytes %u, expected bytes %u\n", CmosSize, sizeof(CmosMemory)); - RtlZeroMemory(&CmosMemory, sizeof(CmosMemory)); + /* Reset the CMOS RAM file */ + CmosWriteFile(hCmosRam, &CmosMemory, sizeof(CmosMemory), NULL); } - DPRINT1("CMOS loading %s (Error: %u)\n", Success ? "succeeded" : "failed", GetLastError()); SetFilePointer(hCmosRam, 0, NULL, FILE_BEGIN); } @@ -518,19 +567,25 @@ VOID CmosInitialize(VOID) VOID CmosCleanup(VOID) { - DWORD CmosSize = sizeof(CmosMemory); - - if (hCmosRam == INVALID_HANDLE_VALUE) return; - DestroyHardwareTimer(PeriodicTimer); DestroyHardwareTimer(ClockTimer); - /* Flush the CMOS memory back to the RAM file and close it */ - SetFilePointer(hCmosRam, 0, NULL, FILE_BEGIN); - WriteFile(hCmosRam, &CmosMemory, CmosSize, &CmosSize, NULL); + if (hCmosRam != INVALID_HANDLE_VALUE) + { + /* Flush the CMOS memory back to the RAM file and close it */ + BOOL Success; + DWORD CmosSize = sizeof(CmosMemory); - CloseHandle(hCmosRam); - hCmosRam = INVALID_HANDLE_VALUE; + Success = CmosWriteFile(hCmosRam, &CmosMemory, CmosSize, &CmosSize); + if (!Success || (CmosSize != sizeof(CmosMemory))) + { + DPRINT1("CMOS saving failed (Error: %u), written %u bytes, expected %u bytes\n", + GetLastError(), CmosSize, sizeof(CmosMemory)); + } + + CloseHandle(hCmosRam); + hCmosRam = INVALID_HANDLE_VALUE; + } } /* EOF */ diff --git a/subsystems/mvdm/ntvdm/ntvdm.h b/subsystems/mvdm/ntvdm/ntvdm.h index b3876fb9a98..1c99f2a0011 100644 --- a/subsystems/mvdm/ntvdm/ntvdm.h +++ b/subsystems/mvdm/ntvdm/ntvdm.h @@ -44,6 +44,11 @@ #define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0])) #endif +/* String widening macro */ +#define __L(x) L ## x +#define _L(x) __L(x) +#define L(x) _L(x) + /* PSDK/NDK Headers */ #define WIN32_NO_STATUS #include <windef.h>
3 years
1
0
0
0
[reactos] 07/08: [NTVDM] DosCreateProcess(): Add failure checks when building the OTVDM command-line.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e0a272c95b910b64c5a18…
commit e0a272c95b910b64c5a18310ea3e90335c3dbf75 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Nov 27 02:07:04 2021 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Nov 28 00:26:46 2021 +0100 [NTVDM] DosCreateProcess(): Add failure checks when building the OTVDM command-line. Addendum to commit 0609db55 --- subsystems/mvdm/ntvdm/dos/dos32krnl/process.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c b/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c index b12bd60ee22..a66cf1656d7 100644 --- a/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c +++ b/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c @@ -13,7 +13,6 @@ #define NDEBUG #include <debug.h> -#include <strsafe.h> #include "emulator.h" #include "cpu/cpu.h" @@ -811,12 +810,25 @@ WORD DosCreateProcess(IN LPCSTR ProgramName, STARTUPINFOA si; PROCESS_INFORMATION pi; + union { DWORD Size; NTSTATUS Status; } Ret; CHAR ExpName[MAX_PATH]; - ExpandEnvironmentStringsA(AppName, ExpName, ARRAYSIZE(ExpName) - 1); - StringCbCatA(ExpName, sizeof(ExpName), "\""); // Add double-quote before ProgramName - StringCbCatA(ExpName, sizeof(ExpName), ProgramName); // Append Program name - StringCbCatA(ExpName, sizeof(ExpName), "\""); // Add double-quote after ProgramName + Ret.Size = ExpandEnvironmentStringsA(AppName, ExpName, _countof(ExpName)); + if ((Ret.Size == 0) || (Ret.Size > _countof(ExpName))) + { + /* We failed or buffer too small, fall back to DOS execution */ + goto RunAsDOS; + } + Ret.Size--; // Remove NULL-terminator from count + + /* Add double-quotes before and after ProgramName */ + Ret.Status = RtlStringCchPrintfA(ExpName + Ret.Size, _countof(ExpName) - Ret.Size, + "\"%s\"", ProgramName); + if (!NT_SUCCESS(Ret.Status)) + { + /* We failed or buffer too small, fall back to DOS execution */ + goto RunAsDOS; + } ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&si, sizeof(si)); @@ -842,7 +854,7 @@ WORD DosCreateProcess(IN LPCSTR ProgramName, else { /* Retrieve the actual path to the "Program Files" directory for displaying the error */ - ExpandEnvironmentStringsA("%ProgramFiles%", ExpName, ARRAYSIZE(ExpName) - 1); + ExpandEnvironmentStringsA("%ProgramFiles%", ExpName, _countof(ExpName)); DisplayMessage(L"Trying to load '%S'.\n" L"WOW16 applications are not supported internally by NTVDM at the moment.\n" @@ -852,6 +864,7 @@ WORD DosCreateProcess(IN LPCSTR ProgramName, } // Fall through } + RunAsDOS: case SCS_DOS_BINARY: { /* Load the executable */
3 years
1
0
0
0
[reactos] 06/08: [NTVDM] Retrieve the full directory of the current running NTVDM instance, to be used as a base path for opening other NTVDM system files.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1bd0e3f9f96e255a56e1c…
commit 1bd0e3f9f96e255a56e1c1d9f5c6e57c22878759 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Nov 27 21:03:55 2021 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Nov 28 00:26:45 2021 +0100 [NTVDM] Retrieve the full directory of the current running NTVDM instance, to be used as a base path for opening other NTVDM system files. --- subsystems/mvdm/ntvdm/ntvdm.c | 52 +++++++++++++++++++++++++++++++++++++++++-- subsystems/mvdm/ntvdm/ntvdm.h | 10 +++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/subsystems/mvdm/ntvdm/ntvdm.c b/subsystems/mvdm/ntvdm/ntvdm.c index bedc20ea7ea..5214d81e7c8 100644 --- a/subsystems/mvdm/ntvdm/ntvdm.c +++ b/subsystems/mvdm/ntvdm/ntvdm.c @@ -31,6 +31,10 @@ NTVDM_SETTINGS GlobalSettings; INT NtVdmArgc; WCHAR** NtVdmArgv; +/* Full directory where NTVDM resides, or the SystemRoot\System32 path */ +WCHAR NtVdmPath[MAX_PATH]; +ULONG NtVdmPathSize; // Length without NULL terminator. + /* PRIVATE FUNCTIONS **********************************************************/ static NTSTATUS @@ -476,6 +480,8 @@ PrintMessageAnsi(IN CHAR_PRINT CharPrint, INT wmain(INT argc, WCHAR *argv[]) { + BOOL Success; + #ifdef STANDALONE if (argc < 2) @@ -531,20 +537,62 @@ wmain(INT argc, WCHAR *argv[]) "\n\n", GetCommandLineA()); + /* + * Retrieve the full directory of the current running NTVDM instance. + * In case of failure, use the default SystemRoot\System32 path. + */ + NtVdmPathSize = GetModuleFileNameW(NULL, NtVdmPath, _countof(NtVdmPath)); + NtVdmPath[_countof(NtVdmPath) - 1] = UNICODE_NULL; // Ensure NULL-termination (see WinXP bug) + + Success = ((NtVdmPathSize != 0) && (NtVdmPathSize < _countof(NtVdmPath)) && + (GetLastError() != ERROR_INSUFFICIENT_BUFFER)); + if (Success) + { + /* Find the last path separator, remove it as well as the file name */ + PWCHAR pch = wcsrchr(NtVdmPath, L'\\'); + if (pch) + *pch = UNICODE_NULL; + } + else + { + /* We failed, use the default SystemRoot\System32 path */ + NtVdmPathSize = GetSystemDirectoryW(NtVdmPath, _countof(NtVdmPath)); + Success = ((NtVdmPathSize != 0) && (NtVdmPathSize < _countof(NtVdmPath))); + if (!Success) + { + /* We failed again, try to do it ourselves */ + NtVdmPathSize = (ULONG)wcslen(SharedUserData->NtSystemRoot) + _countof("\\System32") - 1; + Success = (NtVdmPathSize < _countof(NtVdmPath)); + if (Success) + { + Success = NT_SUCCESS(RtlStringCchPrintfW(NtVdmPath, + _countof(NtVdmPath), + L"%s\\System32", + SharedUserData->NtSystemRoot)); + } + if (!Success) + { + wprintf(L"FATAL: Could not retrieve NTVDM path.\n"); + goto Cleanup; + } + } + } + NtVdmPathSize = (ULONG)wcslen(NtVdmPath); + /* Load the global VDM settings */ LoadGlobalSettings(&GlobalSettings); /* Initialize the console */ if (!ConsoleInit()) { - wprintf(L"FATAL: A problem occurred when trying to initialize the console\n"); + wprintf(L"FATAL: A problem occurred when trying to initialize the console.\n"); goto Cleanup; } /* Initialize the emulator */ if (!EmulatorInitialize(ConsoleInput, ConsoleOutput)) { - wprintf(L"FATAL: Failed to initialize the emulator\n"); + wprintf(L"FATAL: Failed to initialize the emulator.\n"); goto Cleanup; } diff --git a/subsystems/mvdm/ntvdm/ntvdm.h b/subsystems/mvdm/ntvdm/ntvdm.h index 2b006c06c39..b3876fb9a98 100644 --- a/subsystems/mvdm/ntvdm/ntvdm.h +++ b/subsystems/mvdm/ntvdm/ntvdm.h @@ -40,6 +40,10 @@ #include <stdarg.h> #include <wchar.h> +#ifndef _countof +#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0])) +#endif + /* PSDK/NDK Headers */ #define WIN32_NO_STATUS #include <windef.h> @@ -67,6 +71,8 @@ DWORD WINAPI SetLastConsoleEventActive(VOID); /* PSEH for SEH Support */ #include <pseh/pseh2.h> +#include <ntstrsafe.h> + /* VARIABLES ******************************************************************/ @@ -84,6 +90,10 @@ extern NTVDM_SETTINGS GlobalSettings; extern INT NtVdmArgc; extern WCHAR** NtVdmArgv; +/* Full directory where NTVDM resides, or the SystemRoot\System32 path */ +extern WCHAR NtVdmPath[MAX_PATH]; +extern ULONG NtVdmPathSize; // Length without NULL terminator. + extern HWND hConsoleWnd;
3 years
1
0
0
0
[reactos] 05/08: [NTVDM] disk.c: Simplify some code; unmount only present disks during cleanup (avoids useless debug-print errors).
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=86eebc2a311b30590d8cc…
commit 86eebc2a311b30590d8ccf349910bd162f94b109 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Nov 27 01:36:56 2021 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Nov 28 00:26:45 2021 +0100 [NTVDM] disk.c: Simplify some code; unmount only present disks during cleanup (avoids useless debug-print errors). --- subsystems/mvdm/ntvdm/hardware/disk.c | 45 +++++++++++++++-------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/subsystems/mvdm/ntvdm/hardware/disk.c b/subsystems/mvdm/ntvdm/hardware/disk.c index 7f448a6f81b..b2ccb65be96 100644 --- a/subsystems/mvdm/ntvdm/hardware/disk.c +++ b/subsystems/mvdm/ntvdm/hardware/disk.c @@ -186,7 +186,7 @@ static DISK_GEO DiskGeometryList[] = {2880, 36, 2, 80, 6}, }; -BOOLEAN +static BOOLEAN MountFDI(IN PDISK_IMAGE DiskImage, IN HANDLE hFile) { @@ -242,7 +242,7 @@ MountFDI(IN PDISK_IMAGE DiskImage, // Secondary Master Drive, Secondary Slave Drive. static DISK_IMAGE XDCHardDrive[4]; -BOOLEAN +static BOOLEAN MountHDD(IN PDISK_IMAGE DiskImage, IN HANDLE hFile) { @@ -525,26 +525,13 @@ MountDisk(IN DISK_TYPE DiskType, /* Try to open the file */ SetLastError(0); // For debugging purposes - if (ReadOnly) - { - hFile = CreateFileW(FileName, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - } - else - { - hFile = CreateFileW(FileName, - GENERIC_READ | GENERIC_WRITE, - 0, // No sharing access - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - } + hFile = CreateFileW(FileName, + GENERIC_READ | (ReadOnly ? 0 : GENERIC_WRITE), + (ReadOnly ? FILE_SHARE_READ : 0), + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); DPRINT1("File '%S' opening %s ; GetLastError() = %u\n", FileName, hFile != INVALID_HANDLE_VALUE ? "succeeded" : "failed", GetLastError()); @@ -638,13 +625,19 @@ VOID DiskCtrlCleanup(VOID) { ULONG DiskNumber; - /* Unmount all the floppy disk drives */ + /* Unmount all the present floppy disk drives */ for (DiskNumber = 0; DiskNumber < DiskMountInfo[FLOPPY_DISK].NumDisks; ++DiskNumber) - UnmountDisk(FLOPPY_DISK, DiskNumber); + { + if (IsDiskPresent(&DiskMountInfo[FLOPPY_DISK].DiskArray[DiskNumber])) + UnmountDisk(FLOPPY_DISK, DiskNumber); + } - /* Unmount all the hard disk drives */ + /* Unmount all the present hard disk drives */ for (DiskNumber = 0; DiskNumber < DiskMountInfo[HARD_DISK].NumDisks; ++DiskNumber) - UnmountDisk(HARD_DISK, DiskNumber); + { + if (IsDiskPresent(&DiskMountInfo[HARD_DISK].DiskArray[DiskNumber])) + UnmountDisk(HARD_DISK, DiskNumber); + } } /* EOF */
3 years
1
0
0
0
[reactos] 04/08: [NTVDM] Sort out some global/emulator header info, and NDK headers inclusions.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6823878a021ea7e42c98a…
commit 6823878a021ea7e42c98a11835f5ba4e1f2630e3 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Nov 25 22:39:56 2021 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Nov 28 00:26:44 2021 +0100 [NTVDM] Sort out some global/emulator header info, and NDK headers inclusions. --- subsystems/mvdm/ntvdm/emulator.h | 16 +++++++- subsystems/mvdm/ntvdm/hardware/sound/speaker.c | 1 + subsystems/mvdm/ntvdm/memory.c | 3 ++ subsystems/mvdm/ntvdm/ntvdm.h | 53 +++++++++++++------------- 4 files changed, 44 insertions(+), 29 deletions(-) diff --git a/subsystems/mvdm/ntvdm/emulator.h b/subsystems/mvdm/ntvdm/emulator.h index deff274d4fa..e4554289bb8 100644 --- a/subsystems/mvdm/ntvdm/emulator.h +++ b/subsystems/mvdm/ntvdm/emulator.h @@ -15,7 +15,11 @@ /* DEFINES ********************************************************************/ -/* Basic Memory Management */ +/* + * Basic Memory Management + */ +#define NULL32 ((ULONG)0) + #define MEM_ALIGN_DOWN(ptr, align) (PVOID)((ULONG_PTR)(ptr) & ~((align) - 1l)) #define MEM_ALIGN_UP(ptr, align) MEM_ALIGN_DOWN((ULONG_PTR)(ptr) + (align) - 1l, (align)) @@ -35,7 +39,9 @@ C_ASSERT(0x100000 <= MAX_ADDRESS); // A minimum of 1 MB is required for PC emul #define ARRAY_INDEX(ptr, array) ((ULONG)(((ULONG_PTR)(ptr) - (ULONG_PTR)(array)) / sizeof(*array))) -/* BCD-Binary conversion */ +/* + * BCD-Binary conversion + */ FORCEINLINE USHORT @@ -71,6 +77,11 @@ BCD_TO_BINARY(USHORT Value) return Result; } + +/* + * Emulator state + */ + enum { EMULATOR_EXCEPTION_DIVISION_BY_ZERO, @@ -94,6 +105,7 @@ extern FAST486_STATE EmulatorContext; extern LPVOID BaseAddress; extern BOOLEAN VdmRunning; + /* FUNCTIONS ******************************************************************/ VOID DumpMemory(BOOLEAN TextFormat); diff --git a/subsystems/mvdm/ntvdm/hardware/sound/speaker.c b/subsystems/mvdm/ntvdm/hardware/sound/speaker.c index f99918b0a0d..3817b004778 100644 --- a/subsystems/mvdm/ntvdm/hardware/sound/speaker.c +++ b/subsystems/mvdm/ntvdm/hardware/sound/speaker.c @@ -18,6 +18,7 @@ /* Extra PSDK/NDK Headers */ #include <ndk/iofuncs.h> +#include <ndk/obfuncs.h> /* DDK Driver Headers */ #include <ntddbeep.h> diff --git a/subsystems/mvdm/ntvdm/memory.c b/subsystems/mvdm/ntvdm/memory.c index 3b53374afc2..c9de5d915d5 100644 --- a/subsystems/mvdm/ntvdm/memory.c +++ b/subsystems/mvdm/ntvdm/memory.c @@ -16,6 +16,9 @@ #include "emulator.h" #include "memory.h" +/* Extra PSDK/NDK Headers */ +#include <ndk/mmfuncs.h> + /* PRIVATE VARIABLES **********************************************************/ typedef struct _MEM_HOOK diff --git a/subsystems/mvdm/ntvdm/ntvdm.h b/subsystems/mvdm/ntvdm/ntvdm.h index 17dbd8dfa1e..2b006c06c39 100644 --- a/subsystems/mvdm/ntvdm/ntvdm.h +++ b/subsystems/mvdm/ntvdm/ntvdm.h @@ -9,6 +9,31 @@ #ifndef _NTVDM_H_ #define _NTVDM_H_ +/* BUILD CONFIGURATION ********************************************************/ + +/* + * Activate this line if you want to run NTVDM in standalone mode with: + * ntvdm.exe <program> + */ +// #define STANDALONE + +/* + * Activate this line for Win2k compliancy + */ +// #define WIN2K_COMPLIANT + +/* + * Activate this line if you want advanced hardcoded debug facilities + * (called interrupts, etc...), that may break PC-AT compatibility. + * USE AT YOUR OWN RISK! (disabled by default) + */ +// #define ADVANCED_DEBUGGING + +#ifdef ADVANCED_DEBUGGING +#define ADVANCED_DEBUGGING_LEVEL 1 +#endif + + /* INCLUDES *******************************************************************/ #include <stdio.h> @@ -36,38 +61,12 @@ DWORD WINAPI SetLastConsoleEventActive(VOID); #define NTOS_MODE_USER -#include <ndk/kefuncs.h> -#include <ndk/mmfuncs.h> -#include <ndk/obfuncs.h> +#include <ndk/kefuncs.h> // For NtQueryPerformanceCounter() #include <ndk/rtlfuncs.h> -#include <ndk/rtltypes.h> /* PSEH for SEH Support */ #include <pseh/pseh2.h> -/* - * Activate this line if you want to run NTVDM in standalone mode with: - * ntvdm.exe <program> - */ -// #define STANDALONE - -/* - * Activate this line for Win2k compliancy - */ -// #define WIN2K_COMPLIANT - -/* - * Activate this line if you want advanced hardcoded debug facilities - * (called interrupts, etc...), that break PC-AT compatibility. - * USE AT YOUR OWN RISK! (disabled by default) - */ -// #define ADVANCED_DEBUGGING - -#ifdef ADVANCED_DEBUGGING -#define ADVANCED_DEBUGGING_LEVEL 1 -#endif - -#define NULL32 0 /* VARIABLES ******************************************************************/
3 years
1
0
0
0
[reactos] 03/08: [NTVDM] Silence noisy DPRINTs when starting processes; they can be re-enabled by recompiling in "advanced debugging" mode.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=695900f51fe8ae1050e65…
commit 695900f51fe8ae1050e65bd715c54762e8943d2d Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Thu Nov 25 21:12:48 2021 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Nov 28 00:26:43 2021 +0100 [NTVDM] Silence noisy DPRINTs when starting processes; they can be re-enabled by recompiling in "advanced debugging" mode. --- subsystems/mvdm/ntvdm/bios/bios32/bios32.c | 4 ++++ subsystems/mvdm/ntvdm/dos/dos32krnl/process.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/subsystems/mvdm/ntvdm/bios/bios32/bios32.c b/subsystems/mvdm/ntvdm/bios/bios32/bios32.c index cd37bd0a877..95b2a31f0cf 100644 --- a/subsystems/mvdm/ntvdm/bios/bios32/bios32.c +++ b/subsystems/mvdm/ntvdm/bios/bios32/bios32.c @@ -624,7 +624,9 @@ Retry: setBX(0x7C00); BiosDiskService(Stack); if (!(Stack[STACK_FLAGS] & EMULATOR_FLAG_CF)) goto Quit; +#ifdef ADVANCED_DEBUGGING DPRINT1("An error happened while loading the bootsector from floppy 0, error = %d\n", getAH()); +#endif break; } @@ -642,7 +644,9 @@ Retry: setBX(0x7C00); BiosDiskService(Stack); if (!(Stack[STACK_FLAGS] & EMULATOR_FLAG_CF)) goto Quit; +#ifdef ADVANCED_DEBUGGING DPRINT1("An error happened while loading the bootsector from HDD 0, error = %d\n", getAH()); +#endif break; } diff --git a/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c b/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c index aa5680dc237..b12bd60ee22 100644 --- a/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c +++ b/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c @@ -87,6 +87,7 @@ static inline VOID DosSaveState(VOID) PDOS_REGISTER_STATE State; WORD StackPointer = getSP(); +#ifdef ADVANCED_DEBUGGING DPRINT1("\n" "DosSaveState(before) -- SS:SP == %04X:%04X\n" "Original CPU State =\n" @@ -96,6 +97,7 @@ static inline VOID DosSaveState(VOID) getSS(), getSP(), getDS(), getES(), getAX(), getCX(), getDX(), getBX(), getBP(), getSI(), getDI()); +#endif /* * Allocate stack space for the registers. Note that we @@ -116,6 +118,7 @@ static inline VOID DosSaveState(VOID) State->SI = getSI(); State->DI = getDI(); +#ifdef ADVANCED_DEBUGGING DPRINT1("\n" "DosSaveState(after) -- SS:SP == %04X:%04X\n" "Saved State =\n" @@ -125,6 +128,7 @@ static inline VOID DosSaveState(VOID) getSS(), getSP(), State->DS, State->ES, State->AX, State->CX, State->DX, State->BX, State->BP, State->SI, State->DI); +#endif } static inline VOID DosRestoreState(VOID) @@ -137,6 +141,7 @@ static inline VOID DosRestoreState(VOID) */ State = SEG_OFF_TO_PTR(getSS(), getSP()); +#ifdef ADVANCED_DEBUGGING DPRINT1("\n" "DosRestoreState(before) -- SS:SP == %04X:%04X\n" "Saved State =\n" @@ -146,6 +151,7 @@ static inline VOID DosRestoreState(VOID) getSS(), getSP(), State->DS, State->ES, State->AX, State->CX, State->DX, State->BX, State->BP, State->SI, State->DI); +#endif setSP(getSP() + sizeof(DOS_REGISTER_STATE) - sizeof(WORD)); @@ -160,6 +166,7 @@ static inline VOID DosRestoreState(VOID) setSI(State->SI); setDI(State->DI); +#ifdef ADVANCED_DEBUGGING DPRINT1("\n" "DosRestoreState(after) -- SS:SP == %04X:%04X\n" "Restored CPU State =\n" @@ -169,6 +176,7 @@ static inline VOID DosRestoreState(VOID) getSS(), getSP(), getDS(), getES(), getAX(), getCX(), getDX(), getBX(), getBP(), getSI(), getDI()); +#endif } static WORD DosCopyEnvironmentBlock(IN LPCSTR Environment OPTIONAL, @@ -633,8 +641,10 @@ DWORD DosLoadExecutableInternal(IN DOS_EXEC_TYPE LoadType, /* Push the task state */ DosSaveState(); +#ifdef ADVANCED_DEBUGGING DPRINT1("Sda->CurrentPsp = 0x%04x; Old LastStack = 0x%08x, New LastStack = 0x%08x\n", Sda->CurrentPsp, SEGMENT_TO_PSP(Sda->CurrentPsp)->LastStack, MAKELONG(getSP(), getSS())); +#endif /* Update the last stack in the PSP */ SEGMENT_TO_PSP(Sda->CurrentPsp)->LastStack = MAKELONG(getSP(), getSS()); @@ -996,13 +1006,17 @@ Done: TerminationType = (KeepResident != 0 ? 0x03 : 0x00); Sda->ErrorLevel = MAKEWORD(ReturnCode, TerminationType); +#ifdef ADVANCED_DEBUGGING DPRINT1("PspBlock->ParentPsp = 0x%04x; Sda->CurrentPsp = 0x%04x\n", PspBlock->ParentPsp, Sda->CurrentPsp); +#endif if (Sda->CurrentPsp != SYSTEM_PSP) { +#ifdef ADVANCED_DEBUGGING DPRINT1("Sda->CurrentPsp = 0x%04x; Old SS:SP = %04X:%04X going to be LastStack = 0x%08x\n", Sda->CurrentPsp, getSS(), getSP(), SEGMENT_TO_PSP(Sda->CurrentPsp)->LastStack); +#endif /* Restore the parent's stack */ setSS(HIWORD(SEGMENT_TO_PSP(Sda->CurrentPsp)->LastStack));
3 years
1
0
0
0
[reactos] 02/08: [NTVDM] In non-STANDALONE builds, check whether we are started as a VDM and bail out if not.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b849a696ef8f5a45edc94…
commit b849a696ef8f5a45edc94f7a42f2292b093c6455 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Nov 27 01:06:21 2021 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Nov 28 00:26:43 2021 +0100 [NTVDM] In non-STANDALONE builds, check whether we are started as a VDM and bail out if not. --- subsystems/mvdm/ntvdm/ntvdm.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/subsystems/mvdm/ntvdm/ntvdm.c b/subsystems/mvdm/ntvdm/ntvdm.c index d7e88cb20ad..bedc20ea7ea 100644 --- a/subsystems/mvdm/ntvdm/ntvdm.c +++ b/subsystems/mvdm/ntvdm/ntvdm.c @@ -20,6 +20,9 @@ #include "dos/dem.h" +/* Extra PSDK/NDK Headers */ +#include <ndk/psfuncs.h> + /* VARIABLES ******************************************************************/ NTVDM_SETTINGS GlobalSettings; @@ -473,9 +476,6 @@ PrintMessageAnsi(IN CHAR_PRINT CharPrint, INT wmain(INT argc, WCHAR *argv[]) { - NtVdmArgc = argc; - NtVdmArgv = argv; - #ifdef STANDALONE if (argc < 2) @@ -485,8 +485,27 @@ wmain(INT argc, WCHAR *argv[]) return 0; } +#else + + /* For non-STANDALONE builds, we must be started as a VDM */ + NTSTATUS Status; + ULONG VdmPower = 0; + Status = NtQueryInformationProcess(NtCurrentProcess(), + ProcessWx86Information, + &VdmPower, + sizeof(VdmPower), + NULL); + if (!NT_SUCCESS(Status) || (VdmPower == 0)) + { + /* Not a VDM, bail out */ + return 0; + } + #endif + NtVdmArgc = argc; + NtVdmArgv = argv; + #ifdef ADVANCED_DEBUGGING { INT i = 20;
3 years
1
0
0
0
[reactos] 01/08: [KERNEL32] Don't hardcode some types in sizeofs, and some flag values.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d6d30f9e05b215486bef2…
commit d6d30f9e05b215486bef281ae9da52d6351f283e Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sat Nov 27 01:19:46 2021 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Nov 28 00:26:42 2021 +0100 [KERNEL32] Don't hardcode some types in sizeofs, and some flag values. --- dll/win32/kernel32/client/file/npipe.c | 28 ++++++++++++++-------------- dll/win32/kernel32/client/loader.c | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dll/win32/kernel32/client/file/npipe.c b/dll/win32/kernel32/client/file/npipe.c index d89047d1f0b..4af4965627a 100644 --- a/dll/win32/kernel32/client/file/npipe.c +++ b/dll/win32/kernel32/client/file/npipe.c @@ -76,7 +76,7 @@ NpGetUserNamep(HANDLE hNamedPipe, /* Restore the thread token */ Status = NtSetInformationThread(NtCurrentThread(), ThreadImpersonationToken, - &hToken, sizeof(HANDLE)); + &hToken, sizeof(hToken)); /* We cannot fail closing the thread token! */ if (!CloseHandle(hToken)) { @@ -169,7 +169,7 @@ CreatePipe(PHANDLE hReadPipe, /* Create the named pipe */ Status = NtCreateNamedPipeFile(&ReadPipeHandle, - GENERIC_READ |FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, + GENERIC_READ | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, &ObjectAttributes, &StatusBlock, FILE_SHARE_READ | FILE_SHARE_WRITE, @@ -296,7 +296,7 @@ CreateNamedPipeW(LPCWSTR lpName, /* Always case insensitive, check if we got extra attributes */ Attributes = OBJ_CASE_INSENSITIVE; - if(lpSecurityAttributes) + if (lpSecurityAttributes) { /* We did; get the security descriptor */ SecurityDescriptor = lpSecurityAttributes->lpSecurityDescriptor; @@ -790,13 +790,13 @@ SetNamedPipeHandleState(HANDLE hNamedPipe, /* Set the Read Mode */ Settings.ReadMode = (*lpMode & PIPE_READMODE_MESSAGE) ? - FILE_PIPE_MESSAGE_MODE: FILE_PIPE_BYTE_STREAM_MODE; + FILE_PIPE_MESSAGE_MODE : FILE_PIPE_BYTE_STREAM_MODE; /* Send the changes to the Driver */ Status = NtSetInformationFile(hNamedPipe, &Iosb, &Settings, - sizeof(FILE_PIPE_INFORMATION), + sizeof(Settings), FilePipeInformation); if (!NT_SUCCESS(Status)) { @@ -816,7 +816,7 @@ SetNamedPipeHandleState(HANDLE hNamedPipe, Status = NtQueryInformationFile(hNamedPipe, &Iosb, &RemoteSettings, - sizeof(FILE_PIPE_REMOTE_INFORMATION), + sizeof(RemoteSettings), FilePipeRemoteInformation); if (!NT_SUCCESS(Status)) { @@ -839,7 +839,7 @@ SetNamedPipeHandleState(HANDLE hNamedPipe, Status = NtSetInformationFile(hNamedPipe, &Iosb, &RemoteSettings, - sizeof(FILE_PIPE_REMOTE_INFORMATION), + sizeof(RemoteSettings), FilePipeRemoteInformation); if (!NT_SUCCESS(Status)) { @@ -1017,7 +1017,7 @@ GetNamedPipeHandleStateW(HANDLE hNamedPipe, Status = NtQueryInformationFile(hNamedPipe, &StatusBlock, &PipeInfo, - sizeof(FILE_PIPE_INFORMATION), + sizeof(PipeInfo), FilePipeInformation); if (!NT_SUCCESS(Status)) { @@ -1029,14 +1029,14 @@ GetNamedPipeHandleStateW(HANDLE hNamedPipe, *lpState |= ((PipeInfo.ReadMode != FILE_PIPE_BYTE_STREAM_MODE) ? PIPE_READMODE_MESSAGE : PIPE_READMODE_BYTE); } - if(lpCurInstances != NULL) + if (lpCurInstances != NULL) { FILE_PIPE_LOCAL_INFORMATION LocalInfo; Status = NtQueryInformationFile(hNamedPipe, &StatusBlock, &LocalInfo, - sizeof(FILE_PIPE_LOCAL_INFORMATION), + sizeof(LocalInfo), FilePipeLocalInformation); if (!NT_SUCCESS(Status)) { @@ -1054,7 +1054,7 @@ GetNamedPipeHandleStateW(HANDLE hNamedPipe, Status = NtQueryInformationFile(hNamedPipe, &StatusBlock, &RemoteInfo, - sizeof(FILE_PIPE_REMOTE_INFORMATION), + sizeof(RemoteInfo), FilePipeRemoteInformation); if (!NT_SUCCESS(Status)) { @@ -1112,7 +1112,7 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe, ANSI_STRING UserNameA; BOOL Ret; - if(lpUserName != NULL) + if (lpUserName != NULL) { UserNameW.MaximumLength = (USHORT)nMaxUserNameSize * sizeof(WCHAR); UserNameW.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, UserNameW.MaximumLength); @@ -1174,7 +1174,7 @@ GetNamedPipeInfo(HANDLE hNamedPipe, Status = NtQueryInformationFile(hNamedPipe, &StatusBlock, &PipeLocalInformation, - sizeof(FILE_PIPE_LOCAL_INFORMATION), + sizeof(PipeLocalInformation), FilePipeLocalInformation); if (!NT_SUCCESS(Status)) { @@ -1185,7 +1185,7 @@ GetNamedPipeInfo(HANDLE hNamedPipe, if (lpFlags != NULL) { *lpFlags = (PipeLocalInformation.NamedPipeEnd == FILE_PIPE_SERVER_END) ? PIPE_SERVER_END : PIPE_CLIENT_END; - *lpFlags |= (PipeLocalInformation.NamedPipeType == 1) ? PIPE_TYPE_MESSAGE : PIPE_TYPE_BYTE; + *lpFlags |= (PipeLocalInformation.NamedPipeType == FILE_PIPE_MESSAGE_TYPE) ? PIPE_TYPE_MESSAGE : PIPE_TYPE_BYTE; } if (lpOutBufferSize != NULL) diff --git a/dll/win32/kernel32/client/loader.c b/dll/win32/kernel32/client/loader.c index 93eb366a0f0..2934b528699 100644 --- a/dll/win32/kernel32/client/loader.c +++ b/dll/win32/kernel32/client/loader.c @@ -677,7 +677,7 @@ GetModuleHandleForUnicodeString(PUNICODE_STRING ModuleName) if (NT_SUCCESS(Status)) return Module; /* If not, then the path should be computed */ - DllPath = BaseComputeProcessDllPath(NULL, 0); + DllPath = BaseComputeProcessDllPath(NULL, NULL); if (!DllPath) { Status = STATUS_NO_MEMORY;
3 years
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
10
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
Results per page:
10
25
50
100
200