fire-eggs / DarkThumbs

Adds thumbnail preview to Windows Explorer for EPUB, FB2, DJVU and Kindle ebooks; 7Z, CB7, CBZ, CBR, RAR and ZIP archives.
452 stars 23 forks source link

To investigate: replacing CreateStreamOnHGlobal with SHCreateMemStream #12

Closed fire-eggs closed 1 year ago

fire-eggs commented 3 years ago

Would eliminate the need for GlobalAlloc call when creating the thumbnail.

https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-shcreatememstream?redirectedfrom=MSDN

https://www.vbforums.com/showthread.php?878101-RESOLVED-GlobalAlloc-without-GlobalFree

fire-eggs commented 1 year ago

Code has been changed to use SHCreateMemStream instead of CreateStreamOnHGlobal. Seems to be fine.

The GlobalAlloc hasn't been removed. The file within the archive needs to be unpacked somewhere and the buffer created via GlobalAlloc is working. Don't mess with working.