From 31fcd8ee63131702a6f100c564393c0d4893d32f Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Thu, 7 Aug 2008 01:02:34 +0000 Subject: [PATCH] * halfplement fonts shell folder * fix registration of nethood shell folder and printer shell folder - displaying is if'd out currently svn path=/trunk/; revision=35153 --- reactos/dll/win32/shell32/lang/bg-BG.rc | 3 + reactos/dll/win32/shell32/lang/ca-ES.rc | 3 + reactos/dll/win32/shell32/lang/cs-CZ.rc | 3 + reactos/dll/win32/shell32/lang/da-DK.rc | 3 + reactos/dll/win32/shell32/lang/de-DE.rc | 3 + reactos/dll/win32/shell32/lang/el-GR.rc | 3 + reactos/dll/win32/shell32/lang/en-GB.rc | 3 + reactos/dll/win32/shell32/lang/en-US.rc | 3 + reactos/dll/win32/shell32/lang/es-ES.rc | 3 + reactos/dll/win32/shell32/lang/fi-FI.rc | 3 + reactos/dll/win32/shell32/lang/fr-FR.rc | 3 + reactos/dll/win32/shell32/lang/hu-HU.rc | 3 + reactos/dll/win32/shell32/lang/it-IT.rc | 3 + reactos/dll/win32/shell32/lang/ja-JP.rc | 3 + reactos/dll/win32/shell32/lang/ko-KR.rc | 3 + reactos/dll/win32/shell32/lang/nl-NL.rc | 3 + reactos/dll/win32/shell32/lang/no-NO.rc | 13 + reactos/dll/win32/shell32/lang/pl-PL.rc | 3 + reactos/dll/win32/shell32/lang/pt-BR.rc | 3 + reactos/dll/win32/shell32/lang/pt-PT.rc | 3 + reactos/dll/win32/shell32/lang/ru-RU.rc | 3 + reactos/dll/win32/shell32/lang/sk-SK.rc | 3 + reactos/dll/win32/shell32/lang/sl-SI.rc | 3 + reactos/dll/win32/shell32/lang/sv-SE.rc | 3 + reactos/dll/win32/shell32/lang/tr-TR.rc | 3 + reactos/dll/win32/shell32/lang/uk-UA.rc | 3 + reactos/dll/win32/shell32/lang/zh-CN.rc | 3 + reactos/dll/win32/shell32/lang/zh-TW.rc | 3 + reactos/dll/win32/shell32/pidl.c | 5 + reactos/dll/win32/shell32/pidl.h | 3 +- reactos/dll/win32/shell32/regsvr.c | 58 +- reactos/dll/win32/shell32/shell32.rbuild | 1 + reactos/dll/win32/shell32/shell32_main.h | 1 + reactos/dll/win32/shell32/shellole.c | 3 +- reactos/dll/win32/shell32/shfldr_fonts.c | 655 +++++++++++++++++++++++ reactos/dll/win32/shell32/shresdef.h | 3 + 36 files changed, 808 insertions(+), 15 deletions(-) create mode 100644 reactos/dll/win32/shell32/shfldr_fonts.c diff --git a/reactos/dll/win32/shell32/lang/bg-BG.rc b/reactos/dll/win32/shell32/lang/bg-BG.rc index 42ef0534030..47b1737d79d 100644 --- a/reactos/dll/win32/shell32/lang/bg-BG.rc +++ b/reactos/dll/win32/shell32/lang/bg-BG.rc @@ -714,6 +714,9 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/ca-ES.rc b/reactos/dll/win32/shell32/lang/ca-ES.rc index 25af924b114..684923a6c92 100644 --- a/reactos/dll/win32/shell32/lang/ca-ES.rc +++ b/reactos/dll/win32/shell32/lang/ca-ES.rc @@ -710,4 +710,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/cs-CZ.rc b/reactos/dll/win32/shell32/lang/cs-CZ.rc index a26048a2ca3..676ef9adb73 100644 --- a/reactos/dll/win32/shell32/lang/cs-CZ.rc +++ b/reactos/dll/win32/shell32/lang/cs-CZ.rc @@ -712,4 +712,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/da-DK.rc b/reactos/dll/win32/shell32/lang/da-DK.rc index acf0f04edb9..87e4a50e4df 100644 --- a/reactos/dll/win32/shell32/lang/da-DK.rc +++ b/reactos/dll/win32/shell32/lang/da-DK.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/de-DE.rc b/reactos/dll/win32/shell32/lang/de-DE.rc index ea4ff5897ea..03a965cea7f 100644 --- a/reactos/dll/win32/shell32/lang/de-DE.rc +++ b/reactos/dll/win32/shell32/lang/de-DE.rc @@ -712,4 +712,7 @@ BEGIN IDS_PREVIEW_VERB "Vorschau" IDS_FILE_FOLDER "%u Dateien, %u Ordner" + IDS_PRINTERS "Drucker" + IDS_FONTS "Schriftarten" + IDS_INSTALLNEWFONT "Neue Schriftart installieren..." END diff --git a/reactos/dll/win32/shell32/lang/el-GR.rc b/reactos/dll/win32/shell32/lang/el-GR.rc index b68244bf2db..fa6dcf7107d 100644 --- a/reactos/dll/win32/shell32/lang/el-GR.rc +++ b/reactos/dll/win32/shell32/lang/el-GR.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/en-GB.rc b/reactos/dll/win32/shell32/lang/en-GB.rc index 65cfda4b430..04eae991aee 100644 --- a/reactos/dll/win32/shell32/lang/en-GB.rc +++ b/reactos/dll/win32/shell32/lang/en-GB.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/en-US.rc b/reactos/dll/win32/shell32/lang/en-US.rc index 2bb84f00698..b54f54cf873 100644 --- a/reactos/dll/win32/shell32/lang/en-US.rc +++ b/reactos/dll/win32/shell32/lang/en-US.rc @@ -712,4 +712,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/es-ES.rc b/reactos/dll/win32/shell32/lang/es-ES.rc index f24bb7c822a..ca5b75807e8 100644 --- a/reactos/dll/win32/shell32/lang/es-ES.rc +++ b/reactos/dll/win32/shell32/lang/es-ES.rc @@ -713,4 +713,7 @@ BEGIN IDS_PREVIEW_VERB "Vista previa" IDS_FILE_FOLDER "%u Archivos, %u Carpetas" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/fi-FI.rc b/reactos/dll/win32/shell32/lang/fi-FI.rc index 380b2314cef..b2b9f75252a 100644 --- a/reactos/dll/win32/shell32/lang/fi-FI.rc +++ b/reactos/dll/win32/shell32/lang/fi-FI.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/fr-FR.rc b/reactos/dll/win32/shell32/lang/fr-FR.rc index b22e37f68ac..d1fda84d685 100644 --- a/reactos/dll/win32/shell32/lang/fr-FR.rc +++ b/reactos/dll/win32/shell32/lang/fr-FR.rc @@ -715,4 +715,7 @@ BEGIN IDS_PREVIEW_VERB "Apercevoir" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/hu-HU.rc b/reactos/dll/win32/shell32/lang/hu-HU.rc index ff28a1e907c..f13e1a82ae9 100644 --- a/reactos/dll/win32/shell32/lang/hu-HU.rc +++ b/reactos/dll/win32/shell32/lang/hu-HU.rc @@ -714,4 +714,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/it-IT.rc b/reactos/dll/win32/shell32/lang/it-IT.rc index bec7d5995b3..630ee78ca12 100644 --- a/reactos/dll/win32/shell32/lang/it-IT.rc +++ b/reactos/dll/win32/shell32/lang/it-IT.rc @@ -712,4 +712,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/ja-JP.rc b/reactos/dll/win32/shell32/lang/ja-JP.rc index 19c87ca98bb..a916b5a7c5e 100644 --- a/reactos/dll/win32/shell32/lang/ja-JP.rc +++ b/reactos/dll/win32/shell32/lang/ja-JP.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/ko-KR.rc b/reactos/dll/win32/shell32/lang/ko-KR.rc index 9aa44ea0de7..c8ddf2b4061 100644 --- a/reactos/dll/win32/shell32/lang/ko-KR.rc +++ b/reactos/dll/win32/shell32/lang/ko-KR.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/nl-NL.rc b/reactos/dll/win32/shell32/lang/nl-NL.rc index 7379264762e..7646070b54e 100644 --- a/reactos/dll/win32/shell32/lang/nl-NL.rc +++ b/reactos/dll/win32/shell32/lang/nl-NL.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/no-NO.rc b/reactos/dll/win32/shell32/lang/no-NO.rc index 893428da959..62d8a9516cc 100644 --- a/reactos/dll/win32/shell32/lang/no-NO.rc +++ b/reactos/dll/win32/shell32/lang/no-NO.rc @@ -679,4 +679,17 @@ BEGIN IDS_INI_FILE "Konfigurasjon innstilling" IDS_LNK_FILE "Snarvei" IDS_SYS_FILE "Systemfil" + + IDS_OPEN_VERB "Open" + IDS_RUNAS_VERB "Run as " + IDS_EDIT_VERB "Edit" + IDS_FIND_VERB "Find" + IDS_PRINT_VERB "Print" + IDS_PLAY_VERB "Play" + IDS_PREVIEW_VERB "Preview" + + IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/pl-PL.rc b/reactos/dll/win32/shell32/lang/pl-PL.rc index f97b6bfe73f..4b5d0e33571 100644 --- a/reactos/dll/win32/shell32/lang/pl-PL.rc +++ b/reactos/dll/win32/shell32/lang/pl-PL.rc @@ -717,4 +717,7 @@ BEGIN IDS_PREVIEW_VERB "Podgld" IDS_FILE_FOLDER "%u Plikw, %u Katalogw" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/pt-BR.rc b/reactos/dll/win32/shell32/lang/pt-BR.rc index e347039b66c..ffb735954e2 100644 --- a/reactos/dll/win32/shell32/lang/pt-BR.rc +++ b/reactos/dll/win32/shell32/lang/pt-BR.rc @@ -713,4 +713,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/pt-PT.rc b/reactos/dll/win32/shell32/lang/pt-PT.rc index 370a379409b..70b9c18da60 100644 --- a/reactos/dll/win32/shell32/lang/pt-PT.rc +++ b/reactos/dll/win32/shell32/lang/pt-PT.rc @@ -713,4 +713,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/ru-RU.rc b/reactos/dll/win32/shell32/lang/ru-RU.rc index 3c69d74573a..d9ec9528dee 100644 --- a/reactos/dll/win32/shell32/lang/ru-RU.rc +++ b/reactos/dll/win32/shell32/lang/ru-RU.rc @@ -709,4 +709,7 @@ BEGIN IDS_PREVIEW_VERB "" IDS_FILE_FOLDER "%u , %u " + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/sk-SK.rc b/reactos/dll/win32/shell32/lang/sk-SK.rc index 53df2a925d5..c26c7f9f376 100644 --- a/reactos/dll/win32/shell32/lang/sk-SK.rc +++ b/reactos/dll/win32/shell32/lang/sk-SK.rc @@ -717,4 +717,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" //Nhad, Ukka, Prezrie ??? IDS_FILE_FOLDER "sbory: %u, prieinky: %u" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/sl-SI.rc b/reactos/dll/win32/shell32/lang/sl-SI.rc index d2b84c9b423..7233f2b842e 100644 --- a/reactos/dll/win32/shell32/lang/sl-SI.rc +++ b/reactos/dll/win32/shell32/lang/sl-SI.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/sv-SE.rc b/reactos/dll/win32/shell32/lang/sv-SE.rc index 85181d70d11..97e9daa5883 100644 --- a/reactos/dll/win32/shell32/lang/sv-SE.rc +++ b/reactos/dll/win32/shell32/lang/sv-SE.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/tr-TR.rc b/reactos/dll/win32/shell32/lang/tr-TR.rc index e4af8518be3..f236f2f25b7 100644 --- a/reactos/dll/win32/shell32/lang/tr-TR.rc +++ b/reactos/dll/win32/shell32/lang/tr-TR.rc @@ -711,4 +711,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/uk-UA.rc b/reactos/dll/win32/shell32/lang/uk-UA.rc index 32648cc4544..a6db6508e25 100644 --- a/reactos/dll/win32/shell32/lang/uk-UA.rc +++ b/reactos/dll/win32/shell32/lang/uk-UA.rc @@ -712,4 +712,7 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/zh-CN.rc b/reactos/dll/win32/shell32/lang/zh-CN.rc index 039835bb796..9972007aedf 100644 --- a/reactos/dll/win32/shell32/lang/zh-CN.rc +++ b/reactos/dll/win32/shell32/lang/zh-CN.rc @@ -699,5 +699,8 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END diff --git a/reactos/dll/win32/shell32/lang/zh-TW.rc b/reactos/dll/win32/shell32/lang/zh-TW.rc index f1a4dcb34d0..0cb39c12550 100644 --- a/reactos/dll/win32/shell32/lang/zh-TW.rc +++ b/reactos/dll/win32/shell32/lang/zh-TW.rc @@ -712,6 +712,9 @@ BEGIN IDS_PREVIEW_VERB "Preview" IDS_FILE_FOLDER "%u Files, %u Folders" + IDS_PRINTERS "Printers" + IDS_FONTS "Fonts" + IDS_INSTALLNEWFONT "Install New Font..." END #pragma code_page(default) diff --git a/reactos/dll/win32/shell32/pidl.c b/reactos/dll/win32/shell32/pidl.c index 9cf62ce0d94..ff9cfd144ae 100644 --- a/reactos/dll/win32/shell32/pidl.c +++ b/reactos/dll/win32/shell32/pidl.c @@ -1643,6 +1643,11 @@ LPITEMIDLIST _ILCreateNetHood(void) return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces); } +LPITEMIDLIST _ILCreateFont(void) +{ + + return _ILCreateGuid(PT_GUID, &CLSID_FontsFolderShortcut); +} BOOL _ILIsMyComputer(LPCITEMIDLIST pidl) { diff --git a/reactos/dll/win32/shell32/pidl.h b/reactos/dll/win32/shell32/pidl.h index 148d901859d..476fb05c7c6 100644 --- a/reactos/dll/win32/shell32/pidl.h +++ b/reactos/dll/win32/shell32/pidl.h @@ -255,7 +255,8 @@ LPITEMIDLIST _ILCreateIExplore (void); LPITEMIDLIST _ILCreateControlPanel (void); LPITEMIDLIST _ILCreatePrinters (void); LPITEMIDLIST _ILCreateNetwork (void); -LPITEMIDLIST _ILCreateNetHood (void); +LPITEMIDLIST _ILCreateNetHood (void); +LPITEMIDLIST _ILCreateFont (void); LPITEMIDLIST _ILCreateBitBucket (void); LPITEMIDLIST _ILCreateDrive (LPCWSTR); diff --git a/reactos/dll/win32/shell32/regsvr.c b/reactos/dll/win32/shell32/regsvr.c index 14c665e28b4..8b455bed855 100644 --- a/reactos/dll/win32/shell32/regsvr.c +++ b/reactos/dll/win32/shell32/regsvr.c @@ -602,24 +602,49 @@ static struct regsvr_coclass const coclass_list[] = { }, { &CLSID_Printers, "Printers & Fax", - 0, + IDS_PRINTERS, + NULL, + "shell32.dll", + "Apartment", + SHELLFOLDER_ATTRIBUTES, + SFGAO_FOLDER, + 0, + NULL, + NULL, + IDI_SHELL_PRINTER + }, + { &CLSID_MyComputer, + "My Computer", + IDS_MYCOMPUTER, NULL, "shell32.dll", "Apartment" }, - { &CLSID_MyComputer, - "My Computer", - IDS_MYCOMPUTER, - NULL, - "shell32.dll", - "Apartment" - }, { &CLSID_NetworkPlaces, - "My Network Places", - IDS_NETWORKPLACE, - NULL, - "shell32.dll", - "Apartment" + "My Network Places", + IDS_NETWORKPLACE, + NULL, + "shell32.dll", + "Apartment", + SHELLFOLDER_ATTRIBUTES, + SFGAO_FOLDER, + 0, + NULL, + NULL, + IDI_SHELL_MY_NETWORK_PLACES + }, + { &CLSID_FontsFolderShortcut, + "Fonts", + IDS_FONTS, + NULL, + "shell32.dll", + "Apartment", + SHELLFOLDER_ATTRIBUTES|SHELLFOLDER_WANTSFORPARSING|SHELLFOLDER_CALLFORATTRIBUTES, + SFGAO_FOLDER, + 0, + NULL, + NULL, + IDI_SHELL_FONTS_FOLDER }, { &CLSID_Shortcut, "Shortcut", @@ -731,6 +756,8 @@ static const WCHAR wszMyComputer[] = { 'M','y','C','o','m','p','u','t','e','r',0 static const WCHAR wszControlPanel[] = { 'C','o','n','t','r','o','l','P','a','n','e','l',0 }; static const WCHAR wszFolderOptions[] = { 'F','o','l','d','e','r',' ','O','p','t','i','o','n','s',0 }; static const WCHAR wszNethoodFolder[] = { 'N','e','t','h','o','o','d',' ','f','o','l','d','e','r',0}; +static const WCHAR wszPrinters[] = { 'P','r','i','n','t','e','r','s',0 }; +static const WCHAR wszFonts[] = { 'F','o','n','t','s',0 }; const GUID CLSID_FolderOptions = { 0x6DFD7C5C, 0x2451, 0x11d3, {0xa2,0x99,0x00,0xC0,0x4F,0x8e,0xf6,0xaf} }; @@ -768,6 +795,11 @@ static struct regsvr_namespace const namespace_extensions_list[] = { wszFolderOptions }, #if 0 + { + &CLSID_FontsFolderShortcut, + wszControlPanel, + wszFonts + }, { &CLSID_Printers, wszControlPanel, diff --git a/reactos/dll/win32/shell32/shell32.rbuild b/reactos/dll/win32/shell32/shell32.rbuild index 6011eb59060..94b80af6154 100644 --- a/reactos/dll/win32/shell32/shell32.rbuild +++ b/reactos/dll/win32/shell32/shell32.rbuild @@ -75,4 +75,5 @@ shv_item_new.c folder_options.c shfldr_netplaces.c + shfldr_fonts.c diff --git a/reactos/dll/win32/shell32/shell32_main.h b/reactos/dll/win32/shell32/shell32_main.h index 285a5738b3d..0ea0a394020 100644 --- a/reactos/dll/win32/shell32/shell32_main.h +++ b/reactos/dll/win32/shell32/shell32_main.h @@ -95,6 +95,7 @@ HRESULT WINAPI ISF_MyComputer_Constructor(IUnknown * pUnkOuter, REFIID riid, LPV HRESULT WINAPI ISF_Printers_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI ISF_MyDocuments_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI ISF_NetworkPlaces_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); +HRESULT WINAPI ISF_Fonts_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV); HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); diff --git a/reactos/dll/win32/shell32/shellole.c b/reactos/dll/win32/shell32/shellole.c index 0ec2af3da96..389de77f1a2 100644 --- a/reactos/dll/win32/shell32/shellole.c +++ b/reactos/dll/win32/shell32/shellole.c @@ -75,7 +75,8 @@ static const struct { {&CLSID_FolderShortcut, &FolderShortcut_Constructor}, #endif {&CLSID_MyDocuments, &ISF_MyDocuments_Constructor}, - {&CLSID_NetworkPlaces, &ISF_NetworkPlaces_Constructor}, + {&CLSID_NetworkPlaces, &ISF_NetworkPlaces_Constructor}, + {&CLSID_FontsFolderShortcut, &ISF_Fonts_Constructor}, {&CLSID_Printers, &ISF_Printers_Constructor}, {&CLSID_RecycleBin, &RecycleBin_Constructor}, {&CLSID_OpenWith, &SHEOW_Constructor}, diff --git a/reactos/dll/win32/shell32/shfldr_fonts.c b/reactos/dll/win32/shell32/shfldr_fonts.c new file mode 100644 index 00000000000..bfe43e957e3 --- /dev/null +++ b/reactos/dll/win32/shell32/shfldr_fonts.c @@ -0,0 +1,655 @@ +/* + * Fonts folder + * + * Copyright 2008 Johannes Anderwald + * + * 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include + +#define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include "winerror.h" +#include "windef.h" +#include "winbase.h" +#include "winreg.h" + +#include "pidl.h" +#include "enumidlist.h" +#include "undocshell.h" +#include "shell32_main.h" +#include "shresdef.h" +#include "wine/debug.h" +#include "debughlp.h" +#include "shfldr.h" +#include "shlwapi.h" + +WINE_DEFAULT_DEBUG_CHANNEL (shell); + +/*********************************************************************** +* IShellFolder implementation +*/ + +typedef struct { + const IShellFolder2Vtbl *lpVtbl; + LONG ref; + const IPersistFolder2Vtbl *lpVtblPersistFolder2; + + /* both paths are parsible from the desktop */ + LPITEMIDLIST pidlRoot; /* absolute pidl */ +} IGenericSFImpl; + +static const IShellFolder2Vtbl vt_ShellFolder2; +static const IPersistFolder2Vtbl vt_NP_PersistFolder2; + + +#define _IPersistFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpVtblPersistFolder2))) +#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset); + +#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) +#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl) +#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2) + +static shvheader FontsSFHeader[] = { + {IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15}, + {IDS_SHV_COLUMN9, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10} +}; + +#define FontsSHELLVIEWCOLUMNS 2 + +/************************************************************************** +* ISF_Fonts_Constructor +*/ +HRESULT WINAPI ISF_Fonts_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv) +{ + IGenericSFImpl *sf; + + TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid)); + + if (!ppv) + return E_POINTER; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + sf = (IGenericSFImpl *) HeapAlloc ( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl)); + if (!sf) + return E_OUTOFMEMORY; + + sf->ref = 0; + sf->lpVtbl = &vt_ShellFolder2; + sf->lpVtblPersistFolder2 = &vt_NP_PersistFolder2; + sf->pidlRoot = _ILCreateFont(); /* my qualified pidl */ + + if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) + { + IUnknown_Release (_IUnknown_ (sf)); + return E_NOINTERFACE; + } + + TRACE ("--(%p)\n", sf); + return S_OK; +} + +/************************************************************************** + * ISF_Fonts_fnQueryInterface + * + * NOTE + * supports not IPersist/IPersistFolder + */ +static HRESULT WINAPI ISF_Fonts_fnQueryInterface (IShellFolder2 *iface, REFIID riid, LPVOID *ppvObj) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj); + + *ppvObj = NULL; + + if (IsEqualIID (riid, &IID_IUnknown) || + IsEqualIID (riid, &IID_IShellFolder) || + IsEqualIID (riid, &IID_IShellFolder2)) + { + *ppvObj = This; + } + else if (IsEqualIID (riid, &IID_IPersist) || + IsEqualIID (riid, &IID_IPersistFolder) || + IsEqualIID (riid, &IID_IPersistFolder2)) + { + *ppvObj = _IPersistFolder2_ (This); + } + + if (*ppvObj) + { + IUnknown_AddRef ((IUnknown *) (*ppvObj)); + TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj); + return S_OK; + } + TRACE ("-- Interface: E_NOINTERFACE\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI ISF_Fonts_fnAddRef (IShellFolder2 * iface) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + TRACE ("(%p)->(count=%u)\n", This, refCount - 1); + + return refCount; +} + +static ULONG WINAPI ISF_Fonts_fnRelease (IShellFolder2 * iface) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + TRACE ("(%p)->(count=%u)\n", This, refCount + 1); + + if (!refCount) { + TRACE ("-- destroying IShellFolder(%p)\n", This); + SHFree (This->pidlRoot); + HeapFree (GetProcessHeap(), 0, This); + } + return refCount; +} + +/************************************************************************** +* ISF_Fonts_fnParseDisplayName +*/ +static HRESULT WINAPI ISF_Fonts_fnParseDisplayName (IShellFolder2 * iface, + HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName, + DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + HRESULT hr = E_UNEXPECTED; + + TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This, + hwndOwner, pbcReserved, lpszDisplayName, debugstr_w (lpszDisplayName), + pchEaten, ppidl, pdwAttributes); + + *ppidl = 0; + if (pchEaten) + *pchEaten = 0; /* strange but like the original */ + + TRACE ("(%p)->(-- ret=0x%08x)\n", This, hr); + + return hr; +} + +/************************************************************************** +* ISF_Fonts_fnEnumObjects +*/ +static HRESULT WINAPI ISF_Fonts_fnEnumObjects (IShellFolder2 * iface, + HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This, + hwndOwner, dwFlags, ppEnumIDList); + + *ppEnumIDList = IEnumIDList_Constructor(); + + TRACE ("-- (%p)->(new ID List: %p)\n", This, *ppEnumIDList); + + return (*ppEnumIDList) ? S_OK : E_OUTOFMEMORY; +} + +/************************************************************************** +* ISF_Fonts_fnBindToObject +*/ +static HRESULT WINAPI ISF_Fonts_fnBindToObject (IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, + pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); + + return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut); +} + +/************************************************************************** +* ISF_Fonts_fnBindToStorage +*/ +static HRESULT WINAPI ISF_Fonts_fnBindToStorage (IShellFolder2 * iface, + LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, + pidl, pbcReserved, shdebugstr_guid (riid), ppvOut); + + *ppvOut = NULL; + return E_NOTIMPL; +} + +/************************************************************************** +* ISF_Fonts_fnCompareIDs +*/ + +static HRESULT WINAPI ISF_Fonts_fnCompareIDs (IShellFolder2 * iface, + LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + int nReturn; + + TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2); + nReturn = SHELL32_CompareIDs (_IShellFolder_ (This), lParam, pidl1, pidl2); + TRACE ("-- %i\n", nReturn); + return nReturn; +} + +/************************************************************************** +* ISF_Fonts_fnCreateViewObject +*/ +static HRESULT WINAPI ISF_Fonts_fnCreateViewObject (IShellFolder2 * iface, + HWND hwndOwner, REFIID riid, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + LPSHELLVIEW pShellView; + HRESULT hr = E_INVALIDARG; + + TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, + hwndOwner, shdebugstr_guid (riid), ppvOut); + + if (!ppvOut) + return hr; + + *ppvOut = NULL; + + if (IsEqualIID (riid, &IID_IDropTarget)) + { + WARN ("IDropTarget not implemented\n"); + hr = E_NOTIMPL; + } + else if (IsEqualIID (riid, &IID_IContextMenu)) + { + WARN ("IContextMenu not implemented\n"); + hr = E_NOTIMPL; + } + else if (IsEqualIID (riid, &IID_IShellView)) + { + pShellView = IShellView_Constructor ((IShellFolder *) iface); + if (pShellView) + { + hr = IShellView_QueryInterface (pShellView, riid, ppvOut); + IShellView_Release (pShellView); + } + } + TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut); + return hr; +} + +/************************************************************************** +* ISF_Fonts_fnGetAttributesOf +*/ +static HRESULT WINAPI ISF_Fonts_fnGetAttributesOf (IShellFolder2 * iface, + UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + HRESULT hr = S_OK; + + TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n", This, + cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0); + + if (!rgfInOut) + return E_INVALIDARG; + if (cidl && !apidl) + return E_INVALIDARG; + + if (*rgfInOut == 0) + *rgfInOut = ~0; + + if (cidl == 0) + { + IShellFolder *psfParent = NULL; + LPCITEMIDLIST rpidl = NULL; + + hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl); + if(SUCCEEDED(hr)) + { + SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); + IShellFolder_Release(psfParent); + } + } + else + { + while (cidl > 0 && *apidl) + { + pdump (*apidl); + SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut); + apidl++; + cidl--; + } + } + + /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */ + *rgfInOut &= ~SFGAO_VALIDATE; + + TRACE ("-- result=0x%08x\n", *rgfInOut); + return hr; +} + +/************************************************************************** +* ISF_Fonts_fnGetUIObjectOf +* +* PARAMETERS +* hwndOwner [in] Parent window for any output +* cidl [in] array size +* apidl [in] simple pidl array +* riid [in] Requested Interface +* prgfInOut [ ] reserved +* ppvObject [out] Resulting Interface +* +*/ +static HRESULT WINAPI ISF_Fonts_fnGetUIObjectOf (IShellFolder2 * iface, + HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, + UINT * prgfInOut, LPVOID * ppvOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + LPITEMIDLIST pidl; + IUnknown *pObj = NULL; + HRESULT hr = E_INVALIDARG; + + TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This, + hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut); + + if (!ppvOut) + return hr; + + *ppvOut = NULL; + + if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) + { + pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) + { + pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl); + SHFree (pidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) + { + pidl = ILCombine (This->pidlRoot, apidl[0]); + pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl); + SHFree (pidl); + hr = S_OK; + } + else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) + { + hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj); + } + else + hr = E_NOINTERFACE; + + if (SUCCEEDED(hr) && !pObj) + hr = E_OUTOFMEMORY; + + *ppvOut = pObj; + TRACE ("(%p)->hr=0x%08x\n", This, hr); + return hr; +} + +/************************************************************************** +* ISF_Fonts_fnGetDisplayNameOf +* +*/ +static HRESULT WINAPI ISF_Fonts_fnGetDisplayNameOf (IShellFolder2 * iface, + LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)->(pidl=%p,0x%08x,%p)\n", This, pidl, dwFlags, strRet); + pdump (pidl); + + if (!strRet) + return E_INVALIDARG; + + return E_NOTIMPL; +} + +/************************************************************************** +* ISF_Fonts_fnSetNameOf +* Changes the name of a file object or subfolder, possibly changing its item +* identifier in the process. +* +* PARAMETERS +* hwndOwner [in] Owner window for output +* pidl [in] simple pidl of item to change +* lpszName [in] the items new display name +* dwFlags [in] SHGNO formatting flags +* ppidlOut [out] simple pidl returned +*/ +static HRESULT WINAPI ISF_Fonts_fnSetNameOf (IShellFolder2 * iface, + HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */ + LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This, + hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut); + return E_FAIL; +} + +static HRESULT WINAPI ISF_Fonts_fnGetDefaultSearchGUID ( + IShellFolder2 * iface, GUID * pguid) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_Fonts_fnEnumSearches (IShellFolder2 * iface, + IEnumExtraSearch ** ppenum) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_Fonts_fnGetDefaultColumn (IShellFolder2 * iface, + DWORD dwRes, ULONG * pSort, ULONG * pDisplay) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)\n", This); + + if (pSort) + *pSort = 0; + if (pDisplay) + *pDisplay = 0; + + return S_OK; +} + +static HRESULT WINAPI ISF_Fonts_fnGetDefaultColumnState ( + IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + TRACE ("(%p)\n", This); + + if (!pcsFlags || iColumn >= FontsSHELLVIEWCOLUMNS) + return E_INVALIDARG; + *pcsFlags = FontsSFHeader[iColumn].pcsFlags; + return S_OK; +} + +static HRESULT WINAPI ISF_Fonts_fnGetDetailsEx (IShellFolder2 * iface, + LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + FIXME ("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_Fonts_fnGetDetailsOf (IShellFolder2 * iface, + LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI ISF_Fonts_fnMapColumnToSCID (IShellFolder2 * iface, + UINT column, SHCOLUMNID * pscid) +{ + IGenericSFImpl *This = (IGenericSFImpl *)iface; + + FIXME ("(%p)\n", This); + + return E_NOTIMPL; +} + +static const IShellFolder2Vtbl vt_ShellFolder2 = { + ISF_Fonts_fnQueryInterface, + ISF_Fonts_fnAddRef, + ISF_Fonts_fnRelease, + ISF_Fonts_fnParseDisplayName, + ISF_Fonts_fnEnumObjects, + ISF_Fonts_fnBindToObject, + ISF_Fonts_fnBindToStorage, + ISF_Fonts_fnCompareIDs, + ISF_Fonts_fnCreateViewObject, + ISF_Fonts_fnGetAttributesOf, + ISF_Fonts_fnGetUIObjectOf, + ISF_Fonts_fnGetDisplayNameOf, + ISF_Fonts_fnSetNameOf, + /* ShellFolder2 */ + ISF_Fonts_fnGetDefaultSearchGUID, + ISF_Fonts_fnEnumSearches, + ISF_Fonts_fnGetDefaultColumn, + ISF_Fonts_fnGetDefaultColumnState, + ISF_Fonts_fnGetDetailsEx, + ISF_Fonts_fnGetDetailsOf, + ISF_Fonts_fnMapColumnToSCID +}; + +/************************************************************************ + * INPFldr_PersistFolder2_QueryInterface + */ +static HRESULT WINAPI INPFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface, + REFIID iid, LPVOID * ppvObj) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)\n", This); + + return IUnknown_QueryInterface (_IUnknown_ (This), iid, ppvObj); +} + +/************************************************************************ + * INPFldr_PersistFolder2_AddRef + */ +static ULONG WINAPI INPFldr_PersistFolder2_AddRef (IPersistFolder2 * iface) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_AddRef (_IUnknown_ (This)); +} + +/************************************************************************ + * ISFPersistFolder_Release + */ +static ULONG WINAPI INPFldr_PersistFolder2_Release (IPersistFolder2 * iface) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)->(count=%u)\n", This, This->ref); + + return IUnknown_Release (_IUnknown_ (This)); +} + +/************************************************************************ + * INPFldr_PersistFolder2_GetClassID + */ +static HRESULT WINAPI INPFldr_PersistFolder2_GetClassID ( + IPersistFolder2 * iface, CLSID * lpClassId) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)\n", This); + + if (!lpClassId) + return E_POINTER; + + *lpClassId = CLSID_FontsFolderShortcut; + + return S_OK; +} + +/************************************************************************ + * INPFldr_PersistFolder2_Initialize + * + * NOTES: it makes no sense to change the pidl + */ +static HRESULT WINAPI INPFldr_PersistFolder2_Initialize ( + IPersistFolder2 * iface, LPCITEMIDLIST pidl) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)->(%p)\n", This, pidl); + + return E_NOTIMPL; +} + +/************************************************************************** + * IPersistFolder2_fnGetCurFolder + */ +static HRESULT WINAPI INPFldr_PersistFolder2_GetCurFolder ( + IPersistFolder2 * iface, LPITEMIDLIST * pidl) +{ + _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface); + + TRACE ("(%p)->(%p)\n", This, pidl); + + if (!pidl) + return E_POINTER; + + *pidl = ILClone (This->pidlRoot); + + return S_OK; +} + +static const IPersistFolder2Vtbl vt_NP_PersistFolder2 = +{ + INPFldr_PersistFolder2_QueryInterface, + INPFldr_PersistFolder2_AddRef, + INPFldr_PersistFolder2_Release, + INPFldr_PersistFolder2_GetClassID, + INPFldr_PersistFolder2_Initialize, + INPFldr_PersistFolder2_GetCurFolder +}; diff --git a/reactos/dll/win32/shell32/shresdef.h b/reactos/dll/win32/shell32/shresdef.h index 4be17316838..e93a0798928 100644 --- a/reactos/dll/win32/shell32/shresdef.h +++ b/reactos/dll/win32/shell32/shresdef.h @@ -87,6 +87,8 @@ #define IDS_DRIVE_CDROM 73 #define IDS_DRIVE_NETWORK 74 #define IDS_NETWORKPLACE 75 +#define IDS_FONTS 76 +#define IDS_PRINTERS 77 #define IDS_CREATEFOLDER_DENIED 128 #define IDS_CREATEFOLDER_CAPTION 129 @@ -142,6 +144,7 @@ #define IDS_PREVIEW_VERB 306 #define IDS_FILE_FOLDER 307 #define IDS_CREATELINK 308 +#define IDS_INSTALLNEWFONT 309 /* Note: this string is referenced from the registry */ #define IDS_RECYCLEBIN_FOLDER_NAME 8964