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
August 2023
----- 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
30 participants
167 discussions
Start a n
N
ew thread
[reactos] 01/01: [SHELL32] Move SheRemoveQuotesA/W to utils.cpp (#5535)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6413024cab03c194830ee…
commit 6413024cab03c194830eebfe169b5331fc8eb266 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Aug 6 20:07:39 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Aug 6 13:07:39 2023 +0200 [SHELL32] Move SheRemoveQuotesA/W to utils.cpp (#5535) * [SHELL32] Move SheRemoveQuotesA/W to utils.cpp Follow-up to #5529 (7100fa8). JIRA issue: CORE-9277 --- dll/win32/shell32/CMakeLists.txt | 1 + dll/win32/shell32/iconcache.cpp | 48 --------------------------------- dll/win32/shell32/utils.cpp | 58 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 48 deletions(-) diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index 4e1d4f63804..5f972807c8b 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -40,6 +40,7 @@ list(APPEND SOURCE folders.cpp iconcache.cpp shell32.cpp + utils.cpp CShellItem.cpp CShellLink.cpp CFolderOptions.cpp diff --git a/dll/win32/shell32/iconcache.cpp b/dll/win32/shell32/iconcache.cpp index 3da28ecd826..9a55f0f9fc0 100644 --- a/dll/win32/shell32/iconcache.cpp +++ b/dll/win32/shell32/iconcache.cpp @@ -987,54 +987,6 @@ HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD l return hIcon; } -/************************************************************************* - * SheRemoveQuotesA (SHELL32.@) - */ -EXTERN_C LPSTR -WINAPI -SheRemoveQuotesA(LPSTR psz) -{ - PCHAR pch; - - if (*psz == '"') - { - for (pch = psz + 1; *pch && *pch != '"'; ++pch) - { - *(pch - 1) = *pch; - } - - if (*pch == '"') - *(pch - 1) = ANSI_NULL; - } - - return psz; -} - -/************************************************************************* - * SheRemoveQuotesW (SHELL32.@) - * - * ExtractAssociatedIconExW uses this function. - */ -EXTERN_C LPWSTR -WINAPI -SheRemoveQuotesW(LPWSTR psz) -{ - PWCHAR pch; - - if (*psz == L'"') - { - for (pch = psz + 1; *pch && *pch != L'"'; ++pch) - { - *(pch - 1) = *pch; - } - - if (*pch == L'"') - *(pch - 1) = UNICODE_NULL; - } - - return psz; -} - /************************************************************************* * ExtractAssociatedIconExW (SHELL32.@) * diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp new file mode 100644 index 00000000000..c2085b9c1e0 --- /dev/null +++ b/dll/win32/shell32/utils.cpp @@ -0,0 +1,58 @@ +/* + * PROJECT: shell32 + * LICENSE: LGPL-2.1+ (
https://spdx.org/licenses/LGPL-2.1+
) + * PURPOSE: Utility functions + * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#include "precomp.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +/************************************************************************* + * SheRemoveQuotesA (SHELL32.@) + */ +EXTERN_C LPSTR +WINAPI +SheRemoveQuotesA(LPSTR psz) +{ + PCHAR pch; + + if (*psz == '"') + { + for (pch = psz + 1; *pch && *pch != '"'; ++pch) + { + *(pch - 1) = *pch; + } + + if (*pch == '"') + *(pch - 1) = ANSI_NULL; + } + + return psz; +} + +/************************************************************************* + * SheRemoveQuotesW (SHELL32.@) + * + * ExtractAssociatedIconExW uses this function. + */ +EXTERN_C LPWSTR +WINAPI +SheRemoveQuotesW(LPWSTR psz) +{ + PWCHAR pch; + + if (*psz == L'"') + { + for (pch = psz + 1; *pch && *pch != L'"'; ++pch) + { + *(pch - 1) = *pch; + } + + if (*pch == L'"') + *(pch - 1) = UNICODE_NULL; + } + + return psz; +}
1 year, 4 months
1
0
0
0
[reactos] 02/02: [GITHUB] Build subsystems on ARM
by Adam Słaboń
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=365372dc17172d779ded5…
commit 365372dc17172d779ded5e808f69446aec77b707 Author: Adam Słaboń <asaillen(a)protonmail.com> AuthorDate: Mon Jul 31 02:14:31 2023 +0200 Commit: Adam Słaboń <asaillen(a)protonmail.com> CommitDate: Sat Aug 5 16:23:10 2023 +0200 [GITHUB] Build subsystems on ARM CORE-17604 --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11dbe13ece6..036475fe4ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,6 +182,9 @@ jobs: - name: Build rosapps if: ${{ matrix.arch == 'arm' }} run: cmake --build build --target modules/rosapps/all + - name: Build subsystems + if: ${{ matrix.arch == 'arm' }} + run: cmake --build build --target subsystems/all - name: Build some applications (arm64) if: ${{ matrix.arch == 'arm64' }} run: cmake --build build --target calc magnify mstsc notepad osk regedit taskmgr winmine wordpad base/applications/screensavers/all -- -k0 @@ -193,6 +196,7 @@ jobs: build/base build/dll/cpl build/modules/rosapps + build/subsystems !**/CMakeFiles !**/cmake_install.cmake !**/*.asm
1 year, 4 months
1
0
0
0
[reactos] 01/02: [CMAKE][MVDM] Fix CMAKE_ASM16_COMPILER for non-x86 MSVC builds
by Adam Słaboń
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2ffcda90b2a42d7dfba78…
commit 2ffcda90b2a42d7dfba78133171f5391cf583b3f Author: Adam Słaboń <asaillen(a)protonmail.com> AuthorDate: Sun Mar 19 14:47:47 2023 +0100 Commit: Adam Słaboń <asaillen(a)protonmail.com> CommitDate: Sat Aug 5 16:20:22 2023 +0200 [CMAKE][MVDM] Fix CMAKE_ASM16_COMPILER for non-x86 MSVC builds Ensure that CMAKE_ASM16_COMPILER is 32-bit MASM. It is used only for compiling 16-bit x86 ASM code on non-x86 builds. Original patch by serrox. CORE-10452, CORE-17604 Co-authored-by: Sergey Chernov <serrox(a)ya.ru> --- sdk/cmake/msvc.cmake | 18 ++++-------------- subsystems/mvdm/asm16.cmake | 6 +----- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index 4e64db9d3aa..3981715190b 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -409,21 +409,15 @@ endmacro() # PSEH workaround set(PSEH_LIB "pseh") -# Use a full path for the x86 version of ml when using x64 VS. -# It's not a problem when using the DDK/WDK because, in x64 mode, -# both the x86 and x64 versions of ml are available. -if(ARCH STREQUAL "amd64") +# Setup MASM/ML for compiling 16-bit x86 ASM code on x86 or non-x86 ports. +if(NOT ARCH STREQUAL "i386") if((MSVC_VERSION LESS_EQUAL 1900) AND (DEFINED ENV{VCINSTALLDIR})) set(CMAKE_ASM16_COMPILER $ENV{VCINSTALLDIR}/bin/ml.exe) elseif(DEFINED ENV{VCToolsInstallDir}) - set(CMAKE_ASM16_COMPILER $ENV{VCToolsInstallDir}/bin/HostX86/x86/ml.exe) + set(CMAKE_ASM16_COMPILER $ENV{VCToolsInstallDir}/bin/Host$ENV{VSCMD_ARG_HOST_ARCH}/x86/ml.exe) else() set(CMAKE_ASM16_COMPILER ml.exe) endif() -elseif(ARCH STREQUAL "arm") - set(CMAKE_ASM16_COMPILER armasm.exe) -elseif(ARCH STREQUAL "arm64") - set(CMAKE_ASM16_COMPILER armasm64.exe) else() set(CMAKE_ASM16_COMPILER ml.exe) endif() @@ -446,11 +440,7 @@ function(CreateBootSectorTarget _target_name _asm_file _binary_file _base_addres COMMAND ${CMAKE_C_COMPILER} /nologo ${_no_std_includes_flag} /I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm ${_includes} ${_defines} /D__ASM__ /D_USE_ML /EP /c ${_asm_file} > ${_temp_file} DEPENDS ${_asm_file}) - if(ARCH STREQUAL "arm" OR ARCH STREQUAL "arm64") - set(_asm16_command ${CMAKE_ASM16_COMPILER} -nologo -o ${_object_file} ${_temp_file}) - else() - set(_asm16_command ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_temp_file}) - endif() + set(_asm16_command ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_temp_file}) add_custom_command( OUTPUT ${_object_file} diff --git a/subsystems/mvdm/asm16.cmake b/subsystems/mvdm/asm16.cmake index a2df957c080..073314f308b 100644 --- a/subsystems/mvdm/asm16.cmake +++ b/subsystems/mvdm/asm16.cmake @@ -112,11 +112,7 @@ function(add_asm16_bin _target _binary_file _base_address) COMMAND cl /nologo /X /I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm ${_directory_includes} ${_source_file_defines} ${_directory_defines} /D__ASM__ /D_USE_ML /EP /c ${_concatenated_asm_file} > ${_preprocessed_asm_file} DEPENDS ${_concatenated_asm_file}) - if(ARCH STREQUAL "arm") - set(_pp_asm16_compile_command ${CMAKE_ASM16_COMPILER} -nologo -o ${_object_file} ${_preprocessed_asm_file}) - else() - set(_pp_asm16_compile_command ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_preprocessed_asm_file}) - endif() + set(_pp_asm16_compile_command ${CMAKE_ASM16_COMPILER} /nologo /Cp /Fo${_object_file} /c /Ta ${_preprocessed_asm_file}) add_custom_command( OUTPUT ${_object_file}
1 year, 4 months
1
0
0
0
[reactos] 02/02: [FREELDR] Implement bus mouse detection
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ffbc81fdf2f8c203d28cb…
commit ffbc81fdf2f8c203d28cb554605a6a099a916265 Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Tue Jul 25 22:12:08 2023 +0600 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Sat Aug 5 16:40:13 2023 +0300 [FREELDR] Implement bus mouse detection This allows to automatically install the inport device driver (it's now possible since 7d5e1591313), which can be used on 86Box. References: -
https://raw.githubusercontent.com/86Box/86Box/master/src/device/mouse_bus.c
-
https://bochs.sourceforge.io/cgi-bin/lxr/source/iodev/busmouse.cc
--- boot/freeldr/freeldr/arch/i386/irqsup.S | 33 +++++ boot/freeldr/freeldr/arch/i386/pc/machpc.c | 214 +++++++++++++++++++++++++++++ boot/freeldr/freeldr/pcat.cmake | 1 + 3 files changed, 248 insertions(+) diff --git a/boot/freeldr/freeldr/arch/i386/irqsup.S b/boot/freeldr/freeldr/arch/i386/irqsup.S new file mode 100644 index 00000000000..7c35ef383ec --- /dev/null +++ b/boot/freeldr/freeldr/arch/i386/irqsup.S @@ -0,0 +1,33 @@ +/* + * PROJECT: FreeLoader + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Interrupt handling + * COPYRIGHT: Copyright 2023 Dmitry Borisov <di.sean(a)protonmail.com> + */ + +#include <asm.inc> + +#define PIC1_CONTROL_PORT HEX(20) +#define PIC_EOI HEX(20) + +.code32 + +PUBLIC _HwIrqHandler +_HwIrqHandler: + push ax + + /* Increment the interrupt count */ + inc dword ptr ds:[_HwIrqCount] + + /* Dismiss the interrupt */ + mov al, PIC_EOI + out PIC1_CONTROL_PORT, al + + pop ax + iret + +PUBLIC _HwIrqCount +_HwIrqCount: + .long 0 + +END diff --git a/boot/freeldr/freeldr/arch/i386/pc/machpc.c b/boot/freeldr/freeldr/arch/i386/pc/machpc.c index f20fa2b9a52..4bef802f667 100644 --- a/boot/freeldr/freeldr/arch/i386/pc/machpc.c +++ b/boot/freeldr/freeldr/arch/i386/pc/machpc.c @@ -38,6 +38,20 @@ DBG_DEFAULT_CHANNEL(HWDETECT); /* Mouse Systems Mouse */ #define MOUSE_TYPE_MOUSESYSTEMS 4 +#define INPORT_REGISTER_CONTROL 0x00 +#define INPORT_REGISTER_DATA 0x01 +#define INPORT_REGISTER_SIGNATURE 0x02 + +#define INPORT_REG_MODE 0x07 +#define INPORT_RESET 0x80 +#define INPORT_MODE_BASE 0x10 +#define INPORT_TEST_IRQ 0x16 +#define INPORT_SIGNATURE 0xDE + +#define PIC1_CONTROL_PORT 0x20 +#define PIC1_DATA_PORT 0x21 +#define PIC2_CONTROL_PORT 0xA0 +#define PIC2_DATA_PORT 0xA1 /* PS2 stuff */ @@ -1291,6 +1305,203 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey) } } +#if defined(_M_IX86) +static VOID +CreateBusMousePeripheralKey( + _Inout_ PCONFIGURATION_COMPONENT_DATA BusKey, + _In_ ULONG IoBase, + _In_ ULONG Irq) +{ + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; + PCONFIGURATION_COMPONENT_DATA ControllerKey; + PCONFIGURATION_COMPONENT_DATA PeripheralKey; + ULONG Size; + + /* Set 'Configuration Data' value */ + Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[2]); + PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST); + if (PartialResourceList == NULL) + { + ERR("Failed to allocate resource descriptor\n"); + return; + } + + /* Initialize resource descriptor */ + RtlZeroMemory(PartialResourceList, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 2; + + /* Set IO Port */ + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; + PartialDescriptor->Type = CmResourceTypePort; + PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; + PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; + PartialDescriptor->u.Port.Start.LowPart = IoBase; + PartialDescriptor->u.Port.Start.HighPart = 0; + PartialDescriptor->u.Port.Length = 4; + + /* Set Interrupt */ + PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; + PartialDescriptor->Type = CmResourceTypeInterrupt; + PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; + PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; + PartialDescriptor->u.Interrupt.Level = Irq; + PartialDescriptor->u.Interrupt.Vector = Irq; + PartialDescriptor->u.Interrupt.Affinity = (KAFFINITY)-1; + + /* Create controller key */ + FldrCreateComponentKey(BusKey, + ControllerClass, + PointerController, + Input, + 0, + 0xFFFFFFFF, + NULL, + PartialResourceList, + Size, + &ControllerKey); + + /* Set 'Configuration Data' value */ + Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors); + PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST); + if (PartialResourceList == NULL) + { + ERR("Failed to allocate resource descriptor\n"); + return; + } + + /* Initialize resource descriptor */ + RtlZeroMemory(PartialResourceList, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 0; + + /* Create peripheral key */ + FldrCreateComponentKey(ControllerKey, + ControllerClass, + PointerPeripheral, + Input, + 0, + 0xFFFFFFFF, + "MICROSOFT INPORT MOUSE", + PartialResourceList, + Size, + &PeripheralKey); +} + +extern KIDTENTRY DECLSPEC_ALIGN(4) i386Idt[32]; +VOID __cdecl HwIrqHandler(VOID); +extern volatile ULONG HwIrqCount; + +static ULONG +DetectBusMouseTestIrq( + _In_ ULONG IoBase, + _In_ ULONG Irq) +{ + USHORT OldOffset, OldExtendedOffset; + ULONG Vector, i; + + HwIrqCount = 0; + + /* Reset the device */ + WRITE_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_CONTROL, INPORT_RESET); + WRITE_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_CONTROL, INPORT_REG_MODE); + + Vector = Irq + 8; + + /* Save the old interrupt vector and replace it by ours */ + OldOffset = i386Idt[Vector].Offset; + OldExtendedOffset = i386Idt[Vector].ExtendedOffset; + + i386Idt[Vector].Offset = (ULONG)HwIrqHandler & 0xFFFF; + i386Idt[Vector].ExtendedOffset = (ULONG)HwIrqHandler >> 16; + + /* Enable the requested IRQ on the master PIC */ + WRITE_PORT_UCHAR((PUCHAR)PIC1_DATA_PORT, ~(1 << Irq)); + + _enable(); + + /* Configure the device to generate interrupts */ + for (i = 0; i < 15; i++) + { + WRITE_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_DATA, INPORT_MODE_BASE); + WRITE_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_DATA, INPORT_TEST_IRQ); + } + + /* Disable the device */ + WRITE_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_DATA, 0); + + _disable(); + + i386Idt[Vector].Offset = OldOffset; + i386Idt[Vector].ExtendedOffset = OldExtendedOffset; + + return (HwIrqCount != 0) ? Irq : 0; +} + +static ULONG +DetectBusMouseIrq( + _In_ ULONG IoBase) +{ + UCHAR Mask1, Mask2; + ULONG Irq, Result; + + /* Save the current interrupt mask */ + Mask1 = READ_PORT_UCHAR(PIC1_DATA_PORT); + Mask2 = READ_PORT_UCHAR(PIC2_DATA_PORT); + + /* Mask the interrupts on the slave PIC */ + WRITE_PORT_UCHAR(PIC2_DATA_PORT, 0xFF); + + /* Process IRQ detection: IRQ 5, 4, 3 */ + for (Irq = 5; Irq >= 3; Irq--) + { + Result = DetectBusMouseTestIrq(IoBase, Irq); + if (Result != 0) + break; + } + + /* Restore the mask */ + WRITE_PORT_UCHAR(PIC1_DATA_PORT, Mask1); + WRITE_PORT_UCHAR(PIC2_DATA_PORT, Mask2); + + return Result; +} + +static VOID +DetectBusMouse( + _Inout_ PCONFIGURATION_COMPONENT_DATA BusKey) +{ + ULONG IoBase, Irq, Signature1, Signature2, Signature3; + + /* + * The bus mouse lives at one of these addresses: 0x230, 0x234, 0x238, 0x23C. + * The 0x23C port is the most common I/O setting. + */ + for (IoBase = 0x23C; IoBase >= 0x230; IoBase -= 4) + { + Signature1 = READ_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_SIGNATURE); + Signature2 = READ_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_SIGNATURE); + if (Signature1 == Signature2) + continue; + if (Signature1 != INPORT_SIGNATURE && Signature2 != INPORT_SIGNATURE) + continue; + + Signature3 = READ_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_SIGNATURE); + if (Signature1 != Signature3) + continue; + + Irq = DetectBusMouseIrq(IoBase); + if (Irq == 0) + continue; + + CreateBusMousePeripheralKey(BusKey, IoBase, Irq); + break; + } +} +#endif /* _M_IX86 */ // Implemented in pcvesa.c, returns the VESA version USHORT BiosIsVesaSupported(VOID); @@ -1393,6 +1604,9 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) DetectParallelPorts(BusKey); DetectKeyboardController(BusKey); DetectPS2Mouse(BusKey); +#if defined(_M_IX86) + DetectBusMouse(BusKey); +#endif DetectDisplayController(BusKey); /* FIXME: Detect more ISA devices */ diff --git a/boot/freeldr/freeldr/pcat.cmake b/boot/freeldr/freeldr/pcat.cmake index 24c8e3627f0..5ea6f9b8aa7 100644 --- a/boot/freeldr/freeldr/pcat.cmake +++ b/boot/freeldr/freeldr/pcat.cmake @@ -42,6 +42,7 @@ if(ARCH STREQUAL "i386") arch/i386/drvmap.S arch/i386/entry.S arch/i386/int386.S + arch/i386/irqsup.S arch/i386/pnpbios.S # arch/i386/i386trap.S arch/i386/linux.S)
1 year, 4 months
1
0
0
0
[reactos] 01/02: [INPORT] Fix swapped buttons for the inport bus mouse
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a14019b219048647871b8…
commit a14019b219048647871b88fa0f2d4c66b6f69224 Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Tue Jul 25 21:32:13 2023 +0600 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Sat Aug 5 16:40:07 2023 +0300 [INPORT] Fix swapped buttons for the inport bus mouse Also don't read the delta state when there is no mouse movement. --- drivers/input/inport/hardware.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/input/inport/hardware.c b/drivers/input/inport/hardware.c index 33103f25311..0cbd9f62800 100644 --- a/drivers/input/inport/hardware.c +++ b/drivers/input/inport/hardware.c @@ -71,12 +71,13 @@ #define INPORT_MODE_IRQ 0x01 #define INPORT_MODE_BASE 0x10 #define INPORT_MODE_HOLD 0x20 + #define INPORT_HAS_MOVED 0x40 #define MS_INPORT_SIGNATURE 0x02 -#define MS_BUTTON_MIDDLE 0x01 -#define MS_BUTTON_LEFT 0x02 -#define MS_BUTTON_RIGHT 0x04 +#define MS_BUTTON_RIGHT 0x01 +#define MS_BUTTON_MIDDLE 0x02 +#define MS_BUTTON_LEFT 0x04 /* * Logitech @@ -270,14 +271,23 @@ InPortIsr( WRITE_MOUSE(DeviceExtension, MS_INPORT_DATA, INPORT_MODE_HOLD | INPORT_MODE_IRQ | INPORT_MODE_BASE); - WRITE_MOUSE(DeviceExtension, MS_INPORT_CONTROL, INPORT_REG_X); - DeltaX = READ_MOUSE(DeviceExtension, MS_INPORT_DATA); - - WRITE_MOUSE(DeviceExtension, MS_INPORT_CONTROL, INPORT_REG_Y); - DeltaY = READ_MOUSE(DeviceExtension, MS_INPORT_DATA); - WRITE_MOUSE(DeviceExtension, MS_INPORT_CONTROL, INPORT_REG_BTNS); Buttons = READ_MOUSE(DeviceExtension, MS_INPORT_DATA); + + if (Buttons & INPORT_HAS_MOVED) + { + WRITE_MOUSE(DeviceExtension, MS_INPORT_CONTROL, INPORT_REG_X); + DeltaX = READ_MOUSE(DeviceExtension, MS_INPORT_DATA); + + WRITE_MOUSE(DeviceExtension, MS_INPORT_CONTROL, INPORT_REG_Y); + DeltaY = READ_MOUSE(DeviceExtension, MS_INPORT_DATA); + } + else + { + DeltaX = 0; + DeltaY = 0; + } + Buttons &= (MS_BUTTON_MIDDLE | MS_BUTTON_LEFT | MS_BUTTON_RIGHT); WRITE_MOUSE(DeviceExtension, MS_INPORT_CONTROL, INPORT_REG_MODE);
1 year, 4 months
1
0
0
0
[reactos] 01/01: [ATL] CImage: Hack fix for getting filter string (#5528)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=36a35ee203e1121a07b89…
commit 36a35ee203e1121a07b8960c3566b01882b0d423 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Aug 5 21:23:21 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 5 21:23:21 2023 +0900 [ATL] CImage: Hack fix for getting filter string (#5528) - Fix the crash on opening/saving file. - To get the filename extension info from CODECs, we have to keep gdiplus.dll loaded. - The perfect fix will take time. CORE-19093, CORE-19094 --- sdk/lib/atl/atlimage.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/lib/atl/atlimage.h b/sdk/lib/atl/atlimage.h index 236defea834..bbf7dc6a115 100644 --- a/sdk/lib/atl/atlimage.h +++ b/sdk/lib/atl/atlimage.h @@ -811,6 +811,7 @@ public: DWORD dwExclude = excludeDefaultLoad, TCHAR chSeparator = TEXT('|')) { + CImage dummy; // HACK: Initialize common UINT cDecoders = 0; Gdiplus::ImageCodecInfo* pDecoders = _getAllDecoders(cDecoders); HRESULT hr = BuildCodecFilterString(pDecoders, @@ -831,6 +832,7 @@ public: DWORD dwExclude = excludeDefaultSave, TCHAR chSeparator = TEXT('|')) { + CImage dummy; // HACK: Initialize common UINT cEncoders = 0; Gdiplus::ImageCodecInfo* pEncoders = _getAllEncoders(cEncoders); HRESULT hr = BuildCodecFilterString(pEncoders, @@ -1057,6 +1059,7 @@ protected: // Deprecated. Don't use this static const GUID *FileTypeFromExtension(LPCTSTR dotext) { + CImage dummy; // HACK: Initialize common UINT cEncoders = 0; Gdiplus::ImageCodecInfo* pEncoders = _getAllEncoders(cEncoders); @@ -1111,6 +1114,7 @@ protected: // Deprecated. Don't use this static bool GetClsidFromFileType(CLSID *clsid, const GUID *guid) { + CImage dummy; // HACK: Initialize common UINT cEncoders = 0; Gdiplus::ImageCodecInfo* pEncoders = _getAllEncoders(cEncoders); *clsid = FindCodecForFileType(*guid, pEncoders, cEncoders); @@ -1120,8 +1124,6 @@ protected: static Gdiplus::ImageCodecInfo* _getAllEncoders(UINT& cEncoders) { - CImage image; // Initialize common - UINT total_size = 0; GetCommon().GetImageEncodersSize(&cEncoders, &total_size); if (total_size == 0) @@ -1141,8 +1143,6 @@ protected: static Gdiplus::ImageCodecInfo* _getAllDecoders(UINT& cDecoders) { - CImage image; // Initialize common - UINT total_size = 0; GetCommon().GetImageDecodersSize(&cDecoders, &total_size); if (total_size == 0)
1 year, 4 months
1
0
0
0
[reactos] 01/01: [SHLWAPI][SHLWAPI_APITEST][SDK] SHCreatePropertyBagOnMemory (#5511)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b4bc6f0a6a1ea3d6e9aed…
commit b4bc6f0a6a1ea3d6e9aed68c28b2b4787dd21fd9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Aug 5 21:20:58 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 5 21:20:58 2023 +0900 [SHLWAPI][SHLWAPI_APITEST][SDK] SHCreatePropertyBagOnMemory (#5511) - Add propbag.cpp. - Add CBasePropertyBag / CMemPropertyBag classes. - Implement SHCreatePropertyBagOnMemory. - Strengthen SHPropertyBag testcase in shlwapi_apitest. CORE-9283 --- dll/win32/shlwapi/CMakeLists.txt | 5 +- dll/win32/shlwapi/precomp.h | 4 + dll/win32/shlwapi/propbag.cpp | 253 +++++++++++++++++++++ dll/win32/shlwapi/shlwapi.spec | 2 +- .../rostests/apitests/shlwapi/SHPropertyBag.cpp | 132 +++++++++++ sdk/include/reactos/shlwapi_undoc.h | 2 + 6 files changed, 396 insertions(+), 2 deletions(-) diff --git a/dll/win32/shlwapi/CMakeLists.txt b/dll/win32/shlwapi/CMakeLists.txt index fcb03a15c37..87551cd21c5 100644 --- a/dll/win32/shlwapi/CMakeLists.txt +++ b/dll/win32/shlwapi/CMakeLists.txt @@ -24,6 +24,7 @@ list(APPEND SOURCE list(APPEND PCH_SKIP_SOURCE assoc.c + propbag.cpp wsprintf.c ${CMAKE_CURRENT_BINARY_DIR}/shlwapi_stubs.c) @@ -36,7 +37,9 @@ add_library(shlwapi MODULE # our C++ atlbase.h conflicts with the one from wine, so only use wine includes for C # Unfortunately, we can't use different includes for C & C++ in VS generator, so use an object library to achieve this -target_include_directories(shlwapi BEFORE PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) +target_include_directories(shlwapi BEFORE PRIVATE + ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine + ${REACTOS_SOURCE_DIR}/sdk/lib/atl) add_library(shlwapi_autocomp OBJECT autocomp.cpp) target_link_libraries(shlwapi_autocomp PRIVATE atl_classes) diff --git a/dll/win32/shlwapi/precomp.h b/dll/win32/shlwapi/precomp.h index eff450aa861..86f3ea401fd 100644 --- a/dll/win32/shlwapi/precomp.h +++ b/dll/win32/shlwapi/precomp.h @@ -28,6 +28,10 @@ #include <wine/debug.h> #include <wine/unicode.h> +#ifdef __REACTOS__ +EXTERN_C HRESULT VariantChangeTypeForRead(_Inout_ VARIANTARG *pvarg, _In_ VARTYPE vt); +#endif + #include "resource.h" #endif /* !_SHLWAPI_PCH_ */ diff --git a/dll/win32/shlwapi/propbag.cpp b/dll/win32/shlwapi/propbag.cpp new file mode 100644 index 00000000000..27434091fc3 --- /dev/null +++ b/dll/win32/shlwapi/propbag.cpp @@ -0,0 +1,253 @@ +/* + * PROJECT: ReactOS Shell + * LICENSE: LGPL-2.0-or-later (
https://spdx.org/licenses/LGPL-2.0-or-later
) + * PURPOSE: Implement shell property bags + * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#define _ATL_NO_EXCEPTIONS +#include "precomp.h" +#include <shlwapi.h> +#include <shlwapi_undoc.h> +#include <atlstr.h> // for CStringW +#include <atlsimpcoll.h> // for CSimpleMap +#include <atlcomcli.h> // for CComVariant + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +class CBasePropertyBag + : public IPropertyBag +#if (_WIN32_WINNT < _WIN32_WINNT_VISTA) + , public IPropertyBag2 +#endif +{ +protected: + LONG m_cRefs; // reference count + DWORD m_dwMode; // STGM_* flags + +public: + CBasePropertyBag(DWORD dwMode) + : m_cRefs(0) + , m_dwMode(dwMode) + { + } + + virtual ~CBasePropertyBag() { } + + // IUnknown interface + STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject) override + { +#if (_WIN32_WINNT < _WIN32_WINNT_VISTA) + if (::IsEqualGUID(riid, IID_IPropertyBag2)) + { + AddRef(); + *ppvObject = static_cast<IPropertyBag2*>(this); + return S_OK; + } +#endif + if (::IsEqualGUID(riid, IID_IUnknown) || ::IsEqualGUID(riid, IID_IPropertyBag)) + { + AddRef(); + *ppvObject = static_cast<IPropertyBag*>(this); + return S_OK; + } + return E_NOTIMPL; + } + STDMETHODIMP_(ULONG) AddRef() override + { + return ::InterlockedIncrement(&m_cRefs); + } + STDMETHODIMP_(ULONG) Release() override + { + if (::InterlockedDecrement(&m_cRefs) == 0) + { + delete this; + return 0; + } + return m_cRefs; + } + +#if (_WIN32_WINNT < _WIN32_WINNT_VISTA) + // IPropertyBag2 interface (stubs) + STDMETHODIMP Read( + _In_ ULONG cProperties, + _In_ PROPBAG2 *pPropBag, + _In_opt_ IErrorLog *pErrorLog, + _Out_ VARIANT *pvarValue, + _Out_ HRESULT *phrError) override + { + return E_NOTIMPL; + } + STDMETHODIMP Write( + _In_ ULONG cProperties, + _In_ PROPBAG2 *pPropBag, + _In_ VARIANT *pvarValue) + { + return E_NOTIMPL; + } + STDMETHODIMP CountProperties(_Out_ ULONG *pcProperties) override + { + return E_NOTIMPL; + } + STDMETHODIMP GetPropertyInfo( + _In_ ULONG iProperty, + _In_ ULONG cProperties, + _Out_ PROPBAG2 *pPropBag, + _Out_ ULONG *pcProperties) override + { + return E_NOTIMPL; + } + STDMETHODIMP LoadObject( + _In_z_ LPCWSTR pstrName, + _In_ DWORD dwHint, + _In_ IUnknown *pUnkObject, + _In_opt_ IErrorLog *pErrorLog) override + { + return E_NOTIMPL; + } +#endif +}; + +struct CPropMapEqual +{ + static bool IsEqualKey(const ATL::CStringW& k1, const ATL::CStringW& k2) + { + return k1.CompareNoCase(k2) == 0; + } + + static bool IsEqualValue(const ATL::CComVariant& v1, const ATL::CComVariant& v2) + { + return false; + } +}; + +class CMemPropertyBag : public CBasePropertyBag +{ +protected: + ATL::CSimpleMap<ATL::CStringW, ATL::CComVariant, CPropMapEqual> m_PropMap; + +public: + CMemPropertyBag(DWORD dwFlags) : CBasePropertyBag(dwFlags) { } + + STDMETHODIMP Read(_In_z_ LPCWSTR pszPropName, _Inout_ VARIANT *pvari, + _Inout_opt_ IErrorLog *pErrorLog) override; + STDMETHODIMP Write(_In_z_ LPCWSTR pszPropName, _In_ VARIANT *pvari) override; +}; + +STDMETHODIMP +CMemPropertyBag::Read( + _In_z_ LPCWSTR pszPropName, + _Inout_ VARIANT *pvari, + _Inout_opt_ IErrorLog *pErrorLog) +{ + UNREFERENCED_PARAMETER(pErrorLog); + + TRACE("%p: %s %p %p\n", this, debugstr_w(pszPropName), pvari, pErrorLog); + + VARTYPE vt = V_VT(pvari); + + ::VariantInit(pvari); + +#if (_WIN32_WINNT < _WIN32_WINNT_VISTA) + if ((m_dwMode & (STGM_READ | STGM_WRITE | STGM_READWRITE)) == STGM_WRITE) + { + ERR("%p: 0x%X\n", this, m_dwMode); + return E_ACCESSDENIED; + } +#endif + + if (!pszPropName || !pvari) + { + ERR("%p: %s %p %p\n", this, debugstr_w(pszPropName), pvari, pErrorLog); + return E_INVALIDARG; + } + + INT iItem = m_PropMap.FindKey(pszPropName); + if (iItem == -1) + { + ERR("%p: %s %p %p\n", this, debugstr_w(pszPropName), pvari, pErrorLog); + return E_FAIL; + } + + HRESULT hr = ::VariantCopy(pvari, &m_PropMap.GetValueAt(iItem)); + if (FAILED(hr)) + { + ERR("%p: 0x%08X %p\n", this, hr, pvari); + return hr; + } + + hr = ::VariantChangeTypeForRead(pvari, vt); + if (FAILED(hr)) + { + ERR("%p: 0x%08X %p\n", this, hr, pvari); + return hr; + } + + return hr; +} + +STDMETHODIMP +CMemPropertyBag::Write( + _In_z_ LPCWSTR pszPropName, + _In_ VARIANT *pvari) +{ + TRACE("%p: %s %p\n", this, debugstr_w(pszPropName), pvari); + +#if (_WIN32_WINNT < _WIN32_WINNT_VISTA) + if ((m_dwMode & (STGM_READ | STGM_WRITE | STGM_READWRITE)) == STGM_READ) + { + ERR("%p: 0x%X\n", this, m_dwMode); + return E_ACCESSDENIED; + } +#endif + + if (!pszPropName || !pvari) + { + ERR("%p: %s %p\n", this, debugstr_w(pszPropName), pvari); + return E_INVALIDARG; + } + + ATL::CComVariant vari; + HRESULT hr = vari.Copy(pvari); + if (FAILED(hr)) + { + ERR("%p: %s %p: 0x%08X\n", this, debugstr_w(pszPropName), pvari, hr); + return hr; + } + + if (!m_PropMap.SetAt(pszPropName, vari)) + { + ERR("%p: %s %p\n", this, debugstr_w(pszPropName), pvari); + return E_FAIL; + } + + return hr; +} + +/************************************************************************** + * SHCreatePropertyBagOnMemory (SHLWAPI.477) + * + * Creates a property bag object on memory. + * + * @param dwMode Specifies either STGM_READ, STGM_WRITE or STGM_READWRITE. Ignored on Vista+. + * @param riid Specifies either IID_IUnknown, IID_IPropertyBag or IID_IPropertyBag2. + * Vista+ rejects IID_IPropertyBag2. + * @param ppvObj Receives an IPropertyBag pointer. + * @return An HRESULT value. S_OK on success, non-zero on failure. + * @see
http://undoc.airesoft.co.uk/shlwapi.dll/SHCreatePropertyBagOnMemory.php
+ */ +EXTERN_C HRESULT WINAPI +SHCreatePropertyBagOnMemory(_In_ DWORD dwMode, _In_ REFIID riid, _Out_ void **ppvObj) +{ + TRACE("0x%08X, %s, %p\n", dwMode, debugstr_guid(&riid), ppvObj); + + *ppvObj = NULL; + + CComPtr<CMemPropertyBag> pMemBag(new CMemPropertyBag(dwMode)); + + HRESULT hr = pMemBag->QueryInterface(riid, ppvObj); + if (FAILED(hr)) + ERR("0x%08X %s\n", hr, debugstr_guid(&riid)); + + return hr; +} diff --git a/dll/win32/shlwapi/shlwapi.spec b/dll/win32/shlwapi/shlwapi.spec index 8dc01d454dc..0844af03d5d 100644 --- a/dll/win32/shlwapi/shlwapi.spec +++ b/dll/win32/shlwapi/shlwapi.spec @@ -474,7 +474,7 @@ 474 stub -noname SHSetIniStringUTF7W 475 stdcall -noname GetShellSecurityDescriptor(ptr long) 476 stdcall -noname SHGetObjectCompatFlags(ptr ptr) -477 stub -noname SHCreatePropertyBagOnMemory +477 stdcall -noname SHCreatePropertyBagOnMemory(long ptr ptr) 478 stdcall -noname IUnknown_TranslateAcceleratorIO(ptr ptr) 479 stdcall -noname IUnknown_UIActivateIO(ptr long ptr) 480 stdcall -noname UrlCrackW(wstr long long ptr) wininet.InternetCrackUrlW diff --git a/modules/rostests/apitests/shlwapi/SHPropertyBag.cpp b/modules/rostests/apitests/shlwapi/SHPropertyBag.cpp index 1aca2d256c0..2114ceff231 100644 --- a/modules/rostests/apitests/shlwapi/SHPropertyBag.cpp +++ b/modules/rostests/apitests/shlwapi/SHPropertyBag.cpp @@ -325,8 +325,140 @@ static void SHPropertyBag_WriteTest(void) ok_int(s_cWrite, 1); } +static void SHPropertyBag_OnMemory(void) +{ + HRESULT hr; + VARIANT vari; + + IPropertyBag *pPropBag = NULL; + hr = SHCreatePropertyBagOnMemory(STGM_READWRITE, IID_IPropertyBag, (void**)&pPropBag); + ok_long(hr, S_OK); + if (pPropBag == NULL) + { + skip("pPropBag was NULL\n"); + return; + } + + VariantInit(&vari); + hr = pPropBag->Read(L"InvalidName", &vari, NULL); + ok_long(hr, E_FAIL); + VariantClear(&vari); + + VariantInit(&vari); + V_VT(&vari) = VT_UI4; + V_UI4(&vari) = 0xDEADFACE; + hr = pPropBag->Write(L"Name1", &vari); + ok_long(hr, S_OK); + VariantClear(&vari); + + VariantInit(&vari); + hr = pPropBag->Read(L"Name1", &vari, NULL); + ok_long(hr, S_OK); + ok_long(V_VT(&vari), VT_UI4); + ok_long(V_UI4(&vari), 0xDEADFACE); + VariantClear(&vari); + + pPropBag->Release(); + pPropBag = NULL; + + hr = SHCreatePropertyBagOnMemory(STGM_READ, IID_IPropertyBag, (void**)&pPropBag); + ok_long(hr, S_OK); + + VariantInit(&vari); + V_VT(&vari) = VT_UI4; + V_UI4(&vari) = 0xDEADFACE; + hr = pPropBag->Write(L"Name1", &vari); + ok_long(hr, (IsWindowsVistaOrGreater() ? S_OK : E_ACCESSDENIED)); + VariantClear(&vari); + + VariantInit(&vari); + V_VT(&vari) = VT_UI4; + V_UI4(&vari) = 0xFEEDF00D; + hr = pPropBag->Read(L"Name1", &vari, NULL); + if (IsWindowsVistaOrGreater()) + { + ok_long(hr, S_OK); + ok_int(V_VT(&vari), VT_UI4); + ok_long(V_UI4(&vari), 0xDEADFACE); + } + else + { + ok_long(hr, E_FAIL); + ok_int(V_VT(&vari), VT_EMPTY); + ok_long(V_UI4(&vari), 0xFEEDF00D); + } + VariantClear(&vari); + + pPropBag->Release(); + pPropBag = NULL; + + hr = SHCreatePropertyBagOnMemory(STGM_WRITE, IID_IPropertyBag, (void**)&pPropBag); + ok_long(hr, S_OK); + + VariantInit(&vari); + V_VT(&vari) = VT_UI4; + V_UI4(&vari) = 0xDEADFACE; + hr = pPropBag->Write(L"Name1", &vari); + ok_long(hr, S_OK); + VariantClear(&vari); + + VariantInit(&vari); + V_VT(&vari) = VT_UI4; + V_UI4(&vari) = 0xFEEDF00D; + hr = pPropBag->Read(L"Name1", &vari, NULL); + if (IsWindowsVistaOrGreater()) + { + ok_long(hr, S_OK); + ok_int(V_VT(&vari), VT_UI4); + ok_long(V_UI4(&vari), 0xDEADFACE); + } + else + { + ok_long(hr, E_ACCESSDENIED); + ok_int(V_VT(&vari), VT_EMPTY); + ok_long(V_UI4(&vari), 0xFEEDF00D); + } + VariantClear(&vari); + + pPropBag->Release(); + + hr = SHCreatePropertyBagOnMemory(STGM_READWRITE, IID_IPropertyBag2, (void**)&pPropBag); + if (IsWindowsVistaOrGreater()) + { + ok_long(hr, E_NOINTERFACE); + } + else + { + ok_long(hr, S_OK); + pPropBag->Release(); + } + + hr = SHCreatePropertyBagOnMemory(STGM_READ, IID_IPropertyBag2, (void**)&pPropBag); + if (IsWindowsVistaOrGreater()) + { + ok_long(hr, E_NOINTERFACE); + } + else + { + ok_long(hr, S_OK); + pPropBag->Release(); + } + + hr = SHCreatePropertyBagOnMemory(STGM_WRITE, IID_IPropertyBag2, (void**)&pPropBag); + if (IsWindowsVistaOrGreater()) + { + ok_long(hr, E_NOINTERFACE); + } + else + { + ok_long(hr, S_OK); + pPropBag->Release(); + } +} + START_TEST(SHPropertyBag) { SHPropertyBag_ReadTest(); SHPropertyBag_WriteTest(); + SHPropertyBag_OnMemory(); } diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h index a50900a731e..9ed45b2c8d5 100644 --- a/sdk/include/reactos/shlwapi_undoc.h +++ b/sdk/include/reactos/shlwapi_undoc.h @@ -124,6 +124,8 @@ HRESULT WINAPI SHPropertyBag_WritePOINTL(IPropertyBag *ppb, LPCWSTR pszPropName, HRESULT WINAPI SHPropertyBag_WritePOINTS(IPropertyBag *ppb, LPCWSTR pszPropName, const POINTS *ppts); HRESULT WINAPI SHPropertyBag_WriteRECTL(IPropertyBag *ppb, LPCWSTR pszPropName, const RECTL *prcl); +HRESULT WINAPI SHCreatePropertyBagOnMemory(_In_ DWORD dwMode, _In_ REFIID riid, _Out_ void **ppvObj); + HWND WINAPI SHCreateWorkerWindowA(WNDPROC wndProc, HWND hWndParent, DWORD dwExStyle, DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra);
1 year, 4 months
1
0
0
0
[reactos] 01/01: [SHELL32] Move SheRemoveQuotesA/W to iconcache.cpp (#5529)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7100fa88544611767d100…
commit 7100fa88544611767d1006287aec507cf693b7e9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Aug 5 21:17:06 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 5 21:17:06 2023 +0900 [SHELL32] Move SheRemoveQuotesA/W to iconcache.cpp (#5529) Follow-up to #5517 (358e45d). stubs.cpp is for stub functions only. CORE-9277 --- dll/win32/shell32/iconcache.cpp | 48 +++++++++++++++++++++++++++++++++++++++++ dll/win32/shell32/stubs.cpp | 40 ---------------------------------- 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/dll/win32/shell32/iconcache.cpp b/dll/win32/shell32/iconcache.cpp index 9a55f0f9fc0..3da28ecd826 100644 --- a/dll/win32/shell32/iconcache.cpp +++ b/dll/win32/shell32/iconcache.cpp @@ -987,6 +987,54 @@ HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD l return hIcon; } +/************************************************************************* + * SheRemoveQuotesA (SHELL32.@) + */ +EXTERN_C LPSTR +WINAPI +SheRemoveQuotesA(LPSTR psz) +{ + PCHAR pch; + + if (*psz == '"') + { + for (pch = psz + 1; *pch && *pch != '"'; ++pch) + { + *(pch - 1) = *pch; + } + + if (*pch == '"') + *(pch - 1) = ANSI_NULL; + } + + return psz; +} + +/************************************************************************* + * SheRemoveQuotesW (SHELL32.@) + * + * ExtractAssociatedIconExW uses this function. + */ +EXTERN_C LPWSTR +WINAPI +SheRemoveQuotesW(LPWSTR psz) +{ + PWCHAR pch; + + if (*psz == L'"') + { + for (pch = psz + 1; *pch && *pch != L'"'; ++pch) + { + *(pch - 1) = *pch; + } + + if (*pch == L'"') + *(pch - 1) = UNICODE_NULL; + } + + return psz; +} + /************************************************************************* * ExtractAssociatedIconExW (SHELL32.@) * diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp index ec1da6daf41..f3c79305971 100644 --- a/dll/win32/shell32/stubs.cpp +++ b/dll/win32/shell32/stubs.cpp @@ -440,46 +440,6 @@ SheSetCurDrive(INT iIndex) return 1; } -EXTERN_C LPWSTR -WINAPI -SheRemoveQuotesW(LPWSTR psz) -{ - PWCHAR pch; - - if (*psz == L'"') - { - for (pch = psz + 1; *pch && *pch != L'"'; ++pch) - { - *(pch - 1) = *pch; - } - - if (*pch == L'"') - *(pch - 1) = UNICODE_NULL; - } - - return psz; -} - -EXTERN_C LPSTR -WINAPI -SheRemoveQuotesA(LPSTR psz) -{ - PCHAR pch; - - if (*psz == '"') - { - for (pch = psz + 1; *pch && *pch != '"'; ++pch) - { - *(pch - 1) = *pch; - } - - if (*pch == '"') - *(pch - 1) = ANSI_NULL; - } - - return psz; -} - /* * Unimplemented */
1 year, 4 months
1
0
0
0
[reactos] 01/01: [SHELL32][SHELL32_APITEST][SDK] Implement SheRemoveQuotesA/W (#5517)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=358e45d33a80a8db86832…
commit 358e45d33a80a8db868324cf1f477c9e24408e53 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Aug 5 19:44:13 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 5 19:44:13 2023 +0900 [SHELL32][SHELL32_APITEST][SDK] Implement SheRemoveQuotesA/W (#5517) - Implement SheRemoveQuotesA and SheRemoveQuotesW functions. - Add She testcase into shell32_apitest. - Add SheRemoveQuotesA/W into <undocshell.h>. CORE-9277 --- dll/win32/shell32/stubs.cpp | 42 ++++++++---- modules/rostests/apitests/shell32/CMakeLists.txt | 1 + modules/rostests/apitests/shell32/She.cpp | 87 ++++++++++++++++++++++++ modules/rostests/apitests/shell32/testlist.c | 2 + sdk/include/reactos/undocshell.h | 3 + 5 files changed, 123 insertions(+), 12 deletions(-) diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp index 460a423206c..ec1da6daf41 100644 --- a/dll/win32/shell32/stubs.cpp +++ b/dll/win32/shell32/stubs.cpp @@ -440,26 +440,44 @@ SheSetCurDrive(INT iIndex) return 1; } -/* - * Unimplemented - */ EXTERN_C LPWSTR WINAPI -SheRemoveQuotesW(LPWSTR lpInput) +SheRemoveQuotesW(LPWSTR psz) { - FIXME("SheRemoveQuotesW() stub\n"); - return NULL; + PWCHAR pch; + + if (*psz == L'"') + { + for (pch = psz + 1; *pch && *pch != L'"'; ++pch) + { + *(pch - 1) = *pch; + } + + if (*pch == L'"') + *(pch - 1) = UNICODE_NULL; + } + + return psz; } -/* - * Unimplemented - */ EXTERN_C LPSTR WINAPI -SheRemoveQuotesA(LPSTR lpInput) +SheRemoveQuotesA(LPSTR psz) { - FIXME("SheRemoveQuotesA() stub\n"); - return NULL; + PCHAR pch; + + if (*psz == '"') + { + for (pch = psz + 1; *pch && *pch != '"'; ++pch) + { + *(pch - 1) = *pch; + } + + if (*pch == '"') + *(pch - 1) = ANSI_NULL; + } + + return psz; } /* diff --git a/modules/rostests/apitests/shell32/CMakeLists.txt b/modules/rostests/apitests/shell32/CMakeLists.txt index 797e6e5ed1c..602e25ad199 100644 --- a/modules/rostests/apitests/shell32/CMakeLists.txt +++ b/modules/rostests/apitests/shell32/CMakeLists.txt @@ -25,6 +25,7 @@ list(APPEND SOURCE SHCreateFileDataObject.cpp SHCreateFileExtractIconW.cpp SHParseDisplayName.cpp + She.cpp ShellExecCmdLine.cpp ShellExecuteEx.cpp ShellExecuteW.cpp diff --git a/modules/rostests/apitests/shell32/She.cpp b/modules/rostests/apitests/shell32/She.cpp new file mode 100644 index 00000000000..4c2c9f4e494 --- /dev/null +++ b/modules/rostests/apitests/shell32/She.cpp @@ -0,0 +1,87 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Test for She* functions + * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#include "shelltest.h" +#include <undocshell.h> + +typedef LPSTR (WINAPI *FN_SheRemoveQuotesA)(LPSTR psz); +typedef LPWSTR (WINAPI *FN_SheRemoveQuotesW)(LPWSTR psz); + +static FN_SheRemoveQuotesA pSheRemoveQuotesA = NULL; +static FN_SheRemoveQuotesW pSheRemoveQuotesW = NULL; + +static void test_SheRemoveQuotesA(void) +{ + CHAR sz0[] = "A\"Test\""; + CHAR sz1[] = "\"Test\""; + CHAR sz2[] = "\"Test\"123"; + + BOOL bGotException = FALSE; + _SEH2_TRY + { + pSheRemoveQuotesA(NULL); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + bGotException = TRUE; + } + _SEH2_END; + ok_int(bGotException, TRUE); + + ok_ptr(pSheRemoveQuotesA(sz0), sz0); + ok_str(sz0, "A\"Test\""); + + ok_ptr(pSheRemoveQuotesA(sz1), sz1); + ok_str(sz1, "Test"); + + ok_ptr(pSheRemoveQuotesA(sz2), sz2); + ok_str(sz2, "Test"); +} + +static void test_SheRemoveQuotesW(void) +{ + WCHAR sz0[] = L"A\"Test\""; + WCHAR sz1[] = L"\"Test\""; + WCHAR sz2[] = L"\"Test\"123"; + + BOOL bGotException = FALSE; + _SEH2_TRY + { + pSheRemoveQuotesW(NULL); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + bGotException = TRUE; + } + _SEH2_END; + ok_int(bGotException, TRUE); + + ok_ptr(pSheRemoveQuotesW(sz0), sz0); + ok_wstr(sz0, L"A\"Test\""); + + ok_ptr(pSheRemoveQuotesW(sz1), sz1); + ok_wstr(sz1, L"Test"); + + ok_ptr(pSheRemoveQuotesW(sz2), sz2); + ok_wstr(sz2, L"Test"); +} + +START_TEST(She) +{ + HINSTANCE hShell32 = GetModuleHandleW(L"shell32"); + pSheRemoveQuotesA = (FN_SheRemoveQuotesA)GetProcAddress(hShell32, "SheRemoveQuotesA"); + pSheRemoveQuotesW = (FN_SheRemoveQuotesW)GetProcAddress(hShell32, "SheRemoveQuotesW"); + + if (!pSheRemoveQuotesA || !pSheRemoveQuotesW) + { + skip("SheRemoveQuotes not found"); + return; + } + + test_SheRemoveQuotesA(); + test_SheRemoveQuotesW(); +} diff --git a/modules/rostests/apitests/shell32/testlist.c b/modules/rostests/apitests/shell32/testlist.c index 5522cb0b659..2d364f19770 100644 --- a/modules/rostests/apitests/shell32/testlist.c +++ b/modules/rostests/apitests/shell32/testlist.c @@ -26,6 +26,7 @@ extern void func_SHChangeNotify(void); extern void func_SHCreateDataObject(void); extern void func_SHCreateFileDataObject(void); extern void func_SHCreateFileExtractIconW(void); +extern void func_She(void); extern void func_ShellExecCmdLine(void); extern void func_ShellExecuteEx(void); extern void func_ShellExecuteW(void); @@ -60,6 +61,7 @@ const struct test winetest_testlist[] = { "SHCreateDataObject", func_SHCreateDataObject }, { "SHCreateFileDataObject", func_SHCreateFileDataObject }, { "SHCreateFileExtractIconW", func_SHCreateFileExtractIconW }, + { "She", func_She }, { "ShellExecCmdLine", func_ShellExecCmdLine }, { "ShellExecuteEx", func_ShellExecuteEx }, { "ShellExecuteW", func_ShellExecuteW }, diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index 9196713ef6d..1d87844e1a9 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -653,6 +653,9 @@ BOOL WINAPI GUIDFromStringW( _Out_ LPGUID pguid ); +LPSTR WINAPI SheRemoveQuotesA(LPSTR psz); +LPWSTR WINAPI SheRemoveQuotesW(LPWSTR psz); + /***************************************************************************** * Shell32 resources */
1 year, 4 months
1
0
0
0
[reactos] 01/01: [SHELL32] Improve CFSDropTarget::CopyItems logic (#5481)
by Huw Campbell
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1273bbe417825fa4d6d01…
commit 1273bbe417825fa4d6d012c7d19c58637a02da46 Author: Huw Campbell <huw.campbell(a)gmail.com> AuthorDate: Sat Aug 5 20:12:36 2023 +1000 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 5 13:12:36 2023 +0300 [SHELL32] Improve CFSDropTarget::CopyItems logic (#5481) The previous version resolved the path of the parent then did logic assuming simple pidls. This now resolves each source directly. This change addresses a longstanding TODO in copying and moving to shell folders. It's a simple change, but it removes a bit of code and makes things simpler. Corresponding Wine PR:
https://gitlab.winehq.org/wine/wine/-/merge_requests/3360
--- dll/win32/shell32/droptargets/CFSDropTarget.cpp | 99 ++++++++++--------------- 1 file changed, 41 insertions(+), 58 deletions(-) diff --git a/dll/win32/shell32/droptargets/CFSDropTarget.cpp b/dll/win32/shell32/droptargets/CFSDropTarget.cpp index 7dff8fb3885..10aee5e3532 100644 --- a/dll/win32/shell32/droptargets/CFSDropTarget.cpp +++ b/dll/win32/shell32/droptargets/CFSDropTarget.cpp @@ -24,82 +24,65 @@ WINE_DEFAULT_DEBUG_CHANNEL (shell); -/**************************************************************************** - * BuildPathsList - * - * Builds a list of paths like the one used in SHFileOperation from a table of - * PIDLs relative to the given base folder - */ -static WCHAR* BuildPathsList(LPCWSTR wszBasePath, int cidl, LPCITEMIDLIST *pidls) -{ - WCHAR *pwszPathsList = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR) * cidl + 1); - WCHAR *pwszListPos = pwszPathsList; - - for (int i = 0; i < cidl; i++) - { - FileStructW* pDataW = _ILGetFileStructW(pidls[i]); - if (!pDataW) - { - ERR("Mistreating a pidl:\n"); - pdump_always(pidls[i]); - continue; - } - - PathCombineW(pwszListPos, wszBasePath, pDataW->wszName); - pwszListPos += wcslen(pwszListPos) + 1; - } - *pwszListPos = 0; - return pwszPathsList; -} /**************************************************************************** * CFSDropTarget::_CopyItems * - * copies items to this folder - * FIXME: We should not ask the parent folder: 'What is your path', and then manually build paths assuming everything is a simple pidl! - * We should be asking the parent folder: Give me a full name for this pidl (for each child!) + * copies or moves items to this folder */ HRESULT CFSDropTarget::_CopyItems(IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl, BOOL bCopy) { - LPWSTR pszSrcList; - HRESULT hr; - WCHAR wszTargetPath[MAX_PATH + 1]; + HRESULT ret; + WCHAR wszDstPath[MAX_PATH + 1] = {0}; + PWCHAR pwszSrcPathsList = (PWCHAR) HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR) * cidl + 1); + if (!pwszSrcPathsList) + return E_OUTOFMEMORY; - wcscpy(wszTargetPath, m_sPathTarget); - //Double NULL terminate. - wszTargetPath[wcslen(wszTargetPath) + 1] = '\0'; + PWCHAR pwszListPos = pwszSrcPathsList; + STRRET strretFrom; + SHFILEOPSTRUCTW fop; - TRACE ("(%p)->(%p,%u,%p)\n", this, pSFFrom, cidl, apidl); + /* Build a double null terminated list of C strings from source paths */ + for (UINT i = 0; i < cidl; i++) + { + ret = pSFFrom->GetDisplayNameOf(apidl[i], SHGDN_FORPARSING, &strretFrom); + if (FAILED(ret)) + goto cleanup; - STRRET strretFrom; - hr = pSFFrom->GetDisplayNameOf(NULL, SHGDN_FORPARSING, &strretFrom); - if (hr != S_OK) - return hr; + ret = StrRetToBufW(&strretFrom, NULL, pwszListPos, MAX_PATH); + if (FAILED(ret)) + goto cleanup; - pszSrcList = BuildPathsList(strretFrom.pOleStr, cidl, apidl); - TRACE("Source file (just the first) = %s, target path = %s, bCopy: %d\n", debugstr_w(pszSrcList), debugstr_w(m_sPathTarget), bCopy); - CoTaskMemFree(strretFrom.pOleStr); - if (!pszSrcList) - return E_OUTOFMEMORY; + pwszListPos += lstrlenW(pwszListPos) + 1; + } + /* Append the final null. */ + *pwszListPos = L'\0'; - SHFILEOPSTRUCTW op = {0}; - op.pFrom = pszSrcList; - op.pTo = wszTargetPath; - op.hwnd = m_hwndSite; - op.wFunc = bCopy ? FO_COPY : FO_MOVE; - op.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR; + /* Build a double null terminated target (this path) */ + ret = StringCchCopyW(wszDstPath, MAX_PATH, m_sPathTarget); + if (FAILED(ret)) + goto cleanup; - int res = SHFileOperationW(&op); + wszDstPath[lstrlenW(wszDstPath) + 1] = L'\0'; - HeapFree(GetProcessHeap(), 0, pszSrcList); + ZeroMemory(&fop, sizeof(fop)); + fop.hwnd = m_hwndSite; + fop.wFunc = bCopy ? FO_COPY : FO_MOVE; + fop.pFrom = pwszSrcPathsList; + fop.pTo = wszDstPath; + fop.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR; + ret = S_OK; - if (res) + if (SHFileOperationW(&fop)) { - ERR("SHFileOperationW failed with 0x%x\n", res); - return E_FAIL; + ERR("SHFileOperationW failed\n"); + ret = E_FAIL; } - return S_OK; + +cleanup: + HeapFree(GetProcessHeap(), 0, pwszSrcPathsList); + return ret; } CFSDropTarget::CFSDropTarget():
1 year, 4 months
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200