diff --git a/base/shell/explorer/explorer.cpp b/base/shell/explorer/explorer.cpp index 140a1e93ffa..9f9d6d1ca39 100644 --- a/base/shell/explorer/explorer.cpp +++ b/base/shell/explorer/explorer.cpp @@ -49,6 +49,31 @@ static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize) } } +static void +InitializeServerAdminUI() +{ + HKEY hKey = SHGetShellKey(SHKEY_Root_HKCU | SHKEY_Key_Explorer, L"Advanced", TRUE); + if (!hKey) + return; + + DWORD value, size = sizeof(value), type; + DWORD error = SHGetValueW(hKey, NULL, L"ServerAdminUI", &type, &value, &size); + if (error || type != REG_DWORD || size != sizeof(value)) + { + // The value doesn't exist or is invalid, calculate and apply a default value + value = IsOS(OS_ANYSERVER) && IsUserAnAdmin(); + SHSetValueW(hKey, NULL, L"ServerAdminUI", REG_DWORD, &value, sizeof(value)); + if (value) + { + // TODO: Apply registry tweaks with RegInstallW; RegServerAdmin in the REGINST resource in shell32. + #if !ROSPOLICY_SHELL_NODEFKEYBOARDCUES + SystemParametersInfo(SPI_SETKEYBOARDCUES, 0, IntToPtr(TRUE), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + #endif + } + } + RegCloseKey(hKey); +} + #if !WIN7_DEBUG_MODE static BOOL SetShellReadyEvent(IN LPCWSTR lpEventName) @@ -179,6 +204,8 @@ StartWithDesktop(IN HINSTANCE hInstance) /* Initialize CLSID_ShellWindows class */ _WinList_Init(); + InitializeServerAdminUI(); + CComPtr Tray; CreateTrayWindow(&Tray); diff --git a/dll/cpl/sysdm/advanced.c b/dll/cpl/sysdm/advanced.c index 4b8c0bd6929..8fcdbada295 100644 --- a/dll/cpl/sysdm/advanced.c +++ b/dll/cpl/sysdm/advanced.c @@ -9,8 +9,8 @@ */ #include "precomp.h" -#define WIN32_NO_STATUS -#include "pstypes.h" /* SharedUserData */ +#define NTOS_MODE_USER +#include /* For SharedUserData */ static TCHAR BugLink[] = _T("http://jira.reactos.org/"); static TCHAR ReportAsWorkstationKey[] = _T("SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version"); @@ -56,7 +56,7 @@ OnInitSysSettingsDialog(HWND hwndDlg) DWORD dwVal = 0; DWORD dwType = REG_DWORD; DWORD cbData = sizeof(DWORD); - BOOL ReportAsWorkstation = SharedUserData->NtProductType == VER_NT_WORKSTATION; + BOOL ReportAsWorkstation = SharedUserData->NtProductType == NtProductWinNt; if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, ReportAsWorkstationKey, @@ -71,7 +71,7 @@ OnInitSysSettingsDialog(HWND hwndDlg) (LPBYTE)&dwVal, &cbData) == ERROR_SUCCESS) { - if (cbData == sizeof(DWORD)) + if (dwType == REG_DWORD && cbData == sizeof(DWORD)) ReportAsWorkstation = dwVal != FALSE; } diff --git a/dll/ntdll/rtl/version.c b/dll/ntdll/rtl/version.c index 63f94592f88..df567251977 100644 --- a/dll/ntdll/rtl/version.c +++ b/dll/ntdll/rtl/version.c @@ -53,11 +53,11 @@ SetRosSpecificInfo(IN OUT PRTL_OSVERSIONINFOEXW VersionInformation) (kvpInfo->Type == REG_DWORD) && (kvpInfo->DataLength == sizeof(ULONG))) { - ULONG IsWorkstation = SharedUserData->NtProductType == NtProductWinNt; - ULONG ReportAsWorkstation = (*(PULONG)kvpInfo->Data) != 0; + BOOLEAN IsWorkstation = SharedUserData->NtProductType == NtProductWinNt; + BOOLEAN ReportAsWorkstation = (*(PULONG)kvpInfo->Data) != 0; if (IsWorkstation != ReportAsWorkstation) { - g_ReportProductType = ReportAsWorkstation ? NtProductWinNt : NtProductServer; + g_ReportProductType = ReportAsWorkstation ? VER_NT_WORKSTATION : VER_NT_SERVER; } } @@ -73,7 +73,7 @@ SetRosSpecificInfo(IN OUT PRTL_OSVERSIONINFOEXW VersionInformation) } else { - g_ReportProductType = -1; + g_ReportProductType = -1; /* No override, caller gets the real value */ } } diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp index 00b98cd07f3..acd7965e688 100644 --- a/dll/win32/browseui/shellbrowser.cpp +++ b/dll/win32/browseui/shellbrowser.cpp @@ -886,27 +886,18 @@ HRESULT CShellBrowser::CreateRelativeBrowsePIDL(LPCITEMIDLIST relative, UINT Sbs HRESULT CShellBrowser::BrowseToPIDL(LPCITEMIDLIST pidl, long flags) { + // Called by shell view to browse to new folder + // also called by explorer band to navigate to new folder CComPtr newFolder; FOLDERSETTINGS newFolderSettings = m_deffoldersettings.FolderSettings; - HRESULT hResult; - CLSID clsid; - BOOL HasIconViewType; - // called by shell view to browse to new folder - // also called by explorer band to navigate to new folder - hResult = SHBindToFolder(pidl, &newFolder); - if (FAILED_UNEXPECTEDLY(hResult)) - return hResult; - // HACK & FIXME: Get view mode from shellbag when fully implemented. - IUnknown_GetClassID(newFolder, &clsid); - HasIconViewType = clsid == CLSID_MyComputer || clsid == CLSID_ControlPanel || - clsid == CLSID_ShellDesktop; + HRESULT hr = SHBindToFolder(pidl, &newFolder); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; - if (HasIconViewType) - newFolderSettings.ViewMode = FVM_ICON; - hResult = BrowseToPath(newFolder, pidl, &newFolderSettings, flags); - if (FAILED_UNEXPECTEDLY(hResult)) - return hResult; + hr = BrowseToPath(newFolder, pidl, &newFolderSettings, flags); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; return S_OK; } @@ -1095,8 +1086,22 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder, absolutePIDL = fCurrentDirectoryPIDL; // create view window - hResult = newShellView->CreateViewWindow(saveCurrentShellView, folderSettings, - this, &shellViewWindowBounds, &newShellViewWindow); + SHELLVIEWID vid; + SV2CVW2_PARAMS cvw2 = { sizeof(cvw2), saveCurrentShellView, folderSettings, this, &shellViewWindowBounds, NULL }; + + CComPtr newShellView2; + if (SUCCEEDED(newShellView->QueryInterface(IID_PPV_ARG(IShellView2, &newShellView2)))) + { + if (SUCCEEDED(newShellView2->GetView(&vid, SV2GV_DEFAULTVIEW))) + cvw2.pvid = &vid; + hResult = newShellView2->CreateViewWindow2(&cvw2); + } + else + { + hResult = newShellView->CreateViewWindow(cvw2.psvPrev, cvw2.pfs, this, cvw2.prcView, &cvw2.hwndView); + } + newShellViewWindow = cvw2.hwndView; + if (FAILED_UNEXPECTEDLY(hResult) || newShellViewWindow == NULL) { fCurrentShellView = saveCurrentShellView; diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index d2c41bf5b30..eab3a239c52 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -217,6 +217,10 @@ static inline COLORREF GetViewColor(COLORREF Clr, UINT SysFallback) return Clr != CLR_INVALID ? Clr : GetSysColor(SysFallback); } +#define VID_Default ( *(const SHELLVIEWID*)&IID_CDefView ) +extern HRESULT ShellViewIdToFolderViewMode(const SHELLVIEWID *pVid); +extern const SHELLVIEWID* FolderViewModeToShellViewId(UINT FVM); + class CDefView : public CWindowImpl, public CComObjectRootEx, @@ -370,6 +374,11 @@ public: return 0; } + static inline bool IsSupportedFolderViewMode(int Mode) + { + return Mode >= FVM_FIRST && Mode <= FVM_DETAILS; // We don't support Tile nor Thumbstrip + } + // *** IOleWindow methods *** STDMETHOD(GetWindow)(HWND *lphwnd) override; STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) override; @@ -388,7 +397,7 @@ public: STDMETHOD(GetItemObject)(UINT uItem, REFIID riid, void **ppv) override; // *** IShellView2 methods *** - STDMETHOD(GetView)(SHELLVIEWID *view_guid, ULONG view_type) override; + STDMETHOD(GetView)(SHELLVIEWID *pVid, ULONG view_type) override; STDMETHOD(CreateViewWindow2)(LPSV2CVW2_PARAMS view_params) override; STDMETHOD(HandleRename)(LPCITEMIDLIST new_pidl) override; STDMETHOD(SelectAndPositionItem)(LPCITEMIDLIST item, UINT flags, POINT *point) override; @@ -839,10 +848,7 @@ LRESULT CDefView::OnUpdateStatusbar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOO // creates the list view window BOOL CDefView::CreateList() { - HRESULT hr; DWORD dwStyle, dwExStyle, ListExStyle; - UINT ViewMode; - TRACE("%p\n", this); dwStyle = WS_TABSTOP | WS_VISIBLE | WS_CHILDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | @@ -865,16 +871,6 @@ BOOL CDefView::CreateList() #endif } - ViewMode = m_FolderSettings.ViewMode; - hr = _DoFolderViewCB(SFVM_DEFVIEWMODE, 0, (LPARAM)&ViewMode); - if (SUCCEEDED(hr)) - { - if (ViewMode >= FVM_FIRST && ViewMode <= FVM_LAST) - m_FolderSettings.ViewMode = ViewMode; - else - ERR("Ignoring invalid ViewMode from SFVM_DEFVIEWMODE: %u (was: %u)\n", ViewMode, m_FolderSettings.ViewMode); - } - switch (m_FolderSettings.ViewMode) { case FVM_ICON: @@ -3578,7 +3574,7 @@ FOLDERVIEWMODE CDefView::GetDefaultViewMode() { FOLDERVIEWMODE mode = ((m_FolderSettings.fFlags & FWF_DESKTOP) || !IsOS(OS_SERVERADMINUI)) ? FVM_ICON : FVM_DETAILS; FOLDERVIEWMODE temp = mode; - if (SUCCEEDED(_DoFolderViewCB(SFVM_DEFVIEWMODE, 0, (LPARAM)&temp)) && temp >= FVM_FIRST && temp <= FVM_LAST) + if (SUCCEEDED(_DoFolderViewCB(SFVM_DEFVIEWMODE, 0, (LPARAM)&temp)) && IsSupportedFolderViewMode(temp)) mode = temp; return mode; } @@ -3803,10 +3799,22 @@ HRESULT STDMETHODCALLTYPE CDefView::SelectAndPositionItems(UINT cidl, PCUITEMID_ // IShellView2 implementation -HRESULT STDMETHODCALLTYPE CDefView::GetView(SHELLVIEWID *view_guid, ULONG view_type) +HRESULT STDMETHODCALLTYPE CDefView::GetView(SHELLVIEWID *pVid, ULONG view_type) { - FIXME("(%p)->(%p, %lu) stub\n", this, view_guid, view_type); - return E_NOTIMPL; + if (view_type == SV2GV_DEFAULTVIEW) + { + *pVid = VID_Default; + return S_OK; + } + if (view_type == SV2GV_CURRENTVIEW) + view_type = m_FolderSettings.ViewMode; + if ((int)view_type < 0) + return E_UNEXPECTED; + + if (!IsSupportedFolderViewMode(view_type += FVM_FIRST)) + return E_INVALIDARG; + *pVid = *FolderViewModeToShellViewId(view_type); + return S_OK; } HRESULT STDMETHODCALLTYPE CDefView::CreateViewWindow2(LPSV2CVW2_PARAMS view_params) @@ -3835,9 +3843,6 @@ HRESULT STDMETHODCALLTYPE CDefView::CreateViewWindow3(IShellBrowser *psb, IShell if (view_flags & ~SUPPORTED_SV3CVW3) FIXME("unsupported view flags 0x%08x\n", view_flags & ~SUPPORTED_SV3CVW3); - if (mode == FVM_AUTO) - mode = GetDefaultViewMode(); - /* Set up the member variables */ m_pShellBrowser = psb; m_FolderSettings.ViewMode = mode; @@ -3845,23 +3850,23 @@ HRESULT STDMETHODCALLTYPE CDefView::CreateViewWindow3(IShellBrowser *psb, IShell if (view_id) { - if (IsEqualIID(*view_id, VID_LargeIcons)) - m_FolderSettings.ViewMode = FVM_ICON; - else if (IsEqualIID(*view_id, VID_SmallIcons)) - m_FolderSettings.ViewMode = FVM_SMALLICON; - else if (IsEqualIID(*view_id, VID_List)) - m_FolderSettings.ViewMode = FVM_LIST; - else if (IsEqualIID(*view_id, VID_Details)) - m_FolderSettings.ViewMode = FVM_DETAILS; - else if (IsEqualIID(*view_id, VID_Thumbnails)) - m_FolderSettings.ViewMode = FVM_THUMBNAIL; - else if (IsEqualIID(*view_id, VID_Tile)) - m_FolderSettings.ViewMode = FVM_TILE; - else if (IsEqualIID(*view_id, VID_ThumbStrip)) - m_FolderSettings.ViewMode = FVM_THUMBSTRIP; + FOLDERVIEWMODE temp = (FOLDERVIEWMODE)ShellViewIdToFolderViewMode(view_id); + if (IsSupportedFolderViewMode(temp)) + mode = temp; + else if (*view_id == VID_Default) + mode = FVM_AUTO; else FIXME("Ignoring unrecognized VID %s\n", debugstr_guid(view_id)); } + if (mode == FVM_AUTO) + m_FolderSettings.ViewMode = GetDefaultViewMode(); + + if (!IsSupportedFolderViewMode(m_FolderSettings.ViewMode)) + { + ERR("Ignoring %s FVM %u\n", FolderViewModeToShellViewId(m_FolderSettings.ViewMode) + ? "unsupported" : "invalid", m_FolderSettings.ViewMode); + m_FolderSettings.ViewMode = FVM_ICON; + } const UINT requestedViewMode = m_FolderSettings.ViewMode; /* Get our parent window */ diff --git a/dll/win32/shell32/CDefViewUtil.cpp b/dll/win32/shell32/CDefViewUtil.cpp index 3996b0d3891..eb79f33ce3c 100644 --- a/dll/win32/shell32/CDefViewUtil.cpp +++ b/dll/win32/shell32/CDefViewUtil.cpp @@ -31,6 +31,38 @@ public: } }; +HRESULT +ShellViewIdToFolderViewMode(const SHELLVIEWID *pVid) +{ + if (IsEqualIID(*pVid, VID_LargeIcons)) + return FVM_ICON; + else if (IsEqualIID(*pVid, VID_SmallIcons)) + return FVM_SMALLICON; + else if (IsEqualIID(*pVid, VID_List)) + return FVM_LIST; + else if (IsEqualIID(*pVid, VID_Details)) + return FVM_DETAILS; + else if (IsEqualIID(*pVid, VID_Thumbnails)) + return FVM_THUMBNAIL; + else if (IsEqualIID(*pVid, VID_Tile)) + return FVM_TILE; + else if (IsEqualIID(*pVid, VID_ThumbStrip)) + return FVM_THUMBSTRIP; + return E_UNEXPECTED; +} + +const SHELLVIEWID * +FolderViewModeToShellViewId(UINT FVM) +{ + static const SHELLVIEWID *vids[] = { + &VID_LargeIcons, &VID_SmallIcons, + &VID_Details, &VID_Thumbnails, + &VID_Tile, &VID_ThumbStrip, + }; + FVM -= FVM_FIRST; + return FVM < _countof(vids) ? vids[FVM] : NULL; +} + // This class adapts the legacy function callback to work as an IShellFolderViewCB class CShellFolderViewCBWrapper : public CComObjectRootEx, diff --git a/dll/win32/shell32/folders/CControlPanelFolder.cpp b/dll/win32/shell32/folders/CControlPanelFolder.cpp index f66018e9fd0..c901dfda8d7 100644 --- a/dll/win32/shell32/folders/CControlPanelFolder.cpp +++ b/dll/win32/shell32/folders/CControlPanelFolder.cpp @@ -378,7 +378,7 @@ HRESULT WINAPI CControlPanelFolder::CreateViewObject(HWND hwndOwner, REFIID riid WARN("IContextMenu not implemented\n"); hr = E_NOTIMPL; } else if (IsEqualIID(riid, IID_IShellView)) { - SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this}; + SFV_CREATE sfvparams = { sizeof(SFV_CREATE), this , NULL, this }; hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut); } } @@ -660,6 +660,23 @@ HRESULT WINAPI CControlPanelFolder::GetCurFolder(PIDLIST_ABSOLUTE * pidl) return S_OK; } +HRESULT WINAPI CControlPanelFolder::MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case SFVM_DEFVIEWMODE: + { +#if ROSPOLICY_SHELLFOLDER_DEFLARGEICONS & ( 1 << (PT_CONTROLS_NEWREGITEM >> 4) ) + *((FOLDERVIEWMODE*)lParam) = FVM_ICON; +#else + *((FOLDERVIEWMODE*)lParam) = IsOS(OS_SERVERADMINUI) ? FVM_LIST : FVM_ICON; +#endif + return S_OK; + } + } + return E_NOTIMPL; +} + CCPLItemMenu::CCPLItemMenu() { m_apidl = NULL; diff --git a/dll/win32/shell32/folders/CControlPanelFolder.h b/dll/win32/shell32/folders/CControlPanelFolder.h index 282ca461315..27f1e73e1d2 100644 --- a/dll/win32/shell32/folders/CControlPanelFolder.h +++ b/dll/win32/shell32/folders/CControlPanelFolder.h @@ -26,7 +26,8 @@ class CControlPanelFolder : public CComCoClass, public CComObjectRootEx, public IShellFolder2, - public IPersistFolder2 + public IPersistFolder2, + public IShellFolderViewCB { private: /* both paths are parsible from the desktop */ @@ -70,6 +71,9 @@ class CControlPanelFolder : // IPersistFolder2 STDMETHOD(GetCurFolder)(PIDLIST_ABSOLUTE * pidl) override; + // IShellFolderViewCB + STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override; + DECLARE_REGISTRY_RESOURCEID(IDR_CONTROLPANEL) DECLARE_NOT_AGGREGATABLE(CControlPanelFolder) @@ -81,6 +85,7 @@ class CControlPanelFolder : COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder) COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2) COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist) + COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB) END_COM_MAP() }; diff --git a/dll/win32/shell32/folders/CDesktopFolder.cpp b/dll/win32/shell32/folders/CDesktopFolder.cpp index 3999df2d481..1a532278d14 100644 --- a/dll/win32/shell32/folders/CDesktopFolder.cpp +++ b/dll/win32/shell32/folders/CDesktopFolder.cpp @@ -1092,6 +1092,11 @@ HRESULT WINAPI CDesktopFolderViewCB::MessageSFVCB(UINT uMsg, WPARAM wParam, LPAR { switch (uMsg) { +#if ROSPOLICY_SHELLFOLDER_DEFLARGEICONS & ( 1 << (PT_DESKTOP_REGITEM >> 4) ) + case SFVM_DEFVIEWMODE: // CDesktopBrowser always forces FVM_ICON. + *((FOLDERVIEWMODE*)lParam) = FVM_ICON; // This sets the default for generic browsers. + return S_OK; +#endif case SFVM_VIEWRELEASE: m_pShellView = NULL; return S_OK; diff --git a/dll/win32/shell32/folders/CDrivesFolder.cpp b/dll/win32/shell32/folders/CDrivesFolder.cpp index 5fcf9d94a7e..965441cad3f 100644 --- a/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -867,8 +867,8 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO } else if (IsEqualIID(riid, IID_IShellView)) { - SFV_CREATE sfvparams = { sizeof(SFV_CREATE), this, NULL, static_cast(this) }; - hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut); + SFV_CREATE sfvparams = { sizeof(SFV_CREATE), this, NULL, this }; + hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut); } TRACE("-- (%p)->(interface=%p)\n", this, ppvOut); return hr; @@ -1284,6 +1284,21 @@ HRESULT WINAPI CDrivesFolder::ShouldShow(IShellFolder *psf, PCIDLIST_ABSOLUTE pi return S_OK; } +HRESULT WINAPI CDrivesFolder::MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) +{ +#if ROSPOLICY_SHELLFOLDER_DEFLARGEICONS & ( 1 << (PT_COMPUTER_REGITEM >> 4) ) + switch (uMsg) + { + case SFVM_DEFVIEWMODE: + { + *((FOLDERVIEWMODE*)lParam) = FVM_ICON; + return S_OK; + } + } +#endif + return E_NOTIMPL; +} + /************************************************************************/ /* IContextMenuCB interface */ diff --git a/dll/win32/shell32/folders/CDrivesFolder.h b/dll/win32/shell32/folders/CDrivesFolder.h index 74cb2bef455..61bfa9be956 100644 --- a/dll/win32/shell32/folders/CDrivesFolder.h +++ b/dll/win32/shell32/folders/CDrivesFolder.h @@ -79,7 +79,7 @@ class CDrivesFolder : STDMETHOD(CallBack)(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override; // IShellFolderViewCB - STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override { return E_NOTIMPL; } + STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override; // IFolderFilter STDMETHOD(ShouldShow)(IShellFolder *psf, PCIDLIST_ABSOLUTE pidlFolder, PCUITEMID_CHILD pidlItem) override; diff --git a/dll/win32/shlwapi/ordinal.c b/dll/win32/shlwapi/ordinal.c index 3646c54153c..1aa73bc16c2 100644 --- a/dll/win32/shlwapi/ordinal.c +++ b/dll/win32/shlwapi/ordinal.c @@ -4225,8 +4225,21 @@ BOOL WINAPI IsOS(DWORD feature) FIXME("(OS_TABLETPC) What should we return here?\n"); return FALSE; case OS_SERVERADMINUI: +#ifdef __REACTOS__ + { + DWORD value = FALSE, size = sizeof(value); + HKEY hKey = SHGetShellKey(SHKEY_Root_HKCU | SHKEY_Key_Explorer, L"Advanced", FALSE); + if (hKey) + { + SHQueryValueExW(hKey, L"ServerAdminUI", NULL, NULL, &value, &size); + RegCloseKey(hKey); + } + ISOS_RETURN(value); + } +#else FIXME("(OS_SERVERADMINUI) What should we return here?\n"); return FALSE; +#endif case OS_MEDIACENTER: FIXME("(OS_MEDIACENTER) What should we return here?\n"); return FALSE; diff --git a/modules/rostests/apitests/ntdll/RtlGetNtProductType.c b/modules/rostests/apitests/ntdll/RtlGetNtProductType.c index 29051810ec2..1d221a854cf 100644 --- a/modules/rostests/apitests/ntdll/RtlGetNtProductType.c +++ b/modules/rostests/apitests/ntdll/RtlGetNtProductType.c @@ -135,8 +135,8 @@ START_TEST(RtlGetNtProductType) if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version", 0, KEY_READ | KEY_WRITE, &hKey) == ERROR_SUCCESS) { - DWORD cb = sizeof(DWORD); - if (RegQueryValueExW(hKey, L"ReportAsWorkstation", NULL, NULL, (PBYTE)&ReportAsWorkstation, &cb)) + DWORD cb = sizeof(ReportAsWorkstation); + if (RegQueryValueExW(hKey, L"ReportAsWorkstation", NULL, NULL, (PBYTE)&ReportAsWorkstation, &cb) != ERROR_SUCCESS) ReportAsWorkstation = 0xbaadf00d; RegDeleteValueW(hKey, L"ReportAsWorkstation"); RegCloseKey(hKey); @@ -178,13 +178,12 @@ START_TEST(RtlGetNtProductType) ok_char(ChangeNtProductType(ProductType), TRUE); - /* Restore ReportAsWorkstation */ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version", 0, KEY_WRITE, &hKey) == ERROR_SUCCESS) { if (ReportAsWorkstation != 0xbaadf00d) - RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (PBYTE)&ReportAsWorkstation, sizeof(DWORD)); + RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (PBYTE)&ReportAsWorkstation, sizeof(ReportAsWorkstation)); RegCloseKey(hKey); } } diff --git a/sdk/include/psdk/shobjidl.idl b/sdk/include/psdk/shobjidl.idl index 777cfde2e4a..89b6fd2a21b 100644 --- a/sdk/include/psdk/shobjidl.idl +++ b/sdk/include/psdk/shobjidl.idl @@ -793,6 +793,9 @@ interface IShellView : IOleWindow interface IShellView2 : IShellView { typedef GUID SHELLVIEWID; +cpp_quote("#define SV2GV_CURRENTVIEW ((UINT)-1)") +cpp_quote("#define SV2GV_DEFAULTVIEW ((UINT)-2)") + cpp_quote("#include ") typedef struct _SV2CVW2_PARAMS { diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index 52ef6f27f0b..ee4ec17d422 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -19,6 +19,14 @@ #ifndef __WINE_UNDOCSHELL_H #define __WINE_UNDOCSHELL_H +// Because ReactOS installs as Server by default, we ignore OS_SERVERADMINUI +// in certain places to present a Client/Server hybrid UI. + +// Windows defaults to FVM_DETAILS for Administrators on OS_ANYSERVER (instead of FVM_ICON). +#define ROSPOLICY_SHELLFOLDER_DEFLARGEICONS ( ~0UL ) + +#define ROSPOLICY_SHELL_NODEFKEYBOARDCUES 1 + #ifdef __cplusplus extern "C" { #endif /* defined(__cplusplus) */