OV2 / RapidCRC-Unicode

Windows tool to quickly create and verify hash checksums
https://www.ov2.eu/programs/rapidcrc-unicode
GNU General Public License v2.0
295 stars 30 forks source link

Files hashed, but save dialog will not show. (Windows 10) #82

Open tERyceNzAchE opened 3 years ago

tERyceNzAchE commented 3 years ago

This is a very rare case. Test files: https://www.transfernow.net/2cHPkG032021

  1. Extract files to root directory.
  2. Go to: C:\_Torrents\Completed\PMP Exam Prep Seminar - Pass the PMP on Your First Attempt\Udemy - PMP Exam Prep Seminar - Pass the PMP on Your First Attempt - (2021-01 Update)\
  3. Right-click on the folder 1. Preparing to Pass the PMP and select RapidCRC🠖Create SHA256

Files will hash but the save dialog will not appear when using SHA/BLAKE as the hash. but works when using MD5.

OV2 commented 3 years ago

This seems to be an issue with the window "Save As" dialog, when the initial filename is longer than 250 characters. I'll have to investigate if there is an alternative.

tERyceNzAchE commented 3 years ago

Agree that it looks like a long path issue. However it's working for MD5 when the path+filename is 257 characters.

In my example above the path+filename for the SHA256 would be exactly 260 characters.

OV2 commented 3 years ago

You need one character for the string end character, so that is most likely why the GetSaveDialog function throws an error in this case with all extensions longer than 5 characters.

tERyceNzAchE commented 3 years ago

Can you try sending the string prefixed with \\?\ ? It seems like this might resolve the issue.

Reference: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#maxpath

For file I/O, the "\?\" prefix to a path string tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the file system. For example, if the file system supports large paths and file names, you can exceed the MAX_PATH limits that are otherwise enforced by the Windows APIs. For more information about the normal maximum path limitation, see the previous section Maximum Path Length Limitation.

OV2 commented 3 years ago

That is what RCRC uses internally, but the windows save/load dialogs do not support this notation.

tERyceNzAchE commented 3 years ago

Can you use IFileSaveDialog::SetSaveAsItem ?