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
May 2018
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
23 participants
218 discussions
Start a n
N
ew thread
03/05: [SDK] Add more types for job objects information
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=69a7879e81d848f076bb6…
commit 69a7879e81d848f076bb609921354c85dad2edc9 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri May 25 08:14:16 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri May 25 08:48:51 2018 +0200 [SDK] Add more types for job objects information --- sdk/include/ndk/pstypes.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sdk/include/ndk/pstypes.h b/sdk/include/ndk/pstypes.h index 411a1d334a..543afcb618 100644 --- a/sdk/include/ndk/pstypes.h +++ b/sdk/include/ndk/pstypes.h @@ -1490,6 +1490,38 @@ typedef struct _JOBOBJECT_BASIC_LIMIT_INFORMATION ULONG SchedulingClass; } JOBOBJECT_BASIC_LIMIT_INFORMATION, *PJOBOBJECT_BASIC_LIMIT_INFORMATION; +typedef struct _JOBOBJECT_BASIC_PROCESS_ID_LIST +{ + ULONG NumberOfAssignedProcesses; + ULONG NumberOfProcessIdsInList; + ULONG_PTR ProcessIdList[1]; +} JOBOBJECT_BASIC_PROCESS_ID_LIST, *PJOBOBJECT_BASIC_PROCESS_ID_LIST; + +typedef struct _JOBOBJECT_BASIC_UI_RESTRICTIONS +{ + ULONG UIRestrictionsClass; +} JOBOBJECT_BASIC_UI_RESTRICTIONS, *PJOBOBJECT_BASIC_UI_RESTRICTIONS; + +typedef struct _JOBOBJECT_SECURITY_LIMIT_INFORMATION +{ + ULONG SecurityLimitFlags; + HANDLE JobToken; + PTOKEN_GROUPS SidsToDisable; + PTOKEN_PRIVILEGES PrivilegesToDelete; + PTOKEN_GROUPS RestrictedSids; +} JOBOBJECT_SECURITY_LIMIT_INFORMATION, *PJOBOBJECT_SECURITY_LIMIT_INFORMATION; + +typedef struct _JOBOBJECT_END_OF_JOB_TIME_INFORMATION +{ + ULONG EndOfJobTimeAction; +} JOBOBJECT_END_OF_JOB_TIME_INFORMATION, PJOBOBJECT_END_OF_JOB_TIME_INFORMATION; + +typedef struct _JOBOBJECT_ASSOCIATE_COMPLETION_PORT +{ + PVOID CompletionKey; + HANDLE CompletionPort; +} JOBOBJECT_ASSOCIATE_COMPLETION_PORT, *PJOBOBJECT_ASSOCIATE_COMPLETION_PORT; + typedef struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION { JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo;
6 years, 7 months
1
0
0
0
02/05: [NTOSKRNL] Implement NtQueryInformationJobObject().
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ffbd6995e6e4fda35ab02…
commit ffbd6995e6e4fda35ab02942c49f6c42e5ca9c83 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri May 25 00:18:20 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri May 25 08:48:51 2018 +0200 [NTOSKRNL] Implement NtQueryInformationJobObject(). This is required by some Python2 applications such as pip.exe --- ntoskrnl/ps/job.c | 265 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 262 insertions(+), 3 deletions(-) diff --git a/ntoskrnl/ps/job.c b/ntoskrnl/ps/job.c index d6f2ba8fc1..7b242c6d60 100644 --- a/ntoskrnl/ps/job.c +++ b/ntoskrnl/ps/job.c @@ -5,6 +5,7 @@ * PURPOSE: Job Native Functions * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) (stubs) * Thomas Weidenmueller <w3seek(a)reactos.com> + * Pierre Schweitzer (pierre(a)reactos.org) */ /* INCLUDES *****************************************************************/ @@ -278,6 +279,8 @@ NtCreateJobObject ( /* inherit the session id from the caller */ Job->SessionId = PsGetProcessSessionId(CurrentProcess); + KeInitializeGuardedMutex(&Job->MemoryLimitsLock); + Status = ExInitializeResource(&Job->JobLock); if(!NT_SUCCESS(Status)) { @@ -444,8 +447,15 @@ NtOpenJobObject ( } +ULONG PspJobInfoLengths[] = { 0x0, sizeof(JOBOBJECT_BASIC_ACCOUNTING_INFORMATION), + sizeof(JOBOBJECT_BASIC_LIMIT_INFORMATION), + 0x0C, 0x4, 0x14, 0x4, 0x8, + sizeof(JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION), + sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION), 0x4 }; +ULONG PspJobInfoAlign[] = { 0x0, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }; + /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI @@ -456,8 +466,257 @@ NtQueryInformationJobObject ( ULONG JobInformationLength, PULONG ReturnLength ) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PEJOB Job; + NTSTATUS Status; + BOOLEAN NoOutput; + PVOID GenericCopy; + PLIST_ENTRY NextEntry; + PKTHREAD CurrentThread; + KPROCESSOR_MODE PreviousMode; + JOBOBJECT_EXTENDED_LIMIT_INFORMATION ExtendedLimit; + JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION BasicAndIo; + ULONG RequiredLength, RequiredAlign, SizeToCopy, NeededSize; + + PAGED_CODE(); + + CurrentThread = KeGetCurrentThread(); + + /* Validate class */ + if (JobInformationClass > JobObjectJobSetInformation || JobInformationClass < JobObjectBasicAccountingInformation) + { + return STATUS_INVALID_INFO_CLASS; + } + + /* Get associated lengths & alignments */ + RequiredLength = PspJobInfoLengths[JobInformationClass]; + RequiredAlign = PspJobInfoAlign[JobInformationClass]; + SizeToCopy = RequiredLength; + NeededSize = RequiredLength; + + /* If length mismatch (needed versus provided) */ + if (JobInformationLength != RequiredLength) + { + /* This can only be accepted if: JobObjectBasicProcessIdList or JobObjectSecurityLimitInformation + * Or if size is bigger than needed + */ + if ((JobInformationClass != JobObjectBasicProcessIdList && JobInformationClass != JobObjectSecurityLimitInformation) || + JobInformationLength < RequiredLength) + { + return STATUS_INFO_LENGTH_MISMATCH; + } + + /* Set what we need to copy out */ + SizeToCopy = JobInformationLength; + } + + PreviousMode = ExGetPreviousMode(); + /* If not comming from umode, we need to probe buffers */ + if (PreviousMode != KernelMode) + { + ASSERT(((RequiredAlign) == 1) || ((RequiredAlign) == 2) || ((RequiredAlign) == 4) || ((RequiredAlign) == 8) || ((RequiredAlign) == 16)); + + _SEH2_TRY + { + /* Probe out buffer for write */ + if (JobInformation != NULL) + { + ProbeForWrite(JobInformation, JobInformationLength, RequiredAlign); + } + + /* But also return lenght if asked */ + if (ReturnLength != NULL) + { + ProbeForWrite(JobInformation, sizeof(ULONG), sizeof(ULONG)); + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + } + + /* If a job handle was provided, use it */ + if (JobHandle != NULL) + { + Status = ObReferenceObjectByHandle(JobHandle, + JOB_OBJECT_QUERY, + PsJobType, + PreviousMode, + (PVOID*)&Job, + NULL); + if (!NT_SUCCESS(Status)) + { + return Status; + } + } + /* Otherwise, get our current process' job, if any */ + else + { + PEPROCESS CurrentProcess; + + CurrentProcess = (PEPROCESS)CurrentThread->ApcState.Process; + Job = CurrentProcess->Job; + if (Job == NULL) + { + return STATUS_ACCESS_DENIED; + } + + ObReferenceObject(Job); + } + + /* By default, assume we'll have to copy data */ + NoOutput = FALSE; + /* Select class */ + switch (JobInformationClass) + { + /* Basic counters */ + case JobObjectBasicAccountingInformation: + case JobObjectBasicAndIoAccountingInformation: + /* Zero basics */ + RtlZeroMemory(&BasicAndIo.BasicInfo, sizeof(JOBOBJECT_BASIC_ACCOUNTING_INFORMATION)); + + /* Lock */ + KeEnterGuardedRegionThread(CurrentThread); + ExAcquireResourceSharedLite(&Job->JobLock, TRUE); + + /* Initialize with job counters */ + BasicAndIo.BasicInfo.TotalUserTime.QuadPart = Job->TotalUserTime.QuadPart; + BasicAndIo.BasicInfo.TotalKernelTime.QuadPart = Job->TotalKernelTime.QuadPart; + BasicAndIo.BasicInfo.ThisPeriodTotalUserTime.QuadPart = Job->ThisPeriodTotalUserTime.QuadPart; + BasicAndIo.BasicInfo.ThisPeriodTotalKernelTime.QuadPart = Job->ThisPeriodTotalKernelTime.QuadPart; + BasicAndIo.BasicInfo.TotalPageFaultCount = Job->TotalPageFaultCount; + BasicAndIo.BasicInfo.TotalProcesses = Job->TotalProcesses; + BasicAndIo.BasicInfo.ActiveProcesses = Job->ActiveProcesses; + BasicAndIo.BasicInfo.TotalTerminatedProcesses = Job->TotalTerminatedProcesses; + + /* We also set IoInfo, even though we might not return it */ + BasicAndIo.IoInfo.ReadOperationCount = Job->ReadOperationCount; + BasicAndIo.IoInfo.WriteOperationCount = Job->WriteOperationCount; + BasicAndIo.IoInfo.OtherOperationCount = Job->OtherOperationCount; + BasicAndIo.IoInfo.ReadTransferCount = Job->ReadTransferCount; + BasicAndIo.IoInfo.WriteTransferCount = Job->WriteTransferCount; + BasicAndIo.IoInfo.OtherTransferCount = Job->OtherTransferCount; + + /* For every process, sum its counters */ + for (NextEntry = Job->ProcessListHead.Flink; + NextEntry != &Job->ProcessListHead; + NextEntry = NextEntry->Flink) + { + PEPROCESS Process; + + Process = CONTAINING_RECORD(NextEntry, EPROCESS, JobLinks); + if (!BooleanFlagOn(Process->JobStatus, 2)) + { + /* FIXME: Call KeQueryValuesProcess() + * We should sum BasicInfo values here, + * but we don't have them + */ + BasicAndIo.IoInfo.ReadOperationCount += Process->ReadOperationCount.QuadPart; + BasicAndIo.IoInfo.WriteOperationCount += Process->WriteOperationCount.QuadPart; + BasicAndIo.IoInfo.OtherOperationCount += Process->OtherOperationCount.QuadPart; + BasicAndIo.IoInfo.ReadTransferCount += Process->ReadTransferCount.QuadPart; + BasicAndIo.IoInfo.WriteTransferCount += Process->WriteTransferCount.QuadPart; + BasicAndIo.IoInfo.OtherTransferCount += Process->OtherTransferCount.QuadPart; + } + } + + /* And done */ + ExReleaseResourceLite(&Job->JobLock); + KeLeaveGuardedRegionThread(CurrentThread); + + /* We'll copy back the buffer */ + GenericCopy = &BasicAndIo; + Status = STATUS_SUCCESS; + + break; + + /* Limits information */ + case JobObjectBasicLimitInformation: + case JobObjectExtendedLimitInformation: + /* Lock */ + KeEnterGuardedRegionThread(CurrentThread); + ExAcquireResourceSharedLite(&Job->JobLock, TRUE); + + /* Copy basic information */ + ExtendedLimit.BasicLimitInformation.LimitFlags = Job->LimitFlags; + ExtendedLimit.BasicLimitInformation.MinimumWorkingSetSize = Job->MinimumWorkingSetSize; + ExtendedLimit.BasicLimitInformation.MaximumWorkingSetSize = Job->MaximumWorkingSetSize; + ExtendedLimit.BasicLimitInformation.ActiveProcessLimit = Job->ActiveProcessLimit; + ExtendedLimit.BasicLimitInformation.PriorityClass = Job->PriorityClass; + ExtendedLimit.BasicLimitInformation.SchedulingClass = Job->SchedulingClass; + ExtendedLimit.BasicLimitInformation.Affinity = Job->Affinity; + ExtendedLimit.BasicLimitInformation.PerProcessUserTimeLimit.QuadPart = Job->PerProcessUserTimeLimit.QuadPart; + ExtendedLimit.BasicLimitInformation.PerJobUserTimeLimit.QuadPart = Job->PerJobUserTimeLimit.QuadPart; + + /* If asking for extending limits */ + if (JobInformationClass == JobObjectExtendedLimitInformation) + { + /* Lock our memory lock */ + KeAcquireGuardedMutexUnsafe(&Job->MemoryLimitsLock); + /* Return limits */ + ExtendedLimit.ProcessMemoryLimit = Job->ProcessMemoryLimit << PAGE_SHIFT; + ExtendedLimit.JobMemoryLimit = Job->JobMemoryLimit << PAGE_SHIFT; + ExtendedLimit.PeakProcessMemoryUsed = Job->PeakProcessMemoryUsed << PAGE_SHIFT; + ExtendedLimit.PeakJobMemoryUsed = Job->PeakJobMemoryUsed << PAGE_SHIFT; + KeReleaseGuardedMutexUnsafe(&Job->MemoryLimitsLock); + + /* And done */ + ExReleaseResourceLite(&Job->JobLock); + KeLeaveGuardedRegionThread(CurrentThread); + + /* We'll never return IoInfo, so zero it out to avoid + * kernel memory leak + */ + RtlZeroMemory(&ExtendedLimit.IoInfo, sizeof(IO_COUNTERS)); + } + else + { + /* And done */ + ExReleaseResourceLite(&Job->JobLock); + KeLeaveGuardedRegionThread(CurrentThread); + } + + /* We'll copy back the buffer */ + GenericCopy = &ExtendedLimit; + Status = STATUS_SUCCESS; + + break; + + default: + DPRINT1("Class %d not implemented\n", JobInformationClass); + Status = STATUS_NOT_IMPLEMENTED; + break; + } + + /* Job is no longer required */ + ObDereferenceObject(Job); + + /* If we succeeed, copy back data */ + if (NT_SUCCESS(Status)) + { + _SEH2_TRY + { + /* If we have anything to copy, do it */ + if (!NoOutput) + { + RtlCopyMemory(JobInformation, GenericCopy, SizeToCopy); + } + + /* And return length if asked */ + if (ReturnLength != NULL) + { + *ReturnLength = NeededSize; + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + } + + return Status; }
6 years, 7 months
1
0
0
0
01/05: [SDK] Add a few types for job objects information
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fb9ffed1cdcba9cd4628a…
commit fb9ffed1cdcba9cd4628af6cfd5df2913a2e9428 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri May 25 00:17:58 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri May 25 08:48:51 2018 +0200 [SDK] Add a few types for job objects information --- sdk/include/ndk/pstypes.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/sdk/include/ndk/pstypes.h b/sdk/include/ndk/pstypes.h index 01468b2eb9..411a1d334a 100644 --- a/sdk/include/ndk/pstypes.h +++ b/sdk/include/ndk/pstypes.h @@ -1461,6 +1461,52 @@ typedef struct _EJOB } EJOB, *PEJOB; #include <poppack.h> +// +// Job Information Structures for NtQueryInformationJobObject +// + +typedef struct _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION +{ + LARGE_INTEGER TotalUserTime; + LARGE_INTEGER TotalKernelTime; + LARGE_INTEGER ThisPeriodTotalUserTime; + LARGE_INTEGER ThisPeriodTotalKernelTime; + ULONG TotalPageFaultCount; + ULONG TotalProcesses; + ULONG ActiveProcesses; + ULONG TotalTerminatedProcesses; +} JOBOBJECT_BASIC_ACCOUNTING_INFORMATION, *PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION; + +typedef struct _JOBOBJECT_BASIC_LIMIT_INFORMATION +{ + LARGE_INTEGER PerProcessUserTimeLimit; + LARGE_INTEGER PerJobUserTimeLimit; + ULONG LimitFlags; + SIZE_T MinimumWorkingSetSize; + SIZE_T MaximumWorkingSetSize; + ULONG ActiveProcessLimit; + ULONG_PTR Affinity; + ULONG PriorityClass; + ULONG SchedulingClass; +} JOBOBJECT_BASIC_LIMIT_INFORMATION, *PJOBOBJECT_BASIC_LIMIT_INFORMATION; + +typedef struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION +{ + JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo; + IO_COUNTERS IoInfo; +} JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION, *PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION; + +typedef struct _JOBOBJECT_EXTENDED_LIMIT_INFORMATION +{ + JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation; + IO_COUNTERS IoInfo; + SIZE_T ProcessMemoryLimit; + SIZE_T JobMemoryLimit; + SIZE_T PeakProcessMemoryUsed; + SIZE_T PeakJobMemoryUsed; +} JOBOBJECT_EXTENDED_LIMIT_INFORMATION, *PJOBOBJECT_EXTENDED_LIMIT_INFORMATION; + + // // Win32K Callback Registration Data //
6 years, 7 months
1
0
0
0
01/01: [MSPAINT] Fix call sequence in OnRButtonUp
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1007a2e0f95ac068ae3df…
commit 1007a2e0f95ac068ae3dfcabf0e4ab47ac577ca7 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Thu May 24 20:11:46 2018 +0300 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Thu May 24 22:12:15 2018 +0200 [MSPAINT] Fix call sequence in OnRButtonUp This fixes unexpected undo action when zooming out with right mouse click. The call sequence in OnLButtonUp is already correct. CORE-14539 --- base/applications/mspaint/imgarea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/mspaint/imgarea.cpp b/base/applications/mspaint/imgarea.cpp index 433fc7b04a..74bf84414f 100644 --- a/base/applications/mspaint/imgarea.cpp +++ b/base/applications/mspaint/imgarea.cpp @@ -291,8 +291,8 @@ LRESULT CImgAreaWindow::OnRButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOO } SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) ""); } - ReleaseCapture(); drawing = FALSE; + ReleaseCapture(); return 0; }
6 years, 7 months
1
0
0
0
01/01: [STORPORT] Enumerate attached devices
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f7c01906e7d81173d2714…
commit f7c01906e7d81173d271456a179c74ecc68aeb28 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Thu May 24 11:39:01 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Thu May 24 11:39:47 2018 +0200 [STORPORT] Enumerate attached devices - Implement AcquireSpinlock, ReleaseSpinlock and GetExtendedFunctionTable notifications. - Implement a bus scan routine, borrowed from scsiport. Storport and storahci are now able to detect a disk device attached to a Virtual Box AHCI controller. --- drivers/storage/port/storport/fdo.c | 314 ++++++++++++++++++++++++++++ drivers/storage/port/storport/miniport.c | 17 ++ drivers/storage/port/storport/misc.c | 13 -- drivers/storage/port/storport/pdo.c | 15 ++ drivers/storage/port/storport/precomp.h | 19 ++ drivers/storage/port/storport/storport.c | 148 ++++++++++++- drivers/storage/port/storport/storport.spec | 4 +- sdk/include/ddk/storport.h | 73 ++++++- 8 files changed, 581 insertions(+), 22 deletions(-) diff --git a/drivers/storage/port/storport/fdo.c b/drivers/storage/port/storport/fdo.c index 92a5a7f9a1..e20fd68bcc 100644 --- a/drivers/storage/port/storport/fdo.c +++ b/drivers/storage/port/storport/fdo.c @@ -243,6 +243,289 @@ PortFdoStartDevice( } +static NTSTATUS +SpiSendInquiry(IN PDEVICE_OBJECT DeviceObject, + ULONG Bus, ULONG Target, ULONG Lun) +{ +// IO_STATUS_BLOCK IoStatusBlock; +// PIO_STACK_LOCATION IrpStack; +// KEVENT Event; +// KIRQL Irql; +// PIRP Irp; + NTSTATUS Status; + PINQUIRYDATA InquiryBuffer; + PUCHAR /*PSENSE_DATA*/ SenseBuffer; +// BOOLEAN KeepTrying = TRUE; +// ULONG RetryCount = 0; + SCSI_REQUEST_BLOCK Srb; + PCDB Cdb; +// PSCSI_PORT_LUN_EXTENSION LunExtension; +// PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; + +PFDO_DEVICE_EXTENSION DeviceExtension; + PVOID SrbExtension = NULL; + BOOLEAN ret; + + DPRINT1("SpiSendInquiry() called\n"); + + DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + InquiryBuffer = ExAllocatePoolWithTag(NonPagedPool, INQUIRYDATABUFFERSIZE, TAG_INQUIRY_DATA); + if (InquiryBuffer == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + SenseBuffer = ExAllocatePoolWithTag(NonPagedPool, SENSE_BUFFER_SIZE, TAG_SENSE_DATA); + if (SenseBuffer == NULL) + { + ExFreePoolWithTag(InquiryBuffer, TAG_INQUIRY_DATA); + return STATUS_INSUFFICIENT_RESOURCES; + } + + if (DeviceExtension->Miniport.PortConfig.SrbExtensionSize != 0) + { + SrbExtension = ExAllocatePoolWithTag(NonPagedPool, DeviceExtension->Miniport.PortConfig.SrbExtensionSize, TAG_SENSE_DATA); + if (SrbExtension == NULL) + { + ExFreePoolWithTag(SenseBuffer, TAG_SENSE_DATA); + ExFreePoolWithTag(InquiryBuffer, TAG_INQUIRY_DATA); + return STATUS_INSUFFICIENT_RESOURCES; + } + } + +// while (KeepTrying) + { + /* Initialize event for waiting */ +// KeInitializeEvent(&Event, +// NotificationEvent, +// FALSE); + + /* Create an IRP */ +// Irp = IoBuildDeviceIoControlRequest(IOCTL_SCSI_EXECUTE_IN, +// DeviceObject, +// NULL, +// 0, +// InquiryBuffer, +// INQUIRYDATABUFFERSIZE, +// TRUE, +// &Event, +// &IoStatusBlock); +// if (Irp == NULL) +// { +// DPRINT1("IoBuildDeviceIoControlRequest() failed\n"); + + /* Quit the loop */ +// Status = STATUS_INSUFFICIENT_RESOURCES; +// KeepTrying = FALSE; +// continue; +// } + + /* Prepare SRB */ + RtlZeroMemory(&Srb, sizeof(SCSI_REQUEST_BLOCK)); + + Srb.Length = sizeof(SCSI_REQUEST_BLOCK); +// Srb.OriginalRequest = Irp; + Srb.PathId = Bus; + Srb.TargetId = Target; + Srb.Lun = Lun; + Srb.Function = SRB_FUNCTION_EXECUTE_SCSI; + Srb.SrbFlags = SRB_FLAGS_DATA_IN | SRB_FLAGS_DISABLE_SYNCH_TRANSFER; + Srb.TimeOutValue = 4; + Srb.CdbLength = 6; + + Srb.SenseInfoBuffer = SenseBuffer; + Srb.SenseInfoBufferLength = SENSE_BUFFER_SIZE; + + Srb.DataBuffer = InquiryBuffer; + Srb.DataTransferLength = INQUIRYDATABUFFERSIZE; + + Srb.SrbExtension = SrbExtension; + + /* Attach Srb to the Irp */ +// IrpStack = IoGetNextIrpStackLocation(Irp); +// IrpStack->Parameters.Scsi.Srb = &Srb; + + /* Fill in CDB */ + Cdb = (PCDB)Srb.Cdb; + Cdb->CDB6INQUIRY.OperationCode = SCSIOP_INQUIRY; + Cdb->CDB6INQUIRY.LogicalUnitNumber = Lun; + Cdb->CDB6INQUIRY.AllocationLength = INQUIRYDATABUFFERSIZE; + + /* Call the driver */ + + + ret = MiniportStartIo(&DeviceExtension->Miniport, + &Srb); +DPRINT1("MiniportStartIo returned %u\n", ret); + +// Status = IoCallDriver(DeviceObject, Irp); + + /* Wait for it to complete */ +// if (Status == STATUS_PENDING) +// { +// DPRINT1("SpiSendInquiry(): Waiting for the driver to process request...\n"); +// KeWaitForSingleObject(&Event, +// Executive, +// KernelMode, +// FALSE, +// NULL); +// Status = IoStatusBlock.Status; +// } + +// DPRINT1("SpiSendInquiry(): Request processed by driver, status = 0x%08X\n", Status); + + if (SRB_STATUS(Srb.SrbStatus) == SRB_STATUS_SUCCESS) + { + /* All fine, copy data over */ +// RtlCopyMemory(LunInfo->InquiryData, +// InquiryBuffer, +// INQUIRYDATABUFFERSIZE); + + /* Quit the loop */ + Status = STATUS_SUCCESS; +// KeepTrying = FALSE; +// continue; + } + + DPRINT("Inquiry SRB failed with SrbStatus 0x%08X\n", Srb.SrbStatus); +#if 0 + /* Check if the queue is frozen */ + if (Srb.SrbStatus & SRB_STATUS_QUEUE_FROZEN) + { + /* Something weird happened, deal with it (unfreeze the queue) */ + KeepTrying = FALSE; + + DPRINT("SpiSendInquiry(): the queue is frozen at TargetId %d\n", Srb.TargetId); + + LunExtension = SpiGetLunExtension(DeviceExtension, + LunInfo->PathId, + LunInfo->TargetId, + LunInfo->Lun); + + /* Clear frozen flag */ + LunExtension->Flags &= ~LUNEX_FROZEN_QUEUE; + + /* Acquire the spinlock */ + KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql); + + /* Process the request */ + SpiGetNextRequestFromLun(DeviceObject->DeviceExtension, LunExtension); + + /* SpiGetNextRequestFromLun() releases the spinlock, + so we just lower irql back to what it was before */ + KeLowerIrql(Irql); + } + + /* Check if data overrun happened */ + if (SRB_STATUS(Srb.SrbStatus) == SRB_STATUS_DATA_OVERRUN) + { + DPRINT("Data overrun at TargetId %d\n", LunInfo->TargetId); + + /* Nothing dramatic, just copy data, but limiting the size */ + RtlCopyMemory(LunInfo->InquiryData, + InquiryBuffer, + (Srb.DataTransferLength > INQUIRYDATABUFFERSIZE) ? + INQUIRYDATABUFFERSIZE : Srb.DataTransferLength); + + /* Quit the loop */ + Status = STATUS_SUCCESS; + KeepTrying = FALSE; + } + else if ((Srb.SrbStatus & SRB_STATUS_AUTOSENSE_VALID) && + SenseBuffer->SenseKey == SCSI_SENSE_ILLEGAL_REQUEST) + { + /* LUN is not valid, but some device responds there. + Mark it as invalid anyway */ + + /* Quit the loop */ + Status = STATUS_INVALID_DEVICE_REQUEST; + KeepTrying = FALSE; + } + else + { + /* Retry a couple of times if no timeout happened */ + if ((RetryCount < 2) && + (SRB_STATUS(Srb.SrbStatus) != SRB_STATUS_NO_DEVICE) && + (SRB_STATUS(Srb.SrbStatus) != SRB_STATUS_SELECTION_TIMEOUT)) + { + RetryCount++; + KeepTrying = TRUE; + } + else + { + /* That's all, quit the loop */ + KeepTrying = FALSE; + + /* Set status according to SRB status */ + if (SRB_STATUS(Srb.SrbStatus) == SRB_STATUS_BAD_FUNCTION || + SRB_STATUS(Srb.SrbStatus) == SRB_STATUS_BAD_SRB_BLOCK_LENGTH) + { + Status = STATUS_INVALID_DEVICE_REQUEST; + } + else + { + Status = STATUS_IO_DEVICE_ERROR; + } + } + } +#endif + } + + /* Free buffers */ + if (SrbExtension != NULL) + ExFreePoolWithTag(SrbExtension, TAG_SENSE_DATA); + + ExFreePoolWithTag(SenseBuffer, TAG_SENSE_DATA); + ExFreePoolWithTag(InquiryBuffer, TAG_INQUIRY_DATA); + + DPRINT("SpiSendInquiry() done with Status 0x%08X\n", Status); + + return Status; +} + + +static +NTSTATUS +PortFdoScanBus( + _In_ PFDO_DEVICE_EXTENSION DeviceExtension) +{ + ULONG Bus, Target, Lun; + NTSTATUS Status; + + + DPRINT1("PortFdoScanBus(%p)\n", + DeviceExtension); + + DPRINT1("NumberOfBuses: %lu\n", DeviceExtension->Miniport.PortConfig.NumberOfBuses); + DPRINT1("MaximumNumberOfTargets: %lu\n", DeviceExtension->Miniport.PortConfig.MaximumNumberOfTargets); + DPRINT1("MaximumNumberOfLogicalUnits: %lu\n", DeviceExtension->Miniport.PortConfig.MaximumNumberOfLogicalUnits); + + /* Scan all buses */ + for (Bus = 0; Bus < DeviceExtension->Miniport.PortConfig.NumberOfBuses; Bus++) + { + DPRINT1("Scanning bus %ld\n", Bus); + + /* Scan all targets */ + for (Target = 0; Target < DeviceExtension->Miniport.PortConfig.MaximumNumberOfTargets; Target++) + { + DPRINT1(" Scanning target %ld:%ld\n", Bus, Target); + + /* Scan all logical units */ + for (Lun = 0; Lun < DeviceExtension->Miniport.PortConfig.MaximumNumberOfLogicalUnits; Lun++) + { + DPRINT1(" Scanning logical unit %ld:%ld:%ld\n", Bus, Target, Lun); + + Status = SpiSendInquiry(DeviceExtension->Device, Bus, Target, Lun); + DPRINT1("SpiSendInquiry returned 0x%08lx\n", Status); + } + } + } + + DPRINT1("Done!\n"); + + return STATUS_SUCCESS; +} + + static NTSTATUS PortFdoQueryBusRelations( @@ -254,6 +537,8 @@ PortFdoQueryBusRelations( DPRINT1("PortFdoQueryBusRelations(%p %p)\n", DeviceExtension, Information); + Status = PortFdoScanBus(DeviceExtension); + *Information = 0; return Status; @@ -282,6 +567,35 @@ PortFdoFilterRequirements( } +NTSTATUS +NTAPI +PortFdoScsi( + _In_ PDEVICE_OBJECT DeviceObject, + _In_ PIRP Irp) +{ + PFDO_DEVICE_EXTENSION DeviceExtension; +// PIO_STACK_LOCATION Stack; + ULONG_PTR Information = 0; + NTSTATUS Status = STATUS_NOT_SUPPORTED; + + DPRINT1("PortFdoScsi(%p %p)\n", + DeviceObject, Irp); + + DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + ASSERT(DeviceExtension); + ASSERT(DeviceExtension->ExtensionType == FdoExtension); + +// Stack = IoGetCurrentIrpStackLocation(Irp); + + + Irp->IoStatus.Information = Information; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; +} + + NTSTATUS NTAPI PortFdoPnp( diff --git a/drivers/storage/port/storport/miniport.c b/drivers/storage/port/storport/miniport.c index 815e609031..e1aedcbfa5 100644 --- a/drivers/storage/port/storport/miniport.c +++ b/drivers/storage/port/storport/miniport.c @@ -362,4 +362,21 @@ MiniportHwInterrupt( return Result; } + +BOOLEAN +MiniportStartIo( + _In_ PMINIPORT Miniport, + _In_ PSCSI_REQUEST_BLOCK Srb) +{ + BOOLEAN Result; + + DPRINT1("MiniportHwStartIo(%p %p)\n", + Miniport, Srb); + + Result = Miniport->InitData->HwStartIo(&Miniport->MiniportExtension->HwDeviceExtension, Srb); + DPRINT1("HwStartIo() returned %u\n", Result); + + return Result; +} + /* EOF */ diff --git a/drivers/storage/port/storport/misc.c b/drivers/storage/port/storport/misc.c index f74fd3516f..1c9c73ae66 100644 --- a/drivers/storage/port/storport/misc.c +++ b/drivers/storage/port/storport/misc.c @@ -370,17 +370,4 @@ AllocateAddressMapping( return STATUS_SUCCESS; } -#if defined(_M_AMD64) -/* KeQuerySystemTime is an inline function, - so we cannot forward the export to ntoskrnl */ -STORPORT_API -VOID -NTAPI -StorPortQuerySystemTime( - _Out_ PLARGE_INTEGER CurrentTime) -{ - KeQuerySystemTime(CurrentTime); -} -#endif /* defined(_M_AMD64) */ - /* EOF */ diff --git a/drivers/storage/port/storport/pdo.c b/drivers/storage/port/storport/pdo.c index fb7280ccc0..8df3151e34 100644 --- a/drivers/storage/port/storport/pdo.c +++ b/drivers/storage/port/storport/pdo.c @@ -15,6 +15,21 @@ /* FUNCTIONS ******************************************************************/ +NTSTATUS +NTAPI +PortPdoScsi( + _In_ PDEVICE_OBJECT DeviceObject, + _In_ PIRP Irp) +{ + DPRINT1("PortPdoScsi()\n"); + + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; +} + + NTSTATUS NTAPI PortPdoPnp( diff --git a/drivers/storage/port/storport/precomp.h b/drivers/storage/port/storport/precomp.h index 5bd16f338f..84925ef1bc 100644 --- a/drivers/storage/port/storport/precomp.h +++ b/drivers/storage/port/storport/precomp.h @@ -29,6 +29,8 @@ #define TAG_ACCRESS_RANGE 'RAtS' #define TAG_RESOURCE_LIST 'LRtS' #define TAG_ADDRESS_MAPPING 'MAtS' +#define TAG_INQUIRY_DATA 'QItS' +#define TAG_SENSE_DATA 'NStS' typedef enum { @@ -119,6 +121,12 @@ typedef struct _PDO_DEVICE_EXTENSION /* fdo.c */ +NTSTATUS +NTAPI +PortFdoScsi( + _In_ PDEVICE_OBJECT DeviceObject, + _In_ PIRP Irp); + NTSTATUS NTAPI PortFdoPnp( @@ -146,6 +154,11 @@ BOOLEAN MiniportHwInterrupt( _In_ PMINIPORT Miniport); +BOOLEAN +MiniportStartIo( + _In_ PMINIPORT Miniport, + _In_ PSCSI_REQUEST_BLOCK Srb); + /* misc.c */ NTSTATUS @@ -206,6 +219,12 @@ AllocateAddressMapping( /* pdo.c */ +NTSTATUS +NTAPI +PortPdoScsi( + _In_ PDEVICE_OBJECT DeviceObject, + _In_ PIRP Irp); + NTSTATUS NTAPI PortPdoPnp( diff --git a/drivers/storage/port/storport/storport.c b/drivers/storage/port/storport/storport.c index a9fd3d07f8..03ec563949 100644 --- a/drivers/storage/port/storport/storport.c +++ b/drivers/storage/port/storport/storport.c @@ -100,6 +100,69 @@ PortGetDriverInitData( } +static +VOID +PortAcquireSpinLock( + PFDO_DEVICE_EXTENSION DeviceExtension, + STOR_SPINLOCK SpinLock, + PVOID LockContext, + PSTOR_LOCK_HANDLE LockHandle) +{ + DPRINT1("PortAcquireSpinLock(%p %lu %p %p)\n", + DeviceExtension, SpinLock, LockContext, LockHandle); + + LockHandle->Lock = SpinLock; + + switch (SpinLock) + { + case DpcLock: /* 1, */ + DPRINT1("DpcLock\n"); + break; + + case StartIoLock: /* 2 */ + DPRINT1("StartIoLock\n"); + break; + + case InterruptLock: /* 3 */ + DPRINT1("InterruptLock\n"); + if (DeviceExtension->Interrupt == NULL) + LockHandle->Context.OldIrql = 0; + else + LockHandle->Context.OldIrql = KeAcquireInterruptSpinLock(DeviceExtension->Interrupt); + break; + } +} + + +static +VOID +PortReleaseSpinLock( + PFDO_DEVICE_EXTENSION DeviceExtension, + PSTOR_LOCK_HANDLE LockHandle) +{ + DPRINT1("PortReleaseSpinLock(%p %p)\n", + DeviceExtension, LockHandle); + + switch (LockHandle->Lock) + { + case DpcLock: /* 1, */ + DPRINT1("DpcLock\n"); + break; + + case StartIoLock: /* 2 */ + DPRINT1("StartIoLock\n"); + break; + + case InterruptLock: /* 3 */ + DPRINT1("InterruptLock\n"); + if (DeviceExtension->Interrupt != NULL) + KeReleaseInterruptSpinLock(DeviceExtension->Interrupt, + LockHandle->Context.OldIrql); + break; + } +} + + static NTSTATUS NTAPI @@ -280,13 +343,30 @@ PortDispatchScsi( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { + PFDO_DEVICE_EXTENSION DeviceExtension; + DPRINT1("PortDispatchScsi(%p %p)\n", DeviceObject, Irp); - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; + DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + DPRINT1("ExtensionType: %u\n", DeviceExtension->ExtensionType); - IoCompleteRequest(Irp, IO_NO_INCREMENT); + switch (DeviceExtension->ExtensionType) + { + case FdoExtension: + return PortFdoScsi(DeviceObject, + Irp); + + case PdoExtension: + return PortPdoScsi(DeviceObject, + Irp); + + default: + Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_UNSUCCESSFUL; + } return STATUS_SUCCESS; } @@ -742,10 +822,13 @@ StorPortGetPhysicalAddress( // FIXME - UNIMPLEMENTED; - *Length = 0; - PhysicalAddress.QuadPart = (LONGLONG)0; + PhysicalAddress = MmGetPhysicalAddress(VirtualAddress); + *Length = 1; +// UNIMPLEMENTED; + +// *Length = 0; +// PhysicalAddress.QuadPart = (LONGLONG)0; return PhysicalAddress; } @@ -1012,11 +1095,16 @@ StorPortNotification( PMINIPORT_DEVICE_EXTENSION MiniportExtension = NULL; PFDO_DEVICE_EXTENSION DeviceExtension = NULL; PHW_PASSIVE_INITIALIZE_ROUTINE HwPassiveInitRoutine; + PSTORPORT_EXTENDED_FUNCTIONS *ppExtendedFunctions; PBOOLEAN Result; PSTOR_DPC Dpc; PHW_DPC_ROUTINE HwDpcRoutine; va_list ap; + STOR_SPINLOCK SpinLock; + PVOID LockContext; + PSTOR_LOCK_HANDLE LockHandle; + DPRINT1("StorPortNotification(%x %p)\n", NotificationType, HwDeviceExtension); @@ -1036,6 +1124,13 @@ StorPortNotification( switch (NotificationType) { + case GetExtendedFunctionTable: + DPRINT1("GetExtendedFunctionTable\n"); + ppExtendedFunctions = (PSTORPORT_EXTENDED_FUNCTIONS*)va_arg(ap, PSTORPORT_EXTENDED_FUNCTIONS*); + if (ppExtendedFunctions != NULL) + *ppExtendedFunctions = NULL; /* FIXME */ + break; + case EnablePassiveInitialization: DPRINT1("EnablePassiveInitialization\n"); HwPassiveInitRoutine = (PHW_PASSIVE_INITIALIZE_ROUTINE)va_arg(ap, PHW_PASSIVE_INITIALIZE_ROUTINE); @@ -1065,6 +1160,28 @@ StorPortNotification( KeInitializeSpinLock(&Dpc->Lock); break; + case AcquireSpinLock: + DPRINT1("AcquireSpinLock\n"); + SpinLock = (STOR_SPINLOCK)va_arg(ap, STOR_SPINLOCK); + DPRINT1("SpinLock %lu\n", SpinLock); + LockContext = (PVOID)va_arg(ap, PVOID); + DPRINT1("LockContext %p\n", LockContext); + LockHandle = (PSTOR_LOCK_HANDLE)va_arg(ap, PSTOR_LOCK_HANDLE); + DPRINT1("LockHandle %p\n", LockHandle); + PortAcquireSpinLock(DeviceExtension, + SpinLock, + LockContext, + LockHandle); + break; + + case ReleaseSpinLock: + DPRINT1("ReleaseSpinLock\n"); + LockHandle = (PSTOR_LOCK_HANDLE)va_arg(ap, PSTOR_LOCK_HANDLE); + DPRINT1("LockHandle %p\n", LockHandle); + PortReleaseSpinLock(DeviceExtension, + LockHandle); + break; + default: DPRINT1("Unsupported Notification %lx\n", NotificationType); break; @@ -1109,6 +1226,25 @@ StorPortPauseDevice( } +#if defined(_M_AMD64) +/* + * @implemented + */ +/* KeQuerySystemTime is an inline function, + so we cannot forward the export to ntoskrnl */ +STORPORT_API +VOID +NTAPI +StorPortQuerySystemTime( + _Out_ PLARGE_INTEGER CurrentTime) +{ + DPRINT1("StorPortQuerySystemTime(%p)\n", CurrentTime); + + KeQuerySystemTime(CurrentTime); +} +#endif /* defined(_M_AMD64) */ + + /* * @unimplemented */ diff --git a/drivers/storage/port/storport/storport.spec b/drivers/storage/port/storport/storport.spec index 310e201f9e..a36e5ed49a 100644 --- a/drivers/storage/port/storport/storport.spec +++ b/drivers/storage/port/storport/storport.spec @@ -24,10 +24,10 @@ @ stdcall StorPortLogError(ptr ptr long long long long long) @ stdcall StorPortMoveMemory(ptr ptr long) @ cdecl StorPortNotification() -@ stdcall -arch=i386 StorPortQuerySystemTime(ptr) NTOSKRNL.KeQuerySystemTime -@ stdcall -arch=amd64 StorPortQuerySystemTime(ptr) @ stdcall StorPortPause(ptr long) @ stdcall StorPortPauseDevice(ptr long long long long) +@ stdcall -arch=i386 StorPortQuerySystemTime(ptr) NTOSKRNL.KeQuerySystemTime +@ stdcall -arch=amd64 StorPortQuerySystemTime(ptr) @ stdcall StorPortReadPortBufferUchar(ptr ptr ptr long) @ stdcall StorPortReadPortBufferUlong(ptr ptr ptr long) @ stdcall StorPortReadPortBufferUshort(ptr ptr ptr long) diff --git a/sdk/include/ddk/storport.h b/sdk/include/ddk/storport.h index 64a6e1059d..44d5d96d27 100644 --- a/sdk/include/ddk/storport.h +++ b/sdk/include/ddk/storport.h @@ -57,7 +57,14 @@ extern "C" { #define CDB10GENERIC_LENGTH 10 #define CDB12GENERIC_LENGTH 12 -#define INQUIRYDATABUFFERSIZE 36 +#define INQUIRYDATABUFFERSIZE 36 +#define SENSE_BUFFER_SIZE 18 +#define MAX_SENSE_BUFFER_SIZE 255 + +#define FILE_DEVICE_SCSI 0x0000001b +#define IOCTL_SCSI_EXECUTE_IN ((FILE_DEVICE_SCSI << 16) + 0x0011) +#define IOCTL_SCSI_EXECUTE_OUT ((FILE_DEVICE_SCSI << 16) + 0x0012) +#define IOCTL_SCSI_EXECUTE_NONE ((FILE_DEVICE_SCSI << 16) + 0x0013) #define MODE_PAGE_VENDOR_SPECIFIC 0x00 #define MODE_PAGE_ERROR_RECOVERY 0x01 @@ -563,6 +570,12 @@ typedef enum _STOR_EVENT_ASSOCIATION_ENUM StorEventInvalidAssociation } STOR_EVENT_ASSOCIATION_ENUM; +typedef enum _GETSGSTATUS +{ + SG_ALLOCATED = 0, + SG_BUFFER_TOO_SMALL +} GETSGSTATUS, *PGETSGSTATUS; + typedef struct _SCSI_REQUEST_BLOCK { USHORT Length; @@ -2182,6 +2195,64 @@ VOID _In_ PSTOR_SCATTER_GATHER_LIST ScatterGather, _In_ PVOID Context); +typedef +BOOLEAN +(NTAPI *PStorPortGetMessageInterruptInformation)( + _In_ PVOID HwDeviceExtension, + _In_ ULONG MessageId, + _Out_ PMESSAGE_INTERRUPT_INFORMATION InterruptInfo); + +typedef +VOID +(NTAPI *PStorPortPutScatterGatherList)( + _In_ PVOID HwDeviceExtension, + _In_ PSTOR_SCATTER_GATHER_LIST ScatterGatherList, + _In_ BOOLEAN WriteToDevice); + +typedef +GETSGSTATUS +(NTAPI *PStorPortBuildScatterGatherList)( + _In_ PVOID HwDeviceExtension, + _In_ PVOID Mdl, + _In_ PVOID CurrentVa, + _In_ ULONG Length, + _In_ PpostScaterGatherExecute ExecutionRoutine, + _In_ PVOID Context, + _In_ BOOLEAN WriteToDevice, + _Inout_ PVOID ScatterGatherBuffer, + _In_ ULONG ScatterGatherBufferLength); + +typedef +VOID +(NTAPI *PStorPortFreePool)( + _In_ PVOID PMemory, + _In_ PVOID HwDeviceExtension, + _In_opt_ PVOID PMdl); + +typedef +PVOID +(NTAPI *PStorPortAllocatePool)( + _In_ ULONG NumberOfBytes, + _In_ ULONG Tag, + _In_ PVOID HwDeviceExtension, + _Out_ PVOID *PMdl); + +typedef +PVOID +(NTAPI *PStorPortGetSystemAddress)( + _In_ PSCSI_REQUEST_BLOCK Srb); + +typedef struct _STORPORT_EXTENDED_FUNCTIONS +{ + ULONG Version; + PStorPortGetMessageInterruptInformation GetMessageInterruptInformation; + PStorPortPutScatterGatherList PutScatterGatherList; + PStorPortBuildScatterGatherList BuildScatterGatherList; + PStorPortFreePool FreePool; + PStorPortAllocatePool AllocatePool; + PStorPortGetSystemAddress GetSystemAddress; +} STORPORT_EXTENDED_FUNCTIONS, *PSTORPORT_EXTENDED_FUNCTIONS; + typedef struct _HW_INITIALIZATION_DATA { ULONG HwInitializationDataSize;
6 years, 7 months
1
0
0
0
01/01: [MSPAINT] Fix divide by zero in drawZoomFrame
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8c726ae0d23c9c02144b2…
commit 8c726ae0d23c9c02144b22a3706a100b3ae08c93 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Thu May 24 00:31:20 2018 +0300 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Wed May 23 23:40:28 2018 +0200 [MSPAINT] Fix divide by zero in drawZoomFrame CORE-14539 #resolve --- base/applications/mspaint/imgarea.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/base/applications/mspaint/imgarea.cpp b/base/applications/mspaint/imgarea.cpp index c9b1b3f49e..433fc7b04a 100644 --- a/base/applications/mspaint/imgarea.cpp +++ b/base/applications/mspaint/imgarea.cpp @@ -41,8 +41,14 @@ void CImgAreaWindow::drawZoomFrame(int mouseX, int mouseY) int x, y, w, h; scrollboxWindow.GetClientRect(&clientRectScrollbox); GetClientRect(&clientRectImageArea); - w = clientRectImageArea.right * clientRectScrollbox.right / (clientRectImageArea.right * 2); - h = clientRectImageArea.bottom * clientRectScrollbox.bottom / (clientRectImageArea.bottom * 2); + w = clientRectImageArea.right * 2; + h = clientRectImageArea.bottom * 2; + if (!w || !h) + { + return; + } + w = clientRectImageArea.right * clientRectScrollbox.right / w; + h = clientRectImageArea.bottom * clientRectScrollbox.bottom / h; x = max(0, min(clientRectImageArea.right - w, mouseX - w / 2)); y = max(0, min(clientRectImageArea.bottom - h, mouseY - h / 2));
6 years, 7 months
1
0
0
0
01/01: [SHELL32] Add icons to the 'File Types' listview (#557)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed1c6bb0060d06f4c0167…
commit ed1c6bb0060d06f4c0167d9c2d732f4dc2b4cce4 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu May 24 06:25:11 2018 +0900 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Wed May 23 23:25:11 2018 +0200 [SHELL32] Add icons to the 'File Types' listview (#557) This commit adds icons to the listview of the 'File Types' property sheet of Folder Options. CORE-12906 --- dll/win32/shell32/dialogs/folder_options.cpp | 411 ++++++++++++++++++++------- dll/win32/shell32/lang/bg-BG.rc | 4 +- dll/win32/shell32/lang/ca-ES.rc | 4 +- dll/win32/shell32/lang/cs-CZ.rc | 4 +- dll/win32/shell32/lang/da-DK.rc | 4 +- dll/win32/shell32/lang/de-DE.rc | 4 +- dll/win32/shell32/lang/el-GR.rc | 4 +- dll/win32/shell32/lang/en-GB.rc | 4 +- dll/win32/shell32/lang/en-US.rc | 4 +- dll/win32/shell32/lang/es-ES.rc | 4 +- dll/win32/shell32/lang/et-EE.rc | 4 +- dll/win32/shell32/lang/fi-FI.rc | 4 +- dll/win32/shell32/lang/fr-FR.rc | 4 +- dll/win32/shell32/lang/he-IL.rc | 4 +- dll/win32/shell32/lang/hu-HU.rc | 4 +- dll/win32/shell32/lang/it-IT.rc | 4 +- dll/win32/shell32/lang/ja-JP.rc | 2 +- dll/win32/shell32/lang/ko-KR.rc | 4 +- dll/win32/shell32/lang/nl-NL.rc | 4 +- dll/win32/shell32/lang/no-NO.rc | 4 +- dll/win32/shell32/lang/pl-PL.rc | 4 +- dll/win32/shell32/lang/pt-BR.rc | 4 +- dll/win32/shell32/lang/pt-PT.rc | 4 +- dll/win32/shell32/lang/ro-RO.rc | 4 +- dll/win32/shell32/lang/ru-RU.rc | 4 +- dll/win32/shell32/lang/sk-SK.rc | 4 +- dll/win32/shell32/lang/sl-SI.rc | 4 +- dll/win32/shell32/lang/sq-AL.rc | 4 +- dll/win32/shell32/lang/sv-SE.rc | 4 +- dll/win32/shell32/lang/tr-TR.rc | 4 +- dll/win32/shell32/lang/uk-UA.rc | 4 +- dll/win32/shell32/lang/zh-CN.rc | 4 +- dll/win32/shell32/lang/zh-TW.rc | 4 +- dll/win32/shell32/shresdef.h | 1 + 34 files changed, 369 insertions(+), 169 deletions(-) diff --git a/dll/win32/shell32/dialogs/folder_options.cpp b/dll/win32/shell32/dialogs/folder_options.cpp index cffee8bee1..29320702a6 100644 --- a/dll/win32/shell32/dialogs/folder_options.cpp +++ b/dll/win32/shell32/dialogs/folder_options.cpp @@ -37,6 +37,10 @@ typedef struct WCHAR FileDescription[100]; WCHAR ClassKey[MAX_PATH]; DWORD EditFlags; + WCHAR AppName[64]; + HICON hIconLarge; + HICON hIconSmall; + WCHAR ProgramPath[MAX_PATH]; } FOLDER_FILE_TYPE_ENTRY, *PFOLDER_FILE_TYPE_ENTRY; // uniquely-defined icon entry for Advanced Settings @@ -174,6 +178,34 @@ Create24BppBitmap(HDC hDC, INT cx, INT cy) return hbm; } +static HBITMAP BitmapFromIcon(HICON hIcon, INT cx, INT cy) +{ + HDC hDC = CreateCompatibleDC(NULL); + if (!hDC) + return NULL; + + HBITMAP hbm = Create24BppBitmap(hDC, cx, cy); + if (!hbm) + { + DeleteDC(hDC); + return NULL; + } + + HGDIOBJ hbmOld = SelectObject(hDC, hbm); + { + RECT rc = { 0, 0, cx, cy }; + FillRect(hDC, &rc, HBRUSH(COLOR_3DFACE + 1)); + if (hIcon) + { + DrawIconEx(hDC, 0, 0, hIcon, cx, cy, 0, NULL, DI_NORMAL); + } + } + SelectObject(hDC, hbmOld); + DeleteDC(hDC); + + return hbm; +} + static HBITMAP CreateCheckImage(HDC hDC, BOOL bCheck, BOOL bEnabled = TRUE) { @@ -1338,44 +1370,148 @@ InitializeFileTypesListCtrlColumns(HWND hDlgCtrl) SendMessage(hDlgCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); } -INT -FindItem(HWND hDlgCtrl, WCHAR * ItemName) -{ - LVFINDINFOW findInfo; - ZeroMemory(&findInfo, sizeof(LVFINDINFOW)); - - findInfo.flags = LVFI_STRING; - findInfo.psz = ItemName; - return ListView_FindItem(hDlgCtrl, 0, &findInfo); -} - static BOOL DeleteExt(HWND hwndDlg, LPCWSTR pszExt) { if (*pszExt != L'.') return FALSE; + // open ".ext" key HKEY hKey; - LONG nResult = RegOpenKeyExW(HKEY_CLASSES_ROOT, pszExt, 0, KEY_READ, &hKey); - if (nResult != ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, pszExt, 0, KEY_READ, &hKey) != ERROR_SUCCESS) return FALSE; - WCHAR szValue[64]; + // query "extfile" key name + WCHAR szValue[64] = { 0 }; DWORD cbValue = sizeof(szValue); - nResult = RegQueryValueExW(hKey, NULL, NULL, NULL, LPBYTE(szValue), &cbValue); + RegQueryValueExW(hKey, NULL, NULL, NULL, LPBYTE(szValue), &cbValue); RegCloseKey(hKey); - if (nResult != ERROR_SUCCESS) - return FALSE; + // delete "extfile" key (if any) if (szValue[0]) SHDeleteKeyW(HKEY_CLASSES_ROOT, szValue); + // delete ".ext" key return SHDeleteKeyW(HKEY_CLASSES_ROOT, pszExt) == ERROR_SUCCESS; } -static -VOID -InsertFileType(HWND hDlgCtrl, WCHAR * szName, PINT iItem, WCHAR * szFile) +static inline HICON +DoExtractIcon(PFOLDER_FILE_TYPE_ENTRY Entry, LPCWSTR IconPath, + INT iIndex = 0, BOOL bSmall = FALSE) +{ + HICON hIcon = NULL; + + if (iIndex < 0) + { + // A negative value will be interpreted as a negated resource ID. + iIndex = -iIndex; + + INT cx, cy; + HINSTANCE hDLL = LoadLibraryExW(IconPath, NULL, LOAD_LIBRARY_AS_DATAFILE); + if (bSmall) + { + cx = GetSystemMetrics(SM_CXSMICON); + cy = GetSystemMetrics(SM_CYSMICON); + } + else + { + cx = GetSystemMetrics(SM_CXICON); + cy = GetSystemMetrics(SM_CYICON); + } + hIcon = HICON(LoadImageW(hDLL, MAKEINTRESOURCEW(iIndex), IMAGE_ICON, + cx, cy, 0)); + FreeLibrary(hDLL); + } + else + { + // A positive value is icon index. + if (bSmall) + ExtractIconExW(IconPath, iIndex, NULL, &hIcon, 1); + else + ExtractIconExW(IconPath, iIndex, &hIcon, NULL, 1); + } + return hIcon; +} + +static void +DoFileTypeIconLocation(PFOLDER_FILE_TYPE_ENTRY Entry, LPCWSTR IconLocation) +{ + // Expand the REG_EXPAND_SZ string by environment variables + WCHAR szLocation[MAX_PATH + 32]; + if (!ExpandEnvironmentStringsW(IconLocation, szLocation, _countof(szLocation))) + { + return; + } + + INT nIndex = PathParseIconLocationW(szLocation); + Entry->hIconLarge = DoExtractIcon(Entry, szLocation, nIndex, FALSE); + Entry->hIconSmall = DoExtractIcon(Entry, szLocation, nIndex, TRUE); +} + +static BOOL +GetFileTypeIconsEx(PFOLDER_FILE_TYPE_ENTRY Entry, LPCWSTR IconLocation) +{ + Entry->hIconLarge = Entry->hIconSmall = NULL; + + if (lstrcmpiW(Entry->FileExtension, L".exe") == 0 || + lstrcmpiW(Entry->FileExtension, L".scr") == 0) + { + // It's an executable + Entry->hIconLarge = LoadIconW(shell32_hInstance, MAKEINTRESOURCEW(IDI_SHELL_EXE)); + Entry->hIconSmall = HICON(LoadImageW(shell32_hInstance, MAKEINTRESOURCEW(IDI_SHELL_EXE), IMAGE_ICON, + GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)); + } + else if (lstrcmpW(IconLocation, L"%1") == 0) + { + return FALSE; // self icon + } + else + { + DoFileTypeIconLocation(Entry, IconLocation); + } + + return Entry->hIconLarge && Entry->hIconSmall; +} + +static BOOL +GetFileTypeIconsByKey(HKEY hKey, PFOLDER_FILE_TYPE_ENTRY Entry) +{ + Entry->hIconLarge = Entry->hIconSmall = NULL; + + // Open the "DefaultIcon" registry key + HKEY hDefIconKey; + LONG nResult = RegOpenKeyExW(hKey, L"DefaultIcon", 0, KEY_READ, &hDefIconKey); + if (nResult != ERROR_SUCCESS) + return FALSE; + + // Get the icon location + WCHAR szLocation[MAX_PATH + 32] = { 0 }; + DWORD dwSize = sizeof(szLocation); + nResult = RegQueryValueExW(hDefIconKey, NULL, NULL, NULL, LPBYTE(szLocation), &dwSize); + + RegCloseKey(hDefIconKey); + + if (nResult != ERROR_SUCCESS || szLocation[0] == 0) + return FALSE; + + return GetFileTypeIconsEx(Entry, szLocation); +} + +static BOOL +QueryFileDescription(LPCWSTR ProgramPath, LPWSTR pszName, INT cchName) +{ + SHFILEINFOW FileInfo = { 0 }; + if (SHGetFileInfoW(ProgramPath, 0, &FileInfo, sizeof(FileInfo), SHGFI_DISPLAYNAME)) + { + StringCchCopyW(pszName, cchName, FileInfo.szDisplayName); + return TRUE; + } + + return !!GetFileTitleW(ProgramPath, pszName, cchName); +} + +static BOOL +InsertFileType(HWND hListView, LPCWSTR szName, INT iItem, LPCWSTR szFile) { PFOLDER_FILE_TYPE_ENTRY Entry; HKEY hKey; @@ -1386,20 +1522,23 @@ InsertFileType(HWND hDlgCtrl, WCHAR * szName, PINT iItem, WCHAR * szFile) if (szName[0] != L'.') { /* FIXME handle URL protocol handlers */ - return; + return FALSE; } + // get imagelists of listview + HIMAGELIST himlLarge = ListView_GetImageList(hListView, LVSIL_NORMAL); + HIMAGELIST himlSmall = ListView_GetImageList(hListView, LVSIL_SMALL); + /* allocate file type entry */ Entry = (PFOLDER_FILE_TYPE_ENTRY)HeapAlloc(GetProcessHeap(), 0, sizeof(FOLDER_FILE_TYPE_ENTRY)); - if (!Entry) - return; + return FALSE; /* open key */ if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szName, 0, KEY_READ, &hKey) != ERROR_SUCCESS) { HeapFree(GetProcessHeap(), 0, Entry); - return; + return FALSE; } /* FIXME check for duplicates */ @@ -1443,20 +1582,54 @@ InsertFileType(HWND hDlgCtrl, WCHAR * szName, PINT iItem, WCHAR * szFile) RegQueryValueExW(hKey, L"EditFlags", NULL, NULL, (LPBYTE)&Entry->EditFlags, &dwSize); } + /* convert extension to upper case */ + wcscpy(Entry->FileExtension, szName); + _wcsupr(Entry->FileExtension); + + /* get icon */ + if (!GetFileTypeIconsByKey(hKey, Entry)) + { + // set default icon + Entry->hIconLarge = LoadIconW(shell32_hInstance, MAKEINTRESOURCEW(IDI_SHELL_FOLDER_OPTIONS)); + INT cxSmall = GetSystemMetrics(SM_CXSMICON); + INT cySmall = GetSystemMetrics(SM_CYSMICON); + Entry->hIconSmall = HICON(LoadImageW(shell32_hInstance, MAKEINTRESOURCEW(IDI_SHELL_FOLDER_OPTIONS), + IMAGE_ICON, cxSmall, cySmall, 0)); + } + /* close key */ RegCloseKey(hKey); + // get program path and app name + DWORD cch = _countof(Entry->ProgramPath); + if (S_OK == AssocQueryStringW(ASSOCF_INIT_IGNOREUNKNOWN, ASSOCSTR_EXECUTABLE, + Entry->FileExtension, NULL, Entry->ProgramPath, &cch)) + { + QueryFileDescription(Entry->ProgramPath, Entry->AppName, _countof(Entry->AppName)); + } + else + { + Entry->ProgramPath[0] = Entry->AppName[0] = 0; + } + + // add icon to imagelist + INT iLargeImage = -1, iSmallImage = -1; + if (Entry->hIconLarge && Entry->hIconSmall) + { + iLargeImage = ImageList_AddIcon(himlLarge, Entry->hIconLarge); + iSmallImage = ImageList_AddIcon(himlSmall, Entry->hIconSmall); + ASSERT(iLargeImage == iSmallImage); + } + /* Do not add excluded entries */ if (Entry->EditFlags & 0x00000001) //FTA_Exclude { + DestroyIcon(Entry->hIconLarge); + DestroyIcon(Entry->hIconSmall); HeapFree(GetProcessHeap(), 0, Entry); - return; + return FALSE; } - /* convert extension to upper case */ - wcscpy(Entry->FileExtension, szName); - _wcsupr(Entry->FileExtension); - if (!Entry->FileDescription[0]) { /* construct default 'FileExtensionFile' by formatting the uppercase extension @@ -1466,21 +1639,22 @@ InsertFileType(HWND hDlgCtrl, WCHAR * szName, PINT iItem, WCHAR * szFile) } ZeroMemory(&lvItem, sizeof(LVITEMW)); - lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; lvItem.iSubItem = 0; lvItem.pszText = &Entry->FileExtension[1]; - lvItem.iItem = *iItem; + lvItem.iItem = iItem; lvItem.lParam = (LPARAM)Entry; - (void)SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem); + lvItem.iImage = iSmallImage; + SendMessageW(hListView, LVM_INSERTITEMW, 0, (LPARAM)&lvItem); ZeroMemory(&lvItem, sizeof(LVITEMW)); lvItem.mask = LVIF_TEXT; lvItem.pszText = Entry->FileDescription; - lvItem.iItem = *iItem; + lvItem.iItem = iItem; lvItem.iSubItem = 1; - ListView_SetItem(hDlgCtrl, &lvItem); + ListView_SetItem(hListView, &lvItem); - (*iItem)++; + return TRUE; } static @@ -1512,8 +1686,19 @@ InitializeFileTypesListCtrl(HWND hwndDlg) DWORD dwName; LVITEMW lvItem; INT iItem = 0; + HIMAGELIST himlLarge, himlSmall; + + // create imagelists + himlLarge = ImageList_Create(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), + ILC_COLOR32 | ILC_MASK, 256, 20); + himlSmall = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), + ILC_COLOR32 | ILC_MASK, 256, 20); + + // set imagelists to listview. + hDlgCtrl = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW); + ListView_SetImageList(hDlgCtrl, himlLarge, LVSIL_NORMAL); + ListView_SetImageList(hDlgCtrl, himlSmall, LVSIL_SMALL); - hDlgCtrl = GetDlgItem(hwndDlg, 14000); InitializeFileTypesListCtrlColumns(hDlgCtrl); szFile[0] = 0; @@ -1528,7 +1713,8 @@ InitializeFileTypesListCtrl(HWND hwndDlg) while (RegEnumKeyExW(HKEY_CLASSES_ROOT, dwIndex++, szName, &dwName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { - InsertFileType(hDlgCtrl, szName, &iItem, szFile); + if (InsertFileType(hDlgCtrl, szName, iItem, szFile)) + ++iItem; dwName = _countof(szName); } @@ -1553,30 +1739,21 @@ InitializeFileTypesListCtrl(HWND hwndDlg) return (PFOLDER_FILE_TYPE_ENTRY)lvItem.lParam; } -static +static inline PFOLDER_FILE_TYPE_ENTRY -FindSelectedItem( - HWND hDlgCtrl) +GetListViewEntry(HWND hListView, INT iItem = -1) { - UINT Count, Index; - LVITEMW lvItem; - - Count = ListView_GetItemCount(hDlgCtrl); - - for (Index = 0; Index < Count; Index++) + if (iItem == -1) { - ZeroMemory(&lvItem, sizeof(LVITEM)); - lvItem.mask = LVIF_PARAM | LVIF_STATE; - lvItem.iItem = Index; - lvItem.stateMask = (UINT) - 1; - - if (ListView_GetItem(hDlgCtrl, &lvItem)) - { - if (lvItem.state & LVIS_SELECTED) - return (PFOLDER_FILE_TYPE_ENTRY)lvItem.lParam; - } + iItem = ListView_GetNextItem(hListView, -1, LVNI_SELECTED); + if (iItem == -1) + return NULL; } + LV_ITEMW lvItem = { LVIF_PARAM, iItem }; + if (ListView_GetItem(hListView, &lvItem)) + return (PFOLDER_FILE_TYPE_ENTRY)lvItem.lParam; + return NULL; } @@ -1879,11 +2056,11 @@ FileTypesDlg_AddExt(HWND hwndDlg, LPCWSTR pszExt, LPCWSTR pszFileType) szFile[_countof(szFileFormat) - 1] = 0; StringCchPrintfW(szFile, _countof(szFile), szFileFormat, &szExt[1]); - // Insert an item to listview + // Insert an item to the listview HWND hListView = GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW); INT iItem = ListView_GetItemCount(hListView); - INT iItemCopy = iItem; - InsertFileType(hListView, szExt, &iItemCopy, szFile); + if (!InsertFileType(hListView, szExt, iItem, szFile)) + return FALSE; LV_ITEM item; ZeroMemory(&item, sizeof(item)); @@ -1917,12 +2094,54 @@ FileTypesDlg_RemoveExt(HWND hwndDlg) ListView_GetItemText(hListView, iItem, 0, &szExt[1], _countof(szExt) - 1); CharLowerW(szExt); - if (DeleteExt(hwndDlg, szExt)) + DeleteExt(hwndDlg, szExt); + ListView_DeleteItem(hListView, iItem); + return TRUE; +} + +static void +FileTypesDlg_OnItemChanging(HWND hwndDlg, PFOLDER_FILE_TYPE_ENTRY pEntry) +{ + WCHAR Buffer[255]; + static HBITMAP s_hbmProgram = NULL; + + // format buffer and set groupbox text + CStringW strFormat(MAKEINTRESOURCEW(IDS_FILE_DETAILS)); + StringCchPrintfW(Buffer, _countof(Buffer), strFormat, &pEntry->FileExtension[1]); + SetDlgItemTextW(hwndDlg, IDC_FILETYPES_DETAILS_GROUPBOX, Buffer); + + // format buffer and set description + strFormat.LoadString(IDS_FILE_DETAILSADV); + StringCchPrintfW(Buffer, _countof(Buffer), strFormat, + &pEntry->FileExtension[1], pEntry->FileDescription, + pEntry->FileDescription); + SetDlgItemTextW(hwndDlg, IDC_FILETYPES_DESCRIPTION, Buffer); + + // delete previous program image + if (s_hbmProgram) { - ListView_DeleteItem(hListView, iItem); - return TRUE; + DeleteObject(s_hbmProgram); + s_hbmProgram = NULL; } - return FALSE; + + // set program image + HICON hIconSm = NULL; + ExtractIconExW(pEntry->ProgramPath, 0, NULL, &hIconSm, 1); + s_hbmProgram = BitmapFromIcon(hIconSm, 16, 16); + DestroyIcon(hIconSm); + SendDlgItemMessageW(hwndDlg, IDC_FILETYPES_ICON, STM_SETIMAGE, IMAGE_BITMAP, LPARAM(s_hbmProgram)); + + // set program name + if (pEntry->AppName[0]) + SetDlgItemTextW(hwndDlg, IDC_FILETYPES_APPNAME, pEntry->AppName); + else + SetDlgItemTextW(hwndDlg, IDC_FILETYPES_APPNAME, L"ReactOS"); + + /* Enable the Delete button */ + if (pEntry->EditFlags & 0x00000010) // FTA_NoRemove + EnableWindow(GetDlgItem(hwndDlg, IDC_FILETYPES_DELETE), FALSE); + else + EnableWindow(GetDlgItem(hwndDlg, IDC_FILETYPES_DELETE), TRUE); } // IDD_FOLDER_OPTIONS_FILETYPES dialog @@ -1935,8 +2154,6 @@ FolderOptionsFileTypesDlg( LPARAM lParam) { LPNMLISTVIEW lppl; - LVITEMW lvItem; - WCHAR Buffer[255], FormatBuffer[255]; PFOLDER_FILE_TYPE_ENTRY pItem; OPENASINFO Info; NEWEXT_DIALOG newext; @@ -1974,7 +2191,7 @@ FolderOptionsFileTypesDlg( } break; case IDC_FILETYPES_CHANGE: - pItem = FindSelectedItem(GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW)); + pItem = GetListViewEntry(GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW)); if (pItem) { Info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT; @@ -1987,54 +2204,36 @@ FolderOptionsFileTypesDlg( case WM_NOTIFY: lppl = (LPNMLISTVIEW) lParam; - - if (lppl->hdr.code == LVN_ITEMCHANGING) + switch (lppl->hdr.code) { - ZeroMemory(&lvItem, sizeof(LVITEM)); - lvItem.mask = LVIF_PARAM; - lvItem.iItem = lppl->iItem; - if (!SendMessageW(lppl->hdr.hwndFrom, LVM_GETITEMW, 0, (LPARAM)&lvItem)) - return TRUE; - - pItem = (PFOLDER_FILE_TYPE_ENTRY)lvItem.lParam; - if (!pItem) - return TRUE; + case LVN_DELETEALLITEMS: + return FALSE; // send LVN_DELETEITEM - if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED)) - { - /* new focused item */ - if (!LoadStringW(shell32_hInstance, IDS_FILE_DETAILS, FormatBuffer, sizeof(FormatBuffer) / sizeof(WCHAR))) + case LVN_DELETEITEM: + pItem = GetListViewEntry(lppl->hdr.hwndFrom, lppl->iItem); + if (pItem) { - /* use default english format string */ - wcscpy(FormatBuffer, L"Details for '%s' extension"); + DestroyIcon(pItem->hIconLarge); + DestroyIcon(pItem->hIconSmall); + HeapFree(GetProcessHeap(), 0, pItem); } + return FALSE; - /* format buffer */ - swprintf(Buffer, FormatBuffer, &pItem->FileExtension[1]); - /* update dialog */ - SetDlgItemTextW(hwndDlg, IDC_FILETYPES_DETAILS_GROUPBOX, Buffer); + case LVN_ITEMCHANGING: + pItem = GetListViewEntry(lppl->hdr.hwndFrom, lppl->iItem); + if (!pItem) + return TRUE; - if (!LoadStringW(shell32_hInstance, IDS_FILE_DETAILSADV, FormatBuffer, sizeof(FormatBuffer) / sizeof(WCHAR))) + if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED)) { - /* use default english format string */ - wcscpy(FormatBuffer, L"Files with extension '%s' are of type '%s'. To change settings that affect all '%s' files, click Advanced."); + FileTypesDlg_OnItemChanging(hwndDlg, pItem); } - /* format buffer */ - swprintf(Buffer, FormatBuffer, &pItem->FileExtension[1], &pItem->FileDescription[0], &pItem->FileDescription[0]); - /* update dialog */ - SetDlgItemTextW(hwndDlg, IDC_FILETYPES_DESCRIPTION, Buffer); - - /* Enable the Delete button */ - if (pItem->EditFlags & 0x00000010) // FTA_NoRemove - EnableWindow(GetDlgItem(hwndDlg, IDC_FILETYPES_DELETE), FALSE); - else - EnableWindow(GetDlgItem(hwndDlg, IDC_FILETYPES_DELETE), TRUE); - } - } - else if (lppl->hdr.code == PSN_SETACTIVE) - { - /* On page activation, set the focus to the listview */ - SetFocus(GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW)); + break; + + case PSN_SETACTIVE: + /* On page activation, set the focus to the listview */ + SetFocus(GetDlgItem(hwndDlg, IDC_FILETYPES_LISTVIEW)); + break; } break; } diff --git a/dll/win32/shell32/lang/bg-BG.rc b/dll/win32/shell32/lang/bg-BG.rc index 94daa0323b..d6b3d0023e 100644 --- a/dll/win32/shell32/lang/bg-BG.rc +++ b/dll/win32/shell32/lang/bg-BG.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "Из&триване", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Подробности за разширение '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Отваряне с:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Име на приложение", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Име на приложение", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "Про&мяна...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 32 PUSHBUTTON "Раз&ширени", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/ca-ES.rc b/dll/win32/shell32/lang/ca-ES.rc index 53c5ebacfb..7b4d4defb0 100644 --- a/dll/win32/shell32/lang/ca-ES.rc +++ b/dll/win32/shell32/lang/ca-ES.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/cs-CZ.rc b/dll/win32/shell32/lang/cs-CZ.rc index c7494ebf33..f4d3515946 100644 --- a/dll/win32/shell32/lang/cs-CZ.rc +++ b/dll/win32/shell32/lang/cs-CZ.rc @@ -463,8 +463,8 @@ BEGIN PUSHBUTTON "O&dstranit", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Podrobnosti pro typ souborů '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Otevírat v:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Změnit...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "&Pokročilé", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/da-DK.rc b/dll/win32/shell32/lang/da-DK.rc index 501648452c..87010cbcb3 100644 --- a/dll/win32/shell32/lang/da-DK.rc +++ b/dll/win32/shell32/lang/da-DK.rc @@ -463,8 +463,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/de-DE.rc b/dll/win32/shell32/lang/de-DE.rc index 5bf042e98f..ab0ff0db71 100644 --- a/dll/win32/shell32/lang/de-DE.rc +++ b/dll/win32/shell32/lang/de-DE.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Löschen", IDC_FILETYPES_DELETE, 200, 140, 55, 14, WS_TABSTOP GROUPBOX "Details zum Dateityp '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 170, 249, 70 LTEXT "Öffnen mit:", -1, 12, 180, 40, 10 - //ICON - LTEXT "Name", IDC_FILETYPES_APPNAME, 100, 180, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Name", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "Än&dern...", IDC_FILETYPES_CHANGE, 200, 180, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 195, 160, 30 PUSHBUTTON "&Erweitert", IDC_FILETYPES_ADVANCED, 200, 215, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/el-GR.rc b/dll/win32/shell32/lang/el-GR.rc index 635fce0c1f..7e288bd377 100644 --- a/dll/win32/shell32/lang/el-GR.rc +++ b/dll/win32/shell32/lang/el-GR.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/en-GB.rc b/dll/win32/shell32/lang/en-GB.rc index 4cd9e85dcc..338628a052 100644 --- a/dll/win32/shell32/lang/en-GB.rc +++ b/dll/win32/shell32/lang/en-GB.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/en-US.rc b/dll/win32/shell32/lang/en-US.rc index 5d327f02f3..2d15ab52a0 100644 --- a/dll/win32/shell32/lang/en-US.rc +++ b/dll/win32/shell32/lang/en-US.rc @@ -458,8 +458,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/es-ES.rc b/dll/win32/shell32/lang/es-ES.rc index 4d86e8c865..d82117f568 100644 --- a/dll/win32/shell32/lang/es-ES.rc +++ b/dll/win32/shell32/lang/es-ES.rc @@ -459,8 +459,8 @@ BEGIN PUSHBUTTON "Eli&minar", IDC_FILETYPES_DELETE, 230, 110, 50, 14, WS_TABSTOP GROUPBOX "Detalles para el tipo de archivo «%s»", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 279, 100 LTEXT "Se abre con:", -1, 12, 140, 50, 10 - //ICON - LTEXT "Aplicación", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Aplicación", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "Cam&biar...", IDC_FILETYPES_CHANGE, 230, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 165, 220, 30 PUSHBUTTON "Opciones avanza&das", IDC_FILETYPES_ADVANCED, 190, 213, 90, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/et-EE.rc b/dll/win32/shell32/lang/et-EE.rc index 7fe739bcf2..e8782c9a44 100644 --- a/dll/win32/shell32/lang/et-EE.rc +++ b/dll/win32/shell32/lang/et-EE.rc @@ -465,8 +465,8 @@ BEGIN PUSHBUTTON "&Kustuta", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Failitüübi '%s' üksikasjad", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Avamisprogramm:", -1, 12, 140, 60, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Muuda...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "&Täpsemalt", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/fi-FI.rc b/dll/win32/shell32/lang/fi-FI.rc index df2a16de1b..5f3c1d0707 100644 --- a/dll/win32/shell32/lang/fi-FI.rc +++ b/dll/win32/shell32/lang/fi-FI.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/fr-FR.rc b/dll/win32/shell32/lang/fr-FR.rc index a1d20cbba3..b819825c50 100644 --- a/dll/win32/shell32/lang/fr-FR.rc +++ b/dll/win32/shell32/lang/fr-FR.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "Supprimer", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Détails concernant l'extension '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Ouvrir avec :", -1, 12, 140, 40, 10 - //ICON - LTEXT "Nom de l'application", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Nom de l'application", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Modifier...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "A&vancé", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/he-IL.rc b/dll/win32/shell32/lang/he-IL.rc index 85a108337b..d09efde782 100644 --- a/dll/win32/shell32/lang/he-IL.rc +++ b/dll/win32/shell32/lang/he-IL.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/hu-HU.rc b/dll/win32/shell32/lang/hu-HU.rc index 38521334e2..5c7f7c3311 100644 --- a/dll/win32/shell32/lang/hu-HU.rc +++ b/dll/win32/shell32/lang/hu-HU.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/it-IT.rc b/dll/win32/shell32/lang/it-IT.rc index 82feea8e7a..69d937088e 100644 --- a/dll/win32/shell32/lang/it-IT.rc +++ b/dll/win32/shell32/lang/it-IT.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Cancella", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Dettagli per l'estensione '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Apri con:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Nome", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Nome", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Cambia...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "A&vanzate", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/ja-JP.rc b/dll/win32/shell32/lang/ja-JP.rc index e21a079cc7..4468fe73ad 100644 --- a/dll/win32/shell32/lang/ja-JP.rc +++ b/dll/win32/shell32/lang/ja-JP.rc @@ -457,7 +457,7 @@ BEGIN PUSHBUTTON "削除(&D)", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "拡張子 '%s' の詳細", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "開くプログラム:", -1, 12, 140, 80, 10 - //ICON + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 LTEXT "アプリ名", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "変更(&C)...", IDC_FILETYPES_CHANGE, 180, 140, 75, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 165, 40 diff --git a/dll/win32/shell32/lang/ko-KR.rc b/dll/win32/shell32/lang/ko-KR.rc index fa1c1b97d2..7d4ee74b81 100644 --- a/dll/win32/shell32/lang/ko-KR.rc +++ b/dll/win32/shell32/lang/ko-KR.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/nl-NL.rc b/dll/win32/shell32/lang/nl-NL.rc index 1e46a4c924..e0968c2f9a 100644 --- a/dll/win32/shell32/lang/nl-NL.rc +++ b/dll/win32/shell32/lang/nl-NL.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/no-NO.rc b/dll/win32/shell32/lang/no-NO.rc index 223977332a..2fc75b45fd 100644 --- a/dll/win32/shell32/lang/no-NO.rc +++ b/dll/win32/shell32/lang/no-NO.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Slett", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Detailjer for '%s' utvidelser", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Åpne med:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Endre...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Av&ansert", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/pl-PL.rc b/dll/win32/shell32/lang/pl-PL.rc index e3a06f2487..82d94ab242 100644 --- a/dll/win32/shell32/lang/pl-PL.rc +++ b/dll/win32/shell32/lang/pl-PL.rc @@ -462,8 +462,8 @@ BEGIN PUSHBUTTON "&Usuń", IDC_FILETYPES_DELETE, 195, 110, 60, 14, WS_TABSTOP GROUPBOX "Szczegóły dla rozszerzenia '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Otwiera z:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Nazwa Aplikacji", IDC_FILETYPES_APPNAME, 50, 140, 80, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Nazwa Aplikacji", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "Z&mień", IDC_FILETYPES_CHANGE, 190, 140, 60, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Zaawa&nsowane", IDC_FILETYPES_ADVANCED, 190, 175, 60, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/pt-BR.rc b/dll/win32/shell32/lang/pt-BR.rc index 19c7f068ba..0a14d66235 100644 --- a/dll/win32/shell32/lang/pt-BR.rc +++ b/dll/win32/shell32/lang/pt-BR.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Apagar", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Detalhes para extensão '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Abrir com:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "Alt&erar...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "A&vançado", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/pt-PT.rc b/dll/win32/shell32/lang/pt-PT.rc index d15c6912ce..a7da71e7a5 100644 --- a/dll/win32/shell32/lang/pt-PT.rc +++ b/dll/win32/shell32/lang/pt-PT.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Apagar", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Detalhes para '%s' extensão", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Abre com:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appnome", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appnome", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Mudar...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "A&vançado", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/ro-RO.rc b/dll/win32/shell32/lang/ro-RO.rc index 54b0ebf0b8..3243fc2081 100644 --- a/dll/win32/shell32/lang/ro-RO.rc +++ b/dll/win32/shell32/lang/ro-RO.rc @@ -459,8 +459,8 @@ BEGIN PUSHBUTTON "&Elimină", IDC_FILETYPES_DELETE, 200, 110, 50, 14, WS_TABSTOP GROUPBOX "Detalii pentru extensia „%s”", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Va fi deschis cu:", -1, 22, 140, 50, 10 - //ICON - LTEXT "Nume aplicație", IDC_FILETYPES_APPNAME, 100, 140, 75, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Nume aplicație", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "Spe&cificare…", IDC_FILETYPES_CHANGE, 190, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 22, 155, 160, 35 PUSHBUTTON "A&vansate…", IDC_FILETYPES_ADVANCED, 190, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/ru-RU.rc b/dll/win32/shell32/lang/ru-RU.rc index e924f7b572..2e7c8e5afc 100644 --- a/dll/win32/shell32/lang/ru-RU.rc +++ b/dll/win32/shell32/lang/ru-RU.rc @@ -459,8 +459,8 @@ BEGIN PUSHBUTTON "&Удалить", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Описание расширения '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Открывать с:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Приложение", IDC_FILETYPES_APPNAME, 100, 140, 45, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Приложение", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Изменить...", IDC_FILETYPES_CHANGE, 180, 140, 65, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "До&полнительно", IDC_FILETYPES_ADVANCED, 180, 175, 65, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/sk-SK.rc b/dll/win32/shell32/lang/sk-SK.rc index acc1f32579..c06885070c 100644 --- a/dll/win32/shell32/lang/sk-SK.rc +++ b/dll/win32/shell32/lang/sk-SK.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "O&dstrániť", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Zmeniť...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/sl-SI.rc b/dll/win32/shell32/lang/sl-SI.rc index 8beba1374d..d1c20fddbd 100644 --- a/dll/win32/shell32/lang/sl-SI.rc +++ b/dll/win32/shell32/lang/sl-SI.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - ICON IDI_SHELL_PROGRAMS_FOLDER2, IDC_STATIC, 20, 20, 21, 20 - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/sq-AL.rc b/dll/win32/shell32/lang/sq-AL.rc index 93e14c424f..8c8a17b8f5 100644 --- a/dll/win32/shell32/lang/sq-AL.rc +++ b/dll/win32/shell32/lang/sq-AL.rc @@ -461,8 +461,8 @@ BEGIN PUSHBUTTON "&Fshi", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Detaje për '%s' zgjerim", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Hap me:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Emriapp", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Emriapp", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Ndrysho...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Avancuar", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/sv-SE.rc b/dll/win32/shell32/lang/sv-SE.rc index fd0f1234c4..1b73e3e5d1 100644 --- a/dll/win32/shell32/lang/sv-SE.rc +++ b/dll/win32/shell32/lang/sv-SE.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "&Ta bort", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Detaljer för filändelsen '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Öppnas med:", -1, 12, 140, 50, 10 - //ICON - LTEXT "Programnamn", IDC_FILETYPES_APPNAME, 100, 140, 46, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Programnamn", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Ändra...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "A&vancerat", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/tr-TR.rc b/dll/win32/shell32/lang/tr-TR.rc index d54c399302..ac07ccfd68 100644 --- a/dll/win32/shell32/lang/tr-TR.rc +++ b/dll/win32/shell32/lang/tr-TR.rc @@ -459,8 +459,8 @@ BEGIN PUSHBUTTON "&Sil", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX """%s"" Uzantısı İçin Ayrıntılar", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Birlikte Açılır:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Uygulama Adı", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Uygulama Adı", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Değiştir...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "&Gelişmiş", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/uk-UA.rc b/dll/win32/shell32/lang/uk-UA.rc index 1ff6fba8c8..7e662ab1d5 100644 --- a/dll/win32/shell32/lang/uk-UA.rc +++ b/dll/win32/shell32/lang/uk-UA.rc @@ -457,8 +457,8 @@ BEGIN PUSHBUTTON "В&идалити", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Подробиці для розширення '%s'", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Відкривати у:", -1, 12, 140, 48, 10 - ICON IDI_SHELL_PROGRAMS_FOLDER2, IDC_STATIC, 20, 20, 21, 20 - LTEXT "Додаток", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Додаток", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Змінити...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 40 PUSHBUTTON "&Додатково", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/zh-CN.rc b/dll/win32/shell32/lang/zh-CN.rc index c32e28828c..73759bc46e 100644 --- a/dll/win32/shell32/lang/zh-CN.rc +++ b/dll/win32/shell32/lang/zh-CN.rc @@ -467,8 +467,8 @@ BEGIN PUSHBUTTON "删除(&D)", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "'%S' 扩展的详细信息", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "打开方式:", -1, 12, 140, 40, 10 - //ICON - LTEXT "应用程序名称", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "应用程序名称", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "更改...(&C)", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "高级(&V)", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/lang/zh-TW.rc b/dll/win32/shell32/lang/zh-TW.rc index 60aa2e7eb8..d9c982fdc7 100644 --- a/dll/win32/shell32/lang/zh-TW.rc +++ b/dll/win32/shell32/lang/zh-TW.rc @@ -465,8 +465,8 @@ BEGIN PUSHBUTTON "&Delete", IDC_FILETYPES_DELETE, 180, 110, 50, 14, WS_TABSTOP GROUPBOX "Details for '%s' extension", IDC_FILETYPES_DETAILS_GROUPBOX, 7, 130, 249, 70 LTEXT "Opens with:", -1, 12, 140, 40, 10 - //ICON - LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 40, 10 + CONTROL "", IDC_FILETYPES_ICON, "STATIC", SS_BITMAP | SS_REALSIZEIMAGE, 85, 140, 10, 10 + LTEXT "Appname", IDC_FILETYPES_APPNAME, 100, 140, 80, 10 PUSHBUTTON "&Change...", IDC_FILETYPES_CHANGE, 180, 140, 50, 14, WS_TABSTOP LTEXT "", IDC_FILETYPES_DESCRIPTION, 12, 155, 160, 30 PUSHBUTTON "Ad&vanced", IDC_FILETYPES_ADVANCED, 180, 175, 50, 14, WS_TABSTOP diff --git a/dll/win32/shell32/shresdef.h b/dll/win32/shell32/shresdef.h index 0014ec2bfa..6e8d624533 100644 --- a/dll/win32/shell32/shresdef.h +++ b/dll/win32/shell32/shresdef.h @@ -356,6 +356,7 @@ #define IDC_FILETYPES_CHANGE 14006 #define IDC_FILETYPES_DESCRIPTION 14007 #define IDC_FILETYPES_ADVANCED 14008 +#define IDC_FILETYPES_ICON 14009 /* Control IDs for IDD_NEWEXTENSION dialog */ #define IDC_NEWEXT_EDIT 14001
6 years, 7 months
1
0
0
0
01/01: [MSPAINT] Fix copy-pasta bug (#562)
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e27d5d2efc73338a08807…
commit e27d5d2efc73338a08807d300f8f5466cf1fe6a6 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Wed May 23 23:17:22 2018 +0300 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Wed May 23 22:17:22 2018 +0200 [MSPAINT] Fix copy-pasta bug (#562) This would fix setting image height via Attributes dialog and help fixing CORE-14539. --- base/applications/mspaint/dialogs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/applications/mspaint/dialogs.h b/base/applications/mspaint/dialogs.h index 701c23f20e..8d7aefe444 100644 --- a/base/applications/mspaint/dialogs.h +++ b/base/applications/mspaint/dialogs.h @@ -43,10 +43,10 @@ public: COMMAND_ID_HANDLER(IDCANCEL, OnCancel) COMMAND_ID_HANDLER(IDD_ATTRIBUTESSTANDARD, OnDefault) COMMAND_ID_HANDLER(IDD_ATTRIBUTESRB1, OnRadioButton1) - COMMAND_ID_HANDLER(IDD_ATTRIBUTESRB1, OnRadioButton2) - COMMAND_ID_HANDLER(IDD_ATTRIBUTESRB1, OnRadioButton3) + COMMAND_ID_HANDLER(IDD_ATTRIBUTESRB2, OnRadioButton2) + COMMAND_ID_HANDLER(IDD_ATTRIBUTESRB3, OnRadioButton3) COMMAND_ID_HANDLER(IDD_ATTRIBUTESEDIT1, OnEdit1) - COMMAND_ID_HANDLER(IDD_ATTRIBUTESEDIT1, OnEdit2) + COMMAND_ID_HANDLER(IDD_ATTRIBUTESEDIT2, OnEdit2) END_MSG_MAP() LRESULT OnInitDialog(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
6 years, 7 months
1
0
0
0
01/01: [MSGINA] Implement the Welcome text feature
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef9cfec290a3c2e56405c…
commit ef9cfec290a3c2e56405c3a1d605eb241faa6bbc Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Wed May 23 13:51:45 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Wed May 23 13:51:45 2018 +0200 [MSGINA] Implement the Welcome text feature --- dll/win32/msgina/gui.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/dll/win32/msgina/gui.c b/dll/win32/msgina/gui.c index 83547425db..2f4e687294 100644 --- a/dll/win32/msgina/gui.c +++ b/dll/win32/msgina/gui.c @@ -41,6 +41,69 @@ GUIInitialize( return TRUE; } + +static +VOID +SetWelcomeText(HWND hWnd) +{ + PWCHAR pBuffer = NULL, p; + HKEY hKey; + DWORD BufSize, dwType, dwWelcomeSize, dwTitleLength; + LONG rc; + + TRACE("GetWelcomeText(%p)\n", hWnd); + + /* Get the path of userinit */ + rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", + 0, + KEY_QUERY_VALUE, + &hKey); + if (rc != ERROR_SUCCESS) + { + WARN("RegOpenKeyExW() failed with error %lu\n", rc); + return; + } + + /* Get the size of the Welcome value */ + dwWelcomeSize = 0; + rc = RegQueryValueExW(hKey, + L"Welcome", + NULL, + &dwType, + NULL, + &dwWelcomeSize); + if (rc == ERROR_FILE_NOT_FOUND || dwWelcomeSize == 0 || dwType != REG_SZ) + goto done; + + dwTitleLength = GetWindowTextLengthW(hWnd); + BufSize = dwWelcomeSize + ((dwTitleLength + 1) * sizeof(WCHAR)); + + pBuffer = HeapAlloc(GetProcessHeap(), 0, BufSize); + if (pBuffer == NULL) + goto done; + + GetWindowTextW(hWnd, pBuffer, BufSize / sizeof(WCHAR)); + wcscat(pBuffer, L" "); + p = &pBuffer[dwTitleLength + 1]; + + RegQueryValueExW(hKey, + L"Welcome", + NULL, + &dwType, + (PBYTE)p, + &dwWelcomeSize); + + SetWindowText(hWnd, pBuffer); + +done: + if (pBuffer != NULL) + HeapFree(GetProcessHeap(), 0, pBuffer); + + RegCloseKey(hKey); +} + + static INT_PTR CALLBACK StatusMessageWindowProc( IN HWND hwndDlg, @@ -695,6 +758,8 @@ LoggedOnWindowProc( pgContext = (PGINA_CONTEXT)lParam; SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pgContext); + SetWelcomeText(hwndDlg); + OnInitSecurityDlg(hwndDlg, (PGINA_CONTEXT)lParam); SetFocus(GetDlgItem(hwndDlg, IDNO)); return TRUE; @@ -972,6 +1037,11 @@ LoggedOutWindowProc( /* FIXME: take care of NoDomainUI */ pDlgData->pgContext = (PGINA_CONTEXT)lParam; + /* Draw the logo bitmap */ + pDlgData->hBitmap = LoadImageW(pDlgData->pgContext->hDllInstance, MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); + + SetWelcomeText(hwndDlg); + if (pDlgData->pgContext->bAutoAdminLogon || !pDlgData->pgContext->bDontDisplayLastUserName) SetDlgItemTextW(hwndDlg, IDC_USERNAME, pDlgData->pgContext->UserName); @@ -989,9 +1059,6 @@ LoggedOutWindowProc( SetFocus(GetDlgItem(hwndDlg, pDlgData->pgContext->bDontDisplayLastUserName ? IDC_USERNAME : IDC_PASSWORD)); - /* Draw the logo bitmap */ - pDlgData->hBitmap = LoadImageW(pDlgData->pgContext->hDllInstance, MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - if (pDlgData->pgContext->bAutoAdminLogon) PostMessage(GetDlgItem(hwndDlg, IDOK), BM_CLICK, 0, 0); @@ -1249,6 +1316,8 @@ UnlockWindowProc( pDlgData->pgContext = (PGINA_CONTEXT)lParam; + SetWelcomeText(hwndDlg); + SetLockMessage(hwndDlg, IDC_LOCKMSG, pDlgData->pgContext); SetDlgItemTextW(hwndDlg, IDC_USERNAME, pDlgData->pgContext->UserName); @@ -1350,6 +1419,8 @@ LockedWindowProc( /* Load the logo bitmap */ pDlgData->hBitmap = LoadImageW(pDlgData->pgContext->hDllInstance, MAKEINTRESOURCEW(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); + SetWelcomeText(hwndDlg); + SetLockMessage(hwndDlg, IDC_LOCKMSG, pDlgData->pgContext); return TRUE; }
6 years, 7 months
1
0
0
0
01/01: [NTOSKRNL] Addendum to 8a8cb4d: don't print uninit pointer.
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2cf9a69bcee1333711aa0…
commit 2cf9a69bcee1333711aa066cec407b3e7ff41ab3 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Wed May 23 08:44:43 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Wed May 23 08:44:43 2018 +0200 [NTOSKRNL] Addendum to 8a8cb4d: don't print uninit pointer. --- ntoskrnl/cc/view.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c index ee9d1e30d2..1909c8bb1e 100644 --- a/ntoskrnl/cc/view.c +++ b/ntoskrnl/cc/view.c @@ -1391,8 +1391,7 @@ CcRosInitializeFileCache ( BOOLEAN Allocated; PROS_SHARED_CACHE_MAP SharedCacheMap; - DPRINT("CcRosInitializeFileCache(FileObject 0x%p, SharedCacheMap 0x%p)\n", - FileObject, SharedCacheMap); + DPRINT("CcRosInitializeFileCache(FileObject 0x%p)\n", FileObject); Allocated = FALSE; KeAcquireGuardedMutex(&ViewLock);
6 years, 7 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
22
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
Results per page:
10
25
50
100
200