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
Zipfldr #451
Zipfldr #451
Conversation
set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) | ||
if(NOT MSVC) | ||
# HACK: this should be enabled globally! | ||
add_compile_flags_language("-std=c++11" "CXX") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry thomas ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it? AFAIK rapps builds with this flag. It must be defined somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to indicate so: https://git.reactos.org/?p=reactos.git&a=search&h=HEAD&st=grep&s=c%2B%2B11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, some stuff doesnt build like this so we keep pushing it back.
dll/shellext/zipfldr/precomp.h
Outdated
#include <assert.h> | ||
|
||
EXTERN_C | ||
ULONG DbgPrint(PCSTR Format,...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should think about moving this somewhere shared...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it already in debug.h ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boot/freeldr/freeldr/include/debug.h
That doesn't really help outside freeldr ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I thought it was also in sdk/include/reactos/debug.h.
dll/shellext/zipfldr/precomp.h
Outdated
return uRet; | ||
} | ||
|
||
#include "zlib_contrib\unzip.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slash instead of backslash?
dll/shellext/zipfldr/zipfldr.cpp
Outdated
CZipFldrModule gModule; | ||
|
||
|
||
#include "zlib_contrib\ioapi.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any plan to put the zlib_contrib into sdk/lib/3rdparty (under the name "minizip")?
#define SFVM_GET_WEBVIEW_TASKS 84 /* undocumented */ | ||
#define SFVM_GET_WEBVIEW_THEME 86 /* undocumented */ | ||
#define SFVM_GETDEFERREDVIEWSETTINGS 92 /* undocumented */ | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using some sdk/include/reactos/undocshell.h for these would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer apitests to be stand-alone.
When we will use this in the code, I'll move this somewhere shared.
return E_POINTER; | ||
|
||
if (pceltFetched) | ||
*pceltFetched = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it some kind of "FALSE"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 items fetched
private: | ||
CComPtr<IZip> spZip; | ||
bool first; | ||
CAtlList<CStringA> _returned; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't use the usual "m_Blah;" notation for class members here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rename those to be consistent.
dll/shellext/zipfldr/CZipExtract.cpp
Outdated
|
||
if (err < 0) | ||
{ | ||
__debugbreak(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these debugbreaks meant to be removed in the near future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I probably should replace them with DPRINT1 before committing.
dll/shellext/zipfldr/CZipFolder.hpp
Outdated
{ | ||
{ IDS_COL_NAME, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, 25, LVCFMT_LEFT }, | ||
{ IDS_COL_TYPE, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, 20, LVCFMT_LEFT }, | ||
{ IDS_COL_COMPRSIZE,SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, 10, LVCFMT_RIGHT }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/me suggests space after the first comma.
{ | ||
SHFILEINFOA shfi; | ||
DWORD dwAttributes = isDir ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL; | ||
ULONG_PTR firet = SHGetFileInfoA(zipEntry->Name, dwAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_TYPENAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"firet"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FileInfo RETurn
I guess, probably copied that from somwhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FileInfo-RET
STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) | ||
{ | ||
static const GUID UnknownIID = // {93F81976-6A0D-42C3-94DD-AA258A155470} | ||
{0x93F81976, 0x6A0D, 0x42C3, {0x94, 0xDD, 0xAA, 0x25, 0x8A, 0x15, 0x54, 0x70}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no existing standard name for this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently not. I did a quick googling and no one has a name for it.
{ | ||
public: | ||
|
||
CFolderViewCB() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is created for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I had some code in those that is gone now.
{ | ||
private: | ||
CComPtr<IZip> spZip; | ||
bool first; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bIsFirst
... but you don't use the usual MS style in this file, so whatever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_Zip, m_First, m_Returned
:uf(NULL) | ||
{ | ||
m_Filename = Filename; | ||
m_Directory = m_Filename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initializing those two members in initalizer list would be cleaner IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_Filename
maybe, m_Directory
no because I also modify it.
m_Filename = Filename; | ||
m_Directory = m_Filename; | ||
PWSTR Dir = m_Directory.GetBuffer(); | ||
PathRemoveExtensionW(Dir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using rvalue from GetBuffer() would be cleaner IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree :)
m_Directory.ReleaseBuffer(); | ||
} | ||
|
||
~CZipExtract() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is created for you. Maybe you wanted virtual dtor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I should call Close()
here, and warn that it wasnt closed.
{ | ||
if (uf) | ||
unzClose(uf); | ||
uf = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better IMO.
if (uf)
{
unzClose(uf);
uf = NULL;
}
{ | ||
case IDYES: return Yes; | ||
case IDYESALL: return YesToAll; | ||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems weird IMO but would work OK.
I would reorder the labels:
case IDCANCEL: return Cancel;
case IDNO: //return No;
default: return No;
HICON hIcon = LoadIcon(NULL, IDI_EXCLAMATION); | ||
SendDlgItemMessage(IDC_EXCLAMATION_ICON, STM_SETICON, (WPARAM)hIcon); | ||
|
||
/* Our CString does not support FormatMessage yet */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing it then 😺
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I were to implement every feature that shit depends on, I can commit this in about 3 year.
dll/shellext/zipfldr/CZipExtract.cpp
Outdated
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double newline.
@@ -0,0 +1,74 @@ | |||
MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think zlib_contrib should be moved to zlib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, inside our existing zlib?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being close to linux may not be bad. Some it is more easy if it's an bit more equivalent in direction linux as the "original", because later it's more easy to use with.. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blackcrack: I have no idea what you are saying here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sanchaez why, is there something else that needs it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since they come from the same source, keeping them together makes it easier to sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@learn-more
Mark, do not mob around here otherwise I'll report you to Github.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blackcrack : I don't understand your first message either...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this is a other musik :) Okey maybe a bit Awkwardly expressed :)
i have meant , because Linux use the zlib also , i have mentored to use the zlib too.
Makes may later more usable if we use it directly.. {less complications or so.. (it was just an assumption)} ;)
And GonzoMD, it must not be bad if you it not understand ;)
dll/win32/shell32/CDefView.cpp
Outdated
@@ -400,7 +402,6 @@ HRESULT WINAPI CDefView::Initialize(IShellFolder *shellFolder) | |||
{ | |||
m_pSFParent = shellFolder; | |||
shellFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, &m_pSF2Parent)); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I was experimenting with calls to the IShellFolderViewCB
;)
{ | ||
ok(!memcmp(colorData, colorDataRef, colorSize), "Expected equal colorData for %S(%lx)\n", cur.Name, cur.dwFlags); | ||
/* Incase requested filetype does not match, the exe icon is not used! */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Justin Case
😆
} | ||
|
||
{ | ||
CComPtr<IUnknown> spUnkown, spUnknown2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spUnknown
for (size_t n = 0; n < _countof(InterfaceTests); ++n) | ||
{ | ||
{ | ||
CComPtr<IUnknown> spUnkown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spUnknown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice.
if (m_bFirst && celt) | ||
{ | ||
m_bFirst = false; | ||
celt--; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah Initially I wrote this so that it could handle multiple items, to be consistent i'll leave it in.
dll/win32/shell32/CDefView.cpp
Outdated
@@ -402,6 +402,7 @@ HRESULT WINAPI CDefView::Initialize(IShellFolder *shellFolder) | |||
{ | |||
m_pSFParent = shellFolder; | |||
shellFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, &m_pSF2Parent)); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this achieve? :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It negates the removal of this line in an earlier commit.
Moved minizip to zlib/contrib, and into a static library. |
@@ -21,9 +21,22 @@ list(APPEND SOURCE | |||
infback.c | |||
uncompr.c) | |||
|
|||
list(APPEND MINIZIP_SOURCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe MiniZip deserves it's own CMakeLists.txt with a minizip target that could be included here via add_subdirectory()
?
EDIT: refer to MiniZip Makefile or Automake/Autoconf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding it inside an additional add_subdirectory
would just be a pointless indirection.
What is there to see in the Makefile?
sdk/lib/3rdparty/zlib/CMakeLists.txt
Outdated
if(CMAKE_CROSSCOMPILING) | ||
add_library(zlib ${SOURCE} ${SOLO_SOURCE}) | ||
add_library(zlib_solo ${SOLO_SOURCE}) | ||
add_library(minizip ${MINIZIP_SOURCE}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing dependency on xdk
…ncorrect. CORE-14082
CORE-7684
Icon by Jared Smudde CORE-7684
Initial implementation
JIRA issue: CORE-7684
This pr aims to cleanup this code, and get it in the tree.
Further improvements will be made later on, like fixing
SHCreateFileExtractIconW
, implementing a toolbar that will handleIExplorerCommand
etc. CORE-14175