RapidCRC-Unicode icon indicating copy to clipboard operation
RapidCRC-Unicode copied to clipboard

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

Open tERyceNzAchE opened this issue 3 years ago • 6 comments

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.

tERyceNzAchE avatar Mar 01 '21 22:03 tERyceNzAchE

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.

OV2 avatar Mar 01 '21 23:03 OV2

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.

tERyceNzAchE avatar Mar 01 '21 23:03 tERyceNzAchE

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.

OV2 avatar Mar 02 '21 00:03 OV2

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.

tERyceNzAchE avatar Mar 22 '21 16:03 tERyceNzAchE

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

OV2 avatar Mar 22 '21 16:03 OV2

Can you use IFileSaveDialog::SetSaveAsItem ?

tERyceNzAchE avatar Mar 22 '21 16:03 tERyceNzAchE