Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into windivs8
  • Loading branch information
errortek committed Apr 30, 2024
2 parents 1831718 + ae078c9 commit 8010b71
Show file tree
Hide file tree
Showing 26 changed files with 2,312 additions and 5,687 deletions.
2 changes: 2 additions & 0 deletions dll/win32/shell32/CDefView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2287,6 +2287,7 @@ LRESULT CDefView::OnChangeNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &
{
case SHCNE_MKDIR:
case SHCNE_CREATE:
case SHCNE_DRIVEADD:
if (bParent0)
{
if (LV_FindItemByPidl(ILFindLastID(Pidls[0])) == -1)
Expand All @@ -2297,6 +2298,7 @@ LRESULT CDefView::OnChangeNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &
break;
case SHCNE_RMDIR:
case SHCNE_DELETE:
case SHCNE_DRIVEREMOVED:
if (bParent0)
LV_DeleteItem(ILFindLastID(Pidls[0]));
break;
Expand Down
35 changes: 34 additions & 1 deletion dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <atlcoll.h>
#endif

#include <dbt.h>

WINE_DEFAULT_DEBUG_CHANNEL(desktop);

static const WCHAR szProgmanClassName[] = L"Progman";
Expand All @@ -45,6 +47,7 @@ class CDesktopBrowser :

CComPtr<IOleWindow> m_ChangeNotifyServer;
HWND m_hwndChangeNotifyServer;
DWORD m_dwDrives;

LRESULT _NotifyTray(UINT uMsg, WPARAM wParam, LPARAM lParam);
HRESULT _Resize();
Expand Down Expand Up @@ -85,6 +88,7 @@ class CDesktopBrowser :
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnGetChangeNotifyServer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnDeviceChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnShowOptionsDlg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);

DECLARE_WND_CLASS_EX(szProgmanClassName, CS_DBLCLKS, COLOR_DESKTOP)
Expand All @@ -99,6 +103,7 @@ BEGIN_MSG_MAP(CBaseBar)
MESSAGE_HANDLER(WM_COMMAND, OnCommand)
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
MESSAGE_HANDLER(WM_DESKTOP_GET_CNOTIFY_SERVER, OnGetChangeNotifyServer)
MESSAGE_HANDLER(WM_DEVICECHANGE, OnDeviceChange)
MESSAGE_HANDLER(WM_PROGMAN_OPENSHELLSETTINGS, OnShowOptionsDlg)
END_MSG_MAP()

Expand All @@ -112,7 +117,8 @@ END_COM_MAP()
CDesktopBrowser::CDesktopBrowser():
m_hAccel(NULL),
m_hWndShellView(NULL),
m_hwndChangeNotifyServer(NULL)
m_hwndChangeNotifyServer(NULL),
m_dwDrives(::GetLogicalDrives())
{
}

Expand Down Expand Up @@ -460,6 +466,33 @@ LRESULT CDesktopBrowser::OnGetChangeNotifyServer(UINT uMsg, WPARAM wParam, LPARA
return (LRESULT)m_hwndChangeNotifyServer;
}

// Detect DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE
LRESULT CDesktopBrowser::OnDeviceChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{
if (wParam != DBT_DEVICEARRIVAL && wParam != DBT_DEVICEREMOVECOMPLETE)
return 0;

DWORD dwDrives = ::GetLogicalDrives();
for (INT iDrive = 0; iDrive <= 'Z' - 'A'; ++iDrive)
{
WCHAR szPath[MAX_PATH];
DWORD dwBit = (1 << iDrive);
if (!(m_dwDrives & dwBit) && (dwDrives & dwBit)) // The drive is added
{
PathBuildRootW(szPath, iDrive);
SHChangeNotify(SHCNE_DRIVEADD, SHCNF_PATHW, szPath, NULL);
}
else if ((m_dwDrives & dwBit) && !(dwDrives & dwBit)) // The drive is removed
{
PathBuildRootW(szPath, iDrive);
SHChangeNotify(SHCNE_DRIVEREMOVED, SHCNF_PATHW, szPath, NULL);
}
}

m_dwDrives = dwDrives;
return 0;
}

extern VOID WINAPI ShowFolderOptionsDialog(UINT Page, BOOL Async);

LRESULT CDesktopBrowser::OnShowOptionsDlg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Expand Down
2 changes: 1 addition & 1 deletion modules/rostests/apitests/win32u/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
add_subdirectory(win32u_ros)
add_subdirectory(win32u_xpsp2)
add_subdirectory(win32u_2k3sp2)
#add_subdirectory(win32u_vista)
add_subdirectory(win32u_vista)
9 changes: 7 additions & 2 deletions modules/rostests/apitests/win32u/win32u_vista/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

spec2def(win32u_vista.spec win32u_vista.spec ADD_IMPORTLIB)
add_asm_files(win32u_vista_asm win32u_vista.S)
spec2def(win32u_vista.dll win32u_vista.spec ADD_IMPORTLIB)
add_asm_files(win32u_vista_asm sys-stubs.S)

add_library(win32u_vista MODULE
main.c
Expand All @@ -9,3 +9,8 @@ add_library(win32u_vista MODULE

set_module_type(win32u_vista module)
add_dependencies(win32u_vista psdk)
add_rostests_file(TARGET win32u_vista)

if (STACK_PROTECTOR)
target_compile_options(win32u_vista PRIVATE -fno-stack-protector)
endif()
29 changes: 29 additions & 0 deletions modules/rostests/apitests/win32u/win32u_vista/sys-stubs.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

#include <syscalls.inc>

#ifdef _M_ARM

TEXTAREA

#define SVC_(name, argcount) STUB_U name

#include "w32ksvc32.h"

END

#else

.code

SyscallId = HEX(1000)
#define SVC_(name, argcount) STUB_U name, argcount

#ifdef _WIN64
#include "w32ksvc64.h"
#else
#include "w32ksvc32.h"
#endif

END
#endif

Loading

0 comments on commit 8010b71

Please sign in to comment.