2 * self-registerable dll functions for shell32.dll
4 * Copyright (C) 2003 John K. Hohm
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
34 #include "shell32_main.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
44 * Near the bottom of this file are the exported DllRegisterServer and
45 * DllUnregisterServer, which make all this worthwhile.
48 /***********************************************************************
49 * interface for self-registering
51 struct regsvr_interface
53 IID
const *iid
; /* NULL for end of list */
54 LPCSTR name
; /* can be NULL to omit */
55 IID
const *base_iid
; /* can be NULL to omit */
56 int num_methods
; /* can be <0 to omit */
57 CLSID
const *ps_clsid
; /* can be NULL to omit */
58 CLSID
const *ps_clsid32
; /* can be NULL to omit */
61 static HRESULT
register_interfaces(struct regsvr_interface
const *list
);
62 static HRESULT
unregister_interfaces(struct regsvr_interface
const *list
);
66 CLSID
const *clsid
; /* NULL for end of list */
67 LPCSTR name
; /* can be NULL to omit */
68 UINT idName
; /* can be 0 to omit */
69 LPCSTR ips
; /* can be NULL to omit */
70 LPCSTR ips32
; /* can be NULL to omit */
71 LPCSTR ips32_tmodel
; /* can be NULL to omit */
74 DWORD dwCallForAttributes
;
75 LPCSTR clsid_str
; /* can be NULL to omit */
76 LPCSTR progid
; /* can be NULL to omit */
77 UINT idDefaultIcon
; /* can be 0 to omit */
80 /* flags for regsvr_coclass.flags */
81 #define SHELLEX_MAYCHANGEDEFAULTMENU 0x00000001
82 #define SHELLFOLDER_WANTSFORPARSING 0x00000002
83 #define SHELLFOLDER_ATTRIBUTES 0x00000004
84 #define SHELLFOLDER_CALLFORATTRIBUTES 0x00000008
86 static HRESULT
register_coclasses(struct regsvr_coclass
const *list
);
87 static HRESULT
unregister_coclasses(struct regsvr_coclass
const *list
);
89 struct regsvr_namespace
91 CLSID
const *clsid
; /* CLSID of the namespace extension. NULL for end of list */
92 LPCWSTR parent
; /* Mount point (MyComputer, Desktop, ..). */
93 LPCWSTR value
; /* Display name of the extension. */
96 static HRESULT
register_namespace_extensions(struct regsvr_namespace
const *list
);
97 static HRESULT
unregister_namespace_extensions(struct regsvr_namespace
const *list
);
99 /***********************************************************************
100 * static string constants
102 static WCHAR
const interface_keyname
[10] = {
103 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
104 static WCHAR
const base_ifa_keyname
[14] = {
105 'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
107 static WCHAR
const num_methods_keyname
[11] = {
108 'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
109 static WCHAR
const ps_clsid_keyname
[15] = {
110 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
112 static WCHAR
const ps_clsid32_keyname
[17] = {
113 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
114 'i', 'd', '3', '2', 0 };
115 static WCHAR
const clsid_keyname
[6] = {
116 'C', 'L', 'S', 'I', 'D', 0 };
117 static WCHAR
const ips_keyname
[13] = {
118 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
120 static WCHAR
const ips32_keyname
[15] = {
121 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
123 static WCHAR
const progid_keyname
[7] = {
124 'P', 'r', 'o', 'g', 'I', 'D', 0 };
125 static WCHAR
const shellex_keyname
[8] = {
126 's', 'h', 'e', 'l', 'l', 'e', 'x', 0 };
127 static WCHAR
const shellfolder_keyname
[12] = {
128 'S', 'h', 'e', 'l', 'l', 'F', 'o', 'l', 'd', 'e', 'r', 0 };
129 static WCHAR
const mcdm_keyname
[21] = {
130 'M', 'a', 'y', 'C', 'h', 'a', 'n', 'g', 'e', 'D', 'e', 'f',
131 'a', 'u', 'l', 't', 'M', 'e', 'n', 'u', 0 };
132 static WCHAR
const defaulticon_keyname
[] = {
133 'D','e','f','a','u','l','t','I','c','o','n',0};
134 static char const tmodel_valuename
[] = "ThreadingModel";
135 static char const wfparsing_valuename
[] = "WantsFORPARSING";
136 static char const attributes_valuename
[] = "Attributes";
137 static char const cfattributes_valuename
[] = "CallForAttributes";
138 static char const localized_valuename
[] = "LocalizedString";
140 /***********************************************************************
141 * static helper functions
143 static LONG
register_key_guid(HKEY base
, WCHAR
const *name
, GUID
const *guid
);
144 static LONG
register_key_defvalueW(HKEY base
, WCHAR
const *name
,
146 static LONG
register_key_defvalueA(HKEY base
, WCHAR
const *name
,
148 static LONG
recursive_delete_key(HKEY key
);
149 static LONG
recursive_delete_keyA(HKEY base
, char const *name
);
150 static LONG
recursive_delete_keyW(HKEY base
, WCHAR
const *name
);
152 /***********************************************************************
153 * register_interfaces
155 static HRESULT
register_interfaces(struct regsvr_interface
const *list
)
157 LONG res
= ERROR_SUCCESS
;
160 res
= RegCreateKeyExW(HKEY_CLASSES_ROOT
, interface_keyname
, 0, NULL
, 0,
161 KEY_READ
| KEY_WRITE
, NULL
, &interface_key
, NULL
);
162 if (res
!= ERROR_SUCCESS
) goto error_return
;
164 for (; res
== ERROR_SUCCESS
&& list
->iid
; ++list
) {
168 StringFromGUID2(list
->iid
, buf
, 39);
169 res
= RegCreateKeyExW(interface_key
, buf
, 0, NULL
, 0,
170 KEY_READ
| KEY_WRITE
, NULL
, &iid_key
, NULL
);
171 if (res
!= ERROR_SUCCESS
) goto error_close_interface_key
;
174 res
= RegSetValueExA(iid_key
, NULL
, 0, REG_SZ
,
175 (CONST BYTE
*)(list
->name
),
176 strlen(list
->name
) + 1);
177 if (res
!= ERROR_SUCCESS
) goto error_close_iid_key
;
180 if (list
->base_iid
) {
181 res
= register_key_guid(iid_key
, base_ifa_keyname
, list
->base_iid
);
182 if (res
!= ERROR_SUCCESS
) goto error_close_iid_key
;
185 if (0 <= list
->num_methods
) {
186 static WCHAR
const fmt
[3] = { '%', 'd', 0 };
189 res
= RegCreateKeyExW(iid_key
, num_methods_keyname
, 0, NULL
, 0,
190 KEY_READ
| KEY_WRITE
, NULL
, &key
, NULL
);
191 if (res
!= ERROR_SUCCESS
) goto error_close_iid_key
;
193 wsprintfW(buf
, fmt
, list
->num_methods
);
194 res
= RegSetValueExW(key
, NULL
, 0, REG_SZ
,
196 (lstrlenW(buf
) + 1) * sizeof(WCHAR
));
199 if (res
!= ERROR_SUCCESS
) goto error_close_iid_key
;
202 if (list
->ps_clsid
) {
203 res
= register_key_guid(iid_key
, ps_clsid_keyname
, list
->ps_clsid
);
204 if (res
!= ERROR_SUCCESS
) goto error_close_iid_key
;
207 if (list
->ps_clsid32
) {
208 res
= register_key_guid(iid_key
, ps_clsid32_keyname
, list
->ps_clsid32
);
209 if (res
!= ERROR_SUCCESS
) goto error_close_iid_key
;
213 RegCloseKey(iid_key
);
216 error_close_interface_key
:
217 RegCloseKey(interface_key
);
219 return res
!= ERROR_SUCCESS
? HRESULT_FROM_WIN32(res
) : S_OK
;
222 /***********************************************************************
223 * unregister_interfaces
225 static HRESULT
unregister_interfaces(struct regsvr_interface
const *list
)
227 LONG res
= ERROR_SUCCESS
;
230 res
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, interface_keyname
, 0,
231 KEY_READ
| KEY_WRITE
, &interface_key
);
232 if (res
== ERROR_FILE_NOT_FOUND
) return S_OK
;
233 if (res
!= ERROR_SUCCESS
) goto error_return
;
235 for (; res
== ERROR_SUCCESS
&& list
->iid
; ++list
) {
238 StringFromGUID2(list
->iid
, buf
, 39);
239 res
= recursive_delete_keyW(interface_key
, buf
);
242 RegCloseKey(interface_key
);
244 return res
!= ERROR_SUCCESS
? HRESULT_FROM_WIN32(res
) : S_OK
;
247 /***********************************************************************
250 static HRESULT
register_coclasses(struct regsvr_coclass
const *list
)
252 LONG res
= ERROR_SUCCESS
;
255 res
= RegCreateKeyExW(HKEY_CLASSES_ROOT
, clsid_keyname
, 0, NULL
, 0,
256 KEY_READ
| KEY_WRITE
, NULL
, &coclass_key
, NULL
);
257 if (res
!= ERROR_SUCCESS
) goto error_return
;
259 for (; res
== ERROR_SUCCESS
&& list
->clsid
; ++list
) {
263 StringFromGUID2(list
->clsid
, buf
, 39);
264 res
= RegCreateKeyExW(coclass_key
, buf
, 0, NULL
, 0,
265 KEY_READ
| KEY_WRITE
, NULL
, &clsid_key
, NULL
);
266 if (res
!= ERROR_SUCCESS
) goto error_close_coclass_key
;
269 res
= RegSetValueExA(clsid_key
, NULL
, 0, REG_SZ
,
270 (CONST BYTE
*)(list
->name
),
271 strlen(list
->name
) + 1);
272 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
277 sprintf(buffer
, "@shell32.dll,-%u", list
->idName
);
278 res
= RegSetValueExA(clsid_key
, localized_valuename
, 0, REG_SZ
,
279 (CONST BYTE
*)(buffer
), strlen(buffer
)+1);
280 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
283 if (list
->idDefaultIcon
) {
287 res
= RegCreateKeyExW(clsid_key
, defaulticon_keyname
, 0, NULL
, 0,
288 KEY_READ
| KEY_WRITE
, NULL
, &icon_key
, NULL
);
289 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
291 sprintf(buffer
, "shell32.dll,-%u", list
->idDefaultIcon
);
292 res
= RegSetValueExA(icon_key
, NULL
, 0, REG_SZ
,
293 (CONST BYTE
*)(buffer
), strlen(buffer
)+1);
294 RegCloseKey(icon_key
);
295 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
299 res
= register_key_defvalueA(clsid_key
, ips_keyname
, list
->ips
);
300 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
306 res
= RegCreateKeyExW(clsid_key
, ips32_keyname
, 0, NULL
, 0,
307 KEY_READ
| KEY_WRITE
, NULL
,
309 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
311 res
= RegSetValueExA(ips32_key
, NULL
, 0, REG_SZ
,
312 (CONST BYTE
*)list
->ips32
,
313 lstrlenA(list
->ips32
) + 1);
314 if (res
== ERROR_SUCCESS
&& list
->ips32_tmodel
)
315 res
= RegSetValueExA(ips32_key
, tmodel_valuename
, 0, REG_SZ
,
316 (CONST BYTE
*)list
->ips32_tmodel
,
317 strlen(list
->ips32_tmodel
) + 1);
318 RegCloseKey(ips32_key
);
319 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
322 if (list
->flags
& SHELLEX_MAYCHANGEDEFAULTMENU
) {
323 HKEY shellex_key
, mcdm_key
;
325 res
= RegCreateKeyExW(clsid_key
, shellex_keyname
, 0, NULL
, 0,
326 KEY_READ
| KEY_WRITE
, NULL
,
328 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
329 res
= RegCreateKeyExW(shellex_key
, mcdm_keyname
, 0, NULL
, 0,
330 KEY_READ
| KEY_WRITE
, NULL
,
332 RegCloseKey(shellex_key
);
333 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
334 RegCloseKey(mcdm_key
);
338 (SHELLFOLDER_WANTSFORPARSING
|SHELLFOLDER_ATTRIBUTES
|SHELLFOLDER_CALLFORATTRIBUTES
))
340 HKEY shellfolder_key
;
342 res
= RegCreateKeyExW(clsid_key
, shellfolder_keyname
, 0, NULL
, 0,
343 KEY_READ
| KEY_WRITE
, NULL
,
344 &shellfolder_key
, NULL
);
345 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
346 if (list
->flags
& SHELLFOLDER_WANTSFORPARSING
)
347 res
= RegSetValueExA(shellfolder_key
, wfparsing_valuename
, 0, REG_SZ
, (const BYTE
*)"", 1);
348 if (list
->flags
& SHELLFOLDER_ATTRIBUTES
)
349 res
= RegSetValueExA(shellfolder_key
, attributes_valuename
, 0, REG_DWORD
,
350 (const BYTE
*)&list
->dwAttributes
, sizeof(DWORD
));
351 if (list
->flags
& SHELLFOLDER_CALLFORATTRIBUTES
)
352 res
= RegSetValueExA(shellfolder_key
, cfattributes_valuename
, 0, REG_DWORD
,
353 (const BYTE
*)&list
->dwCallForAttributes
, sizeof(DWORD
));
354 RegCloseKey(shellfolder_key
);
355 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
358 if (list
->clsid_str
) {
359 res
= register_key_defvalueA(clsid_key
, clsid_keyname
,
361 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
367 res
= register_key_defvalueA(clsid_key
, progid_keyname
,
369 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
371 res
= RegCreateKeyExA(HKEY_CLASSES_ROOT
, list
->progid
, 0,
372 NULL
, 0, KEY_READ
| KEY_WRITE
, NULL
,
374 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
376 res
= register_key_defvalueW(progid_key
, clsid_keyname
, buf
);
377 RegCloseKey(progid_key
);
378 if (res
!= ERROR_SUCCESS
) goto error_close_clsid_key
;
381 error_close_clsid_key
:
382 RegCloseKey(clsid_key
);
385 error_close_coclass_key
:
386 RegCloseKey(coclass_key
);
388 return res
!= ERROR_SUCCESS
? HRESULT_FROM_WIN32(res
) : S_OK
;
391 /***********************************************************************
392 * unregister_coclasses
394 static HRESULT
unregister_coclasses(struct regsvr_coclass
const *list
)
396 LONG res
= ERROR_SUCCESS
;
399 res
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, clsid_keyname
, 0,
400 KEY_READ
| KEY_WRITE
, &coclass_key
);
401 if (res
== ERROR_FILE_NOT_FOUND
) return S_OK
;
402 if (res
!= ERROR_SUCCESS
) goto error_return
;
404 for (; res
== ERROR_SUCCESS
&& list
->clsid
; ++list
) {
407 StringFromGUID2(list
->clsid
, buf
, 39);
408 res
= recursive_delete_keyW(coclass_key
, buf
);
409 if (res
!= ERROR_SUCCESS
) goto error_close_coclass_key
;
412 res
= recursive_delete_keyA(HKEY_CLASSES_ROOT
, list
->progid
);
413 if (res
!= ERROR_SUCCESS
) goto error_close_coclass_key
;
417 error_close_coclass_key
:
418 RegCloseKey(coclass_key
);
420 return res
!= ERROR_SUCCESS
? HRESULT_FROM_WIN32(res
) : S_OK
;
423 /**********************************************************************
424 * register_namespace_extensions
426 static WCHAR
*get_namespace_key(struct regsvr_namespace
const *list
) {
427 static const WCHAR wszExplorerKey
[] = {
428 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
429 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
430 'E','x','p','l','o','r','e','r','\\',0 };
431 static const WCHAR wszNamespace
[] = { '\\','N','a','m','e','s','p','a','c','e','\\',0 };
432 WCHAR
*pwszKey
, *pwszCLSID
;
434 pwszKey
= HeapAlloc(GetProcessHeap(), 0, sizeof(wszExplorerKey
)+sizeof(wszNamespace
)+
435 sizeof(WCHAR
)*(lstrlenW(list
->parent
)+CHARS_IN_GUID
));
439 lstrcpyW(pwszKey
, wszExplorerKey
);
440 lstrcatW(pwszKey
, list
->parent
);
441 lstrcatW(pwszKey
, wszNamespace
);
442 if (FAILED(StringFromCLSID(list
->clsid
, &pwszCLSID
))) {
443 HeapFree(GetProcessHeap(), 0, pwszKey
);
446 lstrcatW(pwszKey
, pwszCLSID
);
447 CoTaskMemFree(pwszCLSID
);
452 static HRESULT
register_namespace_extensions(struct regsvr_namespace
const *list
) {
456 for (; list
->clsid
; list
++) {
457 pwszKey
= get_namespace_key(list
);
459 /* Create the key and set the value. */
460 if (pwszKey
&& ERROR_SUCCESS
==
461 RegCreateKeyExW(HKEY_LOCAL_MACHINE
, pwszKey
, 0, NULL
, 0, KEY_WRITE
, NULL
, &hKey
, NULL
))
463 RegSetValueExW(hKey
, NULL
, 0, REG_SZ
, (const BYTE
*)list
->value
, sizeof(WCHAR
)*(lstrlenW(list
->value
)+1));
467 HeapFree(GetProcessHeap(), 0, pwszKey
);
472 static HRESULT
unregister_namespace_extensions(struct regsvr_namespace
const *list
) {
475 for (; list
->clsid
; list
++) {
476 pwszKey
= get_namespace_key(list
);
477 RegDeleteKeyW(HKEY_LOCAL_MACHINE
, pwszKey
);
478 HeapFree(GetProcessHeap(), 0, pwszKey
);
483 /***********************************************************************
486 static LONG
register_key_guid(HKEY base
, WCHAR
const *name
, GUID
const *guid
)
490 StringFromGUID2(guid
, buf
, 39);
491 return register_key_defvalueW(base
, name
, buf
);
494 /***********************************************************************
495 * regsvr_key_defvalueW
497 static LONG
register_key_defvalueW(
505 res
= RegCreateKeyExW(base
, name
, 0, NULL
, 0,
506 KEY_READ
| KEY_WRITE
, NULL
, &key
, NULL
);
507 if (res
!= ERROR_SUCCESS
) return res
;
508 res
= RegSetValueExW(key
, NULL
, 0, REG_SZ
, (CONST BYTE
*)value
,
509 (lstrlenW(value
) + 1) * sizeof(WCHAR
));
514 /***********************************************************************
515 * regsvr_key_defvalueA
517 static LONG
register_key_defvalueA(
525 res
= RegCreateKeyExW(base
, name
, 0, NULL
, 0,
526 KEY_READ
| KEY_WRITE
, NULL
, &key
, NULL
);
527 if (res
!= ERROR_SUCCESS
) return res
;
528 res
= RegSetValueExA(key
, NULL
, 0, REG_SZ
, (CONST BYTE
*)value
,
529 lstrlenA(value
) + 1);
534 /***********************************************************************
535 * recursive_delete_key
537 static LONG
recursive_delete_key(HKEY key
)
540 WCHAR subkey_name
[MAX_PATH
];
545 cName
= sizeof(subkey_name
) / sizeof(WCHAR
);
546 res
= RegEnumKeyExW(key
, 0, subkey_name
, &cName
,
547 NULL
, NULL
, NULL
, NULL
);
548 if (res
!= ERROR_SUCCESS
&& res
!= ERROR_MORE_DATA
) {
549 res
= ERROR_SUCCESS
; /* presumably we're done enumerating */
552 res
= RegOpenKeyExW(key
, subkey_name
, 0,
553 KEY_READ
| KEY_WRITE
, &subkey
);
554 if (res
== ERROR_FILE_NOT_FOUND
) continue;
555 if (res
!= ERROR_SUCCESS
) break;
557 res
= recursive_delete_key(subkey
);
559 if (res
!= ERROR_SUCCESS
) break;
562 if (res
== ERROR_SUCCESS
) res
= RegDeleteKeyW(key
, 0);
566 /***********************************************************************
567 * recursive_delete_keyA
569 static LONG
recursive_delete_keyA(HKEY base
, char const *name
)
574 res
= RegOpenKeyExA(base
, name
, 0, KEY_READ
| KEY_WRITE
, &key
);
575 if (res
== ERROR_FILE_NOT_FOUND
) return ERROR_SUCCESS
;
576 if (res
!= ERROR_SUCCESS
) return res
;
577 res
= recursive_delete_key(key
);
582 /***********************************************************************
583 * recursive_delete_keyW
585 static LONG
recursive_delete_keyW(HKEY base
, WCHAR
const *name
)
590 res
= RegOpenKeyExW(base
, name
, 0, KEY_READ
| KEY_WRITE
, &key
);
591 if (res
== ERROR_FILE_NOT_FOUND
) return ERROR_SUCCESS
;
592 if (res
!= ERROR_SUCCESS
) return res
;
593 res
= recursive_delete_key(key
);
598 /***********************************************************************
601 static GUID
const CLSID_Desktop
= {
602 0x00021400, 0x0000, 0x0000, {0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46} };
604 static GUID
const CLSID_Shortcut
= {
605 0x00021401, 0x0000, 0x0000, {0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46} };
607 static struct regsvr_coclass
const coclass_list
[] = {
615 { &CLSID_DragDropHelper
,
616 "Shell Drag and Drop Helper",
629 { &CLSID_NetworkPlaces
,
642 SHELLEX_MAYCHANGEDEFAULTMENU
644 { &CLSID_AutoComplete
,
657 SHELLFOLDER_WANTSFORPARSING
659 { &CLSID_UnixDosFolder
,
665 SHELLFOLDER_WANTSFORPARSING
|SHELLFOLDER_ATTRIBUTES
|SHELLFOLDER_CALLFORATTRIBUTES
,
666 SFGAO_FILESYSANCESTOR
|SFGAO_FOLDER
|SFGAO_HASSUBFOLDER
,
669 { &CLSID_FolderShortcut
,
675 SHELLFOLDER_ATTRIBUTES
|SHELLFOLDER_CALLFORATTRIBUTES
,
676 SFGAO_FILESYSTEM
|SFGAO_FOLDER
|SFGAO_LINK
,
677 SFGAO_HASSUBFOLDER
|SFGAO_FILESYSTEM
|SFGAO_FOLDER
|SFGAO_FILESYSANCESTOR
679 { &CLSID_MyDocuments
,
685 SHELLFOLDER_WANTSFORPARSING
|SHELLFOLDER_ATTRIBUTES
|SHELLFOLDER_CALLFORATTRIBUTES
,
686 SFGAO_FILESYSANCESTOR
|SFGAO_FOLDER
|SFGAO_HASSUBFOLDER
,
691 IDS_RECYCLEBIN_FOLDER_NAME
,
695 SHELLFOLDER_ATTRIBUTES
,
696 SFGAO_FOLDER
|SFGAO_DROPTARGET
|SFGAO_HASPROPSHEET
,
700 IDI_SHELL_FULL_RECYCLE_BIN
702 { &CLSID_ShellFSFolder
,
703 "Shell File System Folder",
709 { &CLSID_ShellFolderViewOC
,
710 "Microsoft Shell Folder View Router",
716 { NULL
} /* list terminator */
719 /***********************************************************************
723 static struct regsvr_interface
const interface_list
[] = {
724 { NULL
} /* list terminator */
727 /***********************************************************************
728 * namespace extensions list
730 static const WCHAR wszDesktop
[] = { 'D','e','s','k','t','o','p',0 };
731 static const WCHAR wszSlash
[] = { '/', 0 };
732 static const WCHAR wszMyDocuments
[] = { 'M','y',' ','D','o','c','u','m','e','n','t','s', 0 };
733 static const WCHAR wszRecycleBin
[] = { 'T','r','a','s','h', 0 };
735 static struct regsvr_namespace
const namespace_extensions_list
[] = {
737 &CLSID_UnixDosFolder
,
754 /***********************************************************************
755 * DllRegisterServer (SHELL32.@)
757 HRESULT WINAPI
DllRegisterServer(void)
763 hr
= register_coclasses(coclass_list
);
765 hr
= register_interfaces(interface_list
);
767 hr
= SHELL_RegisterShellFolders();
769 hr
= register_namespace_extensions(namespace_extensions_list
);
773 /***********************************************************************
774 * DllUnregisterServer (SHELL32.@)
776 HRESULT WINAPI
DllUnregisterServer(void)
782 hr
= unregister_coclasses(coclass_list
);
784 hr
= unregister_interfaces(interface_list
);
786 hr
= unregister_namespace_extensions(namespace_extensions_list
);