Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exports/Imports table in win32 shell ext page showing blank rows #413

Open
ksharperd opened this issue Apr 10, 2024 · 21 comments
Open

Exports/Imports table in win32 shell ext page showing blank rows #413

ksharperd opened this issue Apr 10, 2024 · 21 comments
Assignees
Labels
Milestone

Comments

@ksharperd
Copy link

Issue

Exports/Imports table in win32 shell ext page showing blank rows, but Copy/Export works fine.
image

OS Version

Windows 10 Build 19045.4291

Details

I'm using locally built version(with commit fcfeea7) without any change.
configured with cmake . -G "Visual Studio 14 2015" -A "x64" -DCMAKE_SYSTEM_VERSION="8.1" -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION="8.1" and build with 'Release' config since there is a build error when i try to build with WinSDK 10 or newer Visual Studio version.

**this issue has occurred two or three weeks ago though.

@GerbilSoft
Copy link
Owner

GerbilSoft commented Apr 13, 2024

I've seen the ListView issue happen occasionally but I thought I had that fixed...

Can you post the build errors you're encountering with later versions of Visual Studio and/or the Windows 10 SDK? I've been using MSVC 2022 for release builds (v143 for most architectures; v141_xp for i386) without any issues.

@GerbilSoft GerbilSoft self-assigned this Apr 14, 2024
@GerbilSoft GerbilSoft added the bug label Apr 14, 2024
@GerbilSoft GerbilSoft added this to the 2.4 milestone Apr 14, 2024
@GerbilSoft
Copy link
Owner

I've managed to reproduce this error in the debug build, and it isn't the same issue I was seeing before. The issue I was seeing before was on all ListViews. This one seems to just be for the import/export tables.

@GerbilSoft
Copy link
Owner

Commit 59c3d23 should fix this.

@GerbilSoft
Copy link
Owner

Reopening because I'd still like to know what was causing build issues with later versions of MSVC, since I can't reproduce it here.

@GerbilSoft GerbilSoft reopened this Apr 16, 2024
@ksharperd
Copy link
Author

ksharperd commented Apr 16, 2024

Reopening because I'd still like to know what was causing build issues with later versions of MSVC, since I can't reproduce it here.

@GerbilSoft sorry for my late replay :(
to repro, i config with cmake .. -G "Visual Studio 17 2022" -A "x64" and build with cmake --build ./ --config Release

this is my binlog obtained from msbuild: https://litter.catbox.moe/rtz3ug.binlog

**u can use https://msbuildlog.com/ to open *.binlog

GerbilSoft added a commit that referenced this issue Apr 16, 2024
…f Windows headers have already been included.

I can't reproduce this issue locally, but I received a report about this
from a user who was using the Windows 11 SDK (10.0.22621.0) with
MSVC 2022.

See #413: Exports/Imports table in win32 shell ext page showing blank rows
Reported by @ksharperd.
@GerbilSoft
Copy link
Owner

Looks like it was a conflict between the EXE parser's custom headers and the Windows SDK headers, though I'm not sure why it didn't show up on my system, even with the same MSVC and SDK version...

Try building the latest commit with MSVC 2022 and SDK 10.0.22621.0 and let me know if you encounter any more errors.

@ksharperd
Copy link
Author

latest commit seems solve redefinition error, but build still encountered some errors: https://litter.catbox.moe/qc1yic.binlog

GerbilSoft added a commit that referenced this issue Apr 16, 2024
…d in the Windows SDK.

See #413: Exports/Imports table in win32 shell ext page showing blank rows
Reported by @ksharperd.
@GerbilSoft
Copy link
Owner

It seems IMAGE_IMPORT_DIRECTORY is not defined in the Windows SDK. Reworked that so it's unconditionally defined by exe_pe_structs.h.

GerbilSoft added a commit that referenced this issue Apr 16, 2024
…lso not present in the Windows SDK.

See #413: Exports/Imports table in win32 shell ext page showing blank rows
Reported by @ksharperd.
@GerbilSoft
Copy link
Owner

...and the IMAGE_DATA_DIRECTORY_* constants.

GerbilSoft added a commit that referenced this issue Apr 16, 2024
…ined in the Windows SDK.

See #413: Exports/Imports table in win32 shell ext page showing blank rows
Reported by @ksharperd.
@GerbilSoft
Copy link
Owner

I believe that should be all of it now. Try building again.

@ksharperd
Copy link
Author

still catch some build errors, i can successfully build with my addition changes: https://litter.catbox.moe/g688xp.patch

@GerbilSoft
Copy link
Owner

Pushed some more changes that should hopefully fix everything that was in that patch.

@ksharperd
Copy link
Author

thanks for investigate! but i still got these errors while building latest commit

rom-properties\src\libromdata\disc\PEResourceReader.cpp(784,31): error C2664: 'LibRpFile::IRpFilePtr LibRomData::PEResourceReader::open(uint16_t,int,int)': cannot conver
t argument 1 from 'LPWSTR' to 'uint16_t'
rom-properties\src\libromdata\disc\NEResourceReader.cpp(699,31): error C2664: 'LibRpFile::IRpFilePtr LibRomData::NEResourceReader::open(uint16_t,int,int)': cannot conver
t argument 1 from 'LPWSTR' to 'uint16_t'

should we add a overload for it?

@GerbilSoft
Copy link
Owner

Should be working now. Please re-test and let me know if there are any other issues.

@ksharperd
Copy link
Author

Should be working now. Please re-test and let me know if there are any other issues.

unfortunately not :(
latest binlog: https://files.catbox.moe/u18mlq.binlog

@GerbilSoft
Copy link
Owner

Added another attempt at a workaround in commit ed2999e. Please try that out and let me know how it goes.

@ksharperd
Copy link
Author

ksharperd commented Jun 2, 2024

Added another attempt at a workaround in commit ed2999e. Please try that out and let me know how it goes.

I can confirm that this commit fixes the build issue, but try to open shell ext page will crash the explorer with 0xc0000005.

*Edit: romdata-5.dll cause the crash, i will attach this file alongside with other components since i'm not comfortable with Windows debugging : )
binaries: https://files.catbox.moe/i77kne.7z
crash dump: https://files.catbox.moe/7s78ye.dmp

@GerbilSoft
Copy link
Owner

GerbilSoft commented Jun 2, 2024

From WinDbg:

0:021> k
 # Child-SP          RetAddr           Call Site
00 00000000`1037d278 00007ffe`a3d8bea0 ntdll!NtWaitForMultipleObjects+0x14
01 00000000`1037d280 00007ffe`a3d8bd9e KERNELBASE!WaitForMultipleObjectsEx+0xf0
02 00000000`1037d570 00007ffe`a4a5f93a KERNELBASE!WaitForMultipleObjects+0xe
03 00000000`1037d5b0 00007ffe`a4a5f376 kernel32!WerpReportFaultInternal+0x58a
04 00000000`1037d6d0 00007ffe`a3e5da19 kernel32!WerpReportFault+0xbe
05 00000000`1037d710 00007ffe`a67822c9 KERNELBASE!UnhandledExceptionFilter+0x3d9
06 00000000`1037d830 00007ffe`a6782d82 ntdll!TppExceptionFilter+0x75
07 00000000`1037d870 00007ffe`a67156ce ntdll!TppWorkerpInnerExceptionFilter+0x1a
08 00000000`1037d8a0 00007ffe`a66fca06 ntdll!TppWorkerThread$filt$5+0x19
09 00000000`1037d8e0 00007ffe`a670cc9e ntdll!_C_specific_handler+0x96
0a 00000000`1037d950 00007ffe`a671247f ntdll!_GSHandlerCheck_SEH+0x6a
0b 00000000`1037d980 00007ffe`a66c14b4 ntdll!RtlpExecuteHandlerForException+0xf
0c 00000000`1037d9b0 00007ffe`a6710f8e ntdll!RtlDispatchException+0x244
0d 00000000`1037e0c0 00007ffe`7345ba98 ntdll!KiUserExceptionDispatch+0x2e
*** WARNING: Unable to verify timestamp for romdata-5.dll
0e 00000000`1037e7c0 00000000`00000030 romdata_5!LibRpFile::RpFilePrivate::reOpenFile+0x3e8
0f 00000000`1037e7c8 00000000`00000000 0x30

From Visual Studio 2022:

>	romdata-5.dll!LibRpFile::RpFilePrivate::reOpenFile(void)	C++
 	romdata-5.dll!LibRpFile::RpFile::init(void)	C++
 	romdata-5.dll!LibRpFile::RpFile::RpFile(wchar_t const *,enum LibRpFile::RpFile::FileMode)	C++
 	romdata-5.dll!std::make_shared<class LibRomData::XboxDisc,class std::shared_ptr<class LibRpFile::IRpFile> const &>(class std::shared_ptr<class LibRpFile::IRpFile> const &)	C++
 	romdata-5.dll!LibRomData::RomDataFactory::create(wchar_t const *,unsigned int)	C++
 	rom-properties.dll!RP_ShellPropSheetExt::Initialize(struct _ITEMIDLIST const *,struct IDataObject *,struct HKEY__ *)	C++

Visual Studio doesn't seem to want to map the dump file and PDBs to the original source code, which is making this difficult to debug. I'll try to reproduce it with a local build.

EDIT: I can't seem to reproduce this locally... In Visual Studio, can you use "Attach to Process", attach to explorer.exe, then try to reproduce the crash and take a screenshot of where Visual Studio shows the exception?

@ksharperd
Copy link
Author

ksharperd commented Jun 2, 2024

From WinDbg:

0:021> k
 # Child-SP          RetAddr           Call Site
00 00000000`1037d278 00007ffe`a3d8bea0 ntdll!NtWaitForMultipleObjects+0x14
01 00000000`1037d280 00007ffe`a3d8bd9e KERNELBASE!WaitForMultipleObjectsEx+0xf0
02 00000000`1037d570 00007ffe`a4a5f93a KERNELBASE!WaitForMultipleObjects+0xe
03 00000000`1037d5b0 00007ffe`a4a5f376 kernel32!WerpReportFaultInternal+0x58a
04 00000000`1037d6d0 00007ffe`a3e5da19 kernel32!WerpReportFault+0xbe
05 00000000`1037d710 00007ffe`a67822c9 KERNELBASE!UnhandledExceptionFilter+0x3d9
06 00000000`1037d830 00007ffe`a6782d82 ntdll!TppExceptionFilter+0x75
07 00000000`1037d870 00007ffe`a67156ce ntdll!TppWorkerpInnerExceptionFilter+0x1a
08 00000000`1037d8a0 00007ffe`a66fca06 ntdll!TppWorkerThread$filt$5+0x19
09 00000000`1037d8e0 00007ffe`a670cc9e ntdll!_C_specific_handler+0x96
0a 00000000`1037d950 00007ffe`a671247f ntdll!_GSHandlerCheck_SEH+0x6a
0b 00000000`1037d980 00007ffe`a66c14b4 ntdll!RtlpExecuteHandlerForException+0xf
0c 00000000`1037d9b0 00007ffe`a6710f8e ntdll!RtlDispatchException+0x244
0d 00000000`1037e0c0 00007ffe`7345ba98 ntdll!KiUserExceptionDispatch+0x2e
*** WARNING: Unable to verify timestamp for romdata-5.dll
0e 00000000`1037e7c0 00000000`00000030 romdata_5!LibRpFile::RpFilePrivate::reOpenFile+0x3e8
0f 00000000`1037e7c8 00000000`00000000 0x30

From Visual Studio 2022:

>	romdata-5.dll!LibRpFile::RpFilePrivate::reOpenFile(void)	C++
 	romdata-5.dll!LibRpFile::RpFile::init(void)	C++
 	romdata-5.dll!LibRpFile::RpFile::RpFile(wchar_t const *,enum LibRpFile::RpFile::FileMode)	C++
 	romdata-5.dll!std::make_shared<class LibRomData::XboxDisc,class std::shared_ptr<class LibRpFile::IRpFile> const &>(class std::shared_ptr<class LibRpFile::IRpFile> const &)	C++
 	romdata-5.dll!LibRomData::RomDataFactory::create(wchar_t const *,unsigned int)	C++
 	rom-properties.dll!RP_ShellPropSheetExt::Initialize(struct _ITEMIDLIST const *,struct IDataObject *,struct HKEY__ *)	C++

Visual Studio doesn't seem to want to map the dump file and PDBs to the original source code, which is making this difficult to debug. I'll try to reproduce it with a local build.

EDIT: I can't seem to reproduce this locally... In Visual Studio, can you use "Attach to Process", attach to explorer.exe, then try to reproduce the crash and take a screenshot of where Visual Studio shows the exception?

yes i can see the cause:

RpFile_scsi_win32.cpp:67
d->filename was nullptr

btw, hitting exception seems make everything freeze except cursor(even Visual Studio itself is unclickable), but i can still catch the error fortunately 😂

GerbilSoft added a commit that referenced this issue Jun 2, 2024
…enameW, not d->filename.

d->filename is usually nullptr at this point on Windows.

Also, ensure that d->filenameW is neither NULL nor an empty string.
It shouldn't happen, but a redundant check is better than a crash.

See #413: Exports/Imports table in win32 shell ext page showing blank rows
Reported by @ksharperd.
@GerbilSoft
Copy link
Owner

Looks like the problem is RpFile_scsi_win32 wasn't updated to use d->filenameW. I'm not sure why I wasn't hitting this issue locally...

Updated it to use d->filenameW, plus a NULL pointer check.

@ksharperd
Copy link
Author

Looks like the problem is RpFile_scsi_win32 wasn't updated to use d->filenameW. I'm not sure why I wasn't hitting this issue locally...

Updated it to use d->filenameW, plus a NULL pointer check.

yeah, it fix the crash but rom properties tab just disappear.

image

i guess we need more work to make newer win-sdk version work, a long journey... isn't it? 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants