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
October 2017
----- 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
43 participants
275 discussions
Start a n
N
ew thread
[pschweitzer] 76025: [KERNEL32] - Implement the internal functions: GetVolumeNameForRoot(), BasepGetVolumeNameFromReparsePoint(), BasepGetVolumeNameForVolumeMountPoint() that allow querying the vol...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Oct 1 16:36:37 2017 New Revision: 76025 URL:
http://svn.reactos.org/svn/reactos?rev=76025&view=rev
Log: [KERNEL32] - Implement the internal functions: GetVolumeNameForRoot(), BasepGetVolumeNameFromReparsePoint(), BasepGetVolumeNameForVolumeMountPoint() that allow querying the volume name (GUID form) given a volume root - Reimplement GetVolumeNameForVolumeMountPointW() with the new internal function BasepGetVolumeNameForVolumeMountPoint() this fixes a few bugs and adds supports for reparse points - Reimplement GetVolumeNameForVolumeMountPointA() to make it w2k3 compliant Note that I dropped copyrights in the header, as everything got reimplemented Modified: trunk/reactos/dll/win32/kernel32/client/file/mntpoint.c Modified: trunk/reactos/dll/win32/kernel32/client/file/mntpoint.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/mntpoint.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/mntpoint.c [iso-8859-1] Sun Oct 1 16:36:37 2017 @@ -3,25 +3,468 @@ * PROJECT: ReactOS system libraries * FILE: dll/win32/kernel32/client/file/mntpoint.c * PURPOSE: File volume mount point functions - * PROGRAMMER: Ariadne ( ariadne(a)xs4all.nl) - * Erik Bos, Alexandre Julliard : - * GetLogicalDriveStringsA, - * GetLogicalDriveStringsW, GetLogicalDrives - * UPDATE HISTORY: - * Created 01/11/98 - */ -//WINE copyright notice: -/* - * DOS drives handling functions - * - * Copyright 1993 Erik Bos - * Copyright 1996 Alexandre Julliard + * PROGRAMMER: Pierre Schweitzer (pierre(a)reactos.org) */ #include <k32.h> #define NDEBUG #include <debug.h> -DEBUG_CHANNEL(kernel32file); + +/* + * @implemented + */ +static BOOL +GetVolumeNameForRoot(IN LPCWSTR lpszRootPath, + OUT LPWSTR lpszVolumeName, + IN DWORD cchBufferLength) +{ + BOOL Ret; + NTSTATUS Status; + PWSTR FoundVolume; + DWORD BytesReturned; + UNICODE_STRING NtPathName; + IO_STATUS_BLOCK IoStatusBlock; + PMOUNTMGR_MOUNT_POINT MountPoint; + ULONG CurrentMntPt, FoundVolumeLen; + PMOUNTMGR_MOUNT_POINTS MountPoints; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE VolumeHandle, MountMgrHandle; + struct + { + MOUNTDEV_NAME; + WCHAR Buffer[MAX_PATH]; + } MountDevName; + + /* It makes no sense on a non-local drive */ + if (GetDriveTypeW(lpszRootPath) == DRIVE_REMOTE) + { + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } + + /* Get the NT path */ + if (!RtlDosPathNameToNtPathName_U(lpszRootPath, &NtPathName, NULL, NULL)) + { + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } + + /* If it's a root path - likely - drop backslash to open volume */ + if (NtPathName.Buffer[(NtPathName.Length / sizeof(WCHAR)) - 1] == L'\\') + { + NtPathName.Buffer[(NtPathName.Length / sizeof(WCHAR)) - 1] = UNICODE_NULL; + NtPathName.Length -= sizeof(WCHAR); + } + + /* If that's a DOS volume, upper case the letter */ + if (NtPathName.Length >= 2 * sizeof(WCHAR)) + { + if (NtPathName.Buffer[(NtPathName.Length / sizeof(WCHAR)) - 1] == L':') + { + NtPathName.Buffer[(NtPathName.Length / sizeof(WCHAR)) - 2] = _toupper(NtPathName.Buffer[(NtPathName.Length / sizeof(WCHAR)) - 2]); + } + } + + /* Attempt to open the volume */ + InitializeObjectAttributes(&ObjectAttributes, &NtPathName, + OBJ_CASE_INSENSITIVE, NULL, NULL); + Status = NtOpenFile(&VolumeHandle, SYNCHRONIZE | FILE_READ_ATTRIBUTES, + &ObjectAttributes, &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_SYNCHRONOUS_IO_ALERT); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathName.Buffer); + BaseSetLastNTError(Status); + return FALSE; + } + + /* Query the device name - that's what we'll translate */ + if (!DeviceIoControl(VolumeHandle, IOCTL_MOUNTDEV_QUERY_DEVICE_NAME, NULL, + 0, &MountDevName, sizeof(MountDevName), &BytesReturned, + NULL)) + { + NtClose(VolumeHandle); + RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathName.Buffer); + return FALSE; + } + + /* No longer need the volume */ + NtClose(VolumeHandle); + RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathName.Buffer); + + /* We'll keep the device name for later usage */ + NtPathName.Length = MountDevName.NameLength; + NtPathName.MaximumLength = MountDevName.NameLength + sizeof(UNICODE_NULL); + NtPathName.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, NtPathName.MaximumLength); + if (NtPathName.Buffer == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + RtlCopyMemory(NtPathName.Buffer, MountDevName.Name, NtPathName.Length); + NtPathName.Buffer[NtPathName.Length / sizeof(WCHAR)] = UNICODE_NULL; + + /* Allocate the structure for querying the mount mgr */ + MountPoint = RtlAllocateHeap(RtlGetProcessHeap(), 0, + NtPathName.Length + sizeof(MOUNTMGR_MOUNT_POINT)); + if (MountPoint == NULL) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathName.Buffer); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + /* 0 everything, we provide a device name */ + RtlZeroMemory(MountPoint, sizeof(MOUNTMGR_MOUNT_POINT)); + MountPoint->DeviceNameOffset = sizeof(MOUNTMGR_MOUNT_POINT); + MountPoint->DeviceNameLength = NtPathName.Length; + RtlCopyMemory((PVOID)((ULONG_PTR)MountPoint + sizeof(MOUNTMGR_MOUNT_POINT)), NtPathName.Buffer, NtPathName.Length); + RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathName.Buffer); + + /* Allocate a dummy output buffer to probe for size */ + MountPoints = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(MOUNTMGR_MOUNT_POINTS)); + if (MountPoints == NULL) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + /* Open a handle to the mount manager */ + MountMgrHandle = CreateFileW(MOUNTMGR_DOS_DEVICE_NAME, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, + INVALID_HANDLE_VALUE); + if (MountMgrHandle == INVALID_HANDLE_VALUE) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); + return FALSE; + } + + /* Query the names associated to our device name */ + Ret = DeviceIoControl(MountMgrHandle, IOCTL_MOUNTMGR_QUERY_POINTS, + MountPoint, NtPathName.Length + sizeof(MOUNTMGR_MOUNT_POINT), + MountPoints, sizeof(MOUNTMGR_MOUNT_POINTS), &BytesReturned, + NULL); + /* As long as the buffer is too small, keep looping */ + while (!Ret && GetLastError() == ERROR_MORE_DATA) + { + ULONG BufferSize; + + /* Get the size we've to allocate */ + BufferSize = MountPoints->Size; + /* Reallocate the buffer with enough room */ + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + MountPoints = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferSize); + if (MountPoints == NULL) + { + CloseHandle(MountMgrHandle); + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + /* Reissue the request, it should work now! */ + Ret = DeviceIoControl(MountMgrHandle, IOCTL_MOUNTMGR_QUERY_POINTS, + MountPoint, NtPathName.Length + sizeof(MOUNTMGR_MOUNT_POINT), + MountPoints, BufferSize, &BytesReturned, NULL); + } + + /* We're done, no longer need the mount manager */ + CloseHandle(MountMgrHandle); + /* Nor our input buffer */ + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); + + /* If the mount manager failed, just quit */ + if (!Ret) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + CurrentMntPt = 0; + /* If there were no associated mount points, we'll return the device name */ + if (MountPoints->NumberOfMountPoints == 0) + { + FoundVolume = NtPathName.Buffer; + FoundVolumeLen = NtPathName.Length; + } + /* Otherwise, find one which is matching */ + else + { + for (; CurrentMntPt < MountPoints->NumberOfMountPoints; ++CurrentMntPt) + { + UNICODE_STRING SymbolicLink; + + /* Make a string of it, to easy the checks */ + SymbolicLink.Length = MountPoints->MountPoints[CurrentMntPt].SymbolicLinkNameLength; + SymbolicLink.MaximumLength = SymbolicLink.Length; + SymbolicLink.Buffer = (PVOID)((ULONG_PTR)&MountPoints->MountPoints[CurrentMntPt] + MountPoints->MountPoints[CurrentMntPt].SymbolicLinkNameOffset); + /* If that's a NT volume name (GUID form), keep it! */ + if (MOUNTMGR_IS_NT_VOLUME_NAME(&SymbolicLink)) + { + FoundVolume = SymbolicLink.Buffer; + FoundVolumeLen = SymbolicLink.Length; + + break; + } + } + } + + /* We couldn't find anything matching, return an error */ + if (CurrentMntPt == MountPoints->NumberOfMountPoints) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + /* We found a matching volume, have we enough memory to return it? */ + if (cchBufferLength * sizeof(WCHAR) < FoundVolumeLen + 2 * sizeof(WCHAR)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + SetLastError(ERROR_FILENAME_EXCED_RANGE); + return FALSE; + } + + /* Copy it back! */ + RtlCopyMemory(lpszVolumeName, FoundVolume, FoundVolumeLen); + /* Make it compliant */ + lpszVolumeName[1] = L'\\'; + /* And transform it as root path */ + lpszVolumeName[FoundVolumeLen / sizeof(WCHAR)] = L'\\'; + lpszVolumeName[FoundVolumeLen / sizeof(WCHAR) + 1] = UNICODE_NULL; + + /* We're done! */ + RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); + return TRUE; +} + +/* + * @implemented + */ +static BOOL +BasepGetVolumeNameFromReparsePoint(IN LPCWSTR lpszMountPoint, + OUT LPWSTR lpszVolumeName, + IN DWORD cchBufferLength, + OUT LPBOOL IsAMountPoint) +{ + WCHAR Old; + DWORD BytesReturned; + HANDLE ReparseHandle; + UNICODE_STRING SubstituteName; + PREPARSE_DATA_BUFFER ReparseBuffer; + + /* Try to open the reparse point */ + ReparseHandle = CreateFileW(lpszMountPoint, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, + FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_NORMAL, + INVALID_HANDLE_VALUE); + /* It failed! */ + if (ReparseHandle == INVALID_HANDLE_VALUE) + { + /* Report it's not a mount point (it's not a reparse point) */ + if (IsAMountPoint != NULL) + { + *IsAMountPoint = FALSE; + } + + /* And zero output */ + if (lpszVolumeName != NULL && cchBufferLength >= 1) + { + lpszVolumeName[0] = UNICODE_NULL; + } + + return FALSE; + } + + /* This is a mount point! */ + if (IsAMountPoint != NULL) + { + *IsAMountPoint = TRUE; + } + + /* Prepare a buffer big enough to read its data */ + ReparseBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, MAXIMUM_REPARSE_DATA_BUFFER_SIZE); + if (ReparseBuffer == NULL) + { + CloseHandle(ReparseHandle); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + + /* Zero output */ + if (lpszVolumeName != NULL && cchBufferLength >= 1) + { + lpszVolumeName[0] = UNICODE_NULL; + } + + return FALSE; + } + + /* Dump the reparse point data */ + if (!DeviceIoControl(ReparseHandle, FSCTL_GET_REPARSE_POINT, NULL, 0, + ReparseBuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &BytesReturned, + NULL)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseBuffer); + CloseHandle(ReparseHandle); + + /* Zero output */ + if (lpszVolumeName != NULL && cchBufferLength >= 1) + { + lpszVolumeName[0] = UNICODE_NULL; + } + + return FALSE; + } + + /* We no longer need the reparse point */ + CloseHandle(ReparseHandle); + + /* We only handle mount points */ + if (ReparseBuffer->ReparseTag != IO_REPARSE_TAG_MOUNT_POINT) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseBuffer); + + /* Zero output */ + if (lpszVolumeName != NULL && cchBufferLength >= 1) + { + lpszVolumeName[0] = UNICODE_NULL; + } + + return FALSE; + } + + /* Do we have enough room for copying substitue name? */ + if ((ReparseBuffer->MountPointReparseBuffer.SubstituteNameLength + sizeof(UNICODE_NULL)) > cchBufferLength * sizeof(WCHAR)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseBuffer); + SetLastError(ERROR_FILENAME_EXCED_RANGE); + + /* Zero output */ + if (lpszVolumeName != NULL && cchBufferLength >= 1) + { + lpszVolumeName[0] = UNICODE_NULL; + } + + return FALSE; + } + + /* Copy the link target */ + RtlCopyMemory(lpszVolumeName, + &ReparseBuffer->MountPointReparseBuffer.PathBuffer[ReparseBuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)], + ReparseBuffer->MountPointReparseBuffer.SubstituteNameLength); + /* Make it DOS valid */ + Old = lpszVolumeName[1]; + /* We want a root path */ + lpszVolumeName[1] = L'\\'; + /* And null terminate obviously */ + lpszVolumeName[ReparseBuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR)] = UNICODE_NULL; + + /* Make it a string to easily check it */ + SubstituteName.Length = ReparseBuffer->MountPointReparseBuffer.SubstituteNameLength; + SubstituteName.MaximumLength = SubstituteName.Length; + SubstituteName.Buffer = lpszVolumeName; + + /* No longer need the data? */ + RtlFreeHeap(RtlGetProcessHeap(), 0, ReparseBuffer); + + /* Is that a dos volume name with backslash? */ + if (MOUNTMGR_IS_DOS_VOLUME_NAME_WB(&SubstituteName)) + { + return TRUE; + } + + /* No, so restore previous name and return to the caller */ + lpszVolumeName[1] = Old; + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; +} + +/* + * @implemented + */ +BOOL +BasepGetVolumeNameForVolumeMountPoint(IN LPCWSTR lpszMountPoint, + OUT LPWSTR lpszVolumeName, + IN DWORD cchBufferLength, + OUT LPBOOL IsAMountPoint) +{ + BOOL Ret; + UNICODE_STRING MountPoint; + + /* Assume it's a mount point (likely for non reparse points) */ + if (IsAMountPoint != NULL) + { + *IsAMountPoint = 1; + } + + /* Make a string with the mount point name */ + RtlInitUnicodeString(&MountPoint, lpszMountPoint); + /* Not a root path? */ + if (MountPoint.Buffer[(MountPoint.Length / sizeof(WCHAR)) - 1] != L'\\') + { + BaseSetLastNTError(STATUS_OBJECT_NAME_INVALID); + /* Zero output */ + if (lpszVolumeName != NULL && cchBufferLength >= 1) + { + lpszVolumeName[0] = UNICODE_NULL; + } + + return FALSE; + } + + /* Does it look like <letter>:\? */ + if (MountPoint.Length == 3 * sizeof(WCHAR)) + { + /* Try to get volume name for root path */ + Ret = GetVolumeNameForRoot(lpszMountPoint, lpszVolumeName, cchBufferLength); + /* It failed? */ + if (!Ret) + { + /* If wasn't a drive letter, so maybe a reparse point? */ + if (MountPoint.Buffer[1] != ':') + { + Ret = BasepGetVolumeNameFromReparsePoint(lpszMountPoint, lpszVolumeName, cchBufferLength, IsAMountPoint); + } + /* It was, so zero output */ + else if (lpszVolumeName != NULL && cchBufferLength >= 1) + { + lpszVolumeName[0] = UNICODE_NULL; + } + } + } + else + { + /* Try to get volume name for root path */ + Ret = GetVolumeNameForRoot(lpszMountPoint, lpszVolumeName, cchBufferLength); + /* It failed? */ + if (!Ret) + { + /* It was a DOS volume as UNC name, so fail and zero output */ + if (MountPoint.Length == 14 && MountPoint.Buffer[0] == '\\' && MountPoint.Buffer[1] == '\\' && + (MountPoint.Buffer[2] == '.' || MountPoint.Buffer[2] == '?') && MountPoint.Buffer[3] == L'\\' && + MountPoint.Buffer[5] == ':') + { + if (lpszVolumeName != NULL && cchBufferLength >= 1) + { + lpszVolumeName[0] = UNICODE_NULL; + } + } + /* Maybe it's a reparse point? */ + else + { + Ret = BasepGetVolumeNameFromReparsePoint(lpszMountPoint, lpszVolumeName, cchBufferLength, IsAMountPoint); + } + } + } + + return Ret; +} /** * @name GetVolumeNameForVolumeMountPointW @@ -48,218 +491,21 @@ OUT LPWSTR VolumeName, IN DWORD VolumeNameLength) { - UNICODE_STRING NtFileName; - OBJECT_ATTRIBUTES ObjectAttributes; - HANDLE FileHandle; - IO_STATUS_BLOCK Iosb; - ULONG BufferLength; - PMOUNTDEV_NAME MountDevName; - PMOUNTMGR_MOUNT_POINT MountPoint; - ULONG MountPointSize; - PMOUNTMGR_MOUNT_POINTS MountPoints; - ULONG Index; - PUCHAR SymbolicLinkName; - BOOL Result; - NTSTATUS Status; - - if (!VolumeMountPoint || !VolumeMountPoint[0]) - { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; - } - - /* - * First step is to convert the passed volume mount point name to - * an NT acceptable name. - */ - - if (!RtlDosPathNameToNtPathName_U(VolumeMountPoint, &NtFileName, NULL, NULL)) - { - SetLastError(ERROR_PATH_NOT_FOUND); - return FALSE; - } - - if (NtFileName.Length > sizeof(WCHAR) && - NtFileName.Buffer[(NtFileName.Length / sizeof(WCHAR)) - 1] == '\\') - { - NtFileName.Length -= sizeof(WCHAR); - } - - /* - * Query mount point device name which we will later use for determining - * the volume name. - */ - - InitializeObjectAttributes(&ObjectAttributes, &NtFileName, 0, NULL, NULL); - Status = NtOpenFile(&FileHandle, FILE_READ_ATTRIBUTES | SYNCHRONIZE, - &ObjectAttributes, &Iosb, - FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_SYNCHRONOUS_IO_NONALERT); - RtlFreeUnicodeString(&NtFileName); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - BufferLength = sizeof(MOUNTDEV_NAME) + 50 * sizeof(WCHAR); - do - { - MountDevName = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); - if (MountDevName == NULL) - { - NtClose(FileHandle); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - Status = NtDeviceIoControlFile(FileHandle, NULL, NULL, NULL, &Iosb, - IOCTL_MOUNTDEV_QUERY_DEVICE_NAME, - NULL, 0, MountDevName, BufferLength); - if (!NT_SUCCESS(Status)) - { - if (Status == STATUS_BUFFER_OVERFLOW) - { - BufferLength = sizeof(MOUNTDEV_NAME) + MountDevName->NameLength; - RtlFreeHeap(GetProcessHeap(), 0, MountDevName); - continue; - } - else - { - RtlFreeHeap(GetProcessHeap(), 0, MountDevName); - NtClose(FileHandle); - BaseSetLastNTError(Status); - return FALSE; - } - } - } - while (!NT_SUCCESS(Status)); - - NtClose(FileHandle); - - /* - * Get the mount point information from mount manager. - */ - - MountPointSize = MountDevName->NameLength + sizeof(MOUNTMGR_MOUNT_POINT); - MountPoint = RtlAllocateHeap(GetProcessHeap(), 0, MountPointSize); - if (MountPoint == NULL) - { - RtlFreeHeap(GetProcessHeap(), 0, MountDevName); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - RtlZeroMemory(MountPoint, sizeof(MOUNTMGR_MOUNT_POINT)); - MountPoint->DeviceNameOffset = sizeof(MOUNTMGR_MOUNT_POINT); - MountPoint->DeviceNameLength = MountDevName->NameLength; - RtlCopyMemory(MountPoint + 1, MountDevName->Name, MountDevName->NameLength); - RtlFreeHeap(RtlGetProcessHeap(), 0, MountDevName); - - RtlInitUnicodeString(&NtFileName, L"\\??\\MountPointManager"); - InitializeObjectAttributes(&ObjectAttributes, &NtFileName, 0, NULL, NULL); - Status = NtOpenFile(&FileHandle, FILE_GENERIC_READ, &ObjectAttributes, - &Iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_SYNCHRONOUS_IO_NONALERT); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); - return FALSE; - } - - BufferLength = sizeof(MOUNTMGR_MOUNT_POINTS); - do - { - MountPoints = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferLength); - if (MountPoints == NULL) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); - NtClose(FileHandle); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - Status = NtDeviceIoControlFile(FileHandle, NULL, NULL, NULL, &Iosb, - IOCTL_MOUNTMGR_QUERY_POINTS, - MountPoint, MountPointSize, - MountPoints, BufferLength); - if (!NT_SUCCESS(Status)) - { - if (Status == STATUS_BUFFER_OVERFLOW) - { - BufferLength = MountPoints->Size; - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); - continue; - } - else if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); - NtClose(FileHandle); - BaseSetLastNTError(Status); - return FALSE; - } - } - } - while (!NT_SUCCESS(Status)); - - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); - NtClose(FileHandle); - - /* - * Now we've gathered info about all mount points mapped to our device, so - * select the correct one and copy it into the output buffer. - */ - - for (Index = 0; Index < MountPoints->NumberOfMountPoints; Index++) - { - MountPoint = MountPoints->MountPoints + Index; - SymbolicLinkName = (PUCHAR)MountPoints + MountPoint->SymbolicLinkNameOffset; - - /* - * Check for "\\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\" - * (with the last slash being optional) style symbolic links. - */ - - if (MountPoint->SymbolicLinkNameLength == 48 * sizeof(WCHAR) || - (MountPoint->SymbolicLinkNameLength == 49 * sizeof(WCHAR) && - SymbolicLinkName[48] == L'\\')) - { - if (RtlCompareMemory(SymbolicLinkName, L"\\??\\Volume{", - 11 * sizeof(WCHAR)) == 11 * sizeof(WCHAR) && - SymbolicLinkName[19] == L'-' && SymbolicLinkName[24] == L'-' && - SymbolicLinkName[29] == L'-' && SymbolicLinkName[34] == L'-' && - SymbolicLinkName[47] == L'}') - { - if (VolumeNameLength >= MountPoint->SymbolicLinkNameLength / sizeof(WCHAR)) - { - RtlCopyMemory(VolumeName, - (PUCHAR)MountPoints + MountPoint->SymbolicLinkNameOffset, - MountPoint->SymbolicLinkNameLength); - VolumeName[1] = L'\\'; - Result = TRUE; - } - else - { - SetLastError(ERROR_FILENAME_EXCED_RANGE); - Result = FALSE; - } - - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); - - return Result; - } - } - } - - RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints); - SetLastError(ERROR_INVALID_PARAMETER); - - return FALSE; -} - -/* - * @implemented (Wine 13 sep 2008) + BOOL Ret; + + /* Just query our internal function */ + Ret = BasepGetVolumeNameForVolumeMountPoint(VolumeMountPoint, VolumeName, + VolumeNameLength, NULL); + if (!Ret && VolumeName != NULL && VolumeNameLength >= 1) + { + VolumeName[0] = UNICODE_NULL; + } + + return Ret; +} + +/* + * @implemented */ BOOL WINAPI @@ -267,20 +513,60 @@ IN LPSTR lpszVolumeName, IN DWORD cchBufferLength) { - BOOL ret; - WCHAR volumeW[50], *pathW = NULL; - DWORD len = min( sizeof(volumeW) / sizeof(WCHAR), cchBufferLength ); - - TRACE("(%s, %p, %x)\n", debugstr_a(lpszVolumeMountPoint), lpszVolumeName, cchBufferLength); - - if (!lpszVolumeMountPoint || !(pathW = FilenameA2W( lpszVolumeMountPoint, TRUE ))) - return FALSE; - - if ((ret = GetVolumeNameForVolumeMountPointW( pathW, volumeW, len ))) - FilenameW2A_N( lpszVolumeName, len, volumeW, -1 ); - - RtlFreeHeap( RtlGetProcessHeap(), 0, pathW ); - return ret; + BOOL Ret; + ANSI_STRING VolumeName; + UNICODE_STRING VolumeNameU; + PUNICODE_STRING VolumeMountPointU; + + /* Convert mount point to unicode */ + VolumeMountPointU = Basep8BitStringToStaticUnicodeString(lpszVolumeMountPoint); + if (VolumeMountPointU == NULL) + { + return FALSE; + } + + /* Initialize the strings we'll use for convention */ + VolumeName.Buffer = lpszVolumeName; + VolumeName.Length = 0; + VolumeName.MaximumLength = cchBufferLength - 1; + + VolumeNameU.Length = 0; + VolumeNameU.MaximumLength = (cchBufferLength - 1) * sizeof(WCHAR) + sizeof(UNICODE_NULL); + /* Allocate a buffer big enough to contain the returned name */ + VolumeNameU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, VolumeNameU.MaximumLength); + if (VolumeNameU.Buffer == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + /* Query -W */ + Ret = GetVolumeNameForVolumeMountPointW(VolumeMountPointU->Buffer, VolumeNameU.Buffer, cchBufferLength); + /* If it succeed, perform -A conversion */ + if (Ret) + { + NTSTATUS Status; + + /* Reinit our string for length */ + RtlInitUnicodeString(&VolumeNameU, VolumeNameU.Buffer); + /* Convert to ANSI */ + Status = RtlUnicodeStringToAnsiString(&VolumeName, &VolumeNameU, FALSE); + /* If conversion failed, force failure, otherwise, just null terminate */ + if (!NT_SUCCESS(Status)) + { + Ret = FALSE; + BaseSetLastNTError(Status); + } + else + { + VolumeName.Buffer[VolumeName.Length] = ANSI_NULL; + } + } + + /* Internal buffer no longer needed */ + RtlFreeHeap(RtlGetProcessHeap(), 0, VolumeNameU.Buffer); + + return Ret; } /*
7 years, 2 months
1
0
0
0
[hbelusca] 76024: [CMD]: Fix inclusion order.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Oct 1 16:33:33 2017 New Revision: 76024 URL:
http://svn.reactos.org/svn/reactos?rev=76024&view=rev
Log: [CMD]: Fix inclusion order. Modified: trunk/reactos/base/shell/cmd/precomp.h Modified: trunk/reactos/base/shell/cmd/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/precomp.h?r…
============================================================================== --- trunk/reactos/base/shell/cmd/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/precomp.h [iso-8859-1] Sun Oct 1 16:33:33 2017 @@ -22,10 +22,10 @@ #include <wincon.h> #include <shellapi.h> -#include <conutils.h> - #define NTOS_MODE_USER #include <ndk/rtlfuncs.h> + +#include <conutils.h> #include "resource.h"
7 years, 2 months
1
0
0
0
[hbelusca] 76023: [CMD]: Use the CONUTILS library (Part 1/x) for an uniform and consistent experience across command-line tools. - Make most of CMD use the conutils library. This means that now we ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Oct 1 16:30:39 2017 New Revision: 76023 URL:
http://svn.reactos.org/svn/reactos?rev=76023&view=rev
Log: [CMD]: Use the CONUTILS library (Part 1/x) for an uniform and consistent experience across command-line tools. - Make most of CMD use the conutils library. This means that now we explicitely use the CON_STREAM objects. In particular code handling STDIN/OUT/ERR redirection should be handled with care. - Factor out much of console-related support code into console.c. Code for console input is however not "CON_STREAM-enabled" yet. - Change ConOutPrintfPaging prototype to make it return TRUE/FALSE when it can continue paged-printing or not, respectively. CORE-13860 Modified: trunk/reactos/base/shell/cmd/CMakeLists.txt trunk/reactos/base/shell/cmd/beep.c trunk/reactos/base/shell/cmd/cls.c trunk/reactos/base/shell/cmd/cmd.c trunk/reactos/base/shell/cmd/cmd.h trunk/reactos/base/shell/cmd/color.c trunk/reactos/base/shell/cmd/console.c trunk/reactos/base/shell/cmd/console.h trunk/reactos/base/shell/cmd/dir.c trunk/reactos/base/shell/cmd/history.c trunk/reactos/base/shell/cmd/misc.c trunk/reactos/base/shell/cmd/precomp.h trunk/reactos/base/shell/cmd/redir.c trunk/reactos/base/shell/cmd/start.c Modified: trunk/reactos/base/shell/cmd/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/CMakeLists.…
============================================================================== --- trunk/reactos/base/shell/cmd/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/CMakeLists.txt [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -4,6 +4,7 @@ -D_DEBUG_MEM) include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) +include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) list(APPEND SOURCE alias.c @@ -68,8 +69,9 @@ add_rc_deps(cmd.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/terminal.ico) add_executable(cmd ${SOURCE} cmd.rc) +add_pch(cmd precomp.h SOURCE) +set_module_type(cmd win32cui UNICODE) target_link_libraries(cmd wine) -set_module_type(cmd win32cui UNICODE) +target_link_libraries(cmd conutils ${PSEH_LIB}) add_importlibs(cmd advapi32 user32 msvcrt kernel32 ntdll) -add_pch(cmd precomp.h SOURCE) add_cd_file(TARGET cmd DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/base/shell/cmd/beep.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/beep.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/beep.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/beep.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -42,7 +42,7 @@ return 1; #endif - ConRingBell(GetStdHandle(STD_OUTPUT_HANDLE)); + ConRingBell(ConStreamGetOSHandle(StdOut)); return 0; } Modified: trunk/reactos/base/shell/cmd/cls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cls.c?rev=7…
============================================================================== --- trunk/reactos/base/shell/cmd/cls.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cls.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -38,7 +38,7 @@ return 0; } - ConClearScreen(GetStdHandle(STD_OUTPUT_HANDLE)); + ConClearScreen(&StdOutScreen); return 0; } Modified: trunk/reactos/base/shell/cmd/cmd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=7…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -156,18 +156,22 @@ static BOOL bWaitForCommand = FALSE; /* When we are executing something passed on the commandline after /c or /k */ INT nErrorLevel = 0; /* Errorlevel of last launched external program */ CRITICAL_SECTION ChildProcessRunningLock; -BOOL bUnicodeOutput = FALSE; BOOL bDisableBatchEcho = FALSE; BOOL bEnableExtensions = TRUE; BOOL bDelayedExpansion = FALSE; BOOL bTitleSet = FALSE; DWORD dwChildProcessId = 0; -HANDLE hIn; LPTSTR lpOriginalEnvironment; HANDLE CMD_ModuleHandle; static NtQueryInformationProcessProc NtQueryInformationProcessPtr = NULL; static NtReadVirtualMemoryProc NtReadVirtualMemoryPtr = NULL; + +/* + * Default output file stream translation mode is UTF8, but CMD switches + * allow to change it to either UTF16 (/U) or ANSI (/A). + */ +CON_STREAM_MODE OutputStreamMode = UTF8Text; // AnsiText; #ifdef INCLUDE_CMD_COLOR WORD wDefColor = 0; /* Default color */ @@ -417,7 +421,7 @@ stui.wShowWindow = SW_SHOWDEFAULT; /* Set the console to standard mode */ - SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), + SetConsoleMode(ConStreamGetOSHandle(StdIn), ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT); if (CreateProcess(szFullName, @@ -468,15 +472,32 @@ } /* Restore our default console mode */ - SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), + SetConsoleMode(ConStreamGetOSHandle(StdIn), ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT); - SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), + SetConsoleMode(ConStreamGetOSHandle(StdOut), ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT); } - /* Get code page if it has been changed */ - InputCodePage= GetConsoleCP(); - OutputCodePage = GetConsoleOutputCP(); + /* Update our local codepage cache */ + { + UINT uNewInputCodePage = GetConsoleCP(); + UINT uNewOutputCodePage = GetConsoleOutputCP(); + + if ((InputCodePage != uNewInputCodePage) || + (OutputCodePage != uNewOutputCodePage)) + { + /* Update the locale as well */ + InitLocale(); + } + + InputCodePage = uNewInputCodePage; + OutputCodePage = uNewOutputCodePage; + + /* Update the streams codepage cache as well */ + ConStreamSetCacheCodePage(StdIn , InputCodePage ); + ConStreamSetCacheCodePage(StdOut, OutputCodePage); + ConStreamSetCacheCodePage(StdErr, OutputCodePage); + } /* Restore the original console title */ if (!bTitleSet) @@ -1472,7 +1493,7 @@ rec.Event.KeyEvent.uChar.UnicodeChar = _T('C'); rec.Event.KeyEvent.dwControlKeyState = RIGHT_CTRL_PRESSED; - WriteConsoleInput(hIn, + WriteConsoleInput(ConStreamGetOSHandle(StdIn), &rec, 1, &dwWritten); @@ -1779,7 +1800,7 @@ TCHAR ModuleName[_MAX_PATH + 1]; INT nExitCode; - HANDLE hOut; + HANDLE hIn, hOut; TCHAR *ptr, *cmdLine, option = 0; BOOL AlwaysStrip = FALSE; @@ -1805,10 +1826,6 @@ /* Initialize our locale */ InitLocale(); - /* Get default input and output console handles */ - hOut = GetStdHandle(STD_OUTPUT_HANDLE); - hIn = GetStdHandle(STD_INPUT_HANDLE); - /* Initialize prompt support */ InitPrompt(); @@ -1833,6 +1850,8 @@ AddBreakHandler(); /* Set our default console mode */ + hOut = ConStreamGetOSHandle(StdOut); + hIn = ConStreamGetOSHandle(StdIn); SetConsoleMode(hOut, 0); // Reinitialize the console output mode SetConsoleMode(hOut, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT); SetConsoleMode(hIn , ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT); @@ -1871,7 +1890,7 @@ } else if (option == _T('A')) { - bUnicodeOutput = FALSE; + OutputStreamMode = AnsiText; } else if (option == _T('C') || option == _T('K') || option == _T('R')) { @@ -1899,7 +1918,7 @@ #endif else if (option == _T('U')) { - bUnicodeOutput = TRUE; + OutputStreamMode = UTF16Text; } else if (option == _T('V')) { @@ -1935,8 +1954,13 @@ } if (wDefColor != 0) - ConSetScreenColor(GetStdHandle(STD_OUTPUT_HANDLE), wDefColor, TRUE); + ConSetScreenColor(ConStreamGetOSHandle(StdOut), wDefColor, TRUE); #endif + + /* Reset the output Standard Streams translation modes and codepage caches */ + // ConStreamSetMode(StdIn , OutputStreamMode, InputCodePage ); + ConStreamSetMode(StdOut, OutputStreamMode, OutputCodePage); + ConStreamSetMode(StdErr, OutputStreamMode, OutputCodePage); if (!*ptr) { @@ -2000,9 +2024,9 @@ RemoveBreakHandler(); /* Restore the default console mode */ - SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), + SetConsoleMode(ConStreamGetOSHandle(StdIn), ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT); - SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), + SetConsoleMode(ConStreamGetOSHandle(StdOut), ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT); DeleteCriticalSection(&ChildProcessRunningLock); @@ -2022,8 +2046,13 @@ _tchdir(startPath); SetFileApisToOEM(); - InputCodePage = GetConsoleCP(); + InputCodePage = GetConsoleCP(); OutputCodePage = GetConsoleOutputCP(); + + /* Initialize the Console Standard Streams */ + ConStreamInit(StdIn , GetStdHandle(STD_INPUT_HANDLE) , /*OutputStreamMode*/ AnsiText, InputCodePage); + ConStreamInit(StdOut, GetStdHandle(STD_OUTPUT_HANDLE), OutputStreamMode, OutputCodePage); + ConStreamInit(StdErr, GetStdHandle(STD_ERROR_HANDLE) , OutputStreamMode, OutputCodePage); CMD_ModuleHandle = GetModuleHandle(NULL); Modified: trunk/reactos/base/shell/cmd/cmd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=7…
============================================================================== --- trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -54,7 +54,6 @@ extern BOOL bEnableExtensions; extern BOOL bDelayedExpansion; extern INT nErrorLevel; -extern BOOL bUnicodeOutput; /* Prototypes for ALIAS.C */ @@ -282,7 +281,7 @@ #define PROMPT_ALL 2 #define PROMPT_BREAK 3 -INT PagePrompt (VOID); +BOOL __stdcall PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total); INT FilePromptYN (UINT); INT FilePromptYNA (UINT); Modified: trunk/reactos/base/shell/cmd/color.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/color.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/color.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/color.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -46,7 +46,7 @@ /* No parameter: Set the default colors */ if (rest[0] == _T('\0')) { - ConSetScreenColor(GetStdHandle(STD_OUTPUT_HANDLE), wDefColor, TRUE); + ConSetScreenColor(ConStreamGetOSHandle(StdOut), wDefColor, TRUE); return 0; } @@ -87,7 +87,7 @@ * Set the chosen color. Use also the following advanced flag: * /-F to avoid changing already buffered foreground/background. */ - if (ConSetScreenColor(GetStdHandle(STD_OUTPUT_HANDLE), wColor, + if (ConSetScreenColor(ConStreamGetOSHandle(StdOut), wColor, !_tcsstr(rest, _T("/-F")) && !_tcsstr(rest, _T("/-f"))) == FALSE) { /* Failed because foreground and background colors were the same */ Modified: trunk/reactos/base/shell/cmd/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?r…
============================================================================== --- trunk/reactos/base/shell/cmd/console.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/console.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -25,30 +25,9 @@ UINT InputCodePage; UINT OutputCodePage; - -BOOL IsConsoleHandle(HANDLE hHandle) -{ - DWORD dwMode; - - /* Check whether the handle may be that of a console... */ - if ((GetFileType(hHandle) & ~FILE_TYPE_REMOTE) != FILE_TYPE_CHAR) - return FALSE; - - /* - * It may be. Perform another test... The idea comes from the - * MSDN description of the WriteConsole API: - * - * "WriteConsole fails if it is used with a standard handle - * that is redirected to a file. If an application processes - * multilingual output that can be redirected, determine whether - * the output handle is a console handle (one method is to call - * the GetConsoleMode function and check whether it succeeds). - * If the handle is a console handle, call WriteConsole. If the - * handle is not a console handle, the output is redirected and - * you should call WriteFile to perform the I/O." - */ - return GetConsoleMode(hHandle, &dwMode); -} +/* Global console Screen and Pager */ +CON_SCREEN StdOutScreen = INIT_CON_SCREEN(StdOut); +CON_PAGER StdOutPager = INIT_CON_PAGER(&StdOutScreen); @@ -90,9 +69,11 @@ do { ReadConsoleInput(hInput, lpBuffer, 1, &dwRead); - if ((lpBuffer->EventType == KEY_EVENT) && - (lpBuffer->Event.KeyEvent.bKeyDown != FALSE)) + if (lpBuffer->EventType == KEY_EVENT && + lpBuffer->Event.KeyEvent.bKeyDown) + { break; + } } while (TRUE); } @@ -139,306 +120,68 @@ /******************** Console STREAM OUT utility functions ********************/ -static VOID ConWrite(DWORD nStdHandle, TCHAR *str, DWORD len) -{ - DWORD dwNumBytes = 0; - HANDLE hOutput = GetStdHandle(nStdHandle); - PVOID p; - - /* If we don't write anything, just return */ - if (!str || len == 0) - return; - - /* Check whether we are writing to a console and if so, write to it */ - if (IsConsoleHandle(hOutput)) - { - WriteConsole(hOutput, str, len, &dwNumBytes, NULL); - return; - } - - /* We're writing to a file or pipe instead of the console. Convert the - * string from TCHARs to the desired output format, if the two differ */ - if (bUnicodeOutput) - { -#ifndef _UNICODE - WCHAR *buffer = cmd_alloc(len * sizeof(WCHAR)); - if (!buffer) - { - error_out_of_memory(); - return; - } - len = (DWORD)MultiByteToWideChar(OutputCodePage, 0, str, (INT)len, buffer, (INT)len); - str = (PVOID)buffer; -#endif - /* - * Find any newline character in the buffer, - * write the part BEFORE the newline, then write - * a carriage-return + newline, and then write - * the remaining part of the buffer. - * - * This fixes output in files and serial console. - */ - while (len > 0) - { - /* Loop until we find a \r or \n character */ - // FIXME: What about the pair \r\n ? - p = str; - while (len > 0 && *(PWCHAR)p != L'\r' && *(PWCHAR)p != L'\n') - { - /* Advance one character */ - p = (PVOID)((PWCHAR)p + 1); - len--; - } - - /* Write everything up to \r or \n */ - dwNumBytes = ((PWCHAR)p - (PWCHAR)str) * sizeof(WCHAR); - WriteFile(hOutput, str, dwNumBytes, &dwNumBytes, NULL); - - /* If we hit \r or \n ... */ - if (len > 0 && (*(PWCHAR)p == L'\r' || *(PWCHAR)p == L'\n')) - { - /* ... send a carriage-return + newline sequence and skip \r or \n */ - WriteFile(hOutput, L"\r\n", 2 * sizeof(WCHAR), &dwNumBytes, NULL); - str = (PVOID)((PWCHAR)p + 1); - len--; - } - } - -#ifndef _UNICODE - cmd_free(buffer); -#endif - } - else - { -#ifdef _UNICODE - CHAR *buffer = cmd_alloc(len * MB_LEN_MAX * sizeof(CHAR)); - if (!buffer) - { - error_out_of_memory(); - return; - } - len = WideCharToMultiByte(OutputCodePage, 0, str, len, buffer, len * MB_LEN_MAX, NULL, NULL); - str = (PVOID)buffer; -#endif - /* - * Find any newline character in the buffer, - * write the part BEFORE the newline, then write - * a carriage-return + newline, and then write - * the remaining part of the buffer. - * - * This fixes output in files and serial console. - */ - while (len > 0) - { - /* Loop until we find a \r or \n character */ - // FIXME: What about the pair \r\n ? - p = str; - while (len > 0 && *(PCHAR)p != '\r' && *(PCHAR)p != '\n') - { - /* Advance one character */ - p = (PVOID)((PCHAR)p + 1); - len--; - } - - /* Write everything up to \r or \n */ - dwNumBytes = ((PCHAR)p - (PCHAR)str) * sizeof(CHAR); - WriteFile(hOutput, str, dwNumBytes, &dwNumBytes, NULL); - - /* If we hit \r or \n ... */ - if (len > 0 && (*(PCHAR)p == '\r' || *(PCHAR)p == '\n')) - { - /* ... send a carriage-return + newline sequence and skip \r or \n */ - WriteFile(hOutput, "\r\n", 2, &dwNumBytes, NULL); - str = (PVOID)((PCHAR)p + 1); - len--; - } - } - -#ifdef _UNICODE - cmd_free(buffer); -#endif - } -} - -VOID ConPuts(DWORD nStdHandle, LPTSTR szText) -{ - ConWrite(nStdHandle, szText, (DWORD)_tcslen(szText)); -} - -VOID ConResPuts(DWORD nStdHandle, UINT resID) -{ - TCHAR szMsg[RC_STRING_MAX_SIZE]; - LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg)); - ConPuts(nStdHandle, szMsg); -} - VOID ConOutChar(TCHAR c) { - ConWrite(STD_OUTPUT_HANDLE, &c, 1); + ConWrite(StdOut, &c, 1); } VOID ConErrChar(TCHAR c) { - ConWrite(STD_ERROR_HANDLE, &c, 1); -} - -VOID ConPrintfV(DWORD nStdHandle, LPTSTR szFormat, va_list arg_ptr) -{ - TCHAR szOut[OUTPUT_BUFFER_SIZE]; - DWORD len; - - len = (DWORD)_vstprintf(szOut, szFormat, arg_ptr); - ConWrite(nStdHandle, szOut, len); -} - -VOID ConPrintf(DWORD nStdHandle, LPTSTR szFormat, ...) -{ + ConWrite(StdErr, &c, 1); +} + +VOID __cdecl ConFormatMessage(PCON_STREAM Stream, DWORD MessageId, ...) +{ + INT Len; va_list arg_ptr; - va_start(arg_ptr, szFormat); - ConPrintfV(nStdHandle, szFormat, arg_ptr); - va_end(arg_ptr); -} - -VOID ConResPrintf(DWORD nStdHandle, UINT resID, ...) -{ - TCHAR szMsg[RC_STRING_MAX_SIZE]; - va_list arg_ptr; - - va_start(arg_ptr, resID); - LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg)); - ConPrintfV(nStdHandle, szMsg, arg_ptr); - va_end(arg_ptr); -} - -VOID ConFormatMessage(DWORD nStdHandle, DWORD MessageId, ...) -{ - DWORD ret; - LPTSTR text; - va_list arg_ptr; - va_start(arg_ptr, MessageId); - ret = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + Len = ConMsgPrintfV(Stream, + FORMAT_MESSAGE_FROM_SYSTEM, NULL, MessageId, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&text, - 0, - &arg_ptr); + LANG_USER_DEFAULT, + arg_ptr); va_end(arg_ptr); - if (ret > 0) - { - ConPuts(nStdHandle, text); - LocalFree(text); - } - else - { - ConResPrintf(nStdHandle, STRING_CONSOLE_ERROR, MessageId); - } + if (Len <= 0) + ConResPrintf(Stream, STRING_CONSOLE_ERROR, MessageId); } /************************** Console PAGER functions ***************************/ -BOOL ConPrintfVPaging(DWORD nStdHandle, BOOL NewPage, LPTSTR szFormat, va_list arg_ptr) -{ - INT len; - CONSOLE_SCREEN_BUFFER_INFO csbi; +BOOL ConPrintfVPaging(PCON_PAGER Pager, BOOL StartPaging, LPTSTR szFormat, va_list arg_ptr) +{ + // INT len; TCHAR szOut[OUTPUT_BUFFER_SIZE]; - DWORD dwWritten; - HANDLE hOutput = GetStdHandle(nStdHandle); - - /* Used to count number of lines since last pause */ - static int LineCount = 0; - - /* Used to see how big the screen is */ - int ScreenLines = 0; - - /* Chars since start of line */ - int CharSL; - - int from = 0, i = 0; - - if (NewPage != FALSE) - LineCount = 0; - - /* Reset LineCount and return if no string has been given */ + + /* Return if no string has been given */ if (szFormat == NULL) return TRUE; - /* Get the size of the visual screen that can be printed to */ - if (!IsConsoleHandle(hOutput) || !GetConsoleScreenBufferInfo(hOutput, &csbi)) - { - /* We assume it's a file handle */ - ConPrintfV(nStdHandle, szFormat, arg_ptr); - return TRUE; - } - - /* - * Get the number of lines currently displayed on screen, minus 1 - * to account for the "press any key..." prompt from PagePrompt(). - */ - ScreenLines = (csbi.srWindow.Bottom - csbi.srWindow.Top); - CharSL = csbi.dwCursorPosition.X; - - /* Make sure the user doesn't have the screen too small */ - if (ScreenLines < 4) - { - ConPrintfV(nStdHandle, szFormat, arg_ptr); - return TRUE; - } - - len = _vstprintf(szOut, szFormat, arg_ptr); - - while (i < len) - { - /* Search until the end of a line is reached */ - if (szOut[i++] != _T('\n') && ++CharSL < csbi.dwSize.X) - continue; - - LineCount++; - CharSL=0; - - if (LineCount >= ScreenLines) - { - WriteConsole(hOutput, &szOut[from], i-from, &dwWritten, NULL); - from = i; - - /* Prompt the user */ - if (PagePrompt() != PROMPT_YES) - return FALSE; - - // TODO: Recalculate 'ScreenLines' in case the user redimensions - // the window during the prompt. - - /* Reset the number of lines being printed */ - LineCount = 0; - } - } - - WriteConsole(hOutput, &szOut[from], i-from, &dwWritten, NULL); - - return TRUE; -} - -BOOL ConOutPrintfPaging(BOOL NewPage, LPTSTR szFormat, ...) + /*len =*/ _vstprintf(szOut, szFormat, arg_ptr); + + // return ConPutsPaging(Pager, PagePrompt, StartPaging, szOut); + return ConWritePaging(Pager, PagePrompt, StartPaging, + szOut, wcslen(szOut)); +} + +BOOL __cdecl ConOutPrintfPaging(BOOL StartPaging, LPTSTR szFormat, ...) { BOOL bRet; va_list arg_ptr; va_start(arg_ptr, szFormat); - bRet = ConPrintfVPaging(STD_OUTPUT_HANDLE, NewPage, szFormat, arg_ptr); + bRet = ConPrintfVPaging(&StdOutPager, StartPaging, szFormat, arg_ptr); va_end(arg_ptr); return bRet; } -VOID ConOutResPaging(BOOL NewPage, UINT resID) -{ - TCHAR szMsg[RC_STRING_MAX_SIZE]; - LoadString(CMD_ModuleHandle, resID, szMsg, ARRAYSIZE(szMsg)); - ConOutPrintfPaging(NewPage, szMsg); +VOID ConOutResPaging(BOOL StartPaging, UINT resID) +{ + ConResPaging(&StdOutPager, PagePrompt, StartPaging, resID); } @@ -451,7 +194,7 @@ coPos.X = x; coPos.Y = y; - SetConsoleCursorPosition(GetStdHandle (STD_OUTPUT_HANDLE), coPos); + SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coPos); } VOID GetCursorXY(PSHORT x, PSHORT y) @@ -487,7 +230,7 @@ cci.dwSize = bInsert ? 10 : 99; cci.bVisible = bVisible; - SetConsoleCursorInfo(GetStdHandle (STD_OUTPUT_HANDLE), &cci); + SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cci); } VOID GetScreenSize(PSHORT maxx, PSHORT maxy) @@ -552,32 +295,6 @@ else #endif MessageBeep(-1); -} -#endif - -#ifdef INCLUDE_CMD_CLS -VOID ConClearScreen(HANDLE hOutput) -{ - CONSOLE_SCREEN_BUFFER_INFO csbi; - COORD coPos; - DWORD dwWritten; - - if (GetConsoleScreenBufferInfo(hOutput, &csbi)) - { - coPos.X = 0; - coPos.Y = 0; - FillConsoleOutputAttribute(hOutput, csbi.wAttributes, - csbi.dwSize.X * csbi.dwSize.Y, - coPos, &dwWritten); - FillConsoleOutputCharacter(hOutput, _T(' '), - csbi.dwSize.X * csbi.dwSize.Y, - coPos, &dwWritten); - SetConsoleCursorPosition(hOutput, coPos); - } - else - { - ConOutChar(_T('\f')); - } } #endif Modified: trunk/reactos/base/shell/cmd/console.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.h?r…
============================================================================== --- trunk/reactos/base/shell/cmd/console.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/console.h [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -1,9 +1,13 @@ #pragma once -/* Cache codepage */ +/* Cache codepage for text streams */ extern UINT InputCodePage; extern UINT OutputCodePage; + +/* Global console Screen and Pager */ +extern CON_SCREEN StdOutScreen; +extern CON_PAGER StdOutPager; // /* Global variables */ // extern BOOL bCtrlBreak; @@ -18,50 +22,45 @@ VOID ConInString (LPTSTR, DWORD); -VOID ConOutChar (TCHAR); -VOID ConErrChar (TCHAR); -VOID ConPrintfV(DWORD, LPTSTR, va_list); +VOID ConOutChar(TCHAR); +VOID ConErrChar(TCHAR); -VOID ConPuts(DWORD nStdHandle, LPTSTR szText); -VOID ConPrintf(DWORD nStdHandle, LPTSTR szFormat, ...); -VOID ConResPuts(DWORD nStdHandle, UINT resID); -VOID ConResPrintf(DWORD nStdHandle, UINT resID, ...); -VOID ConFormatMessage(DWORD nStdHandle, DWORD MessageId, ...); +VOID __cdecl ConFormatMessage(PCON_STREAM Stream, DWORD MessageId, ...); #define ConOutPuts(szStr) \ - ConPuts(STD_OUTPUT_HANDLE, (szStr)) + ConPuts(StdOut, (szStr)) #define ConErrPuts(szStr) \ - ConPuts(STD_ERROR_HANDLE, (szStr)) + ConPuts(StdErr, (szStr)) #define ConOutResPuts(uID) \ - ConResPuts(STD_OUTPUT_HANDLE, (uID)) + ConResPuts(StdOut, (uID)) #define ConErrResPuts(uID) \ - ConResPuts(STD_ERROR_HANDLE, (uID)) + ConResPuts(StdErr, (uID)) #define ConOutPrintf(szStr, ...) \ - ConPrintf(STD_OUTPUT_HANDLE, (szStr), ##__VA_ARGS__) + ConPrintf(StdOut, (szStr), ##__VA_ARGS__) #define ConErrPrintf(szStr, ...) \ - ConPrintf(STD_ERROR_HANDLE, (szStr), ##__VA_ARGS__) + ConPrintf(StdErr, (szStr), ##__VA_ARGS__) #define ConOutResPrintf(uID, ...) \ - ConResPrintf(STD_OUTPUT_HANDLE, (uID), ##__VA_ARGS__) + ConResPrintf(StdOut, (uID), ##__VA_ARGS__) #define ConErrResPrintf(uID, ...) \ - ConResPrintf(STD_ERROR_HANDLE, (uID), ##__VA_ARGS__) + ConResPrintf(StdErr, (uID), ##__VA_ARGS__) #define ConOutFormatMessage(MessageId, ...) \ - ConFormatMessage(STD_OUTPUT_HANDLE, (MessageId), ##__VA_ARGS__) + ConFormatMessage(StdOut, (MessageId), ##__VA_ARGS__) #define ConErrFormatMessage(MessageId, ...) \ - ConFormatMessage(STD_ERROR_HANDLE, (MessageId), ##__VA_ARGS__) + ConFormatMessage(StdErr, (MessageId), ##__VA_ARGS__) -BOOL ConPrintfVPaging(DWORD nStdHandle, BOOL, LPTSTR, va_list); -BOOL ConOutPrintfPaging (BOOL NewPage, LPTSTR, ...); -VOID ConOutResPaging(BOOL NewPage, UINT resID); +BOOL ConPrintfVPaging(PCON_PAGER Pager, BOOL StartPaging, LPTSTR szFormat, va_list arg_ptr); +BOOL __cdecl ConOutPrintfPaging(BOOL StartPaging, LPTSTR szFormat, ...); +VOID ConOutResPaging(BOOL StartPaging, UINT resID); SHORT GetCursorX (VOID); SHORT GetCursorY (VOID); @@ -83,10 +82,6 @@ VOID ConRingBell(HANDLE hOutput); #endif -#ifdef INCLUDE_CMD_CLS -VOID ConClearScreen(HANDLE hOutput); -#endif - #ifdef INCLUDE_CMD_COLOR BOOL ConSetScreenColor(HANDLE hOutput, WORD wColor, BOOL bFill); #endif @@ -99,6 +94,5 @@ // #define PROMPT_ALL 2 // #define PROMPT_BREAK 3 -// INT PagePrompt (VOID); // INT FilePromptYN (UINT); // INT FilePromptYNA (UINT); Modified: trunk/reactos/base/shell/cmd/dir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dir.c?rev=7…
============================================================================== --- trunk/reactos/base/shell/cmd/dir.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/dir.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -557,9 +557,9 @@ va_list arg_ptr; va_start(arg_ptr, szFormat); if (lpFlags->bPause) - Done = ConPrintfVPaging(STD_OUTPUT_HANDLE, FALSE, szFormat, arg_ptr); + Done = ConPrintfVPaging(&StdOutPager, FALSE, szFormat, arg_ptr); else - ConPrintfV(STD_OUTPUT_HANDLE, szFormat, arg_ptr); + ConPrintfV(StdOut, szFormat, arg_ptr); va_end(arg_ptr); return Done; } Modified: trunk/reactos/base/shell/cmd/history.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/history.c?r…
============================================================================== --- trunk/reactos/base/shell/cmd/history.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/history.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -87,8 +87,6 @@ break; case _T('R'):/*read history from standard in*/ - //hIn=GetStdHandle (STD_INPUT_HANDLE); - for(;;) { ConInString(szBuffer,sizeof(szBuffer)/sizeof(TCHAR)); Modified: trunk/reactos/base/shell/cmd/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/misc.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/misc.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/misc.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -534,7 +534,8 @@ return TRUE; } -INT PagePrompt(VOID) +// See r874 +BOOL __stdcall PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total) { SHORT iScreenWidth, iCursorY; INPUT_RECORD ir; @@ -574,10 +575,10 @@ ConOutChar(_T('\n')); bCtrlBreak = TRUE; - return PROMPT_BREAK; - } - - return PROMPT_YES; + return FALSE; + } + + return TRUE; } Modified: trunk/reactos/base/shell/cmd/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/precomp.h?r…
============================================================================== --- trunk/reactos/base/shell/cmd/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/precomp.h [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -22,6 +22,8 @@ #include <wincon.h> #include <shellapi.h> +#include <conutils.h> + #define NTOS_MODE_USER #include <ndk/rtlfuncs.h> Modified: trunk/reactos/base/shell/cmd/redir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/redir.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/redir.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/redir.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -29,15 +29,18 @@ #ifdef FEATURE_REDIRECTION - -/* cmd allows redirection of handles numbered 3-9 even though these don't - * correspond to any STD_ constant. */ -static HANDLE ExtraHandles[10 - 3]; +/* + * CMD allows redirection of handles numbered 3-9 even though + * these don't correspond to any STD_ constant. + */ +static const PCON_STREAM StdStreams[] = { StdIn, StdOut, StdErr }; +static HANDLE ExtraHandles[10 - 3]; // 3 == ARRAYSIZE(StdStreams) static HANDLE GetHandle(UINT Number) { if (Number < 3) - return GetStdHandle(STD_INPUT_HANDLE - Number); + return ConStreamGetOSHandle(StdStreams[Number]); + // return GetStdHandle(STD_INPUT_HANDLE - Number); else return ExtraHandles[Number - 3]; } @@ -45,9 +48,15 @@ static VOID SetHandle(UINT Number, HANDLE Handle) { if (Number < 3) + { + ConStreamSetOSHandle(StdStreams[Number], Handle); + /* Synchronize the associated Win32 handle */ SetStdHandle(STD_INPUT_HANDLE - Number, Handle); + } else + { ExtraHandles[Number - 3] = Handle; + } } BOOL Modified: trunk/reactos/base/shell/cmd/start.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/start.c?rev…
============================================================================== --- trunk/reactos/base/shell/cmd/start.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/start.c [iso-8859-1] Sun Oct 1 16:30:39 2017 @@ -304,9 +304,26 @@ } CloseHandle (prci.hProcess); - /* Get New code page if it has change */ - InputCodePage= GetConsoleCP(); - OutputCodePage = GetConsoleOutputCP(); + /* Update our local codepage cache */ + { + UINT uNewInputCodePage = GetConsoleCP(); + UINT uNewOutputCodePage = GetConsoleOutputCP(); + + if ((InputCodePage != uNewInputCodePage) || + (OutputCodePage != uNewOutputCodePage)) + { + /* Update the locale as well */ + InitLocale(); + } + + InputCodePage = uNewInputCodePage; + OutputCodePage = uNewOutputCodePage; + + /* Update the streams codepage cache as well */ + ConStreamSetCacheCodePage(StdIn , InputCodePage ); + ConStreamSetCacheCodePage(StdOut, OutputCodePage); + ConStreamSetCacheCodePage(StdErr, OutputCodePage); + } } else {
7 years, 2 months
1
0
0
0
[hbelusca] 76022: [CONUTILS]: Add some string resources functions that can support a specified hModule parameter, and add small construction helpers for CON_SCREEN and CON_PAGER.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Oct 1 16:03:44 2017 New Revision: 76022 URL:
http://svn.reactos.org/svn/reactos?rev=76022&view=rev
Log: [CONUTILS]: Add some string resources functions that can support a specified hModule parameter, and add small construction helpers for CON_SCREEN and CON_PAGER. Modified: trunk/reactos/sdk/lib/conutils/pager.c trunk/reactos/sdk/lib/conutils/pager.h trunk/reactos/sdk/lib/conutils/screen.h trunk/reactos/sdk/lib/conutils/stream.c trunk/reactos/sdk/lib/conutils/stream.h Modified: trunk/reactos/sdk/lib/conutils/pager.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/pager.c?r…
============================================================================== --- trunk/reactos/sdk/lib/conutils/pager.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/conutils/pager.c [iso-8859-1] Sun Oct 1 16:03:44 2017 @@ -131,18 +131,30 @@ } BOOL +ConResPagingEx( + IN PCON_PAGER Pager, + IN PAGE_PROMPT PagePrompt, + IN BOOL StartPaging, + IN HINSTANCE hInstance OPTIONAL, + IN UINT uID) +{ + INT Len; + PWCHAR szStr = NULL; + + Len = K32LoadStringW(hInstance, uID, (PWSTR)&szStr, 0); + if (szStr && Len) + return ConWritePaging(Pager, PagePrompt, StartPaging, szStr, Len); + else + return TRUE; +} + +BOOL ConResPaging( IN PCON_PAGER Pager, IN PAGE_PROMPT PagePrompt, IN BOOL StartPaging, IN UINT uID) { - INT Len; - PWCHAR szStr = NULL; - - Len = K32LoadStringW(GetModuleHandleW(NULL), uID, (PWSTR)&szStr, 0); - if (szStr && Len) - return ConWritePaging(Pager, PagePrompt, StartPaging, szStr, Len); - else - return TRUE; + return ConResPagingEx(Pager, PagePrompt, StartPaging, + NULL /*GetModuleHandleW(NULL)*/, uID); } Modified: trunk/reactos/sdk/lib/conutils/pager.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/pager.h?r…
============================================================================== --- trunk/reactos/sdk/lib/conutils/pager.h [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/conutils/pager.h [iso-8859-1] Sun Oct 1 16:03:44 2017 @@ -30,6 +30,14 @@ DWORD LineCount; } CON_PAGER, *PCON_PAGER; +#define INIT_CON_PAGER(pScreen) {(pScreen), 0} + +#define InitializeConPager(pPager, pScreen) \ +do { \ + (pPager)->Screen = (pScreen); \ + (pPager)->LineCount = 0; \ +} while (0) + // Pager, Done, Total typedef BOOL (__stdcall *PAGE_PROMPT)(IN PCON_PAGER, IN DWORD, IN DWORD); @@ -49,6 +57,14 @@ IN LPTSTR szStr); BOOL +ConResPagingEx( + IN PCON_PAGER Pager, + IN PAGE_PROMPT PagePrompt, + IN BOOL StartPaging, + IN HINSTANCE hInstance OPTIONAL, + IN UINT uID); + +BOOL ConResPaging( IN PCON_PAGER Pager, IN PAGE_PROMPT PagePrompt, Modified: trunk/reactos/sdk/lib/conutils/screen.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/screen.h?…
============================================================================== --- trunk/reactos/sdk/lib/conutils/screen.h [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/conutils/screen.h [iso-8859-1] Sun Oct 1 16:03:44 2017 @@ -35,6 +35,15 @@ CONSOLE_CURSOR_INFO cci; } CON_SCREEN, *PCON_SCREEN; +#define INIT_CON_SCREEN(pStream) {(pStream)} /* {(pStream), {{}}, {{}}} */ + +#define InitializeConScreen(pScreen, pStream) \ +do { \ + (pScreen)->Stream = (pStream); \ + RtlZeroMemory(&(pScreen)->csbi, sizeof((pScreen)->csbi)); \ + RtlZeroMemory(&(pScreen)->cci , sizeof((pScreen)->cci )); \ +} while (0) + BOOL ConGetScreenInfo( IN PCON_SCREEN Screen, Modified: trunk/reactos/sdk/lib/conutils/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/stream.c?…
============================================================================== --- trunk/reactos/sdk/lib/conutils/stream.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/conutils/stream.c [iso-8859-1] Sun Oct 1 16:03:44 2017 @@ -483,7 +483,9 @@ SetLastError(ERROR_NOT_ENOUGH_MEMORY); return 0; } - len = WideCharToMultiByte(Stream->CodePage, 0, szStr, len, buffer, len * MB_LEN_MAX, NULL, NULL); + len = WideCharToMultiByte(Stream->CodePage, 0, + szStr, len, buffer, len * MB_LEN_MAX, + NULL, NULL); szStr = (PVOID)buffer; #else /* @@ -705,14 +707,15 @@ } INT -ConResPuts( - IN PCON_STREAM Stream, +ConResPutsEx( + IN PCON_STREAM Stream, + IN HINSTANCE hInstance OPTIONAL, IN UINT uID) { INT Len; PWCHAR szStr = NULL; - Len = K32LoadStringW(GetModuleHandleW(NULL), uID, (PWSTR)&szStr, 0); + Len = K32LoadStringW(hInstance, uID, (PWSTR)&szStr, 0); if (szStr && Len) // Len = ConPuts(Stream, szStr); CON_STREAM_WRITE2(Stream, szStr, Len, Len); @@ -725,8 +728,17 @@ } INT -ConResPrintfV( - IN PCON_STREAM Stream, +ConResPuts( + IN PCON_STREAM Stream, + IN UINT uID) +{ + return ConResPutsEx(Stream, NULL /*GetModuleHandleW(NULL)*/, uID); +} + +INT +ConResPrintfExV( + IN PCON_STREAM Stream, + IN HINSTANCE hInstance OPTIONAL, IN UINT uID, IN va_list args) // arg_ptr { @@ -734,9 +746,36 @@ WCHAR bufSrc[CON_RC_STRING_MAX_SIZE]; // NOTE: We may use the special behaviour where nBufMaxSize == 0 - Len = K32LoadStringW(GetModuleHandleW(NULL), uID, bufSrc, ARRAYSIZE(bufSrc)); + Len = K32LoadStringW(hInstance, uID, bufSrc, ARRAYSIZE(bufSrc)); if (Len) Len = ConPrintfV(Stream, bufSrc, args); + + return Len; +} + +INT +ConResPrintfV( + IN PCON_STREAM Stream, + IN UINT uID, + IN va_list args) // arg_ptr +{ + return ConResPrintfExV(Stream, NULL /*GetModuleHandleW(NULL)*/, uID, args); +} + +INT +__cdecl +ConResPrintfEx( + IN PCON_STREAM Stream, + IN HINSTANCE hInstance OPTIONAL, + IN UINT uID, + ...) +{ + INT Len; + va_list args; + + va_start(args, uID); + Len = ConResPrintfExV(Stream, hInstance, uID, args); + va_end(args); return Len; } Modified: trunk/reactos/sdk/lib/conutils/stream.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/conutils/stream.h?…
============================================================================== --- trunk/reactos/sdk/lib/conutils/stream.h [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/conutils/stream.h [iso-8859-1] Sun Oct 1 16:03:44 2017 @@ -184,15 +184,36 @@ ...); INT +ConResPutsEx( + IN PCON_STREAM Stream, + IN HINSTANCE hInstance OPTIONAL, + IN UINT uID); + +INT ConResPuts( IN PCON_STREAM Stream, IN UINT uID); INT +ConResPrintfExV( + IN PCON_STREAM Stream, + IN HINSTANCE hInstance OPTIONAL, + IN UINT uID, + IN va_list args); // arg_ptr + +INT ConResPrintfV( IN PCON_STREAM Stream, IN UINT uID, IN va_list args); // arg_ptr + +INT +__cdecl +ConResPrintfEx( + IN PCON_STREAM Stream, + IN HINSTANCE hInstance OPTIONAL, + IN UINT uID, + ...); INT __cdecl
7 years, 2 months
1
0
0
0
[tkreuzer] 76021: [REACTOS] Replace comparison against TRUE with comparison against FALSE Based on patch by Love Nystrom
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Oct 1 14:42:04 2017 New Revision: 76021 URL:
http://svn.reactos.org/svn/reactos?rev=76021&view=rev
Log: [REACTOS] Replace comparison against TRUE with comparison against FALSE Based on patch by Love Nystrom Modified: trunk/reactos/base/applications/calc/utl.c trunk/reactos/base/applications/calc/utl_mpfr.c trunk/reactos/base/applications/calc/winmain.c trunk/reactos/base/applications/charmap/settings.c trunk/reactos/base/applications/mscutils/servman/start.c trunk/reactos/base/applications/network/net/cmdAccounts.c trunk/reactos/base/applications/network/net/cmdUser.c trunk/reactos/base/applications/notepad/dialog.c trunk/reactos/base/applications/notepad/main.c trunk/reactos/base/applications/regedit/edit.c trunk/reactos/base/applications/sndrec32/sndrec32.cpp trunk/reactos/base/applications/sndvol32/dialog.c trunk/reactos/base/services/svchost/svchost.c trunk/reactos/base/setup/usetup/interface/consup.c trunk/reactos/base/setup/usetup/interface/usetup.c trunk/reactos/base/setup/usetup/partlist.c trunk/reactos/base/shell/cmd/choice.c trunk/reactos/base/shell/cmd/console.c trunk/reactos/base/shell/cmd/dir.c trunk/reactos/base/shell/cmd/misc.c trunk/reactos/base/shell/cmd/ren.c trunk/reactos/base/system/autochk/autochk.c trunk/reactos/base/system/diskpart/interpreter.c trunk/reactos/base/system/services/database.c trunk/reactos/base/system/services/driver.c trunk/reactos/base/system/services/services.c trunk/reactos/dll/cpl/desk/background.c trunk/reactos/dll/cpl/main/mouse.c trunk/reactos/dll/cpl/mmsys/sounds.c trunk/reactos/dll/cpl/sysdm/advanced.c trunk/reactos/dll/cpl/sysdm/virtmem.c trunk/reactos/dll/directx/d3d9/adapter.c trunk/reactos/dll/directx/d3d9/d3d9_create.c trunk/reactos/dll/directx/d3d9/d3d9_impl.c trunk/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c trunk/reactos/dll/directx/dsound_new/directsound.c trunk/reactos/dll/directx/wine/dsound/mixer.c trunk/reactos/dll/win32/advapi32/reg/reg.c trunk/reactos/dll/win32/advapi32/sec/misc.c trunk/reactos/dll/win32/advapi32/service/scm.c trunk/reactos/dll/win32/advapi32/service/sctrl.c trunk/reactos/dll/win32/kernel32/client/appcache.c trunk/reactos/dll/win32/kernel32/client/console/init.c trunk/reactos/dll/win32/kernel32/client/dllmain.c trunk/reactos/dll/win32/kernel32/client/power.c trunk/reactos/dll/win32/kernel32/client/proc.c trunk/reactos/dll/win32/lsasrv/authport.c trunk/reactos/dll/win32/lsasrv/lsarpc.c trunk/reactos/dll/win32/lsasrv/privileges.c trunk/reactos/dll/win32/msports/classinst.c trunk/reactos/dll/win32/msv1_0/msv1_0.c trunk/reactos/dll/win32/netapi32/user.c trunk/reactos/dll/win32/samsrv/samrpc.c trunk/reactos/dll/win32/samsrv/setup.c trunk/reactos/dll/win32/serialui/serialui.c trunk/reactos/dll/win32/shimgvw/shimgvw.c trunk/reactos/dll/win32/shlwapi/path.c trunk/reactos/dll/win32/uxtheme/system.c trunk/reactos/dll/win32/uxtheme/themehooks.c trunk/reactos/dll/win32/wshtcpip/wshtcpip.c trunk/reactos/drivers/bus/acpi/pnp.c trunk/reactos/drivers/filesystems/cdfs/dirctl.c trunk/reactos/drivers/ksfilter/ks/misc.c trunk/reactos/drivers/multimedia/audio/mpu401_nt4/mpu401.c trunk/reactos/drivers/multimedia/audio/sndblst.old/sndblst.c trunk/reactos/drivers/storage/class/disk_new/disk.c trunk/reactos/drivers/storage/class/disk_new/part.c trunk/reactos/drivers/storage/class/disk_new/pnp.c trunk/reactos/drivers/storage/classpnp/autorun.c trunk/reactos/drivers/storage/classpnp/class.c trunk/reactos/drivers/storage/classpnp/obsolete.c trunk/reactos/drivers/storage/classpnp/power.c trunk/reactos/drivers/storage/ide/atapi/atapi.c trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp trunk/reactos/drivers/usb/usbohci/usb_request.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp trunk/reactos/drivers/wdm/audio/legacy/stream/helper.c trunk/reactos/hal/halppc/generic/bus.c trunk/reactos/hal/halppc/generic/display.c trunk/reactos/hal/halx86/acpi/busemul.c Modified: trunk/reactos/base/applications/calc/utl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/utl…
============================================================================== --- trunk/reactos/base/applications/calc/utl.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/utl.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -19,7 +19,7 @@ #define MAX_LD_WIDTH 16 /* calculate the width of integer number */ width = (rpn->f==0) ? 1 : (int)log10(fabs(rpn->f))+1; - if (calc.sci_out == TRUE || width > MAX_LD_WIDTH || width < -MAX_LD_WIDTH) + if ((calc.sci_out != FALSE) || (width > MAX_LD_WIDTH) || (width < -MAX_LD_WIDTH)) _stprintf(buffer, TEXT("%#e"), rpn->f); else { TCHAR *ptr, *dst; Modified: trunk/reactos/base/applications/calc/utl_mpfr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/utl…
============================================================================== --- trunk/reactos/base/applications/calc/utl_mpfr.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/utl_mpfr.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -39,7 +39,7 @@ width = 1 + mpfr_get_si(t, MPFR_DEFAULT_RND); mpfr_clear(t); } - if (calc.sci_out == TRUE || width > max_ld_width || width < -max_ld_width) + if ((calc.sci_out != FALSE) || (width > max_ld_width) || (width < -max_ld_width)) ptr = temp + gmp_sprintf(temp, "%*.*#Fe", 1, max_ld_width, ff); else { ptr = temp + gmp_sprintf(temp, "%#*.*Ff", width, ((max_ld_width-width-1)>=0) ? max_ld_width-width-1 : 0, ff); Modified: trunk/reactos/base/applications/calc/winmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/win…
============================================================================== --- trunk/reactos/base/applications/calc/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/calc/winmain.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1144,7 +1144,7 @@ static void run_fe(calc_number_t *number) { - calc.sci_out = ((calc.sci_out == TRUE) ? FALSE : TRUE); + calc.sci_out = ((calc.sci_out != FALSE) ? FALSE : TRUE); } static void handle_context_menu(HWND hWnd, WPARAM wp, LPARAM lp) Modified: trunk/reactos/base/applications/charmap/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/charmap/…
============================================================================== --- trunk/reactos/base/applications/charmap/settings.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/charmap/settings.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -91,7 +91,7 @@ RegQueryValueEx(hKey, _T("Advanced"), NULL, &type, (LPBYTE)&dwAdvancedChecked, &size); - if(dwAdvancedChecked == TRUE) + if(dwAdvancedChecked != FALSE) SendDlgItemMessage(hCharmapDlg, IDC_CHECK_ADVANCED, BM_CLICK, MF_CHECKED, 0); RegCloseKey(hKey); Modified: trunk/reactos/base/applications/mscutils/servman/start.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/servman/start.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/start.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -43,7 +43,7 @@ } else { - if (bWhiteSpace == TRUE) + if (bWhiteSpace != FALSE) { dwArgsCount++; bWhiteSpace = FALSE; @@ -74,7 +74,7 @@ } else { - if (bWhiteSpace == TRUE) + if (bWhiteSpace != FALSE) { lpArgsVector[dwArgsCount] = lpChar; dwArgsCount++; Modified: trunk/reactos/base/applications/network/net/cmdAccounts.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/cmdAccounts.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/cmdAccounts.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -151,7 +151,7 @@ } } - if (Modified == TRUE) + if (Modified != FALSE) { Status = NetUserModalsSet(NULL, 0, (LPBYTE)Info0, &ParamErr); if (Status != NERR_Success) Modified: trunk/reactos/base/applications/network/net/cmdUser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/cmdUser.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/cmdUser.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -617,7 +617,7 @@ } done: - if (bPasswordAllocated == TRUE && lpPassword != NULL) + if ((bPasswordAllocated != FALSE) && (lpPassword != NULL)) HeapFree(GetProcessHeap(), 0, lpPassword); if (!bAdd && !bDelete && pUserInfo != NULL) Modified: trunk/reactos/base/applications/notepad/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -849,7 +849,7 @@ } /* Set status bar visiblity according to the settings. */ - if (Globals.bWrapLongLines == TRUE || Globals.bShowStatusBar == FALSE) + if ((Globals.bWrapLongLines != FALSE) || (Globals.bShowStatusBar == FALSE)) { bStatusBarVisible = FALSE; ShowWindow(Globals.hStatusBar, SW_HIDE); Modified: trunk/reactos/base/applications/notepad/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/main.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -393,7 +393,7 @@ case WM_SIZE: { - if (Globals.bShowStatusBar == TRUE && Globals.bWrapLongLines == FALSE) + if ((Globals.bShowStatusBar != FALSE) && (Globals.bWrapLongLines == FALSE)) { RECT rcStatusBar; HDWP hdwp; Modified: trunk/reactos/base/applications/regedit/edit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/edit.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/edit.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1279,7 +1279,7 @@ { } } - else if (EditBin == TRUE || type == REG_NONE || type == REG_BINARY) + else if ((EditBin != FALSE) || (type == REG_NONE) || (type == REG_BINARY)) { if(valueDataLen > 0) { Modified: trunk/reactos/base/applications/sndrec32/sndrec32.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndrec32…
============================================================================== --- trunk/reactos/base/applications/sndrec32/sndrec32.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndrec32/sndrec32.cpp [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -540,7 +540,7 @@ case WM_COMMAND: wmId = LOWORD(wParam); - if ((wmId >= 0) && (wmId < 5) && (butdisabled[wmId] == TRUE)) + if ((wmId >= 0) && (wmId < 5) && (butdisabled[wmId] != FALSE)) break; switch (wmId) Modified: trunk/reactos/base/applications/sndvol32/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sndvol32…
============================================================================== --- trunk/reactos/base/applications/sndvol32/dialog.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/sndvol32/dialog.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -366,7 +366,7 @@ SetDlgItemTextW(PrefContext->MixerWindow->hWnd, wID, Line->szName); /* query controls */ - if (SndMixerQueryControls(Mixer, &ControlCount, Line, &Control) == TRUE) + if (SndMixerQueryControls(Mixer, &ControlCount, Line, &Control) != FALSE) { /* now go through all controls and update their states */ for(Index = 0; Index < ControlCount; Index++) Modified: trunk/reactos/base/services/svchost/svchost.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/svchost/svch…
============================================================================== --- trunk/reactos/base/services/svchost/svchost.c [iso-8859-1] (original) +++ trunk/reactos/base/services/svchost/svchost.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -666,7 +666,7 @@ ULONG_PTR ulCookie = 0; /* Activate the context */ - if (ActivateActCtx(pDll->hActCtx, &ulCookie) != TRUE) + if (ActivateActCtx(pDll->hActCtx, &ulCookie) == FALSE) { /* We couldn't, bail out */ if (lpdwError) *lpdwError = GetLastError(); @@ -1211,7 +1211,7 @@ pOptions->AuthenticationLevel, pOptions->ImpersonationLevel, pOptions->AuthenticationCapabilities); - if (bResult != TRUE) return FALSE; + if (bResult == FALSE) return FALSE; } /* Do we have a custom RPC stack size? */ Modified: trunk/reactos/base/setup/usetup/interface/consup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
============================================================================== --- trunk/reactos/base/setup/usetup/interface/consup.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/interface/consup.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -69,7 +69,7 @@ ReadConsoleInput(StdInput, Buffer, 1, &Read); if ((Buffer->EventType == KEY_EVENT) - && (Buffer->Event.KeyEvent.bKeyDown == TRUE)) + && (Buffer->Event.KeyEvent.bKeyDown != FALSE)) break; } } Modified: trunk/reactos/base/setup/usetup/interface/usetup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
============================================================================== --- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -257,7 +257,7 @@ if (Length > MaxLength) MaxLength = Length; - if (LastLine == TRUE) + if (LastLine != FALSE) break; pnext = p + 1; @@ -323,7 +323,7 @@ &Written); } - if (LastLine == TRUE) + if (LastLine != FALSE) break; coPos.Y++; @@ -708,7 +708,7 @@ else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; else RedrawGenericList(LanguageList); @@ -980,7 +980,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -1110,7 +1110,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -1147,7 +1147,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -1285,7 +1285,7 @@ else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -1349,7 +1349,7 @@ else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; continue; @@ -1637,7 +1637,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) { DestroyPartitionList(PartitionList); PartitionList = NULL; @@ -1721,7 +1721,7 @@ } else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'L') /* L */ { - if (PartitionList->CurrentPartition->LogicalPartition == TRUE) + if (PartitionList->CurrentPartition->LogicalPartition != FALSE) { Error = LogicalPartitionCreationChecks(PartitionList); if (Error != NOT_AN_ERROR) @@ -1977,14 +1977,14 @@ ShowPartitionSizeInputBox(12, 14, xScreen - 12, 17, /* left, top, right, bottom */ MaxSize, InputBuffer, &Quit, &Cancel); - if (Quit == TRUE) - { - if (ConfirmQuit(Ir) == TRUE) + if (Quit != FALSE) + { + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; } - else if (Cancel == TRUE) + else if (Cancel != FALSE) { return SELECT_PARTITION_PAGE; } @@ -2134,14 +2134,14 @@ ShowPartitionSizeInputBox(12, 14, xScreen - 12, 17, /* left, top, right, bottom */ MaxSize, InputBuffer, &Quit, &Cancel); - if (Quit == TRUE) - { - if (ConfirmQuit(Ir) == TRUE) + if (Quit != FALSE) + { + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; } - else if (Cancel == TRUE) + else if (Cancel != FALSE) { return SELECT_PARTITION_PAGE; } @@ -2290,14 +2290,14 @@ ShowPartitionSizeInputBox(12, 14, xScreen - 12, 17, /* left, top, right, bottom */ MaxSize, InputBuffer, &Quit, &Cancel); - if (Quit == TRUE) - { - if (ConfirmQuit(Ir) == TRUE) + if (Quit != FALSE) + { + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; } - else if (Cancel == TRUE) + else if (Cancel != FALSE) { return SELECT_PARTITION_PAGE; } @@ -2514,7 +2514,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -2705,7 +2705,7 @@ PartTypeString, ARRAYSIZE(PartTypeString)); - if (PartEntry->AutoCreate == TRUE) + if (PartEntry->AutoCreate != FALSE) { CONSOLE_SetTextXY(6, 8, MUIGetString(STRING_NEWPARTITION)); @@ -2731,7 +2731,7 @@ PartEntry->AutoCreate = FALSE; } - else if (PartEntry->New == TRUE) + else if (PartEntry->New != FALSE) { switch (PartitionList->FormatState) { @@ -2828,7 +2828,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -2924,7 +2924,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -3312,7 +3312,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -4225,7 +4225,7 @@ InstallOnFloppy = TRUE; } - if (InstallOnFloppy == TRUE) + if (InstallOnFloppy != FALSE) { return BOOT_LOADER_FLOPPY_PAGE; } @@ -4274,7 +4274,7 @@ else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; @@ -4335,7 +4335,7 @@ if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ { - if (ConfirmQuit(Ir) == TRUE) + if (ConfirmQuit(Ir) != FALSE) return QUIT_PAGE; break; Modified: trunk/reactos/base/setup/usetup/partlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist…
============================================================================== --- trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -673,7 +673,7 @@ PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[PartitionIndex]; if (PartitionInfo->PartitionType == 0 || - (LogicalPartition == TRUE && IsContainerPartition(PartitionInfo->PartitionType))) + ((LogicalPartition != FALSE) && IsContainerPartition(PartitionInfo->PartitionType))) return; PartEntry = RtlAllocateHeap(ProcessHeap, @@ -1665,11 +1665,11 @@ { /* Determine partition type */ PartTypeString[0] = '\0'; - if (PartEntry->New == TRUE) + if (PartEntry->New != FALSE) { PartType = MUIGetString(STRING_UNFORMATTED); } - else if (PartEntry->IsPartitioned == TRUE) + else if (PartEntry->IsPartitioned != FALSE) { GetPartTypeStringFromPartitionType(PartEntry->PartitionType, PartTypeString, @@ -2224,7 +2224,7 @@ { /* Primary or extended partition */ - if (List->CurrentPartition->IsPartitioned == TRUE && + if ((List->CurrentPartition->IsPartitioned != FALSE) && IsContainerPartition(List->CurrentPartition->PartitionType)) { /* First logical partition */ @@ -2318,7 +2318,7 @@ { PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); - if (PartEntry->IsPartitioned == TRUE && + if ((PartEntry->IsPartitioned != FALSE) && IsContainerPartition(PartEntry->PartitionType)) { PartListEntry = List->CurrentDisk->LogicalPartListHead.Blink; @@ -2343,7 +2343,7 @@ { PartEntry = CONTAINING_RECORD(PartListEntry, PARTENTRY, ListEntry); - if (PartEntry->IsPartitioned == TRUE && + if ((PartEntry->IsPartitioned != FALSE) && IsContainerPartition(PartEntry->PartitionType)) { PartListEntry = DiskEntry->LogicalPartListHead.Blink; @@ -2526,7 +2526,7 @@ { PartEntry = CONTAINING_RECORD(ListEntry, PARTENTRY, ListEntry); - if (PartEntry->IsPartitioned == TRUE) + if (PartEntry->IsPartitioned != FALSE) { PartitionInfo = &DiskEntry->LayoutBuffer->PartitionEntry[Index]; @@ -2727,7 +2727,7 @@ if (List == NULL || List->CurrentDisk == NULL || List->CurrentPartition == NULL || - List->CurrentPartition->IsPartitioned == TRUE) + List->CurrentPartition->IsPartitioned != FALSE) { return; } @@ -2737,8 +2737,8 @@ DPRINT1("Current partition sector count: %I64u\n", PartEntry->SectorCount.QuadPart); - if (AutoCreate == TRUE || - AlignDown(PartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - PartEntry->StartSector.QuadPart == PartEntry->SectorCount.QuadPart) + if ((AutoCreate != FALSE) || + (AlignDown(PartEntry->StartSector.QuadPart + SectorCount, DiskEntry->SectorAlignment) - PartEntry->StartSector.QuadPart == PartEntry->SectorCount.QuadPart)) { DPRINT1("Convert existing partition entry\n"); @@ -2845,7 +2845,7 @@ if (List == NULL || List->CurrentDisk == NULL || List->CurrentPartition == NULL || - List->CurrentPartition->IsPartitioned == TRUE) + (List->CurrentPartition->IsPartitioned != FALSE)) { return; } @@ -2955,7 +2955,7 @@ if (List == NULL || List->CurrentDisk == NULL || List->CurrentPartition == NULL || - List->CurrentPartition->IsPartitioned == TRUE) + List->CurrentPartition->IsPartitioned != FALSE) { return; } @@ -3475,7 +3475,7 @@ { DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry); - if (DiskEntry->Dirty == TRUE) + if (DiskEntry->Dirty != FALSE) { WritePartitions(List, DiskEntry); DiskEntry->Dirty = FALSE; @@ -3548,7 +3548,7 @@ PartEntry = List->CurrentPartition; /* Fail if partition is already in use */ - if (PartEntry->IsPartitioned == TRUE) + if (PartEntry->IsPartitioned != FALSE) return ERROR_NEW_PARTITION; /* Fail if there are already 4 primary partitions in the list */ @@ -3570,7 +3570,7 @@ PartEntry = List->CurrentPartition; /* Fail if partition is already in use */ - if (PartEntry->IsPartitioned == TRUE) + if (PartEntry->IsPartitioned != FALSE) return ERROR_NEW_PARTITION; /* Fail if there are already 4 primary partitions in the list */ @@ -3596,7 +3596,7 @@ PartEntry = List->CurrentPartition; /* Fail if partition is already in use */ - if (PartEntry->IsPartitioned == TRUE) + if (PartEntry->IsPartitioned != FALSE) return ERROR_NEW_PARTITION; return ERROR_SUCCESS; Modified: trunk/reactos/base/shell/cmd/choice.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/choice.c?re…
============================================================================== --- trunk/reactos/base/shell/cmd/choice.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/choice.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -56,7 +56,7 @@ //if the event is a key pressed if ((lpBuffer.EventType == KEY_EVENT) && - (lpBuffer.Event.KeyEvent.bKeyDown == TRUE)) + (lpBuffer.Event.KeyEvent.bKeyDown != FALSE)) { //read the key #ifdef _UNICODE Modified: trunk/reactos/base/shell/cmd/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/console.c?r…
============================================================================== --- trunk/reactos/base/shell/cmd/console.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/console.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -91,7 +91,7 @@ { ReadConsoleInput(hInput, lpBuffer, 1, &dwRead); if ((lpBuffer->EventType == KEY_EVENT) && - (lpBuffer->Event.KeyEvent.bKeyDown == TRUE)) + (lpBuffer->Event.KeyEvent.bKeyDown != FALSE)) break; } while (TRUE); @@ -361,7 +361,7 @@ int from = 0, i = 0; - if (NewPage == TRUE) + if (NewPage != FALSE) LineCount = 0; /* Reset LineCount and return if no string has been given */ Modified: trunk/reactos/base/shell/cmd/dir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/dir.c?rev=7…
============================================================================== --- trunk/reactos/base/shell/cmd/dir.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/dir.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -731,7 +731,7 @@ #endif if (pGetFreeDiskSpaceEx != NULL) { - if (pGetFreeDiskSpaceEx(lpRoot, lpFreeSpace, &TotalNumberOfBytes, &TotalNumberOfFreeBytes) == TRUE) + if (pGetFreeDiskSpaceEx(lpRoot, lpFreeSpace, &TotalNumberOfBytes, &TotalNumberOfFreeBytes) != FALSE) return; } } @@ -1392,7 +1392,7 @@ do { /* If retrieved FileName has extension,and szPath doesnt have extension then JUMP the retrieved FileName */ - if (_tcschr(wfdFileInfo.cFileName,_T('.'))&&(fPoint==TRUE)) + if (_tcschr(wfdFileInfo.cFileName,_T('.')) && (fPoint != FALSE)) { continue; /* Here we filter all the specified attributes */ Modified: trunk/reactos/base/shell/cmd/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/misc.c?rev=…
============================================================================== --- trunk/reactos/base/shell/cmd/misc.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/misc.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -48,7 +48,7 @@ { ReadConsoleInput (hInput, &irBuffer, 1, &dwRead); if ((irBuffer.EventType == KEY_EVENT) && - (irBuffer.Event.KeyEvent.bKeyDown == TRUE)) + (irBuffer.Event.KeyEvent.bKeyDown != FALSE)) { if (irBuffer.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)) Modified: trunk/reactos/base/shell/cmd/ren.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/ren.c?rev=7…
============================================================================== --- trunk/reactos/base/shell/cmd/ren.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/ren.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -286,7 +286,7 @@ } *r = 0; //Well we have splitted the Paths,so now we have to paste them again(if needed),thanks bPath. - if (bPath == TRUE) + if (bPath != FALSE) { _tcscpy(srcFinal,srcPath); _tcscat(srcFinal,f.cFileName); Modified: trunk/reactos/base/system/autochk/autochk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/autochk/autoch…
============================================================================== --- trunk/reactos/base/system/autochk/autochk.c [iso-8859-1] (original) +++ trunk/reactos/base/system/autochk/autochk.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -235,7 +235,7 @@ case DONE: Status = (PBOOLEAN)Argument; - if (*Status == TRUE) + if (*Status != FALSE) { PrintString("Autochk was unable to complete successfully.\r\n\r\n"); // Error = TRUE; Modified: trunk/reactos/base/system/diskpart/interpreter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/diskpart/inter…
============================================================================== --- trunk/reactos/base/system/diskpart/interpreter.c [iso-8859-1] (original) +++ trunk/reactos/base/system/diskpart/interpreter.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -114,7 +114,7 @@ } else { - if ((bWhiteSpace == TRUE) && (args_count < MAX_ARGS_COUNT)) + if ((bWhiteSpace != FALSE) && (args_count < MAX_ARGS_COUNT)) { args_vector[args_count] = ptr; args_count++; @@ -147,7 +147,7 @@ BOOL bRun = TRUE; LPWSTR ptr; - while (bRun == TRUE) + while (bRun != FALSE) { args_count = 0; memset(args_vector, 0, sizeof(args_vector)); @@ -168,7 +168,7 @@ } else { - if ((bWhiteSpace == TRUE) && (args_count < MAX_ARGS_COUNT)) + if ((bWhiteSpace != FALSE) && (args_count < MAX_ARGS_COUNT)) { args_vector[args_count] = ptr; args_count++; Modified: trunk/reactos/base/system/services/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
============================================================================== --- trunk/reactos/base/system/services/database.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/database.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -817,7 +817,7 @@ ServiceEntry = ServiceEntry->Flink; - if (CurrentService->bDeleted == TRUE) + if (CurrentService->bDeleted != FALSE) { dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Services", Modified: trunk/reactos/base/system/services/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/drive…
============================================================================== --- trunk/reactos/base/system/services/driver.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/driver.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -215,7 +215,7 @@ return RtlNtStatusToDosError(Status); } - if ((bFound == TRUE) && + if ((bFound != FALSE) && (lpService->Status.dwCurrentState != SERVICE_STOP_PENDING)) { if (lpService->Status.dwCurrentState == SERVICE_STOPPED) Modified: trunk/reactos/base/system/services/services.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/servi…
============================================================================== --- trunk/reactos/base/system/services/services.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/services.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -436,7 +436,7 @@ ScmShutdownSecurity(); /* Delete our communication named pipe's critical section */ - if (bCanDeleteNamedPipeCriticalSection == TRUE) + if (bCanDeleteNamedPipeCriticalSection != FALSE) ScmDeleteNamedPipeCriticalSection(); /* Close the shutdown event */ Modified: trunk/reactos/dll/cpl/desk/background.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/background.c?…
============================================================================== --- trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -669,7 +669,7 @@ if (success) { /* Check if there is already a entry that holds this filename */ - if (CheckListViewFilenameExists(hwndBackgroundList, ofn.lpstrFileTitle) == TRUE) + if (CheckListViewFilenameExists(hwndBackgroundList, ofn.lpstrFileTitle) != FALSE) return; if (pData->listViewItemCount > (MAX_BACKGROUNDS - 1)) @@ -729,7 +729,7 @@ pData->pWallpaperBitmap = NULL; } - if (backgroundItem->bWallpaper == TRUE) + if (backgroundItem->bWallpaper != FALSE) { pData->pWallpaperBitmap = DibLoadImage(backgroundItem->szFilename); @@ -937,7 +937,7 @@ RegSetValueEx(regKey, TEXT("WallpaperStyle"), 0, REG_SZ, (LPBYTE)TEXT("2"), sizeof(TCHAR) * 2); } - if (pData->backgroundItems[pData->backgroundSelection].bWallpaper == TRUE) + if (pData->backgroundItems[pData->backgroundSelection].bWallpaper != FALSE) { GdipLoadImageFromFile(pData->backgroundItems[pData->backgroundSelection].szFilename, &image); if (!image) Modified: trunk/reactos/dll/cpl/main/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/mouse.c?rev=7…
============================================================================== --- trunk/reactos/dll/cpl/main/mouse.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/main/mouse.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1717,7 +1717,7 @@ SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); /* Set the default scroll lines value */ - if (bInit == TRUE) + if (bInit != FALSE) SetDlgItemInt(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES, DEFAULT_WHEEL_SCROLL_LINES, FALSE); } } Modified: trunk/reactos/dll/cpl/mmsys/sounds.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/sounds.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/mmsys/sounds.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/mmsys/sounds.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -996,7 +996,7 @@ ofn.lpstrInitialDir = NULL; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - if (GetOpenFileNameW(&ofn) == TRUE) + if (GetOpenFileNameW(&ofn) != FALSE) { // FIXME search if list already contains that sound Modified: trunk/reactos/dll/cpl/sysdm/advanced.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/advanced.c?r…
============================================================================== --- trunk/reactos/dll/cpl/sysdm/advanced.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/sysdm/advanced.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -68,7 +68,7 @@ (LPBYTE)&dwVal, &cbData) == ERROR_SUCCESS) { - if (dwVal == TRUE) + if (dwVal != FALSE) { // set the check box SendDlgItemMessageW(hwndDlg, Modified: trunk/reactos/dll/cpl/sysdm/virtmem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/virtmem.c?re…
============================================================================== --- trunk/reactos/dll/cpl/sysdm/virtmem.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/sysdm/virtmem.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -599,7 +599,7 @@ static VOID OnOk(PVIRTMEM pVirtMem) { - if (pVirtMem->bModified == TRUE) + if (pVirtMem->bModified != FALSE) { ResourceMessageBox(hApplet, NULL, Modified: trunk/reactos/dll/directx/d3d9/adapter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/adapter.c…
============================================================================== --- trunk/reactos/dll/directx/d3d9/adapter.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/adapter.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -158,7 +158,7 @@ AdapterIndex = 0; FoundDisplayDevice = FALSE; - while (EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) == TRUE) + while (EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) != FALSE) { if (_stricmp(lpszDeviceName, DisplayDevice.DeviceName) == 0) { @@ -176,7 +176,7 @@ lstrcpynA(pIdentifier->Description, DisplayDevice.DeviceString, MAX_DEVICE_IDENTIFIER_STRING); lstrcpynA(pIdentifier->DeviceName, DisplayDevice.DeviceName, CCHDEVICENAME); - if (GetDriverName(&DisplayDevice, pIdentifier) == TRUE) + if (GetDriverName(&DisplayDevice, pIdentifier) != FALSE) GetDriverVersion(&DisplayDevice, pIdentifier); GetDeviceId(DisplayDevice.DeviceID, pIdentifier); Modified: trunk/reactos/dll/directx/d3d9/d3d9_create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_crea…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_create.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_create.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -190,7 +190,7 @@ D3D9_PrimaryDeviceName[0] = '\0'; AdapterIndex = 0; - while (EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) == TRUE && + while ((EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) != FALSE) && pDirect3D9->NumDisplayAdapters < D3D9_INT_MAX_NUM_ADAPTERS) { if ((DisplayDevice.StateFlags & (DISPLAY_DEVICE_DISCONNECT | DISPLAY_DEVICE_MIRRORING_DRIVER)) == 0 && @@ -209,7 +209,7 @@ } AdapterIndex = 0; - while (EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) == TRUE && + while ((EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) != FALSE) && pDirect3D9->NumDisplayAdapters < D3D9_INT_MAX_NUM_ADAPTERS) { if ((DisplayDevice.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) != 0 && Modified: trunk/reactos/dll/directx/d3d9/d3d9_impl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_impl…
============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_impl.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_impl.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -412,8 +412,8 @@ return D3DERR_INVALIDCALL; } - if (BackBufferFormat == D3DFMT_UNKNOWN && - Windowed == TRUE) + if ((BackBufferFormat == D3DFMT_UNKNOWN) && + (Windowed != FALSE)) { BackBufferFormat = DisplayFormat; } @@ -595,7 +595,7 @@ } pDriverCaps = &This->DisplayAdapters[Adapter].DriverCaps; - if ((Usage & D3DUSAGE_DYNAMIC) != 0 && bIsTextureRType == TRUE) + if (((Usage & D3DUSAGE_DYNAMIC) != 0) && (bIsTextureRType != FALSE)) { if ((pDriverCaps->DriverCaps9.Caps2 & D3DCAPS2_DYNAMICTEXTURES) == 0) { Modified: trunk/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/Ge…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -112,7 +112,7 @@ } } - if (found == TRUE) + if (found != FALSE) { /* we found our driver now we start setup it */ if (!_strnicmp(DisplayDeviceA.DeviceKey,"\\REGISTRY\\Machine\\",18)) Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
============================================================================== --- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -42,7 +42,7 @@ DevMode.dmSize = sizeof(DEVMODE); - while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) == TRUE) + while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) != FALSE) { DDSURFACEDESC SurfaceDesc; @@ -140,7 +140,7 @@ DevMode.dmSize = sizeof(DEVMODE); - while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) == TRUE) + while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) != FALSE) { DDSURFACEDESC2 SurfaceDesc; Modified: trunk/reactos/dll/directx/dsound_new/directsound.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/dsound_new/dir…
============================================================================== --- trunk/reactos/dll/directx/dsound_new/directsound.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/dsound_new/directsound.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -33,8 +33,8 @@ LPOLESTR pStr; LPCDirectSoundImpl This = (LPCDirectSoundImpl)CONTAINING_RECORD(iface, CDirectSoundImpl, lpVtbl); - if ((IsEqualIID(riid, &IID_IDirectSound) && This->bDirectSound8 == FALSE) || - (IsEqualIID(riid, &IID_IDirectSound8) && This->bDirectSound8 == TRUE) || + if ((IsEqualIID(riid, &IID_IDirectSound) && This->bDirectSound8 == FALSE) || + (IsEqualIID(riid, &IID_IDirectSound8) && This->bDirectSound8 != FALSE) || (IsEqualIID(riid, &IID_IUnknown))) { *ppobj = (LPVOID)&This->lpVtbl; Modified: trunk/reactos/dll/directx/wine/dsound/mixer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dsound/mi…
============================================================================== --- trunk/reactos/dll/directx/wine/dsound/mixer.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dsound/mixer.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -945,7 +945,7 @@ } /* if device was stopping, its for sure stopped when all buffers have stopped */ - else if((all_stopped == TRUE) && (device->state == STATE_STOPPING)){ + else if((all_stopped != FALSE) && (device->state == STATE_STOPPING)){ TRACE("All buffers have stopped. Stopping primary buffer\n"); device->state = STATE_STOPPED; Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -3203,7 +3203,7 @@ return ERROR_INVALID_HANDLE; } - if (fAsynchronous == TRUE && hEvent == NULL) + if ((fAsynchronous != FALSE) && (hEvent == NULL)) { return ERROR_INVALID_PARAMETER; } Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
============================================================================== --- trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/sec/misc.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -214,7 +214,7 @@ &NewToken, sizeof(HANDLE)); - if (Duplicated == TRUE) + if (Duplicated != FALSE) { NtClose(NewToken); } Modified: trunk/reactos/dll/win32/advapi32/service/scm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -2210,7 +2210,7 @@ return FALSE; } - if (bUseTempBuffer == TRUE) + if (bUseTempBuffer != FALSE) { TRACE("RQueryServiceConfig2A() returns ERROR_INSUFFICIENT_BUFFER\n"); *pcbBytesNeeded = dwBufferSize; @@ -2328,7 +2328,7 @@ return FALSE; } - if (bUseTempBuffer == TRUE) + if (bUseTempBuffer != FALSE) { TRACE("RQueryServiceConfig2W() returns ERROR_INSUFFICIENT_BUFFER\n"); *pcbBytesNeeded = dwBufferSize; Modified: trunk/reactos/dll/win32/advapi32/service/sctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -440,7 +440,7 @@ lpService->hServiceStatus = ControlPacket->hServiceStatus; /* Build the arguments vector */ - if (lpService->bUnicode == TRUE) + if (lpService->bUnicode != FALSE) { ThreadParamsW = HeapAlloc(GetProcessHeap(), 0, sizeof(*ThreadParamsW)); if (ThreadParamsW == NULL) Modified: trunk/reactos/dll/win32/kernel32/client/appcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/appcache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/appcache.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -73,7 +73,7 @@ if ((NT_SUCCESS(Status)) && (KeyInfo.Type == REG_DWORD) && (KeyInfo.DataLength == sizeof(ULONG)) && - (KeyInfo.Data[0] == TRUE)) + (KeyInfo.Data[0] != FALSE)) { /* It is, so disable shims! */ DisableShims = TRUE; Modified: trunk/reactos/dll/win32/kernel32/client/console/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/console/init.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/console/init.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -354,7 +354,7 @@ else if (Reason == DLL_PROCESS_DETACH) { /* Free our resources */ - if (ConsoleInitialized == TRUE) + if (ConsoleInitialized != FALSE) { ConsoleInitialized = FALSE; RtlDeleteCriticalSection(&ConsoleLock); Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -219,7 +219,7 @@ case DLL_PROCESS_DETACH: { - if (DllInitialized == TRUE) + if (DllInitialized != FALSE) { /* Uninitialize console support */ ConDllInitialize(dwReason, NULL); Modified: trunk/reactos/dll/win32/kernel32/client/power.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/power.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/power.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -89,7 +89,7 @@ Status = NtInitiatePowerAction((fSuspend != FALSE) ? PowerActionSleep : PowerActionHibernate, (fSuspend != FALSE) ? PowerSystemSleeping1 : PowerSystemHibernate, - fForce != TRUE, + (fForce == FALSE), FALSE); if (!NT_SUCCESS(Status)) { Modified: trunk/reactos/dll/win32/kernel32/client/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1225,7 +1225,7 @@ if (!NT_SUCCESS(Status)) { /* We failed, was this because this is a VDM process? */ - if (BaseCheckForVDM(hProcess, lpExitCode) == TRUE) return TRUE; + if (BaseCheckForVDM(hProcess, lpExitCode) != FALSE) return TRUE; /* Not a VDM process, fail the call */ BaseSetLastNTError(Status); Modified: trunk/reactos/dll/win32/lsasrv/authport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/authport.…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/authport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/authport.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -97,7 +97,7 @@ TRACE("Logon Process Name: %s\n", RequestMsg->ConnectInfo.LogonProcessNameBuffer); - if (RequestMsg->ConnectInfo.CreateContext == TRUE) + if (RequestMsg->ConnectInfo.CreateContext != FALSE) { Status = LsapCheckLogonProcess(RequestMsg, &LogonContext); @@ -129,7 +129,7 @@ return Status; } - if (Accept == TRUE) + if (Accept != FALSE) { if (LogonContext != NULL) { Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1642,8 +1642,8 @@ AccountHandle, AllPrivileges, Privileges); /* */ - if ((AllPrivileges == FALSE && Privileges == NULL) || - (AllPrivileges == TRUE && Privileges != NULL)) + if (((AllPrivileges == FALSE) && (Privileges == NULL)) || + ((AllPrivileges != FALSE) && (Privileges != NULL))) return STATUS_INVALID_PARAMETER; /* Validate the AccountHandle */ @@ -1657,7 +1657,7 @@ return Status; } - if (AllPrivileges == TRUE) + if (AllPrivileges != FALSE) { /* Delete the Privilgs attribute */ Status = LsapDeleteObjectAttribute(AccountObject, Modified: trunk/reactos/dll/win32/lsasrv/privileges.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/privilege…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/privileges.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/privileges.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -332,7 +332,7 @@ } } - if ((Status == STATUS_SUCCESS) && (MoreEntries == TRUE)) + if ((Status == STATUS_SUCCESS) && (MoreEntries != FALSE)) Status = STATUS_MORE_ENTRIES; return Status; Modified: trunk/reactos/dll/win32/msports/classinst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msports/classins…
============================================================================== --- trunk/reactos/dll/win32/msports/classinst.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msports/classinst.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -91,7 +91,7 @@ if (hDeviceKey) RegCloseKey(hDeviceKey); - if (ret == TRUE) + if (ret != FALSE) *ppResourceList = (PCM_RESOURCE_LIST)lpBuffer; return ret; Modified: trunk/reactos/dll/win32/msv1_0/msv1_0.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msv1_0/msv1_0.c?…
============================================================================== --- trunk/reactos/dll/win32/msv1_0/msv1_0.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msv1_0/msv1_0.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1223,7 +1223,7 @@ if (!NT_SUCCESS(Status)) { - if (SessionCreated == TRUE) + if (SessionCreated != FALSE) DispatchTable.DeleteLogonSession(LogonId); if (*ProfileBuffer != NULL) Modified: trunk/reactos/dll/win32/netapi32/user.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/user.c?…
============================================================================== --- trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -2482,7 +2482,7 @@ if (EnumContext->Index >= EnumContext->Count) { -// if (EnumContext->BuiltinDone == TRUE) +// if (EnumContext->BuiltinDone != FALSE) // { // ApiStatus = NERR_Success; // goto done; Modified: trunk/reactos/dll/win32/samsrv/samrpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
============================================================================== --- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -2393,7 +2393,7 @@ SampRegCloseKey(&NamesKeyHandle); SampRegCloseKey(&GroupsKeyHandle); - if ((Status == STATUS_SUCCESS) && (MoreEntries == TRUE)) + if ((Status == STATUS_SUCCESS) && (MoreEntries != FALSE)) Status = STATUS_MORE_ENTRIES; RtlReleaseResource(&SampResource); @@ -3004,7 +3004,7 @@ SampRegCloseKey(&NamesKeyHandle); SampRegCloseKey(&UsersKeyHandle); - if ((Status == STATUS_SUCCESS) && (MoreEntries == TRUE)) + if ((Status == STATUS_SUCCESS) && (MoreEntries != FALSE)) Status = STATUS_MORE_ENTRIES; RtlReleaseResource(&SampResource); @@ -3385,7 +3385,7 @@ SampRegCloseKey(&NamesKeyHandle); SampRegCloseKey(&AliasesKeyHandle); - if ((Status == STATUS_SUCCESS) && (MoreEntries == TRUE)) + if ((Status == STATUS_SUCCESS) && (MoreEntries != FALSE)) Status = STATUS_MORE_ENTRIES; RtlReleaseResource(&SampResource); @@ -7976,7 +7976,7 @@ Buffer->All.SecurityDescriptor.Length); } - if (WriteFixedData == TRUE) + if (WriteFixedData != FALSE) { Status = SampSetObjectAttribute(UserObject, L"F", Modified: trunk/reactos/dll/win32/samsrv/setup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/setup.c?r…
============================================================================== --- trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/samsrv/setup.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -762,7 +762,7 @@ goto done; /* Create the server SD */ - if (bBuiltinDomain == TRUE) + if (bBuiltinDomain != FALSE) Status = SampCreateBuiltinDomainSD(&Sd, &SdSize); else Modified: trunk/reactos/dll/win32/serialui/serialui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/serialui/serialu…
============================================================================== --- trunk/reactos/dll/win32/serialui/serialui.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/serialui/serialui.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -309,7 +309,7 @@ { SendMessageW(hBox, CB_INSERTSTRING, 1, (LPARAM)wstr); if(lpDlgInfo->lpCC->dcb.fRtsControl == RTS_CONTROL_HANDSHAKE - || lpDlgInfo->lpCC->dcb.fOutxCtsFlow == TRUE) + || lpDlgInfo->lpCC->dcb.fOutxCtsFlow != FALSE) { SendMessageW(hBox, CB_SETCURSEL, 1, 0); lpDlgInfo->InitialFlowIndex = 1; Modified: trunk/reactos/dll/win32/shimgvw/shimgvw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/shimgvw.…
============================================================================== --- trunk/reactos/dll/win32/shimgvw/shimgvw.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shimgvw/shimgvw.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -142,7 +142,7 @@ c++; sizeRemain -= sizeof(*c); - if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID) == TRUE) + if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID) != FALSE) { sfn.nFilterIndex = j + 1; } Modified: trunk/reactos/dll/win32/shlwapi/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/path.c?r…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1643,7 +1643,7 @@ * Although this function is prototyped as returning a BOOL, it returns * FILE_ATTRIBUTE_DIRECTORY for success. This means that code such as: * - *| if (PathIsDirectoryA("c:\\windows\\") == TRUE) + *| if (PathIsDirectoryA("c:\\windows\\") != FALSE) *| ... * * will always fail. Modified: trunk/reactos/dll/win32/uxtheme/system.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/system.c…
============================================================================== --- trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -192,7 +192,7 @@ WCHAR szCurrentSize[64]; BOOL bThemeActive = FALSE; - if(bLoad == TRUE && g_bThemeHooksActive) + if ((bLoad != FALSE) && g_bThemeHooksActive) { /* Get current theme configuration */ if(!RegOpenKeyW(HKEY_CURRENT_USER, szThemeManager, &hKey)) { Modified: trunk/reactos/dll/win32/uxtheme/themehooks.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/themehoo…
============================================================================== --- trunk/reactos/dll/win32/uxtheme/themehooks.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/uxtheme/themehooks.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -235,11 +235,11 @@ return 0; /* We don't touch the shape of the window if the application sets it on its own */ - if (pwndData->HasAppDefinedRgn == TRUE) + if (pwndData->HasAppDefinedRgn != FALSE) return 0; /* Calling SetWindowRgn will call SetWindowPos again so we need to avoid this recursion */ - if (pwndData->UpdatingRgn == TRUE) + if (pwndData->UpdatingRgn != FALSE) return 0; if(!IsAppThemed() || !(GetThemeAppProperties() & STAP_ALLOW_NONCLIENT)) Modified: trunk/reactos/dll/win32/wshtcpip/wshtcpip.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wshtcpip/wshtcpi…
============================================================================== --- trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -399,27 +399,27 @@ IN DWORD RequestSize, IN DWORD IOCTL) { - BOOLEAN Status; + BOOLEAN Success; HANDLE TcpCC; DWORD BytesReturned; if (openTcpFile(&TcpCC, FILE_READ_DATA | FILE_WRITE_DATA) != STATUS_SUCCESS) return WSAEINVAL; - Status = DeviceIoControl(TcpCC, - IOCTL, - Request, - RequestSize, - NULL, - 0, - &BytesReturned, - NULL); + Success = DeviceIoControl(TcpCC, + IOCTL, + Request, + RequestSize, + NULL, + 0, + &BytesReturned, + NULL); closeTcpFile(TcpCC); - DPRINT("DeviceIoControl: %ld\n", ((Status == TRUE) ? 0 : GetLastError())); - - if (!Status) + DPRINT("DeviceIoControl: %ld\n", ((Success != FALSE) ? 0 : GetLastError())); + + if (!Success) return WSAEINVAL; return NO_ERROR; Modified: trunk/reactos/drivers/bus/acpi/pnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/pnp.c?rev…
============================================================================== --- trunk/reactos/drivers/bus/acpi/pnp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/pnp.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -379,7 +379,7 @@ // set the event because we won't be waiting on it. // This optimization avoids grabbing the dispatcher lock and improves perf. // - if (Irp->PendingReturned == TRUE) { + if (Irp->PendingReturned != FALSE) { KeSetEvent ((PKEVENT) Context, IO_NO_INCREMENT, FALSE); } Modified: trunk/reactos/drivers/filesystems/cdfs/dirctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -189,7 +189,7 @@ IsRoot = TRUE; } - if (IsRoot == TRUE) + if (IsRoot != FALSE) { StreamOffset.QuadPart = (LONGLONG)DeviceExt->CdInfo.RootStart * (LONGLONG)BLOCKSIZE; DirSize = DeviceExt->CdInfo.RootSize; Modified: trunk/reactos/drivers/ksfilter/ks/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/misc.c…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/misc.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -53,7 +53,7 @@ IN PIRP Irp, IN PVOID Context) { - if (Irp->PendingReturned == TRUE) + if (Irp->PendingReturned != FALSE) { KeSetEvent ((PKEVENT) Context, IO_NO_INCREMENT, FALSE); } Modified: trunk/reactos/drivers/multimedia/audio/mpu401_nt4/mpu401.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/multimedia/audio/m…
============================================================================== --- trunk/reactos/drivers/multimedia/audio/mpu401_nt4/mpu401.c [iso-8859-1] (original) +++ trunk/reactos/drivers/multimedia/audio/mpu401_nt4/mpu401.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -328,7 +328,7 @@ } else if (BeepParam->Duration == (DWORD)-1) { - if (DeviceExtension->BeepOn == TRUE) + if (DeviceExtension->BeepOn != FALSE) { HalMakeBeep(0); DeviceExtension->BeepOn = FALSE; Modified: trunk/reactos/drivers/multimedia/audio/sndblst.old/sndblst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/multimedia/audio/s…
============================================================================== --- trunk/reactos/drivers/multimedia/audio/sndblst.old/sndblst.c [iso-8859-1] (original) +++ trunk/reactos/drivers/multimedia/audio/sndblst.old/sndblst.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -387,7 +387,7 @@ } else if (BeepParam->Duration == (DWORD)-1) { - if (DeviceExtension->BeepOn == TRUE) + if (DeviceExtension->BeepOn != FALSE) { HalMakeBeep(0); DeviceExtension->BeepOn = FALSE; Modified: trunk/reactos/drivers/storage/class/disk_new/disk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/disk…
============================================================================== --- trunk/reactos/drivers/storage/class/disk_new/disk.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/class/disk_new/disk.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -720,7 +720,7 @@ ASSERT( status != STATUS_INSUFFICIENT_RESOURCES ); - } else if((commonExtension->IsFdo == TRUE) && (residualBytes == 0)) { + } else if ((commonExtension->IsFdo != FALSE) && (residualBytes == 0)) { // // This failed because we think the physical disk is too small. @@ -3641,7 +3641,7 @@ status = DiskGetCacheInformation(fdoExtension, &cacheInfo); - if (NT_SUCCESS(status) && (cacheInfo.WriteCacheEnabled == TRUE)) { + if (NT_SUCCESS(status) && (cacheInfo.WriteCacheEnabled != FALSE)) { cacheInfo.WriteCacheEnabled = FALSE; @@ -4797,7 +4797,7 @@ // // Determine the search direction and setup the loop // - if(SearchTopToBottom == TRUE) { + if(SearchTopToBottom != FALSE) { startIndex = 0; stopIndex = LayoutInfo->PartitionCount; Modified: trunk/reactos/drivers/storage/class/disk_new/part.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/disk…
============================================================================== --- trunk/reactos/drivers/storage/class/disk_new/part.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/class/disk_new/part.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -93,7 +93,7 @@ // If the cached partition table is present then return a copy of it. // - if(diskData->CachedPartitionTableValid == TRUE) { + if (diskData->CachedPartitionTableValid != FALSE) { ULONG partitionNumber; PDRIVE_LAYOUT_INFORMATION_EX layout = diskData->CachedPartitionTable; Modified: trunk/reactos/drivers/storage/class/disk_new/pnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/disk…
============================================================================== --- trunk/reactos/drivers/storage/class/disk_new/pnp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/class/disk_new/pnp.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1314,7 +1314,7 @@ if (NT_SUCCESS(status)) { - if (cacheInfo.WriteCacheEnabled == TRUE) + if (cacheInfo.WriteCacheEnabled != FALSE) { if (writeCacheOverride == DiskWriteCacheDisable) { Modified: trunk/reactos/drivers/storage/classpnp/autorun.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/a…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/autorun.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/autorun.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -750,7 +750,7 @@ Executive, KernelMode, FALSE, - ((Wait == TRUE) ? NULL : &zero)); + ((Wait != FALSE) ? NULL : &zero)); if(status == STATUS_TIMEOUT) { @@ -1757,7 +1757,7 @@ adapterDescriptor = FdoExtension->AdapterDescriptor; atapiResets = 0; retryImmediately = TRUE; - for (i = 0; i < 16 && retryImmediately == TRUE; i++) { + for (i = 0; (i < 16) && (retryImmediately != FALSE); i++) { irp = ClasspPrepareMcnIrp(FdoExtension, Info, TRUE); if (irp == NULL) { Modified: trunk/reactos/drivers/storage/classpnp/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/c…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/class.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/class.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -317,7 +317,7 @@ DriverObject->DriverStartIo = ClasspStartIo; } - if ((InitializationData->ClassUnload) && (ClassPnpAllowUnload == TRUE)) { + if ((InitializationData->ClassUnload) && (ClassPnpAllowUnload != FALSE)) { DriverObject->DriverUnload = ClassUnload; } else { DriverObject->DriverUnload = NULL; @@ -1061,7 +1061,7 @@ // cleanup the changes done above // - if (setPagable == TRUE) { + if (setPagable != FALSE) { DebugPrint((2, "ClassDispatchPnp (%p,%p): Unsetting " "PAGABLE bit due to irp failure\n", DeviceObject, Irp)); Modified: trunk/reactos/drivers/storage/classpnp/obsolete.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/o…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/obsolete.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/obsolete.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -813,7 +813,7 @@ // current position then insert this entry into the current sweep. // - if((LowPriority != TRUE) && (BlockNumber > List->BlockNumber)) { + if ((LowPriority == FALSE) && (BlockNumber > List->BlockNumber)) { ClasspInsertCScanList(&(List->CurrentSweep), entry); } else { ClasspInsertCScanList(&(List->NextSweep), entry); Modified: trunk/reactos/drivers/storage/classpnp/power.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/classpnp/p…
============================================================================== --- trunk/reactos/drivers/storage/classpnp/power.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/classpnp/power.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -189,7 +189,7 @@ // request unless we can ignore failed locks // - if((context->Options.LockQueue == TRUE) && + if ((context->Options.LockQueue != FALSE) && (!NT_SUCCESS(Irp->IoStatus.Status))) { DebugPrint((1, "(%p)\tIrp status was %lx\n", @@ -359,7 +359,7 @@ &status, &context->RetryInterval); - if((retry == TRUE) && (context->RetryCount-- != 0)) { + if ((retry != FALSE) && (context->RetryCount-- != 0)) { DebugPrint((1, "(%p)\tRetrying failed request\n", Irp)); @@ -554,7 +554,7 @@ DebugPrint((1, "(%p)\tPreviously sent power lock\n", Irp)); - if((context->Options.LockQueue == TRUE) && + if ((context->Options.LockQueue != FALSE) && (!NT_SUCCESS(Irp->IoStatus.Status))) { DebugPrint((1, "(%p)\tIrp status was %lx\n", @@ -703,7 +703,7 @@ &status, &context->RetryInterval); - if((retry == TRUE) && (context->RetryCount-- != 0)) { + if ((retry != FALSE) && (context->RetryCount-- != 0)) { DebugPrint((1, "(%p)\tRetrying failed request\n", Irp)); @@ -808,7 +808,7 @@ &status, &context->RetryInterval); - if((retry == TRUE) && (context->RetryCount-- != 0)) { + if ((retry != FALSE) && (context->RetryCount-- != 0)) { DebugPrint((1, "(%p)\tRetrying failed request\n", Irp)); Modified: trunk/reactos/drivers/storage/ide/atapi/atapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/atapi/…
============================================================================== --- trunk/reactos/drivers/storage/ide/atapi/atapi.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/atapi/atapi.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -2824,7 +2824,7 @@ } } - if (*Again == TRUE) { + if (*Again != FALSE) { for (channel = 0; channel < 2; channel++) { @@ -5675,7 +5675,7 @@ UCHAR statusByte,errorByte; - if (EnableMSN == TRUE){ + if (EnableMSN != FALSE){ // // If supported enable Media Status Notification support @@ -5710,7 +5710,7 @@ } } - } else { // end if EnableMSN == TRUE + } else { // end if EnableMSN != FALSE // // disable if previously enabled Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -8712,7 +8712,7 @@ statusByte = WaitOnBaseBusy(chan); //SelectDrive(chan, DeviceNumber); - if (cdb->MEDIA_REMOVAL.Prevent == TRUE) { + if (cdb->MEDIA_REMOVAL.Prevent != FALSE) { //AtapiWritePort1(chan, IDX_IO1_o_Command,IDE_COMMAND_DOOR_LOCK); statusByte = AtaCommand(deviceExtension, DeviceNumber, lChannel, IDE_COMMAND_DOOR_LOCK, 0, 0, 0, 0, 0, ATA_IMMEDIATE); } else { @@ -9002,7 +9002,7 @@ chan = &(deviceExtension->chan[lChannel]); SelectDrive(chan, DeviceNumber); - if (EnableMSN == TRUE){ + if (EnableMSN != FALSE){ // If supported enable Media Status Notification support if ((chan->lun[DeviceNumber]->DeviceFlags & DFLAGS_REMOVABLE_DRIVE)) { @@ -9028,7 +9028,7 @@ } } - } else { // end if EnableMSN == TRUE + } else { // end if EnableMSN != FALSE // disable if previously enabled if ((chan->lun[DeviceNumber]->DeviceFlags & DFLAGS_MEDIA_STATUS_ENABLED)) { Modified: trunk/reactos/drivers/usb/usbohci/usb_request.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbohci/usb_re…
============================================================================== --- trunk/reactos/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -1509,7 +1509,7 @@ // // setup pid direction // - DataDescriptor->Flags |= InternalGetPidDirection() == TRUE ? OHCI_TD_DIRECTION_PID_IN : OHCI_TD_DIRECTION_PID_OUT; + DataDescriptor->Flags |= (InternalGetPidDirection() != FALSE) ? OHCI_TD_DIRECTION_PID_IN : OHCI_TD_DIRECTION_PID_OUT; // // use short packets @@ -1525,7 +1525,7 @@ // // flip status pid direction // - StatusDescriptor->Flags |= InternalGetPidDirection() == TRUE ? OHCI_TD_DIRECTION_PID_OUT : OHCI_TD_DIRECTION_PID_IN; + StatusDescriptor->Flags |= (InternalGetPidDirection() != FALSE) ? OHCI_TD_DIRECTION_PID_OUT : OHCI_TD_DIRECTION_PID_IN; // // link setup descriptor to data descriptor Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -504,7 +504,7 @@ IN PIRP Irp, IN PVOID Context) { - if (Irp->PendingReturned == TRUE) + if (Irp->PendingReturned != FALSE) { KeSetEvent ((PKEVENT) Context, IO_NO_INCREMENT, FALSE); } Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -640,7 +640,8 @@ for(Index = 0; Index < StreamData->StreamHeaderIndex; Index++) { // check if it is the same tag - if (StreamData->Tags[Index].Tag == Tag && StreamData->Tags[Index].Used == TRUE) + if ((StreamData->Tags[Index].Tag == Tag) && + (StreamData->Tags[Index].Used != FALSE)) { // mark mapping as released StreamData->Tags[Index].Tag = NULL; @@ -678,8 +679,8 @@ // check if the released mapping is one of these for(Index = 0; Index < StreamData->StreamHeaderCount; Index++) { - if (StreamData->Tags[Index].Tag == Tag && - StreamData->Tags[Index].Used == TRUE) + if ((StreamData->Tags[Index].Tag == Tag) && + (StreamData->Tags[Index].Used != FALSE)) { // mark mapping as released StreamData->Tags[Index].Tag = NULL; Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -646,7 +646,7 @@ // get event entry context Context = (PLOOPEDSTREAMING_EVENT_CONTEXT)(EventEntry + 1); - if (Context->bLoopedStreaming == TRUE) + if (Context->bLoopedStreaming != FALSE) { if (NewOffset > OldOffset) { Modified: trunk/reactos/drivers/wdm/audio/legacy/stream/helper.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/s…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/stream/helper.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/stream/helper.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -16,7 +16,7 @@ IN PIRP Irp, IN PVOID Context) { - if (Irp->PendingReturned == TRUE) + if (Irp->PendingReturned != FALSE) { KeSetEvent ((PKEVENT) Context, IO_NO_INCREMENT, FALSE); } Modified: trunk/reactos/hal/halppc/generic/bus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halppc/generic/bus.c?r…
============================================================================== --- trunk/reactos/hal/halppc/generic/bus.c [iso-8859-1] (original) +++ trunk/reactos/hal/halppc/generic/bus.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -105,7 +105,7 @@ if (!Context) return FALSE; /* If we have data in the context, then this shouldn't be a new lookup */ - if ((*Context) && (NextBus == TRUE)) return FALSE; + if ((*Context != 0) && (NextBus != FALSE)) return FALSE; /* Return bus data */ TranslatedAddress->QuadPart = BusAddress.QuadPart; Modified: trunk/reactos/hal/halppc/generic/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halppc/generic/display…
============================================================================== --- trunk/reactos/hal/halppc/generic/display.c [iso-8859-1] (original) +++ trunk/reactos/hal/halppc/generic/display.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -257,7 +257,7 @@ if (HalResetDisplayParameters == NULL) return; - if (HalOwnsDisplay == TRUE) + if (HalOwnsDisplay != FALSE) return; HalOwnsDisplay = TRUE; Modified: trunk/reactos/hal/halx86/acpi/busemul.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/acpi/busemul.c?…
============================================================================== --- trunk/reactos/hal/halx86/acpi/busemul.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/acpi/busemul.c [iso-8859-1] Sun Oct 1 14:42:04 2017 @@ -105,7 +105,7 @@ if (!Context) return FALSE; /* If we have data in the context, then this shouldn't be a new lookup */ - if ((*Context) && (NextBus == TRUE)) return FALSE; + if ((*Context != 0) && (NextBus != FALSE)) return FALSE; /* Return bus data */ TranslatedAddress->QuadPart = BusAddress.QuadPart;
7 years, 2 months
1
0
0
0
[tkreuzer] 76020: [RTL/x64] Fix logic in RtlpTryToUnwindEpilog
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Oct 1 14:36:21 2017 New Revision: 76020 URL:
http://svn.reactos.org/svn/reactos?rev=76020&view=rev
Log: [RTL/x64] Fix logic in RtlpTryToUnwindEpilog Modified: trunk/reactos/sdk/lib/rtl/amd64/unwind.c Modified: trunk/reactos/sdk/lib/rtl/amd64/unwind.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/rtl/amd64/unwind.c…
============================================================================== --- trunk/reactos/sdk/lib/rtl/amd64/unwind.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/rtl/amd64/unwind.c [iso-8859-1] Sun Oct 1 14:36:21 2017 @@ -295,9 +295,9 @@ } } - /* Loop the following instructions */ - EndAddress = FunctionEntry->EndAddress + ImageBase; - while((DWORD64)InstrPtr < EndAddress) + /* Loop the following instructions before the ret */ + EndAddress = FunctionEntry->EndAddress + ImageBase - 1; + while ((DWORD64)InstrPtr < EndAddress) { Instr = *(DWORD*)InstrPtr; @@ -315,20 +315,28 @@ if ( (Instr & 0xf8fb) == 0x5841 ) { /* Opcode is pop r8 .. r15 */ - Reg = (Instr & 0x7) + 8; + Reg = ((Instr >> 8) & 0x7) + 8; PopReg(&LocalContext, Reg); InstrPtr += 2; continue; } - /* Check for retn / retf */ - if ( (Instr & 0xf7) == 0xc3 ) - { - /* We are finished */ - break; - } - /* Opcode not allowed for Epilog */ + return FALSE; + } + + /* Check if we are at the ret instruction */ + if ((DWORD64)InstrPtr != EndAddress) + { + /* If we went past the end of the function, something is broken! */ + ASSERT((DWORD64)InstrPtr <= EndAddress); + return FALSE; + } + + /* Make sure this is really a ret instruction */ + if (*InstrPtr != 0xc3) + { + ASSERT(FALSE); return FALSE; } @@ -414,7 +422,7 @@ } } - /* Process the left Ops */ + /* Process the remaining unwind ops */ while (i < UnwindInfo->CountOfCodes) { UnwindCode = UnwindInfo->UnwindCode[i];
7 years, 2 months
1
0
0
0
[tkreuzer] 76019: [RTL/x64] Support frames to skip in flags to RtlWalkFrameChain
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Oct 1 14:34:26 2017 New Revision: 76019 URL:
http://svn.reactos.org/svn/reactos?rev=76019&view=rev
Log: [RTL/x64] Support frames to skip in flags to RtlWalkFrameChain Modified: trunk/reactos/sdk/lib/rtl/amd64/unwind.c Modified: trunk/reactos/sdk/lib/rtl/amd64/unwind.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/rtl/amd64/unwind.c…
============================================================================== --- trunk/reactos/sdk/lib/rtl/amd64/unwind.c [iso-8859-1] (original) +++ trunk/reactos/sdk/lib/rtl/amd64/unwind.c [iso-8859-1] Sun Oct 1 14:34:26 2017 @@ -524,10 +524,13 @@ ULONG64 ControlPc, ImageBase, EstablisherFrame; ULONG64 StackLow, StackHigh; PVOID HandlerData; - ULONG i; + ULONG i, FramesToSkip; PRUNTIME_FUNCTION FunctionEntry; DPRINT("Enter RtlWalkFrameChain\n"); + + /* The upper bits in Flags define how many frames to skip */ + FramesToSkip = Flags >> 8; /* Capture the current Context */ RtlCaptureContext(&Context); @@ -537,12 +540,12 @@ RtlpGetStackLimits(&StackLow, &StackHigh); /* Check if we want the user-mode stack frame */ - if (Flags == 1) + if (Flags & 1) { } /* Loop the frames */ - for (i = 0; i < Count; i++) + for (i = 0; i < FramesToSkip + Count; i++) { /* Lookup the FunctionEntry for the current ControlPc */ FunctionEntry = RtlLookupFunctionEntry(ControlPc, &ImageBase, NULL); @@ -579,9 +582,14 @@ break; } - /* Save this frame and continue with new Rip */ + /* Continue with new Rip */ ControlPc = Context.Rip; - Callers[i] = (PVOID)ControlPc; + + /* Save value, if we are past the frames to skip */ + if (i >= FramesToSkip) + { + Callers[i - FramesToSkip] = (PVOID)ControlPc; + } } DPRINT("RtlWalkFrameChain returns %ld\n", i); @@ -605,14 +613,8 @@ * RtlWalkFrameChain -> RtlGetCallersAddress -> x -> y */ Number = RtlWalkFrameChain(Callers, 4, 0); - if (CallersAddress) - { - *CallersAddress = (Number >= 3) ? Callers[2] : NULL; - } - if (CallersCaller) - { - *CallersCaller = (Number == 4) ? Callers[3] : NULL; - } + *CallersAddress = (Number >= 3) ? Callers[2] : NULL; + *CallersCaller = (Number == 4) ? Callers[3] : NULL; return; }
7 years, 2 months
1
0
0
0
[pschweitzer] 76018: [NDK] Define REPARSE_DATA_BUFFER so that we can stop redefining it everywhere...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Oct 1 12:56:00 2017 New Revision: 76018 URL:
http://svn.reactos.org/svn/reactos?rev=76018&view=rev
Log: [NDK] Define REPARSE_DATA_BUFFER so that we can stop redefining it everywhere... Modified: trunk/reactos/dll/shellext/shellbtrfs/shellext.h trunk/reactos/dll/win32/kernel32/client/file/create.c trunk/reactos/dll/win32/kernel32/client/file/dir.c trunk/reactos/sdk/include/ndk/iotypes.h Modified: trunk/reactos/dll/shellext/shellbtrfs/shellext.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/shellbtrfs/sh…
============================================================================== --- trunk/reactos/dll/shellext/shellbtrfs/shellext.h [iso-8859-1] (original) +++ trunk/reactos/dll/shellext/shellbtrfs/shellext.h [iso-8859-1] Sun Oct 1 12:56:00 2017 @@ -114,6 +114,7 @@ #endif #endif +#ifndef __REACTOS__ typedef struct _REPARSE_DATA_BUFFER { ULONG ReparseTag; USHORT ReparseDataLength; @@ -144,6 +145,7 @@ } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; #define SYMLINK_FLAG_RELATIVE 1 +#endif #ifndef FILE_SUPPORTS_BLOCK_REFCOUNTING Modified: trunk/reactos/dll/win32/kernel32/client/file/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/create.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/create.c [iso-8859-1] Sun Oct 1 12:56:00 2017 @@ -20,36 +20,6 @@ #if DBG DEBUG_CHANNEL(kernel32file); #endif - -#define SYMLINK_FLAG_RELATIVE 1 - -typedef struct _REPARSE_DATA_BUFFER { - ULONG ReparseTag; - USHORT ReparseDataLength; - USHORT Reserved; - union { - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - ULONG Flags; - WCHAR PathBuffer[1]; - } SymbolicLinkReparseBuffer; - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - WCHAR PathBuffer[1]; - } MountPointReparseBuffer; - struct { - UCHAR DataBuffer[1]; - } GenericReparseBuffer; - }; -} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; - -#define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer) /* FUNCTIONS ****************************************************************/ Modified: trunk/reactos/dll/win32/kernel32/client/file/dir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/dir.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/dir.c [iso-8859-1] Sun Oct 1 12:56:00 2017 @@ -26,33 +26,6 @@ s[8] == 'm' && s[9] == 'e' && s[10] == '{' && \ s[19] == '-' && s[24] == '-' && s[29] == '-' && \ s[34] == '-' && s[47] == '}') - -/* FIXME - Get it out of here */ -typedef struct _REPARSE_DATA_BUFFER { - ULONG ReparseTag; - USHORT ReparseDataLength; - USHORT Reserved; - union { - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - ULONG Flags; - WCHAR PathBuffer[1]; - } SymbolicLinkReparseBuffer; - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - WCHAR PathBuffer[1]; - } MountPointReparseBuffer; - struct { - UCHAR DataBuffer[1]; - } GenericReparseBuffer; - }; -} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; /* FUNCTIONS *****************************************************************/ Modified: trunk/reactos/sdk/include/ndk/iotypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/ndk/iotypes.h?…
============================================================================== --- trunk/reactos/sdk/include/ndk/iotypes.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/ndk/iotypes.h [iso-8859-1] Sun Oct 1 12:56:00 2017 @@ -1314,6 +1314,38 @@ #define IOCTL_TAPE_CREATE_PARTITION \ CTL_CODE(FILE_DEVICE_TAPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +// +// Reparse points +// + +#define SYMLINK_FLAG_RELATIVE 1 + +typedef struct _REPARSE_DATA_BUFFER { + ULONG ReparseTag; + USHORT ReparseDataLength; + USHORT Reserved; + _ANONYMOUS_UNION union { + struct { + USHORT SubstituteNameOffset; + USHORT SubstituteNameLength; + USHORT PrintNameOffset; + USHORT PrintNameLength; + ULONG Flags; + WCHAR PathBuffer[1]; + } SymbolicLinkReparseBuffer; + struct { + USHORT SubstituteNameOffset; + USHORT SubstituteNameLength; + USHORT PrintNameOffset; + USHORT PrintNameLength; + WCHAR PathBuffer[1]; + } MountPointReparseBuffer; + struct { + UCHAR DataBuffer[1]; + } GenericReparseBuffer; + } DUMMYUNIONNAME; +} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; + #endif // NTOS_MODE_USER #endif
7 years, 2 months
1
0
0
0
[tkreuzer] 76017: [FREELDR] Simplify DebugDumpBuffer
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Oct 1 11:08:26 2017 New Revision: 76017 URL:
http://svn.reactos.org/svn/reactos?rev=76017&view=rev
Log: [FREELDR] Simplify DebugDumpBuffer Modified: trunk/reactos/boot/freeldr/freeldr/lib/debug.c Modified: trunk/reactos/boot/freeldr/freeldr/lib/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/lib/d…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/lib/debug.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/lib/debug.c [iso-8859-1] Sun Oct 1 11:08:26 2017 @@ -297,7 +297,7 @@ DebugDumpBuffer(ULONG Mask, PVOID Buffer, ULONG Length) { PUCHAR BufPtr = (PUCHAR)Buffer; - ULONG Idx, Idx2; + ULONG Offset, Count, i; /* Mask out unwanted debug messages */ if (!(DbgChannels[Mask] & TRACE_LEVEL)) @@ -306,50 +306,20 @@ DebugStartOfLine = FALSE; // We don't want line headers DbgPrint("Dumping buffer at %p with length of %lu bytes:\n", Buffer, Length); - for (Idx = 0; Idx < Length; ) - { - DebugStartOfLine = FALSE; // We don't want line headers - - if (Idx < 0x0010) - DbgPrint("000%x:\t", Idx); - else if (Idx < 0x0100) - DbgPrint("00%x:\t", Idx); - else if (Idx < 0x1000) - DbgPrint("0%x:\t", Idx); - else - DbgPrint("%x:\t", Idx); - - for (Idx2 = 0; Idx2 < 16; Idx2++, Idx++) - { - if (BufPtr[Idx] < 0x10) - { - DbgPrint("0"); - } - DbgPrint("%x", BufPtr[Idx]); - - if (Idx2 == 7) - { - DbgPrint("-"); - } - else - { - DbgPrint(" "); - } - } - - Idx -= 16; - DbgPrint(" "); - - for (Idx2 = 0; Idx2 < 16; Idx2++, Idx++) - { - if ((BufPtr[Idx] > 20) && (BufPtr[Idx] < 0x80)) - { - DbgPrint("%c", BufPtr[Idx]); - } - else - { - DbgPrint("."); - } + Offset = 0; + while (Offset < Length) + { + /* We don't want line headers */ + DebugStartOfLine = FALSE; + + /* Print the offset */ + DbgPrint("%04x:\t", Offset); + + /* Print either 16 or the remaining number of bytes */ + Count = min(Length - Offset, 16); + for (i = 0; i < Count; i++, Offset++) + { + DbgPrint("%02x%c", BufPtr[Offset], (i == 7) ? '-' : ' '); } DbgPrint("\n");
7 years, 2 months
1
0
0
0
[tkreuzer] 76016: [MPU401] Move registry entries for mpu401.sys from hivesys.inf to it's own registry inf file. This file is not used, since we don't even build the mpu401 driver.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Oct 1 10:56:32 2017 New Revision: 76016 URL:
http://svn.reactos.org/svn/reactos?rev=76016&view=rev
Log: [MPU401] Move registry entries for mpu401.sys from hivesys.inf to it's own registry inf file. This file is not used, since we don't even build the mpu401 driver. Added: trunk/reactos/drivers/multimedia/audio/mpu401_nt4/mpu401_reg.inf Modified: trunk/reactos/boot/bootdata/hivesys.inf Modified: trunk/reactos/boot/bootdata/hivesys.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesys.inf [iso-8859-1] Sun Oct 1 10:56:32 2017 @@ -1575,13 +1575,6 @@ HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","Start",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation","Type",0x00010001,0x00000020 HKLM,"SYSTEM\CurrentControlSet\Services\lanmanworkstation\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\wkssvc.dll" - -; MPU-401 MIDI driver -HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Group",0x00000000,"Base" -HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","ImagePath",0x00020000,"system32\drivers\mpu401.sys" -HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Start",0x00010001,0x00000004 -HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Type",0x00010001,0x00000001 ; Multiple UNC provider driver HKLM,"SYSTEM\CurrentControlSet\Services\Mup","Description",0x00000000,"Multiple UNC Provider (MUP)" Added: trunk/reactos/drivers/multimedia/audio/mpu401_nt4/mpu401_reg.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/multimedia/audio/m…
============================================================================== --- trunk/reactos/drivers/multimedia/audio/mpu401_nt4/mpu401_reg.inf (added) +++ trunk/reactos/drivers/multimedia/audio/mpu401_nt4/mpu401_reg.inf [iso-8859-1] Sun Oct 1 10:56:32 2017 @@ -0,0 +1,7 @@ +; MPU-401 MIDI driver +[AddReg] +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","ErrorControl",0x00010001,0x00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Group",0x00000000,"Base" +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","ImagePath",0x00020000,"system32\drivers\mpu401.sys" +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Start",0x00010001,0x00000004 +HKLM,"SYSTEM\CurrentControlSet\Services\mpu401","Type",0x00010001,0x00000001
7 years, 2 months
1
0
0
0
← Newer
1
...
24
25
26
27
28
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Results per page:
10
25
50
100
200