Commit 2afe205e authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Convert dll registration to the IRegistrar mechanism.

parent 6dcf94b2
......@@ -25,7 +25,6 @@ C_SRCS = \
iconcache.c \
pidl.c \
recyclebin.c \
regsvr.c \
shell32_main.c \
shelldispatch.c \
shellitem.c \
......@@ -91,6 +90,8 @@ PO_SRCS = shell32.rc
IDL_TLB_SRCS = shell32_tlb.idl
IDL_R_SRCS = shell32_classes.idl
SVG_SRCS = \
cdrom.svg \
control.svg \
......
......@@ -263,6 +263,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
/* @makedep: shell32_tlb.tlb */
1 TYPELIB shell32_tlb.tlb
/* @makedep: shell32.rgs */
1 WINE_REGISTRY shell32.rgs
shv_accel ACCELERATORS
BEGIN
VK_F5, FCIDM_SHVIEW_REFRESH, VIRTKEY
......
HKCR
{
NoRemove CLSID
{
'{00021400-0000-0000-C000-000000000046}' { val LocalizedString = s '@%MODULE%,-20' }
'{20D04FE0-3AEA-1069-A2D8-08002B30309D}' { val LocalizedString = s '@%MODULE%,-21' }
'{21EC2020-3AEA-1069-A2DD-08002B30309D}' { val LocalizedString = s '@%MODULE%,-22' }
'{450D8FBA-AD25-11D0-98A8-0800361B1103}' { val LocalizedString = s '@%MODULE%,-46' }
'{645FF040-5081-101B-9F08-00AA002F954E}'
{
val LocalizedString = s '@%MODULE%,-8964'
DefaultIcon = s '@%MODULE%,-33'
}
'{00021401-0000-0000-C000-000000000046}' { shellex { MayChangeDefaultMenu } }
}
}
HKLM
{
NoRemove Software
{
NoRemove Microsoft
{
NoRemove Windows
{
NoRemove CurrentVersion
{
NoRemove Explorer
{
NoRemove Desktop
{
NoRemove Namespace
{
'{450D8FBA-AD25-11D0-98A8-0800361B1103}' = s 'My Documents'
'{645FF040-5081-101B-9F08-00AA002F954E}' = s 'Trash'
'{9D20AAE8-0625-44B0-9CA7-71889C2254D9}' = s '/'
}
}
NoRemove MyComputer
{
NoRemove Namespace
{
'{21EC2020-3AEA-1069-A2DD-08002B30309D}' = s 'Control Panel'
}
}
}
}
}
}
}
}
/*
* Coclasses for shell32
*
* Copyright 2011 Alexandre Julliard
*
* 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 St, Fifth Floor, Boston, MA 02110-1301, USA
*/
[
helpstring("Shell Automation Service"),
progid("Shell.Application.1"),
vi_progid("Shell.Application"),
threading(apartment),
uuid(13709620-c279-11ce-a49e-444553540000)
]
coclass Shell { interface IShellDispatch; }
[
helpstring("Printers and Faxes"),
threading(apartment),
uuid(2227a280-3aea-1069-a2de-08002b30309d)
]
coclass Printers { interface IShellFolder2; }
[
helpstring("Explorer Browser"),
threading(apartment),
uuid(71f96385-ddd6-48d3-a0c1-ae06e8b055fb)
]
coclass ExplorerBrowser { interface IExplorerBrowser; }
[
helpstring("Known Folder Manager"),
threading(apartment),
uuid(4df0c730-df9d-4ae3-9153-aa6b82e9795a)
]
coclass KnownFolderManager { interface IKnownFolderManager; }
[
helpstring("Microsoft Shell Folder View Router"),
threading(apartment),
uuid(9ba05971-f6a8-11cf-a442-00a0c90a8f39)
] coclass ShellFolderViewOC { }
[
helpstring("Query file associations"),
threading(apartment),
uuid(a07034fd-6caa-4954-ac3f-97a27216f98a)
] coclass QueryAssociations { interface IQueryAssociations; }
[
helpstring("Shell Drag and Drop Helper"),
threading(apartment),
uuid(4657278a-411b-11d2-839a-00c04fd918d0)
] coclass DragDropHelper { interface IDropTargetHelper; }
[
threading(apartment),
uuid(00bb2763-6a77-11d0-a535-00c04fd7d062)
] coclass AutoComplete { interface IAutoComplete2; }
[
helpstring("Shell File System Folder"),
threading(apartment),
uuid(f3364ba0-65b9-11ce-a9ba-00aa004ae837)
] coclass ShellFSFolder { interface IShellFolder2; }
[
helpstring("My Network Places"),
threading(apartment),
uuid(208d2c60-3aea-1069-a2d7-08002b30309d)
] coclass NetworkPlaces { interface IShellFolder2; }
[
helpstring("Desktop"),
threading(apartment),
uuid(00021400-0000-0000-c000-000000000046)
] coclass ShellDesktop { interface IShellFolder2; }
[
helpstring("Shortcut"),
threading(apartment),
uuid(00021401-0000-0000-c000-000000000046)
] coclass ShellLink { interface IShellLinkW; }
[
helpstring("My Computer"),
threading(apartment),
uuid(20d04fe0-3aea-1069-a2d8-08002b30309d)
] coclass MyComputer { interface IShellFolder2; }
[
threading(apartment),
uuid(0afaced1-e828-11d1-9187-b532f1e9575d)
] coclass FolderShortcut { interface IShellFolder2; }
[
helpstring("/"),
threading(apartment),
uuid(cc702eb2-7dc5-11d9-c687-0004238a01cd)
] coclass UnixFolder { interface IShellFolder2; }
[
helpstring("/"),
threading(apartment),
uuid(9d20aae8-0625-44b0-9ca7-71889c2254d9)
] coclass UnixDosFolder { interface IShellFolder2; }
[
helpstring("My Documents"),
threading(apartment),
uuid(450d8fba-ad25-11d0-98a8-0800361b1103)
] coclass MyDocuments { interface IShellFolder2; }
[
helpstring("Trash"),
threading(apartment),
uuid(645ff040-5081-101b-9f08-00aa002f954e)
] coclass RecycleBin { interface IShellFolder2; }
[
helpstring("Control Panel"),
threading(apartment),
uuid(21ec2020-3aea-1069-a2dd-08002b30309d)
] coclass ControlPanel { interface IShellFolder2; }
......@@ -37,6 +37,7 @@
#include "winuser.h"
#include "wingdi.h"
#include "shlobj.h"
#include "rpcproxy.h"
#include "shlwapi.h"
#include "propsys.h"
......@@ -45,6 +46,8 @@
#include "shell32_main.h"
#include "version.h"
#include "shresdef.h"
#include "initguid.h"
#include "shfldr.h"
#include "wine/debug.h"
#include "wine/unicode.h"
......@@ -1231,6 +1234,24 @@ HRESULT WINAPI DllCanUnloadNow(void)
}
/***********************************************************************
* DllRegisterServer (SHELL32.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
HRESULT hr = __wine_register_resources( shell32_hInstance, NULL );
if (SUCCEEDED(hr)) hr = SHELL_RegisterShellFolders();
return hr;
}
/***********************************************************************
* DllUnregisterServer (SHELL32.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
return __wine_unregister_resources( shell32_hInstance, NULL );
}
/***********************************************************************
* ExtractVersionResource16W (SHELL32.@)
*/
BOOL WINAPI ExtractVersionResource16W(LPWSTR s, DWORD d)
......
......@@ -2726,6 +2726,77 @@ static HRESULT create_extra_folders(void)
}
/******************************************************************************
* set_folder_attributes
*
* Set the various folder attributes registry keys.
*/
static HRESULT set_folder_attributes(void)
{
static const WCHAR clsidW[] = {'C','L','S','I','D','\\',0 };
static const WCHAR shellfolderW[] = {'\\','S','h','e','l','l','F','o','l','d','e','r', 0 };
static const WCHAR wfparsingW[] = {'W','a','n','t','s','F','O','R','P','A','R','S','I','N','G',0};
static const WCHAR wfdisplayW[] = {'W','a','n','t','s','F','O','R','D','I','S','P','L','A','Y',0};
static const WCHAR hideasdeleteW[] = {'H','i','d','e','A','s','D','e','l','e','t','e','P','e','r','U','s','e','r',0};
static const WCHAR attributesW[] = {'A','t','t','r','i','b','u','t','e','s',0};
static const WCHAR cfattributesW[] = {'C','a','l','l','F','o','r','A','t','t','r','i','b','u','t','e','s',0};
static const WCHAR emptyW[] = {0};
static const struct
{
const CLSID *clsid;
BOOL wfparsing : 1;
BOOL wfdisplay : 1;
BOOL hideasdel : 1;
DWORD attr;
DWORD call_for_attr;
} folders[] =
{
{ &CLSID_UnixFolder, TRUE, FALSE, FALSE },
{ &CLSID_UnixDosFolder, TRUE, FALSE, FALSE,
SFGAO_FILESYSANCESTOR|SFGAO_FOLDER|SFGAO_HASSUBFOLDER, SFGAO_FILESYSTEM },
{ &CLSID_FolderShortcut, FALSE, FALSE, FALSE,
SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_LINK,
SFGAO_HASSUBFOLDER|SFGAO_FILESYSTEM|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR },
{ &CLSID_MyDocuments, TRUE, FALSE, FALSE,
SFGAO_FILESYSANCESTOR|SFGAO_FOLDER|SFGAO_HASSUBFOLDER, SFGAO_FILESYSTEM },
{ &CLSID_RecycleBin, FALSE, FALSE, FALSE,
SFGAO_FOLDER|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET },
{ &CLSID_ControlPanel, FALSE, TRUE, TRUE,
SFGAO_FOLDER|SFGAO_HASSUBFOLDER }
};
unsigned int i;
WCHAR buffer[39 + (sizeof(clsidW) + sizeof(shellfolderW)) / sizeof(WCHAR)];
LONG res;
HKEY hkey;
for (i = 0; i < sizeof(folders)/sizeof(folders[0]); i++)
{
strcpyW( buffer, clsidW );
StringFromGUID2( folders[i].clsid, buffer + strlenW(buffer), 39 );
strcatW( buffer, shellfolderW );
res = RegCreateKeyExW( HKEY_CLASSES_ROOT, buffer, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &hkey, NULL);
if (res) return HRESULT_FROM_WIN32( res );
if (folders[i].wfparsing)
res = RegSetValueExW( hkey, wfparsingW, 0, REG_SZ, (const BYTE *)emptyW, sizeof(emptyW) );
if (folders[i].wfdisplay)
res = RegSetValueExW( hkey, wfdisplayW, 0, REG_SZ, (const BYTE *)emptyW, sizeof(emptyW) );
if (folders[i].hideasdel)
res = RegSetValueExW( hkey, hideasdeleteW, 0, REG_SZ, (const BYTE *)emptyW, sizeof(emptyW) );
if (folders[i].attr)
res = RegSetValueExW( hkey, attributesW, 0, REG_DWORD,
(const BYTE *)&folders[i].attr, sizeof(DWORD));
if (folders[i].call_for_attr)
res = RegSetValueExW( hkey, cfattributesW, 0, REG_DWORD,
(const BYTE *)&folders[i].call_for_attr, sizeof(DWORD));
RegCloseKey( hkey );
}
return S_OK;
}
/* Register the default values in the registry, as some apps seem to depend
* on their presence. The set registered was taken from Windows XP.
*/
......@@ -2746,6 +2817,8 @@ HRESULT SHELL_RegisterShellFolders(void)
hr = _SHRegisterCommonShellFolders();
if (SUCCEEDED(hr))
hr = create_extra_folders();
if (SUCCEEDED(hr))
hr = set_folder_attributes();
return hr;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment