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
2025
January
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
June 2016
----- 2025 -----
January 2025
----- 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
17 participants
228 discussions
Start a n
N
ew thread
[hbelusca] 71698: [NOTEPAD]: Fix russian menu keyboard shortcuts, by 'denis2dev'. CORE-11461 #resolve #comment Committed, thanks!
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jun 29 20:25:49 2016 New Revision: 71698 URL:
http://svn.reactos.org/svn/reactos?rev=71698&view=rev
Log: [NOTEPAD]: Fix russian menu keyboard shortcuts, by 'denis2dev'. CORE-11461 #resolve #comment Committed, thanks! Modified: trunk/reactos/base/applications/notepad/lang/ru-RU.rc Modified: trunk/reactos/base/applications/notepad/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/lang/ru-RU.rc [iso-8859-1] Wed Jun 29 20:25:49 2016 @@ -41,15 +41,15 @@ MENUITEM "ÐÑÑ&авиÑÑ\tCtrl+V", CMD_PASTE MENUITEM "&УдалиÑÑ\tDel", CMD_DELETE MENUITEM SEPARATOR - MENUITEM "&ÐайÑи", CMD_SEARCH + MENUITEM "&ÐайÑи...\tCtrl+F", CMD_SEARCH MENUITEM "ÐайÑи &далее\tF3", CMD_SEARCH_NEXT - MENUITEM "ÐамениÑÑ\tCtrl+H", CMD_REPLACE - MENUITEM "ÐеÑейÑи к...\tCtrl+G", CMD_GOTO + MENUITEM "&ÐамениÑÑ...\tCtrl+H", CMD_REPLACE + MENUITEM "ÐеÑей&Ñи...\tCtrl+G", CMD_GOTO MENUITEM SEPARATOR - MENUITEM "ÐÑделиÑÑ Ð²&Ñе", CMD_SELECT_ALL + MENUITEM "ÐÑделиÑÑ Ð²&Ñе \tCtrl+A", CMD_SELECT_ALL MENUITEM "ÐÑем&Ñ Ð¸ даÑа\tF5", CMD_TIME_DATE END - POPUP "Фо&ÑмаÑ" + POPUP "ФоÑ&маÑ" BEGIN MENUITEM "&ÐеÑÐµÐ½Ð¾Ñ Ð¿Ð¾ Ñловам", CMD_WRAP MENUITEM "&ШÑиÑÑ...", CMD_FONT
8 years, 6 months
1
0
0
0
[tthompson] 71697: [NTFS] Fix typo in NtfsAllocateClusters(), spotted by ThFabba.
by tthompson@svn.reactos.org
Author: tthompson Date: Wed Jun 29 17:49:36 2016 New Revision: 71697 URL:
http://svn.reactos.org/svn/reactos?rev=71697&view=rev
Log: [NTFS] Fix typo in NtfsAllocateClusters(), spotted by ThFabba. Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] Wed Jun 29 17:49:36 2016 @@ -119,7 +119,7 @@ ULONG Read = 0; RTL_BITMAP Bitmap; - DPRINT1("NtfsAllocateClusters(%p, %lu, %lu, %p)\n", DeviceExt, DesiredClusters, FirstDesiredCluster, FirstAssignedCluster, AssignedClusters); + DPRINT1("NtfsAllocateClusters(%p, %lu, %lu, %p, %p)\n", DeviceExt, FirstDesiredCluster, DesiredClusters, FirstAssignedCluster, AssignedClusters); BitmapRecord = ExAllocatePoolWithTag(NonPagedPool, DeviceExt->NtfsInfo.BytesPerFileRecord,
8 years, 6 months
1
0
0
0
[tthompson] 71696: [NTFS] Lay some groundwork for extending allocation size. +AddRun() - Unimplemented +GetLastClusterInDataRun() +NtfsAllocateClusters()
by tthompson@svn.reactos.org
Author: tthompson Date: Wed Jun 29 16:35:36 2016 New Revision: 71696 URL:
http://svn.reactos.org/svn/reactos?rev=71696&view=rev
Log: [NTFS] Lay some groundwork for extending allocation size. +AddRun() - Unimplemented +GetLastClusterInDataRun() +NtfsAllocateClusters() Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c [iso-8859-1] Wed Jun 29 16:35:36 2016 @@ -35,6 +35,19 @@ /* FUNCTIONS ****************************************************************/ +NTSTATUS +AddRun(PNTFS_ATTR_CONTEXT AttrContext, + ULONGLONG NextAssignedCluster, + ULONG RunLength) +{ + UNIMPLEMENTED; + + if (!AttrContext->Record.IsNonResident) + return STATUS_INVALID_PARAMETER; + + return STATUS_NOT_IMPLEMENTED; +} + PUCHAR DecodeRun(PUCHAR DataRun, LONGLONG *DataRunOffset, @@ -551,6 +564,50 @@ return NULL; } +NTSTATUS +GetLastClusterInDataRun(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_RECORD Attribute, PULONGLONG LastCluster) +{ + LONGLONG DataRunOffset; + ULONGLONG DataRunLength; + LONGLONG DataRunStartLCN; + + ULONGLONG LastLCN = 0; + PUCHAR DataRun = (PUCHAR)Attribute + Attribute->NonResident.MappingPairsOffset; + + if (!Attribute->IsNonResident) + return STATUS_INVALID_PARAMETER; + + while (1) + { + DataRun = DecodeRun(DataRun, &DataRunOffset, &DataRunLength); + + if (DataRunOffset == -1) + { + // sparse run + if (*DataRun == 0) + { + // if it's the last run, return the last cluster of the last run + *LastCluster = LastLCN + DataRunLength - 1; + break; + } + } + else + { + // Normal data run. + DataRunStartLCN = LastLCN + DataRunOffset; + LastLCN = DataRunStartLCN; + } + + if (*DataRun == 0) + { + *LastCluster = LastLCN + DataRunLength - 1; + break; + } + } + + return STATUS_SUCCESS; +} + PSTANDARD_INFORMATION GetStandardInformationFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord) Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] Wed Jun 29 16:35:36 2016 @@ -151,7 +151,7 @@ } -ULONG +ULONGLONG AttributeAllocatedLength(PNTFS_ATTR_RECORD AttrRecord) { if (AttrRecord->IsNonResident) @@ -181,9 +181,49 @@ { if (AttrContext->Record.IsNonResident) { + ULONG BytesPerCluster = Fcb->Vcb->NtfsInfo.BytesPerCluster; + ULONGLONG AllocationSize = ROUND_UP(DataSize->QuadPart, BytesPerCluster); + // do we need to increase the allocation size? - if (AttrContext->Record.NonResident.AllocatedSize < DataSize->QuadPart) - { + if (AttrContext->Record.NonResident.AllocatedSize < AllocationSize) + { + ULONG ExistingClusters = AttrContext->Record.NonResident.AllocatedSize / BytesPerCluster; + ULONG ClustersNeeded = (AllocationSize / BytesPerCluster) - ExistingClusters; + LARGE_INTEGER LastClusterInDataRun; + ULONG NextAssignedCluster; + ULONG AssignedClusters; + + NTSTATUS Status = GetLastClusterInDataRun(Fcb->Vcb, &AttrContext->Record, &LastClusterInDataRun.QuadPart); + + DPRINT1("GetLastClusterInDataRun returned: %I64u\n", LastClusterInDataRun.QuadPart); + DPRINT1("Highest VCN of record: %I64u\n", AttrContext->Record.NonResident.HighestVCN); + + while (ClustersNeeded > 0) + { + Status = NtfsAllocateClusters(Fcb->Vcb, + LastClusterInDataRun.LowPart + 1, + ClustersNeeded, + &NextAssignedCluster, + &AssignedClusters); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Error: Unable to allocate requested clusters!\n"); + return Status; + } + + // now we need to add the clusters we allocated to the data run + Status = AddRun(AttrContext, NextAssignedCluster, AssignedClusters); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Error: Unable to add data run!\n"); + return Status; + } + + ClustersNeeded -= AssignedClusters; + LastClusterInDataRun.LowPart = NextAssignedCluster + AssignedClusters - 1; + } + DPRINT1("FixMe: Increasing allocation size is unimplemented!\n"); return STATUS_NOT_IMPLEMENTED; } @@ -462,7 +502,7 @@ PUCHAR SourceBuffer = Buffer; LONGLONG StartingOffset; - DPRINT("WriteAttribute(%p, %p, %I64U, %p, %lu)\n", Vcb, Context, Offset, Buffer, Length); + DPRINT("WriteAttribute(%p, %p, %I64u, %p, %lu, %p)\n", Vcb, Context, Offset, Buffer, Length, RealLengthWritten); // is this a resident attribute? if (!Context->Record.IsNonResident) Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Wed Jun 29 16:35:36 2016 @@ -511,6 +511,11 @@ //VOID //NtfsDumpAttribute(PATTRIBUTE Attribute); +NTSTATUS +AddRun(PNTFS_ATTR_CONTEXT AttrContext, + ULONGLONG NextAssignedCluster, + ULONG RunLength); + PUCHAR DecodeRun(PUCHAR DataRun, LONGLONG *DataRunOffset, @@ -528,6 +533,11 @@ GetFileNameFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord, UCHAR NameType); + +NTSTATUS +GetLastClusterInDataRun(PDEVICE_EXTENSION Vcb, + PNTFS_ATTR_RECORD Attribute, + PULONGLONG LastCluster); PFILENAME_ATTRIBUTE GetBestFileNameFromRecord(PDEVICE_EXTENSION Vcb, @@ -774,7 +784,7 @@ PFILE_RECORD_HEADER FileRecord, PLARGE_INTEGER DataSize); -ULONG +ULONGLONG AttributeAllocatedLength(PNTFS_ATTR_RECORD AttrRecord); BOOLEAN @@ -905,6 +915,13 @@ /* volinfo.c */ +NTSTATUS +NtfsAllocateClusters(PDEVICE_EXTENSION DeviceExt, + ULONG FirstDesiredCluster, + ULONG DesiredClusters, + PULONG FirstAssignedCluster, + PULONG AssignedClusters); + ULONGLONG NtfsGetFreeClusters(PDEVICE_EXTENSION DeviceExt); Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] Wed Jun 29 16:35:36 2016 @@ -99,6 +99,110 @@ return FreeClusters; } +/** +* NtfsAllocateClusters +* Allocates a run of clusters. The run allocated might be smaller than DesiredClusters. +*/ +NTSTATUS +NtfsAllocateClusters(PDEVICE_EXTENSION DeviceExt, + ULONG FirstDesiredCluster, + ULONG DesiredClusters, + PULONG FirstAssignedCluster, + PULONG AssignedClusters) +{ + NTSTATUS Status; + PFILE_RECORD_HEADER BitmapRecord; + PNTFS_ATTR_CONTEXT DataContext; + ULONGLONG BitmapDataSize; + PCHAR BitmapData; + ULONGLONG FreeClusters = 0; + ULONG Read = 0; + RTL_BITMAP Bitmap; + + DPRINT1("NtfsAllocateClusters(%p, %lu, %lu, %p)\n", DeviceExt, DesiredClusters, FirstDesiredCluster, FirstAssignedCluster, AssignedClusters); + + BitmapRecord = ExAllocatePoolWithTag(NonPagedPool, + DeviceExt->NtfsInfo.BytesPerFileRecord, + TAG_NTFS); + if (BitmapRecord == NULL) + { + return 0; + } + + Status = ReadFileRecord(DeviceExt, NTFS_FILE_BITMAP, BitmapRecord); + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(BitmapRecord, TAG_NTFS); + return 0; + } + + Status = FindAttribute(DeviceExt, BitmapRecord, AttributeData, L"", 0, &DataContext, NULL); + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(BitmapRecord, TAG_NTFS); + return 0; + } + + BitmapDataSize = AttributeDataLength(&DataContext->Record); + BitmapDataSize = min(BitmapDataSize, 0xffffffff); + ASSERT((BitmapDataSize * 8) >= DeviceExt->NtfsInfo.ClusterCount); + BitmapData = ExAllocatePoolWithTag(NonPagedPool, ROUND_UP(BitmapDataSize, DeviceExt->NtfsInfo.BytesPerSector), TAG_NTFS); + if (BitmapData == NULL) + { + ReleaseAttributeContext(DataContext); + ExFreePoolWithTag(BitmapRecord, TAG_NTFS); + return 0; + } + + DPRINT1("Total clusters: %I64x\n", DeviceExt->NtfsInfo.ClusterCount); + DPRINT1("Total clusters in bitmap: %I64x\n", BitmapDataSize * 8); + DPRINT1("Diff in size: %I64d B\n", ((BitmapDataSize * 8) - DeviceExt->NtfsInfo.ClusterCount) * DeviceExt->NtfsInfo.SectorsPerCluster * DeviceExt->NtfsInfo.BytesPerSector); + + ReadAttribute(DeviceExt, DataContext, Read, (PCHAR)((ULONG_PTR)BitmapData + Read), (ULONG)BitmapDataSize); + + RtlInitializeBitMap(&Bitmap, (PULONG)BitmapData, DeviceExt->NtfsInfo.ClusterCount); + FreeClusters = RtlNumberOfClearBits(&Bitmap); + + if (FreeClusters >= DesiredClusters) + { + // TODO: Observe MFT reservation zone + + // Can we get one contiguous run? + ULONG AssignedRun = RtlFindClearBitsAndSet(&Bitmap, DesiredClusters, FirstDesiredCluster); + ULONG LengthWritten; + + if (AssignedRun != 0xFFFFFFFF) + { + *FirstAssignedCluster = AssignedRun; + *AssignedClusters = DesiredClusters; + } + else + { + // we can't get one contiguous run + *AssignedClusters = RtlFindNextForwardRunClear(&Bitmap, FirstDesiredCluster, FirstAssignedCluster); + + if (*AssignedClusters == 0) + { + // we couldn't find any runs starting at DesiredFirstCluster + *AssignedClusters = RtlFindLongestRunClear(&Bitmap, FirstAssignedCluster); + } + + } + + Status = WriteAttribute(DeviceExt, DataContext, 0, BitmapData, (ULONG)BitmapDataSize, &LengthWritten); + } + else + Status = STATUS_DISK_FULL; + + + ReleaseAttributeContext(DataContext); + + ExFreePoolWithTag(BitmapData, TAG_NTFS); + ExFreePoolWithTag(BitmapRecord, TAG_NTFS); + + return Status; +} + static NTSTATUS NtfsGetFsVolumeInformation(PDEVICE_OBJECT DeviceObject,
8 years, 6 months
1
0
0
0
[hbelusca] 71695: [SUBST] - Update the resource program description. - Convert to full UNICODE. - Use Win32 functions where possible. - Factor-out the usage of QueryDosDevice into a QuerySubstedDri...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jun 29 00:38:51 2016 New Revision: 71695 URL:
http://svn.reactos.org/svn/reactos?rev=71695&view=rev
Log: [SUBST] - Update the resource program description. - Convert to full UNICODE. - Use Win32 functions where possible. - Factor-out the usage of QueryDosDevice into a QuerySubstedDrive function, that returns error codes according to whether the specified drive is a mapped (substed) drive, or is just an existing drive that is not a mapping, or if the drive does not exist. This allows us to detect attempts to use a drive letter that is not a mapped drive, to define a new mapping, and if so we reject such attempt. This fixes CORE-10681 #resolve #comment Fixed with another patch according to my last remark. Modified: trunk/reactos/base/system/subst/lang/bg-BG.rc trunk/reactos/base/system/subst/lang/de-DE.rc trunk/reactos/base/system/subst/lang/en-US.rc trunk/reactos/base/system/subst/lang/es-ES.rc trunk/reactos/base/system/subst/lang/fr-FR.rc trunk/reactos/base/system/subst/lang/it-IT.rc trunk/reactos/base/system/subst/lang/pl-PL.rc trunk/reactos/base/system/subst/lang/ro-RO.rc trunk/reactos/base/system/subst/lang/ru-RU.rc trunk/reactos/base/system/subst/lang/sq-AL.rc trunk/reactos/base/system/subst/lang/tr-TR.rc trunk/reactos/base/system/subst/lang/uk-UA.rc trunk/reactos/base/system/subst/lang/zh-CN.rc trunk/reactos/base/system/subst/lang/zh-TW.rc trunk/reactos/base/system/subst/resource.h trunk/reactos/base/system/subst/subst.c trunk/reactos/base/system/subst/subst.rc Modified: trunk/reactos/base/system/subst/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/bg-…
============================================================================== --- trunk/reactos/base/system/subst/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/bg-BG.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -6,6 +6,7 @@ IDS_INVALID_PARAMETER "ÐепÑавилен бÑой клÑÑове - %s\n" IDS_INVALID_PARAMETER2 "ÐедопÑÑÑим клÑÑ - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "УÑÑÑойÑÑвоÑо веÑе е подложено на SUBST\n" IDS_FAILED_WITH_ERRORCODE "ÐÑеÑка номеÑ: 0x%x: %s\n" IDS_USAGE "ÐбвÑÑзва пÑÑ Ñ Ð¸Ð¼Ðµ на ÑÑÑÑойÑÑво (дÑл).\n\n\ Modified: trunk/reactos/base/system/subst/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/de-…
============================================================================== --- trunk/reactos/base/system/subst/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/de-DE.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -6,6 +6,7 @@ IDS_INVALID_PARAMETER "Falsche Anzahl an Parametern - %s\n" IDS_INVALID_PARAMETER2 "Falscher Parameter - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "SUBST wurde hier schon ausgeführt.\n" IDS_FAILED_WITH_ERRORCODE "Fehlgeschlagen - Code 0x%x: %s\n" IDS_USAGE "Weist einem Pfad einen Laufwerksbuchstaben zu.n\n\ Modified: trunk/reactos/base/system/subst/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/en-…
============================================================================== --- trunk/reactos/base/system/subst/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/en-US.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -6,6 +6,7 @@ IDS_INVALID_PARAMETER "Incorrect number of parameters - %s\n" IDS_INVALID_PARAMETER2 "Invalid parameter - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Drive already SUBSTed\n" IDS_FAILED_WITH_ERRORCODE "Failed with error code 0x%x: %s\n" IDS_USAGE "Associates a path with a drive letter.\n\n\ Modified: trunk/reactos/base/system/subst/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/es-…
============================================================================== --- trunk/reactos/base/system/subst/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/es-ES.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -6,6 +6,7 @@ IDS_INVALID_PARAMETER "Cantidad de parámetros incorrecta - %s\n" IDS_INVALID_PARAMETER2 "Parámetro incorrecto - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Unidad ya sustituida\n" IDS_FAILED_WITH_ERRORCODE "Falla con código de error 0x%x: %s\n" IDS_USAGE "Asocia una ruta con una letra de unidad.\n\n\ Modified: trunk/reactos/base/system/subst/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/fr-…
============================================================================== --- trunk/reactos/base/system/subst/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/fr-FR.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -6,6 +6,7 @@ IDS_INVALID_PARAMETER "Nombre incorrect de paramètres - %s\n" IDS_INVALID_PARAMETER2 "Paramètre incorrect - %s\n" IDS_PATH_NOT_FOUND "Chemin d'accès introuvable - %s\n" + IDS_ACCESS_DENIED "Accès refusé - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Disque déjà substitué\n" IDS_FAILED_WITH_ERRORCODE "Ãchoue avec le code d'erreur 0x%x : %s\n" IDS_USAGE "Associe un chemin avec une lettre de lecteur.\n\n\ Modified: trunk/reactos/base/system/subst/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/it-…
============================================================================== --- trunk/reactos/base/system/subst/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/it-IT.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -6,6 +6,7 @@ IDS_INVALID_PARAMETER "Numero di parametri errato - %s\n" IDS_INVALID_PARAMETER2 "Parametro errato - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Unità già sostituita\n" IDS_FAILED_WITH_ERRORCODE "Interruzione con codice di errore 0x%x: %s\n" IDS_USAGE "Associa un percorso ad una lettera di unità .\n\n\ Modified: trunk/reactos/base/system/subst/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/pl-…
============================================================================== --- trunk/reactos/base/system/subst/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/pl-PL.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -14,6 +14,7 @@ IDS_INVALID_PARAMETER "NieprawidÅowy parametr - %s\n" IDS_INVALID_PARAMETER2 "NieprawidÅowe parametry - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Na tym dysku już użyto komendy SUBST\n" IDS_FAILED_WITH_ERRORCODE "BÅÄ d 0x%x: %s\n" IDS_USAGE "PowiÄ zuje ÅcieżkÄ z literÄ napÄdu.\n\n\ Modified: trunk/reactos/base/system/subst/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/ro-…
============================================================================== --- trunk/reactos/base/system/subst/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/ro-RO.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -8,6 +8,7 @@ IDS_INVALID_PARAMETER "NumÄr eronat de parametri - %s\n" IDS_INVALID_PARAMETER2 "Parametru eronat - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Unitatea este deja SUBSTituitÄ\n" IDS_FAILED_WITH_ERRORCODE "OperaÈia a eÈuat. Codul de eroare 0x%x: %s\n" IDS_USAGE "Substituie un director cu o unitate de stocare.\n\n\ Modified: trunk/reactos/base/system/subst/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/ru-…
============================================================================== --- trunk/reactos/base/system/subst/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/ru-RU.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -8,6 +8,7 @@ IDS_INVALID_PARAMETER "ÐевеÑное ÑиÑло паÑамеÑÑов - %s\n" IDS_INVALID_PARAMETER2 "ÐевеÑнÑй паÑамеÑÑ - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "ÐиÑк Ñже ÑопоÑÑавлен\n" IDS_FAILED_WITH_ERRORCODE "Сбой Ñ ÐºÐ¾Ð´Ð¾Ð¼ оÑибки 0x%x: %s\n" IDS_USAGE "СопоÑÑавление имени диÑка ÑÐºÐ°Ð·Ð°Ð½Ð½Ð¾Ð¼Ñ Ð¿ÑÑи.\n\n\ Modified: trunk/reactos/base/system/subst/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/sq-…
============================================================================== --- trunk/reactos/base/system/subst/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/sq-AL.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -10,6 +10,7 @@ IDS_INVALID_PARAMETER "Numri i parametrave jo i sakte - %s\n" IDS_INVALID_PARAMETER2 "Parameter i gabuar - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Drive tashme i SUBSTed\n" IDS_FAILED_WITH_ERRORCODE "Deshtoj me error kode 0x%x: %s\n" IDS_USAGE "Perputh rrugen e driverit me germën.\n\n\ Modified: trunk/reactos/base/system/subst/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/tr-…
============================================================================== --- trunk/reactos/base/system/subst/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/tr-TR.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -8,6 +8,7 @@ IDS_INVALID_PARAMETER "DeÄiÅken sayısı yanlıŠ- %s\n" IDS_INVALID_PARAMETER2 "Geçersiz deÄiÅken - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Sürücü önceden SUBST edilmiÅ.\n" IDS_FAILED_WITH_ERRORCODE "YanlıÅlık kodu ile baÅarısız oldu 0x%x: %s\n" IDS_USAGE "Bir sürücü harfiyle bir yolu iliÅkilendirir.\n\n\ Modified: trunk/reactos/base/system/subst/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/uk-…
============================================================================== --- trunk/reactos/base/system/subst/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/uk-UA.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -8,6 +8,7 @@ IDS_INVALID_PARAMETER "ÐевÑÑна кÑлÑкÑÑÑÑ Ð¿Ð°ÑамеÑÑÑв - %s\n" IDS_INVALID_PARAMETER2 "ÐевÑÑний паÑамеÑÑ - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Ðо диÑÐºÑ Ð²Ð¶Ðµ заÑÑоÑовано SUBST\n" IDS_FAILED_WITH_ERRORCODE "ÐевдаÑа з кодом помилки 0x%x: %s\n" IDS_USAGE "ÐÑоÑÑÑÑ ÑлÑÑ Ð· бÑÐºÐ²Ð¾Ñ Ð´Ð¸ÑкÑ.\n\n\ Modified: trunk/reactos/base/system/subst/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/zh-…
============================================================================== --- trunk/reactos/base/system/subst/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/zh-CN.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -8,6 +8,7 @@ IDS_INVALID_PARAMETER "åæ°ä¸ªæ°ä¸æ£ç¡® - %s\n" IDS_INVALID_PARAMETER2 "æ æåæ° - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "驱å¨å¨å·²ç»è¿è¡è¿ SUBST\n" IDS_FAILED_WITH_ERRORCODE "æä½å¤±è´¥ï¼é误ç 0x%xï¼%s\n" IDS_USAGE "å°ä¸ä¸ªè·¯å¾ç¨é©±å¨å¨å·å ³èã\n\n\ Modified: trunk/reactos/base/system/subst/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/zh-…
============================================================================== --- trunk/reactos/base/system/subst/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/zh-TW.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -8,6 +8,7 @@ IDS_INVALID_PARAMETER "åæ¸åæ¸ä¸æ£ç¢º - %s\n" IDS_INVALID_PARAMETER2 "ç¡æåæ¸ - %s\n" IDS_PATH_NOT_FOUND "Path not found - %s\n" + IDS_ACCESS_DENIED "Access denied - %s\n" IDS_DRIVE_ALREADY_SUBSTED "é© åå¨å·²ç¶éè¡é SUBST\n" IDS_FAILED_WITH_ERRORCODE "æä½å¤±æï¼é¯èª¤ç¢¼ 0x%xï¼%s\n" IDS_USAGE "å°ä¸åè·¯å¾ç¨é© åå¨èéè¯ã\n\n\ Modified: trunk/reactos/base/system/subst/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/resource…
============================================================================== --- trunk/reactos/base/system/subst/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/resource.h [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -9,4 +9,5 @@ #define IDS_INVALID_PARAMETER 1004 #define IDS_INVALID_PARAMETER2 1005 #define IDS_PATH_NOT_FOUND 1006 -#define IDS_DRIVE_ALREADY_SUBSTED 1007 +#define IDS_ACCESS_DENIED 1007 +#define IDS_DRIVE_ALREADY_SUBSTED 1008 Modified: trunk/reactos/base/system/subst/subst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/subst.c?…
============================================================================== --- trunk/reactos/base/system/subst/subst.c [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/subst.c [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -1,212 +1,254 @@ -/* PROJECT: ReactOS Kernel +/* + * PROJECT: ReactOS Subst Command * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/subst/subst.c - * PURPOSE: Associates a path with a drive letter + * PURPOSE: Maps a path with a drive letter * PROGRAMMERS: Sam Arun Raj + * Peter Hater + * Hermes Belusca-Maito */ /* INCLUDES *****************************************************************/ -#include <stdarg.h> -#include <stdlib.h> -#include <tchar.h> +#include <stdio.h> #define WIN32_NO_STATUS #include <windef.h> #include <winbase.h> #include <winuser.h> -#define NDEBUG -#include <debug.h> - #include "resource.h" /* FUNCTIONS ****************************************************************/ -VOID PrintError(DWORD ErrCode) -{ - TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; - TCHAR *buffer = (TCHAR*) calloc(2048, - sizeof(TCHAR)); - TCHAR *msg = NULL; - - if (buffer) - { - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - ErrCode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (TCHAR*)&msg, - 0, - NULL); - LoadString(GetModuleHandle(NULL), - IDS_FAILED_WITH_ERRORCODE, - szFmtString, - ARRAYSIZE(szFmtString)); - _sntprintf(buffer, +VOID PrintError(IN DWORD ErrCode) +{ + WCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; + PWSTR buffer, msg = NULL; + + buffer = (PWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 2048 * sizeof(WCHAR)); + if (!buffer) + return; + + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + ErrCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (PWSTR)&msg, + 0, + NULL); + if (msg) + { + LoadStringW(GetModuleHandleW(NULL), + IDS_FAILED_WITH_ERRORCODE, + szFmtString, + ARRAYSIZE(szFmtString)); + _snwprintf(buffer, 2048, szFmtString, ErrCode, msg); - _tprintf(_T("%s"), - buffer); - if (msg) - LocalFree(msg); - free(buffer); - } + wprintf(L"%s", buffer); + + LocalFree(msg); + } + + HeapFree(GetProcessHeap(), 0, buffer); } VOID DisplaySubstUsage(VOID) { - TCHAR szHelp[RC_STRING_MAX_SIZE] = {0}; - - LoadString(GetModuleHandle(NULL), + WCHAR szHelp[RC_STRING_MAX_SIZE] = {0}; + + LoadStringW(GetModuleHandleW(NULL), IDS_USAGE, szHelp, ARRAYSIZE(szHelp)); - _tprintf(_T("%s"), szHelp); -} - -BOOLEAN IsSubstedDrive(TCHAR DriveLetter) -{ - BOOLEAN Result = FALSE; - TCHAR Drive[3] = _T("A:"); - LPTSTR lpTargetPath = NULL; - DWORD CharCount, dwSize; + wprintf(L"%s", szHelp); +} + +ULONG QuerySubstedDrive(IN WCHAR DriveLetter, + IN OUT PWSTR* TargetPath OPTIONAL, + IN OUT PULONG Size) +{ + ULONG Result = ERROR_INVALID_DRIVE; + WCHAR Drive[] = L"A:"; + DWORD dwSize, CharCount = 0; + PWSTR lpTargetPath = NULL, tmp; Drive[0] = DriveLetter; + /* Check whether the user has given a pointer to a target path buffer */ + if (!TargetPath) + { + /* No, therefore use a local buffer */ + dwSize = MAX_PATH; + lpTargetPath = (PWSTR)HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR)); + if (!lpTargetPath) + return ERROR_NOT_ENOUGH_MEMORY; + } + else + { + /* Just use the user-given pointer to a buffer; Size should point to a valid ULONG */ + if (!Size) + return ERROR_INVALID_PARAMETER; + + lpTargetPath = *TargetPath; + dwSize = *Size; + } + +Retry: + /* Try querying DOS device information */ + CharCount = QueryDosDeviceW(Drive, lpTargetPath, dwSize); + if (!CharCount) + Result = GetLastError(); + + if (!CharCount && (Result == ERROR_INSUFFICIENT_BUFFER)) + { + /* Reallocate the buffer with double size */ + dwSize *= 2; + tmp = (PWSTR)HeapReAlloc(GetProcessHeap(), 0, lpTargetPath, dwSize * sizeof(WCHAR)); + if (!tmp) + { + /* Memory problem, bail out */ + CharCount = 0; + Result = ERROR_NOT_ENOUGH_MEMORY; + } + else + { + /* Retry again */ + lpTargetPath = tmp; + goto Retry; + } + } + + if (CharCount) + { + if ( wcsncmp(lpTargetPath, L"\\??\\", 4) == 0 && + ( (lpTargetPath[4] >= L'A' && lpTargetPath[4] <= L'Z') || + (lpTargetPath[4] >= L'a' && lpTargetPath[4] <= L'z') ) ) + { + /* The drive exists and is SUBSTed */ + Result = ERROR_IS_SUBSTED; + } +#if 0 + else + { + /* The drive exists but is not SUBSTed */ + Result = ERROR_INVALID_DRIVE; + } +#endif + } + + if (!TargetPath) + { + /* Free the local buffer */ + HeapFree(GetProcessHeap(), 0, lpTargetPath); + } + else + { + /* Update the user-given pointers */ + *TargetPath = lpTargetPath; + *Size = dwSize; + } + + return Result; +} + +VOID DumpSubstedDrives(VOID) +{ + WCHAR DriveLetter; + PWSTR lpTargetPath = NULL; + DWORD dwSize; + UCHAR i = 0; + dwSize = MAX_PATH; - lpTargetPath = (LPTSTR)malloc(sizeof(TCHAR) * dwSize); - if (!lpTargetPath) - return FALSE; - - CharCount = QueryDosDevice(Drive, - lpTargetPath, - dwSize); - while (!CharCount && - GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - lpTargetPath = (LPTSTR)realloc(lpTargetPath, sizeof(TCHAR) * dwSize); - if (lpTargetPath) - { - CharCount = QueryDosDevice(Drive, - lpTargetPath, - dwSize); - } - } - - if (CharCount) - { - Result = _tcsncmp(lpTargetPath, _T("\\??\\"), 4) == 0 && - ( (lpTargetPath[4] >= _T('A') && - lpTargetPath[4] <= _T('Z')) || - (lpTargetPath[4] >= _T('a') && - lpTargetPath[4] <= _T('z')) ); - } - - free(lpTargetPath); - - return Result; -} - -VOID DumpSubstedDrives(VOID) -{ - TCHAR Drive[3] = _T("A:"); - LPTSTR lpTargetPath = NULL; - DWORD CharCount, dwSize; - INT i = 0; - - dwSize = MAX_PATH; - lpTargetPath = (LPTSTR)malloc(sizeof(TCHAR) * dwSize); + lpTargetPath = (PWSTR)HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR)); if (!lpTargetPath) return; while (i < 26) { - Drive[0] = _T('A') + i; - CharCount = QueryDosDevice(Drive, - lpTargetPath, - dwSize); - while (!CharCount && - GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - lpTargetPath = (LPTSTR)realloc(lpTargetPath, sizeof(TCHAR) * dwSize); - if (lpTargetPath) - { - CharCount = QueryDosDevice(Drive, - lpTargetPath, - dwSize); - } - } - - if (CharCount) - { - if ( _tcsncmp(lpTargetPath, _T("\\??\\"), 4) == 0 && - ( (lpTargetPath[4] >= _T('A') && - lpTargetPath[4] <= _T('Z')) || - (lpTargetPath[4] >= _T('a') && - lpTargetPath[4] <= _T('z')) ) ) - { - _tprintf(_T("%s\\: => %s\n"), - Drive, - lpTargetPath + 4); - } + DriveLetter = L'A' + i; + if (QuerySubstedDrive(DriveLetter, &lpTargetPath, &dwSize) == ERROR_IS_SUBSTED) + { + wprintf(L"%c:\\: => %s\n", DriveLetter, lpTargetPath + 4); } i++; } - free(lpTargetPath); -} - -INT DeleteSubst(TCHAR* Drive) -{ - BOOL Result; - TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; - - LoadString(GetModuleHandle(NULL), - IDS_INVALID_PARAMETER2, - szFmtString, - ARRAYSIZE(szFmtString)); - - if ((_tcslen(Drive) != 2) || (Drive[1] != _T(':'))) - { - _tprintf(szFmtString, Drive); - return 1; - } - - if (!IsSubstedDrive(Drive[0])) - { - _tprintf(szFmtString, Drive); - return 1; - } - - Result = DefineDosDevice(DDD_REMOVE_DEFINITION, - Drive, - NULL); - if (!Result) - { - PrintError(GetLastError()); - return 1; - } + HeapFree(GetProcessHeap(), 0, lpTargetPath); +} + +INT DeleteSubst(IN PWSTR Drive) +{ + DWORD dwResult; + WCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; + + if ((wcslen(Drive) != 2) || (Drive[1] != L':')) + { + dwResult = ERROR_INVALID_PARAMETER; + goto Quit; + } + + if (QuerySubstedDrive(Drive[0], NULL, NULL) != ERROR_IS_SUBSTED) + { + dwResult = ERROR_INVALID_PARAMETER; + goto Quit; + } + + if (!DefineDosDeviceW(DDD_REMOVE_DEFINITION, Drive, NULL)) + dwResult = GetLastError(); + else + dwResult = ERROR_SUCCESS; + +Quit: + switch (dwResult) + { + case ERROR_SUCCESS: + break; + + // case ERROR_INVALID_DRIVE: + case ERROR_INVALID_PARAMETER: + { + LoadStringW(GetModuleHandleW(NULL), + IDS_INVALID_PARAMETER2, + szFmtString, + ARRAYSIZE(szFmtString)); + wprintf(szFmtString, Drive); + return 1; + } + + case ERROR_ACCESS_DENIED: + { + LoadStringW(GetModuleHandleW(NULL), + IDS_ACCESS_DENIED, + szFmtString, + ARRAYSIZE(szFmtString)); + wprintf(szFmtString, Drive); + return 1; + } + + default: + { + PrintError(GetLastError()); + return 1; + } + } + return 0; } -INT AddSubst(TCHAR* Drive, TCHAR *Path) -{ - BOOL Result; - DWORD dwPathAttr; - TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; - - if ((_tcslen(Drive) != 2) || (Drive[1] != _T(':'))) - { - LoadString(GetModuleHandle(NULL), - IDS_INVALID_PARAMETER2, - szFmtString, - ARRAYSIZE(szFmtString)); - _tprintf(szFmtString, Drive); - return 1; +INT AddSubst(IN PWSTR Drive, IN PWSTR Path) +{ + DWORD dwResult, dwPathAttr; + WCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; + + if ((wcslen(Drive) != 2) || (Drive[1] != L':')) + { + dwResult = ERROR_INVALID_PARAMETER; + goto Quit; } /* @@ -215,82 +257,129 @@ * the given path exists and really is a path to a directory, and if not, * just fail with an error. */ - dwPathAttr = GetFileAttributes(Path); + dwPathAttr = GetFileAttributesW(Path); if ( (dwPathAttr == INVALID_FILE_ATTRIBUTES) || !(dwPathAttr & FILE_ATTRIBUTE_DIRECTORY) ) { - LoadString(GetModuleHandle(NULL), - IDS_PATH_NOT_FOUND, + dwResult = ERROR_PATH_NOT_FOUND; + goto Quit; + } + + /* + * QuerySubstedDrive (via QueryDosDevice) returns ERROR_FILE_NOT_FOUND only + * if there is no already existing drive mapping. For all other results + * (existing drive, be it already subst'ed or not, or other errors...) + * no attempt at defining a drive mapping should be done. + */ + dwResult = QuerySubstedDrive(Drive[0], NULL, NULL); + if (dwResult != ERROR_FILE_NOT_FOUND) + goto Quit; + + if (!DefineDosDeviceW(0, Drive, Path)) + dwResult = GetLastError(); + else + dwResult = ERROR_SUCCESS; + +Quit: + switch (dwResult) + { + case ERROR_SUCCESS: + break; + + case ERROR_INVALID_DRIVE: + case ERROR_INVALID_PARAMETER: + { + LoadStringW(GetModuleHandleW(NULL), + IDS_INVALID_PARAMETER2, + szFmtString, + ARRAYSIZE(szFmtString)); + wprintf(szFmtString, Drive); + return 1; + } + + case ERROR_IS_SUBSTED: + { + LoadStringW(GetModuleHandleW(NULL), + IDS_DRIVE_ALREADY_SUBSTED, + szFmtString, + ARRAYSIZE(szFmtString)); + wprintf(szFmtString); + return 1; + } + + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + { + LoadStringW(GetModuleHandleW(NULL), + IDS_PATH_NOT_FOUND, + szFmtString, + ARRAYSIZE(szFmtString)); + wprintf(szFmtString, Path); + return 1; + } + + case ERROR_ACCESS_DENIED: + { + LoadStringW(GetModuleHandleW(NULL), + IDS_ACCESS_DENIED, + szFmtString, + ARRAYSIZE(szFmtString)); + wprintf(szFmtString, Path); + return 1; + } + + default: + { + PrintError(GetLastError()); + return 1; + } + } + + return 0; +} + +int wmain(int argc, WCHAR* argv[]) +{ + INT i; + WCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; + + for (i = 0; i < argc; i++) + { + if (!_wcsicmp(argv[i], L"/?")) + { + DisplaySubstUsage(); + return 0; + } + } + + if (argc < 3) + { + if (argc >= 2) + { + LoadStringW(GetModuleHandleW(NULL), + IDS_INVALID_PARAMETER, + szFmtString, + ARRAYSIZE(szFmtString)); + wprintf(szFmtString, argv[1]); + return 1; + } + DumpSubstedDrives(); + return 0; + } + + if (argc > 3) + { + LoadStringW(GetModuleHandleW(NULL), + IDS_INCORRECT_PARAMETER_COUNT, szFmtString, ARRAYSIZE(szFmtString)); - _tprintf(szFmtString, Path); + wprintf(szFmtString, argv[3]); return 1; } - if (IsSubstedDrive(Drive[0])) - { - // ERROR_IS_SUBSTED - LoadString(GetModuleHandle(NULL), - IDS_DRIVE_ALREADY_SUBSTED, - szFmtString, - ARRAYSIZE(szFmtString)); - _tprintf(szFmtString); - return 1; - } - - Result = DefineDosDevice(0, - Drive, - Path); - if (!Result) - { - PrintError(GetLastError()); - return 1; - } - return 0; -} - -int _tmain(int argc, TCHAR* argv[]) -{ - INT i; - TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; - - for (i = 0; i < argc; i++) - { - if (!_tcsicmp(argv[i], _T("/?"))) - { - DisplaySubstUsage(); - return 0; - } - } - - if (argc < 3) - { - if (argc >= 2) - { - LoadString(GetModuleHandle(NULL), - IDS_INVALID_PARAMETER, - szFmtString, - ARRAYSIZE(szFmtString)); - _tprintf(szFmtString, argv[1]); - return 1; - } - DumpSubstedDrives(); - return 0; - } - - if (argc > 3) - { - LoadString(GetModuleHandle(NULL), - IDS_INCORRECT_PARAMETER_COUNT, - szFmtString, - ARRAYSIZE(szFmtString)); - _tprintf(szFmtString, argv[3]); - return 1; - } - - if (!_tcsicmp(argv[1], _T("/D"))) + if (!_wcsicmp(argv[1], L"/D")) return DeleteSubst(argv[2]); - if (!_tcsicmp(argv[2], _T("/D"))) + if (!_wcsicmp(argv[2], L"/D")) return DeleteSubst(argv[1]); return AddSubst(argv[1], argv[2]); } Modified: trunk/reactos/base/system/subst/subst.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/subst.rc…
============================================================================== --- trunk/reactos/base/system/subst/subst.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/subst.rc [iso-8859-1] Wed Jun 29 00:38:51 2016 @@ -2,9 +2,9 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Virtual Drive Utility Version 1.0" -#define REACTOS_STR_INTERNAL_NAME "subst" -#define REACTOS_STR_ORIGINAL_FILENAME "subst.exe" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Drive Letter Mapper Utility" +#define REACTOS_STR_INTERNAL_NAME "subst" +#define REACTOS_STR_ORIGINAL_FILENAME "subst.exe" #include <reactos/version.rc> /* UTF-8 */
8 years, 7 months
1
0
0
0
[hbelusca] 71694: [COMP]: Fix code header & resource program description.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jun 29 00:29:27 2016 New Revision: 71694 URL:
http://svn.reactos.org/svn/reactos?rev=71694&view=rev
Log: [COMP]: Fix code header & resource program description. Modified: trunk/reactos/base/applications/cmdutils/comp/comp.c trunk/reactos/base/applications/cmdutils/comp/comp.rc Modified: trunk/reactos/base/applications/cmdutils/comp/comp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/comp/comp.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/comp/comp.c [iso-8859-1] Wed Jun 29 00:29:27 2016 @@ -17,8 +17,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* + * PROJECT: ReactOS Comp utility * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS comp utility * FILE: base/applications/cmdutils/comp/comp.c * PURPOSE: Compares the contents of two files * PROGRAMMERS: Ged Murphy (gedmurphy(a)gmail.com) Modified: trunk/reactos/base/applications/cmdutils/comp/comp.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/comp/comp.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/comp/comp.rc [iso-8859-1] Wed Jun 29 00:29:27 2016 @@ -4,7 +4,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#define REACTOS_STR_FILE_DESCRIPTION "File Compare Utility" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS File Compare Utility" #define REACTOS_STR_INTERNAL_NAME "comp" #define REACTOS_STR_ORIGINAL_FILENAME "comp.exe" #include <reactos/version.rc>
8 years, 7 months
1
0
0
0
[hbelusca] 71693: [SUBST] - Headers reordering. - Use ARRAYSIZE. - Give the internal helper function IsSubstedDrive just the single letter of the drive to check for. - AddSubst and DeleteSubst: bot...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jun 28 20:22:07 2016 New Revision: 71693 URL:
http://svn.reactos.org/svn/reactos?rev=71693&view=rev
Log: [SUBST] - Headers reordering. - Use ARRAYSIZE. - Give the internal helper function IsSubstedDrive just the single letter of the drive to check for. - AddSubst and DeleteSubst: both take a drive string of *exactly* two characters: the drive letter and the ':' (and of course there's the NULL terminator): fix the parameter check in this regard. - AddSubst: It is possible on Windows to use the DefineDosDevice API to map a drive letter to a *file* (yes yes!!) (but the mapping made is unusable). Forbids this case in SUBST since it is not made for that. CORE-10681 Modified: trunk/reactos/base/system/subst/lang/bg-BG.rc trunk/reactos/base/system/subst/lang/de-DE.rc trunk/reactos/base/system/subst/lang/en-US.rc trunk/reactos/base/system/subst/lang/es-ES.rc trunk/reactos/base/system/subst/lang/fr-FR.rc trunk/reactos/base/system/subst/lang/it-IT.rc trunk/reactos/base/system/subst/lang/pl-PL.rc trunk/reactos/base/system/subst/lang/ro-RO.rc trunk/reactos/base/system/subst/lang/ru-RU.rc trunk/reactos/base/system/subst/lang/sq-AL.rc trunk/reactos/base/system/subst/lang/tr-TR.rc trunk/reactos/base/system/subst/lang/uk-UA.rc trunk/reactos/base/system/subst/lang/zh-CN.rc trunk/reactos/base/system/subst/lang/zh-TW.rc trunk/reactos/base/system/subst/resource.h trunk/reactos/base/system/subst/subst.c Modified: trunk/reactos/base/system/subst/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/bg-…
============================================================================== --- trunk/reactos/base/system/subst/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/bg-BG.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -5,6 +5,7 @@ IDS_INCORRECT_PARAMETER_COUNT "ÐепÑавилен бÑой клÑÑове - %s\n" IDS_INVALID_PARAMETER "ÐепÑавилен бÑой клÑÑове - %s\n" IDS_INVALID_PARAMETER2 "ÐедопÑÑÑим клÑÑ - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "УÑÑÑойÑÑвоÑо веÑе е подложено на SUBST\n" IDS_FAILED_WITH_ERRORCODE "ÐÑеÑка номеÑ: 0x%x: %s\n" IDS_USAGE "ÐбвÑÑзва пÑÑ Ñ Ð¸Ð¼Ðµ на ÑÑÑÑойÑÑво (дÑл).\n\n\ Modified: trunk/reactos/base/system/subst/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/de-…
============================================================================== --- trunk/reactos/base/system/subst/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/de-DE.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -5,6 +5,7 @@ IDS_INCORRECT_PARAMETER_COUNT "Falsche Anzahl an Parametern - %s\n" IDS_INVALID_PARAMETER "Falsche Anzahl an Parametern - %s\n" IDS_INVALID_PARAMETER2 "Falscher Parameter - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "SUBST wurde hier schon ausgeführt.\n" IDS_FAILED_WITH_ERRORCODE "Fehlgeschlagen - Code 0x%x: %s\n" IDS_USAGE "Weist einem Pfad einen Laufwerksbuchstaben zu.n\n\ Modified: trunk/reactos/base/system/subst/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/en-…
============================================================================== --- trunk/reactos/base/system/subst/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/en-US.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -5,6 +5,7 @@ IDS_INCORRECT_PARAMETER_COUNT "Incorrect number of parameters - %s\n" IDS_INVALID_PARAMETER "Incorrect number of parameters - %s\n" IDS_INVALID_PARAMETER2 "Invalid parameter - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Drive already SUBSTed\n" IDS_FAILED_WITH_ERRORCODE "Failed with error code 0x%x: %s\n" IDS_USAGE "Associates a path with a drive letter.\n\n\ Modified: trunk/reactos/base/system/subst/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/es-…
============================================================================== --- trunk/reactos/base/system/subst/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/es-ES.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -5,6 +5,7 @@ IDS_INCORRECT_PARAMETER_COUNT "Cantidad de parámetros incorrecta - %s\n" IDS_INVALID_PARAMETER "Cantidad de parámetros incorrecta - %s\n" IDS_INVALID_PARAMETER2 "Parámetro incorrecto - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Unidad ya sustituida\n" IDS_FAILED_WITH_ERRORCODE "Falla con código de error 0x%x: %s\n" IDS_USAGE "Asocia una ruta con una letra de unidad.\n\n\ Modified: trunk/reactos/base/system/subst/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/fr-…
============================================================================== --- trunk/reactos/base/system/subst/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/fr-FR.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -5,8 +5,9 @@ IDS_INCORRECT_PARAMETER_COUNT "Nombre incorrect de paramètres - %s\n" IDS_INVALID_PARAMETER "Nombre incorrect de paramètres - %s\n" IDS_INVALID_PARAMETER2 "Paramètre incorrect - %s\n" + IDS_PATH_NOT_FOUND "Chemin d'accès introuvable - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Disque déjà substitué\n" - IDS_FAILED_WITH_ERRORCODE "Ãchoue avec le code d'erreur 0x%x: %s\n" + IDS_FAILED_WITH_ERRORCODE "Ãchoue avec le code d'erreur 0x%x : %s\n" IDS_USAGE "Associe un chemin avec une lettre de lecteur.\n\n\ SUBST [disque1: [disque2:]chemin]\n\ SUBST disque1: /D\n\n\ Modified: trunk/reactos/base/system/subst/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/it-…
============================================================================== --- trunk/reactos/base/system/subst/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/it-IT.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -5,6 +5,7 @@ IDS_INCORRECT_PARAMETER_COUNT "Numero di parametri errato - %s\n" IDS_INVALID_PARAMETER "Numero di parametri errato - %s\n" IDS_INVALID_PARAMETER2 "Parametro errato - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Unità già sostituita\n" IDS_FAILED_WITH_ERRORCODE "Interruzione con codice di errore 0x%x: %s\n" IDS_USAGE "Associa un percorso ad una lettera di unità .\n\n\ Modified: trunk/reactos/base/system/subst/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/pl-…
============================================================================== --- trunk/reactos/base/system/subst/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/pl-PL.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -13,6 +13,7 @@ IDS_INCORRECT_PARAMETER_COUNT "NieprawidÅowa liczba parametrów - %s\n" IDS_INVALID_PARAMETER "NieprawidÅowy parametr - %s\n" IDS_INVALID_PARAMETER2 "NieprawidÅowe parametry - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Na tym dysku już użyto komendy SUBST\n" IDS_FAILED_WITH_ERRORCODE "BÅÄ d 0x%x: %s\n" IDS_USAGE "PowiÄ zuje ÅcieżkÄ z literÄ napÄdu.\n\n\ Modified: trunk/reactos/base/system/subst/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/ro-…
============================================================================== --- trunk/reactos/base/system/subst/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/ro-RO.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -7,6 +7,7 @@ IDS_INCORRECT_PARAMETER_COUNT "NumÄr eronat de parametri - %s\n" IDS_INVALID_PARAMETER "NumÄr eronat de parametri - %s\n" IDS_INVALID_PARAMETER2 "Parametru eronat - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Unitatea este deja SUBSTituitÄ\n" IDS_FAILED_WITH_ERRORCODE "OperaÈia a eÈuat. Codul de eroare 0x%x: %s\n" IDS_USAGE "Substituie un director cu o unitate de stocare.\n\n\ Modified: trunk/reactos/base/system/subst/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/ru-…
============================================================================== --- trunk/reactos/base/system/subst/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/ru-RU.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -7,6 +7,7 @@ IDS_INCORRECT_PARAMETER_COUNT "ÐевеÑное ÑиÑло паÑамеÑÑов - %s\n" IDS_INVALID_PARAMETER "ÐевеÑное ÑиÑло паÑамеÑÑов - %s\n" IDS_INVALID_PARAMETER2 "ÐевеÑнÑй паÑамеÑÑ - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "ÐиÑк Ñже ÑопоÑÑавлен\n" IDS_FAILED_WITH_ERRORCODE "Сбой Ñ ÐºÐ¾Ð´Ð¾Ð¼ оÑибки 0x%x: %s\n" IDS_USAGE "СопоÑÑавление имени диÑка ÑÐºÐ°Ð·Ð°Ð½Ð½Ð¾Ð¼Ñ Ð¿ÑÑи.\n\n\ Modified: trunk/reactos/base/system/subst/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/sq-…
============================================================================== --- trunk/reactos/base/system/subst/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/sq-AL.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -9,6 +9,7 @@ IDS_INCORRECT_PARAMETER_COUNT "Numri i parametrave jo i sakte - %s\n" IDS_INVALID_PARAMETER "Numri i parametrave jo i sakte - %s\n" IDS_INVALID_PARAMETER2 "Parameter i gabuar - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Drive tashme i SUBSTed\n" IDS_FAILED_WITH_ERRORCODE "Deshtoj me error kode 0x%x: %s\n" IDS_USAGE "Perputh rrugen e driverit me germën.\n\n\ Modified: trunk/reactos/base/system/subst/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/tr-…
============================================================================== --- trunk/reactos/base/system/subst/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/tr-TR.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -7,6 +7,7 @@ IDS_INCORRECT_PARAMETER_COUNT "DeÄiÅken sayısı yanlıŠ- %s\n" IDS_INVALID_PARAMETER "DeÄiÅken sayısı yanlıŠ- %s\n" IDS_INVALID_PARAMETER2 "Geçersiz deÄiÅken - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Sürücü önceden SUBST edilmiÅ.\n" IDS_FAILED_WITH_ERRORCODE "YanlıÅlık kodu ile baÅarısız oldu 0x%x: %s\n" IDS_USAGE "Bir sürücü harfiyle bir yolu iliÅkilendirir.\n\n\ Modified: trunk/reactos/base/system/subst/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/uk-…
============================================================================== --- trunk/reactos/base/system/subst/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/uk-UA.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -7,6 +7,7 @@ IDS_INCORRECT_PARAMETER_COUNT "ÐевÑÑна кÑлÑкÑÑÑÑ Ð¿Ð°ÑамеÑÑÑв - %s\n" IDS_INVALID_PARAMETER "ÐевÑÑна кÑлÑкÑÑÑÑ Ð¿Ð°ÑамеÑÑÑв - %s\n" IDS_INVALID_PARAMETER2 "ÐевÑÑний паÑамеÑÑ - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "Ðо диÑÐºÑ Ð²Ð¶Ðµ заÑÑоÑовано SUBST\n" IDS_FAILED_WITH_ERRORCODE "ÐевдаÑа з кодом помилки 0x%x: %s\n" IDS_USAGE "ÐÑоÑÑÑÑ ÑлÑÑ Ð· бÑÐºÐ²Ð¾Ñ Ð´Ð¸ÑкÑ.\n\n\ Modified: trunk/reactos/base/system/subst/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/zh-…
============================================================================== --- trunk/reactos/base/system/subst/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/zh-CN.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -7,6 +7,7 @@ IDS_INCORRECT_PARAMETER_COUNT "åæ°ä¸ªæ°ä¸æ£ç¡® - %s\n" IDS_INVALID_PARAMETER "åæ°ä¸ªæ°ä¸æ£ç¡® - %s\n" IDS_INVALID_PARAMETER2 "æ æåæ° - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "驱å¨å¨å·²ç»è¿è¡è¿ SUBST\n" IDS_FAILED_WITH_ERRORCODE "æä½å¤±è´¥ï¼é误ç 0x%xï¼%s\n" IDS_USAGE "å°ä¸ä¸ªè·¯å¾ç¨é©±å¨å¨å·å ³èã\n\n\ Modified: trunk/reactos/base/system/subst/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/lang/zh-…
============================================================================== --- trunk/reactos/base/system/subst/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/lang/zh-TW.rc [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -7,6 +7,7 @@ IDS_INCORRECT_PARAMETER_COUNT "åæ¸åæ¸ä¸æ£ç¢º - %s\n" IDS_INVALID_PARAMETER "åæ¸åæ¸ä¸æ£ç¢º - %s\n" IDS_INVALID_PARAMETER2 "ç¡æåæ¸ - %s\n" + IDS_PATH_NOT_FOUND "Path not found - %s\n" IDS_DRIVE_ALREADY_SUBSTED "é© åå¨å·²ç¶éè¡é SUBST\n" IDS_FAILED_WITH_ERRORCODE "æä½å¤±æï¼é¯èª¤ç¢¼ 0x%xï¼%s\n" IDS_USAGE "å°ä¸åè·¯å¾ç¨é© åå¨èéè¯ã\n\n\ Modified: trunk/reactos/base/system/subst/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/resource…
============================================================================== --- trunk/reactos/base/system/subst/resource.h [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/resource.h [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -8,4 +8,5 @@ #define IDS_INCORRECT_PARAMETER_COUNT 1003 #define IDS_INVALID_PARAMETER 1004 #define IDS_INVALID_PARAMETER2 1005 -#define IDS_DRIVE_ALREADY_SUBSTED 1006 +#define IDS_PATH_NOT_FOUND 1006 +#define IDS_DRIVE_ALREADY_SUBSTED 1007 Modified: trunk/reactos/base/system/subst/subst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/subst.c?…
============================================================================== --- trunk/reactos/base/system/subst/subst.c [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/subst.c [iso-8859-1] Tue Jun 28 20:22:07 2016 @@ -7,13 +7,14 @@ /* INCLUDES *****************************************************************/ +#include <stdarg.h> +#include <stdlib.h> +#include <tchar.h> + #define WIN32_NO_STATUS -#include <stdarg.h> #include <windef.h> #include <winbase.h> #include <winuser.h> -#include <stdlib.h> -#include <tchar.h> #define NDEBUG #include <debug.h> @@ -22,7 +23,7 @@ /* FUNCTIONS ****************************************************************/ -void PrintError(DWORD ErrCode) +VOID PrintError(DWORD ErrCode) { TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; TCHAR *buffer = (TCHAR*) calloc(2048, @@ -41,7 +42,7 @@ LoadString(GetModuleHandle(NULL), IDS_FAILED_WITH_ERRORCODE, szFmtString, - sizeof(szFmtString) / sizeof(szFmtString[0])); + ARRAYSIZE(szFmtString)); _sntprintf(buffer, 2048, szFmtString, @@ -55,25 +56,25 @@ } } -void DisplaySubstUsage(void) +VOID DisplaySubstUsage(VOID) { TCHAR szHelp[RC_STRING_MAX_SIZE] = {0}; LoadString(GetModuleHandle(NULL), IDS_USAGE, szHelp, - sizeof(szHelp) / sizeof(szHelp[0])); + ARRAYSIZE(szHelp)); _tprintf(_T("%s"), szHelp); } -BOOLEAN IsSubstedDrive(TCHAR *Drive) +BOOLEAN IsSubstedDrive(TCHAR DriveLetter) { BOOLEAN Result = FALSE; + TCHAR Drive[3] = _T("A:"); LPTSTR lpTargetPath = NULL; DWORD CharCount, dwSize; - if (_tcslen(Drive) > 2) - return FALSE; + Drive[0] = DriveLetter; dwSize = MAX_PATH; lpTargetPath = (LPTSTR)malloc(sizeof(TCHAR) * dwSize); @@ -109,7 +110,7 @@ return Result; } -void DumpSubstedDrives(void) +VOID DumpSubstedDrives(VOID) { TCHAR Drive[3] = _T("A:"); LPTSTR lpTargetPath = NULL; @@ -159,7 +160,7 @@ free(lpTargetPath); } -int DeleteSubst(TCHAR* Drive) +INT DeleteSubst(TCHAR* Drive) { BOOL Result; TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; @@ -167,26 +168,24 @@ LoadString(GetModuleHandle(NULL), IDS_INVALID_PARAMETER2, szFmtString, - sizeof(szFmtString) / sizeof(szFmtString[0])); - - if (_tcslen(Drive) > 2) - { - _tprintf(szFmtString, - Drive); - return 1; - } - - if (! IsSubstedDrive(Drive)) - { - _tprintf(szFmtString, - Drive); + ARRAYSIZE(szFmtString)); + + if ((_tcslen(Drive) != 2) || (Drive[1] != _T(':'))) + { + _tprintf(szFmtString, Drive); + return 1; + } + + if (!IsSubstedDrive(Drive[0])) + { + _tprintf(szFmtString, Drive); return 1; } Result = DefineDosDevice(DDD_REMOVE_DEFINITION, Drive, NULL); - if (! Result) + if (!Result) { PrintError(GetLastError()); return 1; @@ -194,35 +193,47 @@ return 0; } -int AddSubst(TCHAR* Drive, TCHAR *Path) +INT AddSubst(TCHAR* Drive, TCHAR *Path) { BOOL Result; - TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; - - LoadString(GetModuleHandle(NULL), - IDS_INVALID_PARAMETER2, - szFmtString, - sizeof(szFmtString) / sizeof(szFmtString[0])); - if (_tcslen(Drive) != 2) - { - _tprintf(szFmtString, - Drive); - return 1; - } - - if (Drive[1] != _T(':')) - { - _tprintf(szFmtString, - Drive); - return 1; - } - - if (IsSubstedDrive(Drive)) - { + DWORD dwPathAttr; + TCHAR szFmtString[RC_STRING_MAX_SIZE] = {0}; + + if ((_tcslen(Drive) != 2) || (Drive[1] != _T(':'))) + { + LoadString(GetModuleHandle(NULL), + IDS_INVALID_PARAMETER2, + szFmtString, + ARRAYSIZE(szFmtString)); + _tprintf(szFmtString, Drive); + return 1; + } + + /* + * Even if DefineDosDevice allows to map files to drive letters (yes yes!!) + * it is not the purpose of SUBST to allow that. Therefore check whether + * the given path exists and really is a path to a directory, and if not, + * just fail with an error. + */ + dwPathAttr = GetFileAttributes(Path); + if ( (dwPathAttr == INVALID_FILE_ATTRIBUTES) || + !(dwPathAttr & FILE_ATTRIBUTE_DIRECTORY) ) + { + LoadString(GetModuleHandle(NULL), + IDS_PATH_NOT_FOUND, + szFmtString, + ARRAYSIZE(szFmtString)); + _tprintf(szFmtString, Path); + return 1; + } + + if (IsSubstedDrive(Drive[0])) + { + // ERROR_IS_SUBSTED LoadString(GetModuleHandle(NULL), IDS_DRIVE_ALREADY_SUBSTED, szFmtString, - sizeof(szFmtString) / sizeof(szFmtString[0])); + ARRAYSIZE(szFmtString)); _tprintf(szFmtString); return 1; } @@ -230,7 +241,7 @@ Result = DefineDosDevice(0, Drive, Path); - if (! Result) + if (!Result) { PrintError(GetLastError()); return 1; @@ -259,9 +270,8 @@ LoadString(GetModuleHandle(NULL), IDS_INVALID_PARAMETER, szFmtString, - sizeof(szFmtString) / sizeof(szFmtString[0])); - _tprintf(szFmtString, - argv[1]); + ARRAYSIZE(szFmtString)); + _tprintf(szFmtString, argv[1]); return 1; } DumpSubstedDrives(); @@ -273,15 +283,14 @@ LoadString(GetModuleHandle(NULL), IDS_INCORRECT_PARAMETER_COUNT, szFmtString, - sizeof(szFmtString) / sizeof(szFmtString[0])); - _tprintf(szFmtString, - argv[3]); - return 1; - } - - if (! _tcsicmp(argv[1], _T("/D"))) + ARRAYSIZE(szFmtString)); + _tprintf(szFmtString, argv[3]); + return 1; + } + + if (!_tcsicmp(argv[1], _T("/D"))) return DeleteSubst(argv[2]); - if (! _tcsicmp(argv[2], _T("/D"))) + if (!_tcsicmp(argv[2], _T("/D"))) return DeleteSubst(argv[1]); return AddSubst(argv[1], argv[2]); }
8 years, 7 months
1
0
0
0
[hbelusca] 71692: [SUBST]: CORE-10681 #comment Apply part of Peter Hater's patch proposed in CORE-10681, that is, fixing the usage of QueryDosDevice API, but without the new IsDriveUsed functionali...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jun 28 19:21:08 2016 New Revision: 71692 URL:
http://svn.reactos.org/svn/reactos?rev=71692&view=rev
Log: [SUBST]: CORE-10681 #comment Apply part of Peter Hater's patch proposed in CORE-10681, that is, fixing the usage of QueryDosDevice API, but without the new IsDriveUsed functionality. (r71692) Modified: trunk/reactos/base/system/subst/subst.c Modified: trunk/reactos/base/system/subst/subst.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/subst/subst.c?…
============================================================================== --- trunk/reactos/base/system/subst/subst.c [iso-8859-1] (original) +++ trunk/reactos/base/system/subst/subst.c [iso-8859-1] Tue Jun 28 19:21:08 2016 @@ -75,81 +75,71 @@ if (_tcslen(Drive) > 2) return FALSE; - dwSize = sizeof(TCHAR) * MAX_PATH; - lpTargetPath = (LPTSTR) malloc(sizeof(TCHAR) * MAX_PATH); - if ( lpTargetPath) - { + dwSize = MAX_PATH; + lpTargetPath = (LPTSTR)malloc(sizeof(TCHAR) * dwSize); + if (!lpTargetPath) + return FALSE; + + CharCount = QueryDosDevice(Drive, + lpTargetPath, + dwSize); + while (!CharCount && + GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + lpTargetPath = (LPTSTR)realloc(lpTargetPath, sizeof(TCHAR) * dwSize); + if (lpTargetPath) + { + CharCount = QueryDosDevice(Drive, + lpTargetPath, + dwSize); + } + } + + if (CharCount) + { + Result = _tcsncmp(lpTargetPath, _T("\\??\\"), 4) == 0 && + ( (lpTargetPath[4] >= _T('A') && + lpTargetPath[4] <= _T('Z')) || + (lpTargetPath[4] >= _T('a') && + lpTargetPath[4] <= _T('z')) ); + } + + free(lpTargetPath); + + return Result; +} + +void DumpSubstedDrives(void) +{ + TCHAR Drive[3] = _T("A:"); + LPTSTR lpTargetPath = NULL; + DWORD CharCount, dwSize; + INT i = 0; + + dwSize = MAX_PATH; + lpTargetPath = (LPTSTR)malloc(sizeof(TCHAR) * dwSize); + if (!lpTargetPath) + return; + + while (i < 26) + { + Drive[0] = _T('A') + i; CharCount = QueryDosDevice(Drive, lpTargetPath, - dwSize / sizeof(TCHAR)); - while (! CharCount && + dwSize); + while (!CharCount && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - free(lpTargetPath); - dwSize *= 2; - lpTargetPath = (LPTSTR) malloc(dwSize); + lpTargetPath = (LPTSTR)realloc(lpTargetPath, sizeof(TCHAR) * dwSize); if (lpTargetPath) { CharCount = QueryDosDevice(Drive, lpTargetPath, - dwSize / sizeof(TCHAR)); + dwSize); } } if (CharCount) - { - if ( _tcsncmp(lpTargetPath, _T("\\??\\"), 4) == 0 && - ( (lpTargetPath[4] >= _T('A') && - lpTargetPath[4] <= _T('Z')) || - (lpTargetPath[4] >= _T('a') && - lpTargetPath[4] <= _T('z')) ) ) - { - Result = TRUE; - } - } - free(lpTargetPath); - } - return Result; -} - -void DumpSubstedDrives(void) -{ - TCHAR Drive[3] = _T("A:"); - LPTSTR lpTargetPath = NULL; - DWORD CharCount, dwSize; - INT i = 0; - - dwSize = sizeof(TCHAR) * MAX_PATH; - lpTargetPath = (LPTSTR) malloc(sizeof(TCHAR) * MAX_PATH); - if (! lpTargetPath) - return; - - while (i < 26) - { - Drive[0] = _T('A') + i; - CharCount = QueryDosDevice(Drive, - lpTargetPath, - dwSize / sizeof(TCHAR)); - while (! CharCount && - GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - free(lpTargetPath); - dwSize *= 2; - lpTargetPath = (LPTSTR) malloc(dwSize); - if (lpTargetPath) - { - CharCount = QueryDosDevice(Drive, - lpTargetPath, - dwSize / sizeof(TCHAR)); - } - } - - if (! CharCount) - { - i++; - continue; - } - else { if ( _tcsncmp(lpTargetPath, _T("\\??\\"), 4) == 0 && ( (lpTargetPath[4] >= _T('A') && @@ -162,8 +152,10 @@ lpTargetPath + 4); } } + i++; } + free(lpTargetPath); }
8 years, 7 months
1
0
0
0
[hbelusca] 71691: [LAUTUS.MSSTYLES]: Russian translation by 'amber' CORE-11425 #resolve #comment Committed, thanks!
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jun 28 18:54:16 2016 New Revision: 71691 URL:
http://svn.reactos.org/svn/reactos?rev=71691&view=rev
Log: [LAUTUS.MSSTYLES]: Russian translation by 'amber' CORE-11425 #resolve #comment Committed, thanks! Added: trunk/reactos/media/themes/lautus.msstyles/lang/ru-RU.rc (with props) Modified: trunk/reactos/media/themes/lautus.msstyles/lautus.rc Added: trunk/reactos/media/themes/lautus.msstyles/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/themes/lautus.msstyl…
============================================================================== --- trunk/reactos/media/themes/lautus.msstyles/lang/ru-RU.rc (added) +++ trunk/reactos/media/themes/lautus.msstyles/lang/ru-RU.rc [iso-8859-1] Tue Jun 28 18:54:16 2016 @@ -0,0 +1,37 @@ +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +STRINGTABLE +{ +1000, "Ater" +} + +STRINGTABLE +{ +2000, "Lautus Ater" +} + +STRINGTABLE +{ +3000, "ÐбÑÑнÑй" +3001, "ÐÑÑпнÑй ÑÑиÑÑ" +3002, "ÐгÑомнÑй ÑÑиÑÑ" +} + +STRINGTABLE +{ +4000, "ÐбÑÑнÑй" +4001, "ÐÑÑпнÑй ÑÑиÑÑ" +4002, "ÐгÑомнÑй ÑÑиÑÑ" +} + +STRINGTABLE +{ +5000, "Lautus" +5001, "ÐизÑалÑнÑй СÑилÑ" +5002, "Ðоманда ReactOS" +5003, "Pisarz, оÑнован на Luna Inspirat" +5004, "ÐÑпÑÑен под GNU/GPL 2.0, 2011" +5005, "
http://www.reactos.org
" +5006, "1.0" +5007, "ÐизÑалÑнÑй ÑÑÐ¸Ð»Ñ Ð´Ð»Ñ ReactOS" +} Propchange: trunk/reactos/media/themes/lautus.msstyles/lang/ru-RU.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/media/themes/lautus.msstyles/lautus.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/themes/lautus.msstyl…
============================================================================== --- trunk/reactos/media/themes/lautus.msstyles/lautus.rc [iso-8859-1] (original) +++ trunk/reactos/media/themes/lautus.msstyles/lautus.rc [iso-8859-1] Tue Jun 28 18:54:16 2016 @@ -201,6 +201,9 @@ #ifdef LANGUAGE_RO_RO #include "lang/ro-RO.rc" #endif +#ifdef LANGUAGE_RU_RU + #include "lang/ru-RU.rc" +#endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif
8 years, 7 months
1
0
0
0
[hbelusca] 71690: [COMP]: Russian translation by 'amber' CORE-11424 #resolve #comment Committed, thanks!
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Jun 28 18:53:12 2016 New Revision: 71690 URL:
http://svn.reactos.org/svn/reactos?rev=71690&view=rev
Log: [COMP]: Russian translation by 'amber' CORE-11424 #resolve #comment Committed, thanks! Added: trunk/reactos/base/applications/cmdutils/comp/lang/ru-RU.rc (with props) Modified: trunk/reactos/base/applications/cmdutils/comp/comp.rc Modified: trunk/reactos/base/applications/cmdutils/comp/comp.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/comp/comp.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/comp/comp.rc [iso-8859-1] Tue Jun 28 18:53:12 2016 @@ -21,3 +21,6 @@ #ifdef LANGUAGE_RO_RO #include "lang/ro-RO.rc" #endif +#ifdef LANGUAGE_RU_RU + #include "lang/ru-RU.rc" +#endif Added: trunk/reactos/base/applications/cmdutils/comp/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/comp/lang/ru-RU.rc (added) +++ trunk/reactos/base/applications/cmdutils/comp/lang/ru-RU.rc [iso-8859-1] Tue Jun 28 18:53:12 2016 @@ -0,0 +1,23 @@ +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_HELP "СÑавнение ÑодеÑжимого двÑÑ Ñайлов или набоÑов Ñайлов.\n\n\ +COMP [/L] [/A] [даннÑе1] [даннÑе2]\n\n\ + даннÑе1 РаÑположение и Ð¸Ð¼Ñ Ð¿ÐµÑвого Ñайла Ð´Ð»Ñ ÑÑавнениÑ.\n\ + даннÑе2 РаÑположение и Ð¸Ð¼Ñ Ð²ÑоÑого Ñайла Ð´Ð»Ñ ÑÑавнениÑ.\n\ + /A ÐÑвод ÑазлиÑий в ÑоÑмаÑе ASCII (по ÑмолÑаниÑ: ÑеÑÑнадÑаÑиÑиÑнÑй).\n\ + /L ÐÑвод номеÑов ÑÑÑок, в коÑоÑÑÑ Ð¾Ð±Ð½Ð°ÑÑÐ¶ÐµÐ½Ñ ÑазлиÑиÑ.\n" + IDS_INVALIDSWITCH "ÐедопÑÑÑимÑй клÑÑ - /%c\n" + IDS_BADSYNTAX "Ðе веÑнÑй ÑоÑÐ¼Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð¾Ð¹ ÑÑÑоки\n" + IDS_FILEERROR "Ðе ÑдалоÑÑ Ð½Ð°Ð¹Ñи/оÑкÑÑÑÑ Ñайл: %s\n" + IDS_COMPARING "СÑавнение %s и %s...\n" + IDS_FILESIZEERROR "Ðе ÑдалоÑÑ Ð¾Ð¿ÑеделиÑÑ ÑÐ°Ð·Ð¼ÐµÑ Ñайла: %s\n" + IDS_SIZEDIFFERS "Ð¤Ð°Ð¹Ð»Ñ ÑазнÑÑ ÑазмеÑов.\n" + IDS_READERROR "ÐÑибка ÑÑÐµÐ½Ð¸Ñ Ñайлов.\n" + IDS_MISMATCHLINE "ÐÑибка ÑÑÐ°Ð²Ð½ÐµÐ½Ð¸Ñ Ð² СТРÐÐÐ %d\n" + IDS_MISMATCHOFFSET "ÐÑибка ÑÑÐ°Ð²Ð½ÐµÐ½Ð¸Ñ Ð² ÐÐÐÐЦÐÐ 0x%X\n" + IDS_ASCIIDIFF "Ñайл%d = %c\n" + IDS_HEXADECIMALDIFF "Ñайл%d = %X\n" + IDS_MATCH "РазлиÑÐ¸Ñ Ð½Ðµ найденÑ\n" +END Propchange: trunk/reactos/base/applications/cmdutils/comp/lang/ru-RU.rc ------------------------------------------------------------------------------ svn:eol-style = native
8 years, 7 months
1
0
0
0
[jimtabor] 71689: [NtUser] - Remove unused code, enhance wine'isms while checking for menus.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Jun 28 16:15:06 2016 New Revision: 71689 URL:
http://svn.reactos.org/svn/reactos?rev=71689&view=rev
Log: [NtUser] - Remove unused code, enhance wine'isms while checking for menus. Modified: trunk/reactos/win32ss/user/ntuser/nonclient.c Modified: trunk/reactos/win32ss/user/ntuser/nonclient.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/noncli…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/nonclient.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/nonclient.c [iso-8859-1] Tue Jun 28 16:15:06 2016 @@ -679,12 +679,6 @@ return !(sbi.rgstate[0] & STATE_SYSTEM_OFFSCREEN); } -BOOL -UserHasMenu(PWND pWnd, ULONG Style) -{ - return (!(Style & WS_CHILD) && UlongToHandle(pWnd->IDMenu) != 0); -} - /* * FIXME: * - Cache bitmaps, then just bitblt instead of calling DFC() (and @@ -951,7 +945,7 @@ { PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); /* Draw menu bar */ - if (menu && !(Style & WS_CHILD)) + if ( menu && (((Style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) ) { TempRect = CurrentRect; TempRect.bottom = TempRect.top + menu->cyMenu; @@ -1120,7 +1114,7 @@ { PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); /* Draw menu bar */ - if (menu && !(Style & WS_CHILD)) + if ( menu && (((Style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) ) { TempRect = CurrentRect; TempRect.bottom = TempRect.top + menu->cyMenu;
8 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
...
23
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
Results per page:
10
25
50
100
200