diff --git a/reactos/subsys/system/explorer/explorer.cpp b/reactos/subsys/system/explorer/explorer.cpp index 277c6939396..c8b2932fba2 100644 --- a/reactos/subsys/system/explorer/explorer.cpp +++ b/reactos/subsys/system/explorer/explorer.cpp @@ -38,6 +38,8 @@ #include "explorer_intres.h" +#include + ExplorerGlobals g_Globals; diff --git a/reactos/subsys/system/explorer/explorer_intres.rc b/reactos/subsys/system/explorer/explorer_intres.rc index 1baa05fb933..8633ba0ef1b 100644 --- a/reactos/subsys/system/explorer/explorer_intres.rc +++ b/reactos/subsys/system/explorer/explorer_intres.rc @@ -8,8 +8,10 @@ // Generated from the TEXTINCLUDE 2 resource. // #ifndef _ROS_ +#ifndef __WINE__ #include "afxres.h" #endif +#endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -140,9 +142,8 @@ IDB_LOGOV BITMAP DISCARDABLE "res/logov.bmp" IDA_EXPLORER ACCELERATORS DISCARDABLE BEGIN - "X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT - "S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, - NOINVERT + 0x58, ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT + 0x53, ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, NOINVERT END #endif // Neutral resources diff --git a/reactos/subsys/system/explorer/shell/filechild.cpp b/reactos/subsys/system/explorer/shell/filechild.cpp index 6813c0e86d8..189e6bdea4a 100644 --- a/reactos/subsys/system/explorer/shell/filechild.cpp +++ b/reactos/subsys/system/explorer/shell/filechild.cpp @@ -89,15 +89,15 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info) #ifdef __linux__ if (info._etype == ET_UNIX) { - _root.drive_type = GetDriveType(path); + _root._drive_type = GetDriveType(info._path); _tsplitpath(info._path, drv, NULL, NULL, NULL); lstrcat(drv, TEXT("/")); - lstrcpy(_root.volname, TEXT("root fs")); - _root.fs_flags = 0; - lstrcpy(_root.fs, TEXT("unixfs")); - lstrcpy(_root.path, TEXT("/")); - _root._entry = new UnixDirectory(_root._path, info._path); + lstrcpy(_root._volname, TEXT("root fs")); + _root._fs_flags = 0; + lstrcpy(_root._fs, TEXT("unixfs")); + lstrcpy(_root._path, TEXT("/")); + _root._entry = new UnixDirectory(_root._path); entry = _root._entry->read_tree(info._path, SORT_NAME/*_sortOrder*/); } else diff --git a/reactos/subsys/system/explorer/shell/mainframe.cpp b/reactos/subsys/system/explorer/shell/mainframe.cpp index 4f2c3c8d74b..40e7947a5a7 100644 --- a/reactos/subsys/system/explorer/shell/mainframe.cpp +++ b/reactos/subsys/system/explorer/shell/mainframe.cpp @@ -33,6 +33,8 @@ #include "../explorer_intres.h" +//#include // for _splitpath() + MainFrame::MainFrame(HWND hwnd) : super(hwnd) diff --git a/reactos/subsys/system/explorer/shell/unixfs.cpp b/reactos/subsys/system/explorer/shell/unixfs.cpp index 2ca30d12eff..7b965934cb4 100644 --- a/reactos/subsys/system/explorer/shell/unixfs.cpp +++ b/reactos/subsys/system/explorer/shell/unixfs.cpp @@ -37,11 +37,10 @@ // for UnixDirectory::read_directory() #include #include -#include #include -void UnixDirectory::read_directory(LPCTSTR path) +void UnixDirectory::read_directory() { Entry* first_entry = NULL; Entry* last = NULL; @@ -49,6 +48,7 @@ void UnixDirectory::read_directory(LPCTSTR path) int level = _level + 1; + LPCTSTR path = (LPCTSTR)_path; DIR* pdir = opendir(path); if (pdir) { @@ -63,7 +63,9 @@ void UnixDirectory::read_directory(LPCTSTR path) *p++ = '/'; while((ent=readdir(pdir))) { - if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + int statres = stat(buffer, &st); + + if (!statres && S_ISDIR(st.st_mode)) entry = new UnixDirectory(this, buffer); else entry = new UnixEntry(this); @@ -72,46 +74,46 @@ void UnixDirectory::read_directory(LPCTSTR path) first_entry = entry; if (last) - last->next = entry; + last->_next = entry; - lstrcpy(entry->data.cFileName, ent->d_name); - entry->data.dwFileAttributes = ent->d_name[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0; + lstrcpy(entry->_data.cFileName, ent->d_name); + entry->_data.dwFileAttributes = ent->d_name[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0; strcpy(p, ent->d_name); - if (!stat(buffer, &st)) { + if (!statres) { if (S_ISDIR(st.st_mode)) - entry->data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY; + entry->_data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY; - entry->data.nFileSizeLow = st.st_size & 0xFFFFFFFF; - entry->data.nFileSizeHigh = st.st_size >> 32; + entry->_data.nFileSizeLow = st.st_size & 0xFFFFFFFF; + entry->_data.nFileSizeHigh = st.st_size >> 32; - memset(&entry->data.ftCreationTime, 0, sizeof(FILETIME)); - time_to_filetime(&st.st_atime, &entry->data.ftLastAccessTime); - time_to_filetime(&st.st_mtime, &entry->data.ftLastWriteTime); + memset(&entry->_data.ftCreationTime, 0, sizeof(FILETIME)); + time_to_filetime(&st.st_atime, &entry->_data.ftLastAccessTime); + time_to_filetime(&st.st_mtime, &entry->_data.ftLastWriteTime); - entry->bhfi.nFileIndexLow = ent->d_ino; - entry->bhfi.nFileIndexHigh = 0; + entry->_bhfi.nFileIndexLow = ent->d_ino; + entry->_bhfi.nFileIndexHigh = 0; - entry->bhfi.nNumberOfLinks = st.st_nlink; + entry->_bhfi.nNumberOfLinks = st.st_nlink; - entry->bhfi_valid = TRUE; + entry->_bhfi_valid = TRUE; } else { - entry->data.nFileSizeLow = 0; - entry->data.nFileSizeHigh = 0; - entry->bhfi_valid = FALSE; + entry->_data.nFileSizeLow = 0; + entry->_data.nFileSizeHigh = 0; + entry->_bhfi_valid = FALSE; } - entry->down = NULL; - entry->up = dir; - entry->expanded = FALSE; - entry->scanned = FALSE; - entry->level = level; + entry->_down = NULL; + entry->_up = this; + entry->_expanded = FALSE; + entry->_scanned = FALSE; + entry->_level = level; last = entry; } - last->next = NULL; + last->_next = NULL; closedir(pdir); } @@ -142,9 +144,9 @@ Entry* UnixDirectory::find_entry(const void* p) { LPCTSTR name = (LPCTSTR)p; - for(Entry*entry=_down; entry; entry=entry->next) { + for(Entry*entry=_down; entry; entry=entry->_next) { LPCTSTR p = name; - LPCTSTR q = entry->data.cFileName; + LPCTSTR q = entry->_data.cFileName; do { if (!*p || *p==TEXT('/')) @@ -162,7 +164,7 @@ void UnixEntry::get_path(PTSTR path) const int level = 0; int len = 0; - for(Entry* entry=this; entry; level++) { + for(const Entry* entry=this; entry; level++) { LPCTSTR name = entry->_data.cFileName; int l = 0; diff --git a/reactos/subsys/system/explorer/shell/unixfs.h b/reactos/subsys/system/explorer/shell/unixfs.h index 304773f42fe..fc7812c7667 100644 --- a/reactos/subsys/system/explorer/shell/unixfs.h +++ b/reactos/subsys/system/explorer/shell/unixfs.h @@ -47,7 +47,7 @@ struct UnixDirectory : public UnixEntry, public Directory } UnixDirectory(UnixDirectory* parent, LPCTSTR path) - : UnixEntry(parent), + : UnixEntry(parent) { _path = _tcsdup(path); } diff --git a/reactos/subsys/system/explorer/taskbar/startmenu.cpp b/reactos/subsys/system/explorer/taskbar/startmenu.cpp index ad03d712e88..bed72362954 100644 --- a/reactos/subsys/system/explorer/taskbar/startmenu.cpp +++ b/reactos/subsys/system/explorer/taskbar/startmenu.cpp @@ -798,7 +798,7 @@ void StartMenuRoot::ShowRestartDialog(HWND hwndOwner, UINT flags) RESTARTWINDOWSDLG RestartDlg = (RESTARTWINDOWSDLG)GetProcAddress(hShell32, (LPCSTR)59); if (RestartDlg) - RestartDlg(hwndOwner, L"You selected .\n\n", flags); //TODO: ANSI string conversion if needed + RestartDlg(hwndOwner, (LPWSTR)L"You selected .\n\n", flags); //TODO: ANSI string conversion if needed } void StartMenuRoot::ShowSearchDialog() diff --git a/reactos/subsys/system/explorer/utility/dragdropimpl.cpp b/reactos/subsys/system/explorer/utility/dragdropimpl.cpp index bf61a78bf2b..28107abb454 100644 --- a/reactos/subsys/system/explorer/utility/dragdropimpl.cpp +++ b/reactos/subsys/system/explorer/utility/dragdropimpl.cpp @@ -325,7 +325,7 @@ EnumFormatEtcImpl::EnumFormatEtcImpl(const StorageArray& ArrFE) m_pFmtEtc.push_back(*it->_format); } -STDMETHODIMP EnumFormatEtcImpl::QueryInterface(REFIID refiid, void FAR* FAR* ppv) +STDMETHODIMP EnumFormatEtcImpl::QueryInterface(REFIID refiid, void** ppv) { *ppv = NULL; if (IID_IUnknown==refiid || IID_IEnumFORMATETC==refiid) @@ -356,7 +356,7 @@ STDMETHODIMP_(ULONG) EnumFormatEtcImpl::Release(void) return nTemp; } -STDMETHODIMP EnumFormatEtcImpl::Next( ULONG celt,LPFORMATETC lpFormatEtc, ULONG FAR *pceltFetched) +STDMETHODIMP EnumFormatEtcImpl::Next( ULONG celt,LPFORMATETC lpFormatEtc, ULONG* pceltFetched) { if (pceltFetched != NULL) *pceltFetched=0; @@ -395,7 +395,7 @@ STDMETHODIMP EnumFormatEtcImpl::Reset(void) return S_OK; } -STDMETHODIMP EnumFormatEtcImpl::Clone(IEnumFORMATETC FAR * FAR*ppCloneEnumFormatEtc) +STDMETHODIMP EnumFormatEtcImpl::Clone(IEnumFORMATETC** ppCloneEnumFormatEtc) { if (ppCloneEnumFormatEtc == NULL) return E_POINTER; diff --git a/reactos/subsys/system/explorer/utility/dragdropimpl.h b/reactos/subsys/system/explorer/utility/dragdropimpl.h index 068a62be225..249d65e760c 100644 --- a/reactos/subsys/system/explorer/utility/dragdropimpl.h +++ b/reactos/subsys/system/explorer/utility/dragdropimpl.h @@ -34,15 +34,15 @@ class EnumFormatEtcImpl : public IEnumFORMATETC EnumFormatEtcImpl(const StorageArray& ArrFE); //IUnknown members - STDMETHOD(QueryInterface)(REFIID, void FAR* FAR*); + STDMETHOD(QueryInterface)(REFIID, void**); STDMETHOD_(ULONG, AddRef)(void); STDMETHOD_(ULONG, Release)(void); //IEnumFORMATETC members - STDMETHOD(Next)(ULONG, LPFORMATETC, ULONG FAR *); + STDMETHOD(Next)(ULONG, LPFORMATETC, ULONG*); STDMETHOD(Skip)(ULONG); STDMETHOD(Reset)(void); - STDMETHOD(Clone)(IEnumFORMATETC FAR * FAR*); + STDMETHOD(Clone)(IEnumFORMATETC**); }; /////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/reactos/subsys/system/explorer/utility/shellclasses.h b/reactos/subsys/system/explorer/utility/shellclasses.h index a1b68967456..2340afae5f5 100644 --- a/reactos/subsys/system/explorer/utility/shellclasses.h +++ b/reactos/subsys/system/explorer/utility/shellclasses.h @@ -742,7 +742,7 @@ struct SpecialFolderPath : public ShellPath { SpecialFolderPath(int folder, HWND hwnd) { - HRESULT hr = SHGetSpecialFolderLocation(hwnd, folder, &_p); + /*HRESULT hr = */SHGetSpecialFolderLocation(hwnd, folder, &_p); } }; diff --git a/reactos/subsys/system/explorer/utility/utility.h b/reactos/subsys/system/explorer/utility/utility.h index 3c19ffa06ea..59a2fc145a5 100644 --- a/reactos/subsys/system/explorer/utility/utility.h +++ b/reactos/subsys/system/explorer/utility/utility.h @@ -42,25 +42,40 @@ #include // for alloca() #include +#include // for _MAX_DIR, ... +#include // for sprintf() #include +#ifndef _MAX_PATH +#define _MAX_DRIVE 3 +#define _MAX_FNAME 256 +#define _MAX_DIR _MAX_FNAME +#define _MAX_EXT _MAX_FNAME +#define _MAX_PATH 260 +#endif + #ifndef BTNS_BUTTON #define BTNS_BUTTON TBSTYLE_BUTTON //missing in old mingw headers #define BTNS_SEP TBSTYLE_SEP #define BTNS_NOPREFIX TBSTYLE_NOPREFIX #endif + #ifndef TB_HITTEST //missing in mingw headers #define TB_HITTEST (WM_USER+69) #endif + #ifndef TB_GETBUTTONINFO //missing in mingw headers #define TB_GETBUTTONINFO (WM_USER+65) #endif + +#ifndef __WINE__ #ifndef SFGAO_HIDDEN //SFGAO_GHOSTED wrong defined, SFGAO_HIDDEN missing in mingw headers #define SFGAO_HIDDEN 0x00080000L #undef SFGAO_GHOSTED #define SFGAO_GHOSTED 0x00008000L #endif +#endif @@ -438,6 +453,22 @@ extern "C" { #endif +#ifdef __WINE__ +#ifdef UNICODE +extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); +#else +extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext); +#endif +#endif + +#ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED +#define FILE_ATTRIBUTE_ENCRYPTED 0x00000040 +#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 +#endif + + #define SetDlgCtrlID(hwnd, id) SetWindowLong(hwnd, GWL_ID, id) #define SetWindowStyle(hwnd, val) (DWORD)SetWindowLong(hwnd, GWL_STYLE, val) #define SetWindowExStyle(h, val) (DWORD)SetWindowLong(hwnd, GWL_EXSTYLE, val) diff --git a/reactos/subsys/system/explorer/utility/window.h b/reactos/subsys/system/explorer/utility/window.h index e5085c8968a..febd1209d4d 100644 --- a/reactos/subsys/system/explorer/utility/window.h +++ b/reactos/subsys/system/explorer/utility/window.h @@ -473,7 +473,7 @@ struct ToolTip : public WindowHandle void add(HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK) { TOOLINFO ti = { - sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND/*|TTF_TRANSPARENT*/, hparent, (UINT)htool, 0, 0, 0, 0, 0, 0, 0 + sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND/*|TTF_TRANSPARENT*/, hparent, (UINT)htool, {0,0,0,0}, 0, 0, 0 }; ti.lpszText = (LPTSTR) txt;