mirror of
https://github.com/reactos/reactos.git
synced 2025-05-30 14:39:46 +00:00
[explorer_new]
- Commit a great experiment for explorer. Our explorer will try to load a library called rshell.dll which will provide an alternative implementation of some functions that are built in in windows shell. These functions are CStartMenu_Constructor, SHCreateDesktop, SHDesktopMessageLoop, WinList_Init and ShellDDEInit. Providing our own implementation for these functions will allow us to make it run in all windows versions up to windows 8 and also test the implementation of our own components that will be placed temporarily in rshell.dll while they are developed and debugged in windows. svn path=/branches/shell-experiments/; revision=61971
This commit is contained in:
parent
527f2f9057
commit
f52dad5f15
4 changed files with 178 additions and 0 deletions
|
@ -1,10 +1,13 @@
|
||||||
|
|
||||||
|
PROJECT(SHELL)
|
||||||
|
|
||||||
add_definitions(-DWIN32)
|
add_definitions(-DWIN32)
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
desktop.c
|
desktop.c
|
||||||
dragdrop.c
|
dragdrop.c
|
||||||
explorer.c
|
explorer.c
|
||||||
|
rshell.c
|
||||||
settings.c
|
settings.c
|
||||||
startmnu.c
|
startmnu.c
|
||||||
startup.c
|
startup.c
|
||||||
|
|
|
@ -166,6 +166,15 @@ GetExplorerRegValueSet(IN HKEY hKey,
|
||||||
IN LPCTSTR lpSubKey,
|
IN LPCTSTR lpSubKey,
|
||||||
IN LPCTSTR lpValue);
|
IN LPCTSTR lpValue);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rshell.c
|
||||||
|
*/
|
||||||
|
|
||||||
|
HRESULT
|
||||||
|
CStartMenu_Constructor(
|
||||||
|
REFIID riid,
|
||||||
|
void **ppv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* traywnd.c
|
* traywnd.c
|
||||||
*/
|
*/
|
||||||
|
|
162
base/shell/explorer-new/rshell.c
Normal file
162
base/shell/explorer-new/rshell.c
Normal file
|
@ -0,0 +1,162 @@
|
||||||
|
/*
|
||||||
|
* ReactOS Explorer
|
||||||
|
*
|
||||||
|
* Copyright 2014 Giannis Adamopoulos
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
typedef HRESULT(*PSTARTMENU_CONSTRUCTOR)(REFIID riid, void **ppv);
|
||||||
|
|
||||||
|
HRESULT
|
||||||
|
CStartMenu_Constructor(
|
||||||
|
REFIID riid,
|
||||||
|
void **ppv)
|
||||||
|
{
|
||||||
|
HINSTANCE hRShell = LoadLibraryW(L"rshell.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PSTARTMENU_CONSTRUCTOR func = (PSTARTMENU_CONSTRUCTOR)GetProcAddress(hRShell, "CStartMenu_Constructor");
|
||||||
|
if(func)
|
||||||
|
{
|
||||||
|
return func(riid, ppv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return CoCreateInstance(&CLSID_StartMenu,
|
||||||
|
NULL,
|
||||||
|
CLSCTX_INPROC_SERVER,
|
||||||
|
riid,
|
||||||
|
ppv);
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef HANDLE(WINAPI *PSHCREATEDESKTOP)(IShellDesktopTray *ShellDesk);
|
||||||
|
|
||||||
|
HANDLE WINAPI SHCreateDesktop(IShellDesktopTray *ShellDesk)
|
||||||
|
{
|
||||||
|
HINSTANCE hRShell = LoadLibraryW(L"rshell.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PSHCREATEDESKTOP func = (PSHCREATEDESKTOP)GetProcAddress(hRShell, "SHCreateDesktop");
|
||||||
|
if (func)
|
||||||
|
{
|
||||||
|
return func(ShellDesk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hRShell = LoadLibraryW(L"shell32.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PSHCREATEDESKTOP func = (PSHCREATEDESKTOP)GetProcAddress(hRShell, "SHCreateDesktop");
|
||||||
|
if (func)
|
||||||
|
{
|
||||||
|
return func(ShellDesk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef BOOL(WINAPI *PSHDESKTOPMESSAGELOOP)(HANDLE hDesktop);
|
||||||
|
|
||||||
|
BOOL WINAPI SHDesktopMessageLoop(HANDLE hDesktop)
|
||||||
|
{
|
||||||
|
HINSTANCE hRShell = LoadLibraryW(L"rshell.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PSHDESKTOPMESSAGELOOP func = (PSHDESKTOPMESSAGELOOP)GetProcAddress(hRShell, "SHDesktopMessageLoop");
|
||||||
|
if (func)
|
||||||
|
{
|
||||||
|
return func(hDesktop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hRShell = LoadLibraryW(L"shell32.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PSHDESKTOPMESSAGELOOP func = (PSHDESKTOPMESSAGELOOP)GetProcAddress(hRShell, "SHDesktopMessageLoop");
|
||||||
|
if (func)
|
||||||
|
{
|
||||||
|
return func(hDesktop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef DWORD(WINAPI* PWINLIST_INIT)(void);
|
||||||
|
|
||||||
|
DWORD WINAPI WinList_Init(void)
|
||||||
|
{
|
||||||
|
HINSTANCE hRShell = LoadLibraryW(L"rshell.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PWINLIST_INIT func = (PWINLIST_INIT)GetProcAddress(hRShell, "WinList_Init");
|
||||||
|
if (func)
|
||||||
|
{
|
||||||
|
return func();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hRShell = LoadLibraryW(L"shdocvw.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PWINLIST_INIT func = (PWINLIST_INIT)GetProcAddress(hRShell, "WinList_Init");
|
||||||
|
if (func)
|
||||||
|
{
|
||||||
|
return func();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef void (WINAPI *PSHELLDDEINIT)(BOOL bInit);
|
||||||
|
|
||||||
|
void WINAPI ShellDDEInit(BOOL bInit)
|
||||||
|
{
|
||||||
|
HINSTANCE hRShell = LoadLibraryW(L"rshell.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PSHELLDDEINIT func = (PSHELLDDEINIT)GetProcAddress(hRShell, "ShellDDEInit");
|
||||||
|
if (func)
|
||||||
|
{
|
||||||
|
func(bInit);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hRShell = LoadLibraryW(L"shell32.dll");
|
||||||
|
|
||||||
|
if (hRShell)
|
||||||
|
{
|
||||||
|
PSHELLDDEINIT func = (PSHELLDDEINIT)GetProcAddress(hRShell, "ShellDDEInit");
|
||||||
|
if (func)
|
||||||
|
{
|
||||||
|
func(bInit);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -848,11 +848,15 @@ CreateStartMenu(IN ITrayWindow *Tray,
|
||||||
if (pSms == NULL)
|
if (pSms == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
#if 0
|
||||||
hr = CoCreateInstance(&CLSID_StartMenu,
|
hr = CoCreateInstance(&CLSID_StartMenu,
|
||||||
NULL,
|
NULL,
|
||||||
CLSCTX_INPROC_SERVER,
|
CLSCTX_INPROC_SERVER,
|
||||||
&IID_IMenuPopup,
|
&IID_IMenuPopup,
|
||||||
(PVOID *)&pMp);
|
(PVOID *)&pMp);
|
||||||
|
#else
|
||||||
|
hr = CStartMenu_Constructor(&IID_IMenuPopup,(PVOID *)&pMp);
|
||||||
|
#endif
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
DbgPrint("CoCreateInstance failed: %x\n", hr);
|
DbgPrint("CoCreateInstance failed: %x\n", hr);
|
||||||
|
|
Loading…
Reference in a new issue