Index: trunk/src/shell32/resource.asm
===================================================================
--- trunk/src/shell32/resource.asm	(revision 1469)
+++ trunk/src/shell32/resource.asm	(revision 1470)
@@ -2,5 +2,5 @@
 ;/* Source : shres.rc */
 ;/* Cmdline: wrc -s -I. -ID:\IBMCPP\include -I..\..\include -I..\..\include\win -o resource.asm shres.rc */
-;/* Date   : Tue Oct 19 20:15:43 1999 */
+;/* Date   : Mon Oct 25 10:23:09 1999 */
 
 	.386p
@@ -12,5 +12,5 @@
 	public	_Resource_PEResTab
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 6
@@ -29,5 +29,5 @@
 L3:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 16
@@ -66,5 +66,5 @@
 L4:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	3, 0
@@ -77,5 +77,5 @@
 L5:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	2, 0
@@ -86,5 +86,5 @@
 L6:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 2
@@ -95,5 +95,5 @@
 L14:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 5
@@ -110,5 +110,5 @@
 L16:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -117,5 +117,5 @@
 L3_1:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -124,5 +124,5 @@
 L3_2:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -131,5 +131,5 @@
 L3_3:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -138,5 +138,5 @@
 L3_4:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -145,5 +145,5 @@
 L3_5:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -152,5 +152,5 @@
 L3_6:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -159,5 +159,5 @@
 L3_7:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -166,5 +166,5 @@
 L3_8:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -173,5 +173,5 @@
 L3_9:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -180,5 +180,5 @@
 L3_10:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -187,5 +187,5 @@
 L3_11:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -194,5 +194,5 @@
 L3_12:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -201,5 +201,5 @@
 L3_13:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -208,5 +208,5 @@
 L3_14:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -215,5 +215,5 @@
 L3_15:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -222,5 +222,5 @@
 L3_16:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -229,5 +229,5 @@
 L4_MENU_001:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -236,5 +236,5 @@
 L4_MENU_002:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -243,5 +243,5 @@
 L4_MENU_SHV_FILE:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -250,5 +250,5 @@
 L5_SHBRSFORFOLDER_MSGBOX:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -257,5 +257,5 @@
 L5_SHELL_ABOUT_MSGBOX:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -264,5 +264,5 @@
 L6_1:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -271,5 +271,5 @@
 L6_2:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -278,5 +278,5 @@
 L14_0:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -285,5 +285,5 @@
 L14_3:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -292,5 +292,5 @@
 L14_8:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -299,5 +299,5 @@
 L14_15:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -306,5 +306,5 @@
 L14_34:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -313,5 +313,5 @@
 L16_1:
 	dd	0
-	dd	0380cc35fh
+	dd	03814217dh
 	dd	0
 	dw	0, 1
@@ -462,5 +462,5 @@
 L16_1_0:
 	dd	_Resource_VerInf_1_0_data - _Resource_PEResTab
-	dd	812
+	dd	760
 	dd	0
 	dd	0
@@ -624,5 +624,5 @@
 	align	4
 _Resource_VerInf_1_0_data:
-	db	02ch, 003h, 034h, 000h, 000h, 000h, 056h, 000h
+	db	0f8h, 002h, 034h, 000h, 000h, 000h, 056h, 000h
 	db	053h, 000h, 05fh, 000h, 056h, 000h, 045h, 000h
 	db	052h, 000h, 053h, 000h, 049h, 000h, 04fh, 000h
@@ -635,10 +635,10 @@
 	db	001h, 000h, 001h, 000h, 001h, 000h, 000h, 000h
 	db	000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
-	db	000h, 000h, 000h, 000h, 08ch, 002h, 000h, 000h
+	db	000h, 000h, 000h, 000h, 058h, 002h, 000h, 000h
 	db	000h, 000h, 053h, 000h, 074h, 000h, 072h, 000h
 	db	069h, 000h, 06eh, 000h, 067h, 000h, 046h, 000h
 	db	069h, 000h, 06ch, 000h, 065h, 000h, 049h, 000h
 	db	06eh, 000h, 066h, 000h, 06fh, 000h, 000h, 000h
-	db	068h, 002h, 000h, 000h, 000h, 000h, 030h, 000h
+	db	034h, 002h, 000h, 000h, 000h, 000h, 030h, 000h
 	db	034h, 000h, 030h, 000h, 039h, 000h, 030h, 000h
 	db	034h, 000h, 045h, 000h, 034h, 000h, 000h, 000h
@@ -657,73 +657,66 @@
 	db	069h, 000h, 06eh, 000h, 020h, 000h, 054h, 000h
 	db	065h, 000h, 061h, 000h, 06dh, 000h, 000h, 000h
-	db	060h, 000h, 01ch, 000h, 001h, 000h, 046h, 000h
+	db	02ah, 000h, 001h, 000h, 001h, 000h, 046h, 000h
 	db	069h, 000h, 06ch, 000h, 065h, 000h, 044h, 000h
 	db	065h, 000h, 073h, 000h, 063h, 000h, 072h, 000h
 	db	069h, 000h, 070h, 000h, 074h, 000h, 069h, 000h
 	db	06fh, 000h, 06eh, 000h, 000h, 000h, 000h, 000h
-	db	047h, 000h, 065h, 000h, 06eh, 000h, 065h, 000h
-	db	072h, 000h, 069h, 000h, 063h, 000h, 020h, 000h
-	db	045h, 000h, 078h, 000h, 061h, 000h, 06dh, 000h
-	db	070h, 000h, 06ch, 000h, 065h, 000h, 020h, 000h
-	db	041h, 000h, 070h, 000h, 070h, 000h, 06ch, 000h
-	db	069h, 000h, 063h, 000h, 061h, 000h, 074h, 000h
-	db	069h, 000h, 06fh, 000h, 06eh, 000h, 000h, 000h
-	db	028h, 000h, 004h, 000h, 001h, 000h, 046h, 000h
-	db	069h, 000h, 06ch, 000h, 065h, 000h, 056h, 000h
-	db	065h, 000h, 072h, 000h, 073h, 000h, 069h, 000h
-	db	06fh, 000h, 06eh, 000h, 000h, 000h, 000h, 000h
-	db	030h, 000h, 02eh, 000h, 030h, 000h, 000h, 000h
-	db	042h, 000h, 011h, 000h, 001h, 000h, 049h, 000h
-	db	06eh, 000h, 074h, 000h, 065h, 000h, 072h, 000h
-	db	06eh, 000h, 061h, 000h, 06ch, 000h, 04eh, 000h
-	db	061h, 000h, 06dh, 000h, 065h, 000h, 000h, 000h
-	db	04fh, 000h, 064h, 000h, 069h, 000h, 06eh, 000h
-	db	033h, 000h, 032h, 000h, 020h, 000h, 02dh, 000h
-	db	020h, 000h, 053h, 000h, 048h, 000h, 045h, 000h
-	db	04ch, 000h, 04ch, 000h, 033h, 000h, 032h, 000h
-	db	000h, 000h, 000h, 000h, 04ah, 000h, 013h, 000h
-	db	001h, 000h, 04ch, 000h, 065h, 000h, 067h, 000h
-	db	061h, 000h, 06ch, 000h, 043h, 000h, 06fh, 000h
-	db	070h, 000h, 079h, 000h, 072h, 000h, 069h, 000h
-	db	067h, 000h, 068h, 000h, 074h, 000h, 000h, 000h
+	db	000h, 000h, 000h, 000h, 028h, 000h, 004h, 000h
+	db	001h, 000h, 046h, 000h, 069h, 000h, 06ch, 000h
+	db	065h, 000h, 056h, 000h, 065h, 000h, 072h, 000h
+	db	073h, 000h, 069h, 000h, 06fh, 000h, 06eh, 000h
+	db	000h, 000h, 000h, 000h, 030h, 000h, 02eh, 000h
+	db	030h, 000h, 000h, 000h, 042h, 000h, 011h, 000h
+	db	001h, 000h, 049h, 000h, 06eh, 000h, 074h, 000h
+	db	065h, 000h, 072h, 000h, 06eh, 000h, 061h, 000h
+	db	06ch, 000h, 04eh, 000h, 061h, 000h, 06dh, 000h
+	db	065h, 000h, 000h, 000h, 04fh, 000h, 064h, 000h
+	db	069h, 000h, 06eh, 000h, 033h, 000h, 032h, 000h
+	db	020h, 000h, 02dh, 000h, 020h, 000h, 053h, 000h
+	db	048h, 000h, 045h, 000h, 04ch, 000h, 04ch, 000h
+	db	033h, 000h, 032h, 000h, 000h, 000h, 000h, 000h
+	db	04ah, 000h, 013h, 000h, 001h, 000h, 04ch, 000h
+	db	065h, 000h, 067h, 000h, 061h, 000h, 06ch, 000h
 	db	043h, 000h, 06fh, 000h, 070h, 000h, 079h, 000h
 	db	072h, 000h, 069h, 000h, 067h, 000h, 068h, 000h
-	db	074h, 000h, 020h, 000h, 028h, 000h, 043h, 000h
-	db	029h, 000h, 020h, 000h, 031h, 000h, 039h, 000h
-	db	039h, 000h, 039h, 000h, 000h, 000h, 000h, 000h
-	db	02ah, 000h, 001h, 000h, 001h, 000h, 04ch, 000h
-	db	065h, 000h, 067h, 000h, 061h, 000h, 06ch, 000h
-	db	054h, 000h, 072h, 000h, 061h, 000h, 064h, 000h
-	db	065h, 000h, 06dh, 000h, 061h, 000h, 072h, 000h
-	db	06bh, 000h, 073h, 000h, 000h, 000h, 000h, 000h
+	db	074h, 000h, 000h, 000h, 043h, 000h, 06fh, 000h
+	db	070h, 000h, 079h, 000h, 072h, 000h, 069h, 000h
+	db	067h, 000h, 068h, 000h, 074h, 000h, 020h, 000h
+	db	028h, 000h, 043h, 000h, 029h, 000h, 020h, 000h
+	db	031h, 000h, 039h, 000h, 039h, 000h, 039h, 000h
 	db	000h, 000h, 000h, 000h, 02ah, 000h, 001h, 000h
-	db	001h, 000h, 04fh, 000h, 072h, 000h, 069h, 000h
-	db	067h, 000h, 069h, 000h, 06eh, 000h, 061h, 000h
-	db	06ch, 000h, 046h, 000h, 069h, 000h, 06ch, 000h
-	db	065h, 000h, 06eh, 000h, 061h, 000h, 06dh, 000h
-	db	065h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
-	db	042h, 000h, 011h, 000h, 001h, 000h, 050h, 000h
-	db	072h, 000h, 06fh, 000h, 064h, 000h, 075h, 000h
-	db	063h, 000h, 074h, 000h, 04eh, 000h, 061h, 000h
-	db	06dh, 000h, 065h, 000h, 000h, 000h, 000h, 000h
-	db	04fh, 000h, 064h, 000h, 069h, 000h, 06eh, 000h
-	db	033h, 000h, 032h, 000h, 020h, 000h, 02dh, 000h
-	db	020h, 000h, 053h, 000h, 048h, 000h, 045h, 000h
-	db	04ch, 000h, 04ch, 000h, 033h, 000h, 032h, 000h
-	db	000h, 000h, 000h, 000h, 02ch, 000h, 004h, 000h
+	db	001h, 000h, 04ch, 000h, 065h, 000h, 067h, 000h
+	db	061h, 000h, 06ch, 000h, 054h, 000h, 072h, 000h
+	db	061h, 000h, 064h, 000h, 065h, 000h, 06dh, 000h
+	db	061h, 000h, 072h, 000h, 06bh, 000h, 073h, 000h
+	db	000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
+	db	02ah, 000h, 001h, 000h, 001h, 000h, 04fh, 000h
+	db	072h, 000h, 069h, 000h, 067h, 000h, 069h, 000h
+	db	06eh, 000h, 061h, 000h, 06ch, 000h, 046h, 000h
+	db	069h, 000h, 06ch, 000h, 065h, 000h, 06eh, 000h
+	db	061h, 000h, 06dh, 000h, 065h, 000h, 000h, 000h
+	db	000h, 000h, 000h, 000h, 042h, 000h, 011h, 000h
 	db	001h, 000h, 050h, 000h, 072h, 000h, 06fh, 000h
 	db	064h, 000h, 075h, 000h, 063h, 000h, 074h, 000h
-	db	056h, 000h, 065h, 000h, 072h, 000h, 073h, 000h
-	db	069h, 000h, 06fh, 000h, 06eh, 000h, 000h, 000h
-	db	031h, 000h, 02eh, 000h, 030h, 000h, 000h, 000h
-	db	044h, 000h, 000h, 000h, 000h, 000h, 056h, 000h
-	db	061h, 000h, 072h, 000h, 046h, 000h, 069h, 000h
-	db	06ch, 000h, 065h, 000h, 049h, 000h, 06eh, 000h
-	db	066h, 000h, 06fh, 000h, 000h, 000h, 000h, 000h
-	db	024h, 000h, 004h, 000h, 000h, 000h, 054h, 000h
-	db	072h, 000h, 061h, 000h, 06eh, 000h, 073h, 000h
-	db	06ch, 000h, 061h, 000h, 074h, 000h, 069h, 000h
-	db	06fh, 000h, 06eh, 000h, 000h, 000h, 000h, 000h
-	db	009h, 004h, 0e4h, 004h
+	db	04eh, 000h, 061h, 000h, 06dh, 000h, 065h, 000h
+	db	000h, 000h, 000h, 000h, 04fh, 000h, 064h, 000h
+	db	069h, 000h, 06eh, 000h, 033h, 000h, 032h, 000h
+	db	020h, 000h, 02dh, 000h, 020h, 000h, 053h, 000h
+	db	048h, 000h, 045h, 000h, 04ch, 000h, 04ch, 000h
+	db	033h, 000h, 032h, 000h, 000h, 000h, 000h, 000h
+	db	02ch, 000h, 004h, 000h, 001h, 000h, 050h, 000h
+	db	072h, 000h, 06fh, 000h, 064h, 000h, 075h, 000h
+	db	063h, 000h, 074h, 000h, 056h, 000h, 065h, 000h
+	db	072h, 000h, 073h, 000h, 069h, 000h, 06fh, 000h
+	db	06eh, 000h, 000h, 000h, 031h, 000h, 02eh, 000h
+	db	030h, 000h, 000h, 000h, 044h, 000h, 000h, 000h
+	db	000h, 000h, 056h, 000h, 061h, 000h, 072h, 000h
+	db	046h, 000h, 069h, 000h, 06ch, 000h, 065h, 000h
+	db	049h, 000h, 06eh, 000h, 066h, 000h, 06fh, 000h
+	db	000h, 000h, 000h, 000h, 024h, 000h, 004h, 000h
+	db	000h, 000h, 054h, 000h, 072h, 000h, 061h, 000h
+	db	06eh, 000h, 073h, 000h, 06ch, 000h, 061h, 000h
+	db	074h, 000h, 069h, 000h, 06fh, 000h, 06eh, 000h
+	db	000h, 000h, 000h, 000h, 009h, 004h, 0e4h, 004h
 
 	align	4
Index: trunk/src/shell32/shellpath.cpp
===================================================================
--- trunk/src/shell32/shellpath.cpp	(revision 1469)
+++ trunk/src/shell32/shellpath.cpp	(revision 1470)
@@ -1,1011 +1,1146 @@
-/* $Id: shellpath.cpp,v 1.2 1999-10-09 11:17:05 sandervl Exp $ */
-/*
- * Path Functions
- *
- * Many of this functions are in SHLWAPI.DLL also
- *
- */
-#include <string.h>
-#include <ctype.h>
-#include <wctype.h>
-#define HAVE_WCTYPE_H
-#include <odin.h>
+/* $Id: shellpath.cpp,v 1.3 1999-10-27 09:33:48 phaller Exp $ */ 
+ 
+/* 
+ * Win32 SHELL32 for OS/2 
+ * 
+ * Copyright 1997 Marcus Meissner 
+ * Copyright 1999 Patrick Haller (haller@zebra.fh-weingarten.de) 
+ * Project Odin Software License can be found in LICENSE.TXT 
+ * 
+ * Path Functions 
+ * 
+ * Many of this functions are in SHLWAPI.DLL also 
+ * 
+ */ 
+ 
+ 
+/***************************************************************************** 
+ * Includes                                                                  * 
+ *****************************************************************************/ 
+ 
+#include <odin.h> 
+#include <odinwrap.h> 
+#include <os2sel.h> 
+ 
+#include <string.h> 
+#include <ctype.h> 
+#include <wctype.h> 
+#define HAVE_WCTYPE_H 
+#include <odin.h> 
+ 
+#define ICOM_CINTERFACE 1 
+#define CINTERFACE 1 
+ 
+#include "debugtools.h" 
+#include "winnls.h" 
+#include "winversion.h" 
+#include "winreg.h" 
+#include "crtdll.h" 
+ 
+#include "shlobj.h" 
+#include "shell32_main.h" 
+ 
+#include <heapstring.h> 
+#include <misc.h> 
+ 
+ 
+ODINDEBUGCHANNEL(SHELL32-SHELLPATH) 
+ 
+ 
+/************************************************************************* 
+ * PathIsRoot [SHELL32.29] 
+ */ 
+ODINFUNCTION1(BOOL, PathIsRootA, 
+              LPCSTR, x)
+{  TRACE("%s\n",x); 
+   if (*(x+1)==':' && *(x+2)=='\\')         /* "X:\" */ 
+     return 1; 
+   if (*x=='\\')                         /* "\" */ 
+     return 0; 
+   if (x[0]=='\\' && x[1]=='\\')            /* UNC "\\<xx>\" */ 
+   { int foundbackslash = 0; 
+     x=x+2; 
+     while (*x) 
+     { if (*x++=='\\') 
+         foundbackslash++; 
+     } 
+     if (foundbackslash<=1)              /* max 1 \ more ... */ 
+       return 1; 
+   } 
+   return 0; 
+} 
+ODINFUNCTION1(BOOL, PathIsRootW, 
+              LPCWSTR, x)
+{  TRACE("%s\n",debugstr_w(x)); 
+   if (*(x+1)==':' && *(x+2)=='\\')         /* "X:\" */ 
+     return 1; 
+   if (*x == (WCHAR) '\\')                  /* "\" */ 
+     return 0; 
+   if (x[0]==(WCHAR)'\\' && x[1]==(WCHAR)'\\') /* UNC "\\<xx>\" */ 
+   { int foundbackslash = 0; 
+     x=x+2; 
+     while (*x) 
+     { if (*x++==(WCHAR)'\\') 
+         foundbackslash++; 
+     } 
+     if (foundbackslash<=1)              /* max 1 \ more ... */ 
+       return 1; 
+   } 
+   return 0; 
+} 
+ODINFUNCTION1(BOOL, PathIsRootAW, 
+              LPCVOID, x)
+{  if (VERSION_OsIsUnicode()) 
+     return PathIsRootW((LPWSTR)x); 
+   return PathIsRootA((LPSTR)x); 
+ 
+} 
+/************************************************************************* 
+ * PathBuildRoot [SHELL32.30] 
+ */ 
+ODINFUNCTION2(LPSTR, PathBuildRootA, 
+              LPSTR, root, 
+              BYTE, drive)
+{ 
+  TRACE("%p %i\n",root, drive); 
+   strcpy(root,"A:\\"); 
+   root[0]+=drive; 
+   return root; 
+} 
+ 
+/************************************************************************* 
+ * PathFindExtension [SHELL32.31] 
+ * 
+ * NOTES 
+ *     returns pointer to last . in last pathcomponent or at \0. 
+ */ 
+ODINFUNCTION1(LPCSTR, PathFindExtensionA, 
+              LPCSTR, path)
+{  LPCSTR   lastpoint = NULL; 
+   TRACE("%p %s\n",path,path); 
+   while (*path) 
+   { if (*path=='\\'||*path==' ') 
+       lastpoint=NULL; 
+     if (*path=='.') 
+       lastpoint=path; 
+     path++; 
+   } 
+   return lastpoint?lastpoint:path; 
+} 
+ODINFUNCTION1(LPCWSTR, PathFindExtensionW, 
+              LPCWSTR, path)
+{  LPCWSTR   lastpoint = NULL; 
+   TRACE("%p L%s\n",path,debugstr_w(path)); 
+   while (*path) 
+   { if (*path==(WCHAR)'\\'||*path==(WCHAR)' ') 
+       lastpoint=NULL; 
+     if (*path==(WCHAR)'.') 
+       lastpoint=path; 
+     path++; 
+   } 
+   return lastpoint?lastpoint:path; 
+} 
+ODINFUNCTION1(LPCVOID, PathFindExtensionAW, 
+              LPCVOID, path)
+{  if (VERSION_OsIsUnicode()) 
+     return PathFindExtensionW((LPWSTR)path); 
+   return PathFindExtensionA((LPSTR)path); 
+ 
+} 
+ 
+/************************************************************************* 
+ * PathAddBackslash [SHELL32.32] 
+ * 
+ * NOTES 
+ *     append \ if there is none 
+ */ 
+ODINFUNCTION1(LPSTR, PathAddBackslashA, 
+              LPSTR, path)
+{  int len; 
+   TRACE("%p->%s\n",path,path); 
+ 
+   len = strlen(path); 
+   if (len && path[len-1]!='\\') 
+   { path[len]  = '\\'; 
+     path[len+1]= 0x00; 
+     return path+len+1; 
+   } 
+   return path+len; 
+} 
+ODINFUNCTION1(LPWSTR, PathAddBackslashW, 
+              LPWSTR, path)
+{  int len; 
+   TRACE("%p->%s\n",path,debugstr_w(path)); 
+ 
+   len = lstrlenW(path); 
+   if (len && path[len-1]!=(WCHAR)'\\') 
+   { path[len]  = (WCHAR)'\\'; 
+     path[len+1]= 0x00; 
+     return path+len+1; 
+   } 
+   return path+len; 
+} 
+ODINFUNCTION1(LPVOID, PathAddBackslashAW, 
+              LPVOID, path)
+{  if(VERSION_OsIsUnicode()) 
+     return PathAddBackslashW((LPWSTR)path); 
+   return PathAddBackslashA((LPSTR)path); 
+} 
+ 
+/************************************************************************* 
+ * PathRemoveBlanks [SHELL32.33] 
+ * 
+ * NOTES 
+ *     remove spaces from beginning and end of passed string 
+ */ 
+ODINFUNCTION1(LPSTR, PathRemoveBlanksA, 
+              LPSTR, str)
+{  LPSTR x = str; 
+   TRACE("%s\n",str); 
+   while (*x==' ') x++; 
+   if (x!=str) 
+     strcpy(str,x); 
+   if (!*str) 
+     return str; 
+   x=str+strlen(str)-1; 
+   while (*x==' ') 
+     x--; 
+   if (*x==' ') 
+     *x='\0'; 
+   return x; 
+} 
+ODINFUNCTION1(LPWSTR, PathRemoveBlanksW, 
+              LPWSTR, str)
+{  LPWSTR x = str; 
+   TRACE("%s\n",debugstr_w(str)); 
+   while (*x==' ') x++; 
+   if (x!=str) 
+     lstrcpyW(str,x); 
+   if (!*str) 
+     return str; 
+   x=str+lstrlenW(str)-1; 
+   while (*x==' ') 
+     x--; 
+   if (*x==' ') 
+     *x='\0'; 
+   return x; 
+} 
+ODINFUNCTION1(LPVOID, PathRemoveBlanksAW, 
+              LPVOID, str)
+{  if(VERSION_OsIsUnicode()) 
+     return PathRemoveBlanksW((LPWSTR)str); 
+   return PathRemoveBlanksA((LPSTR)str); 
+} 
+ 
+ 
+ 
+/************************************************************************* 
+ * PathFindFilename [SHELL32.34] 
+ * 
+ * NOTES 
+ *     basename(char *fn); 
+ */ 
+ODINFUNCTION1(LPCSTR, PathFindFilenameA, 
+              LPCSTR, aptr)
+{  LPCSTR aslash; 
+   aslash = aptr; 
+ 
+   TRACE("%s\n",aslash); 
+   while (aptr[0]) 
+   { if (((aptr[0]=='\\') || (aptr[0]==':')) && aptr[1] && aptr[1]!='\\') 
+         aslash = aptr+1; 
+     aptr++; 
+   } 
+   return aslash; 
+ 
+} 
+ODINFUNCTION1(LPCWSTR, PathFindFilenameW, 
+              LPCWSTR, wptr)
+{  LPCWSTR wslash; 
+   wslash = wptr; 
+ 
+   TRACE("L%s\n",debugstr_w(wslash)); 
+   while (wptr[0]) 
+   { if (((wptr[0]=='\\') || (wptr[0]==':')) && wptr[1] && wptr[1]!='\\') 
+       wslash = wptr+1; 
+     wptr++; 
+   } 
+   return wslash; 
+} 
+ODINFUNCTION1(LPCVOID, PathFindFilenameAW, 
+              LPCVOID, fn)
+{ 
+   if(VERSION_OsIsUnicode()) 
+     return PathFindFilenameW((LPWSTR)fn); 
+   return PathFindFilenameA((LPSTR)fn); 
+} 
+ 
+/************************************************************************* 
+ * PathRemoveFileSpec [SHELL32.35] 
+ * 
+ * NOTES 
+ *     bool getpath(char *pathname); truncates passed argument to a valid path 
+ *     returns if the string was modified or not. 
+ *     "\foo\xx\foo"-> "\foo\xx" 
+ *     "\" -> "\" 
+ *     "a:\foo"   -> "a:\" 
+ */ 
+ODINFUNCTION1(DWORD, PathRemoveFileSpecA, 
+              LPSTR, fn)
+{ 
+   LPSTR x,cutplace; 
+  TRACE("%s\n",fn); 
+   if (!fn[0]) 
+      return 0; 
+   x=fn; 
+   cutplace = fn; 
+   while (*x) { 
+      if (*x=='\\') { 
+         cutplace=x++; 
+         continue; 
+      } 
+      if (*x==':') { 
+         x++; 
+         if (*x=='\\') 
+            cutplace=++x; 
+         continue; /* already x++ed */ 
+      } 
+      x++; 
+   } 
+   if (!*cutplace) 
+      return 0; 
+   if (cutplace==fn) { 
+      if (fn[0]=='\\') { 
+         if (!fn[1]) 
+            return 0; 
+         fn[0]='\0'; 
+         return 1; 
+      } 
+   } 
+   *cutplace='\0'; 
+   return 1; 
+} 
+ 
+/************************************************************************* 
+ * PathAppend [SHELL32.36] 
+ * 
+ * NOTES 
+ *     concat_paths(char*target,const char*add); 
+ *     concats "target\\add" and writes them to target 
+ */ 
+ODINFUNCTION2(LPSTR, PathAppendA, 
+              LPSTR, x1, 
+              LPSTR, x2)
+{ 
+  TRACE("%s %s\n",x1,x2); 
+  while (x2[0]=='\\') x2++; 
+  return PathCombineA(x1,x1,x2); 
+} 
+ 
+/************************************************************************* 
+ * PathCombine [SHELL32.37] 
+ * 
+ * NOTES 
+ *  if lpszFile='.' skip it 
+ *  szDest can be equal to lpszFile. Thats why we use sTemp 
+ */ 
+ODINFUNCTION3(LPSTR, PathCombineA, 
+              LPSTR, szDest, 
+              LPCSTR, lpszDir, 
+              LPCSTR, lpszFile)
+{  char sTemp[MAX_PATH]; 
+   TRACE("%p %p->%s %p->%s\n",szDest, lpszDir, lpszDir, lpszFile, lpszFile); 
+ 
+ 
+   if (!lpszFile || !lpszFile[0] || (lpszFile[0]=='.' && !lpszFile[1]) ) 
+   { strcpy(szDest,lpszDir); 
+     return szDest; 
+   } 
+ 
+   /*  if lpszFile is a complete path don't care about lpszDir */ 
+   if (PathIsRootA(lpszFile)) 
+   { strcpy(szDest,lpszFile); 
+   } 
+   else 
+   { strcpy(sTemp,lpszDir); 
+     PathAddBackslashA(sTemp); 
+     strcat(sTemp,lpszFile); 
+     strcpy(szDest,sTemp); 
+   } 
+   return szDest; 
+} 
+ODINFUNCTION3(LPWSTR, PathCombineW, 
+              LPWSTR, szDest, 
+              LPCWSTR, lpszDir, 
+              LPCWSTR, lpszFile)
+{  WCHAR sTemp[MAX_PATH]; 
+   TRACE("%p %p->%s %p->%s\n",szDest, lpszDir, debugstr_w(lpszDir), 
+          lpszFile, debugstr_w(lpszFile)); 
+ 
+ 
+   if (!lpszFile || !lpszFile[0] || (lpszFile[0]==(WCHAR)'.' && !lpszFile[1]) ) 
+   { lstrcpyW(szDest,lpszDir); 
+     return szDest; 
+   } 
+ 
+   /*  if lpszFile is a complete path don't care about lpszDir */ 
+   if (PathIsRootW(lpszFile)) 
+   { lstrcpyW(szDest,lpszFile); 
+   } 
+   else 
+   { lstrcpyW(sTemp,lpszDir); 
+     PathAddBackslashW(sTemp); 
+     lstrcatW(sTemp,lpszFile); 
+     lstrcpyW(szDest,sTemp); 
+   } 
+   return szDest; 
+} 
+ODINFUNCTION3(LPVOID, PathCombineAW, 
+              LPVOID, szDest, 
+              LPCVOID, lpszDir, 
+              LPCVOID, lpszFile)
+{  if (VERSION_OsIsUnicode()) 
+     return PathCombineW( (LPWSTR)szDest, (LPWSTR)lpszDir, (LPWSTR)lpszFile ); 
+   return PathCombineA( (LPSTR)szDest, (LPSTR)lpszDir, (LPSTR)lpszFile ); 
+} 
+ 
+/************************************************************************* 
+ * PathIsUNC [SHELL32.39] 
+ * 
+ * NOTES 
+ *     PathIsUNC(char*path); 
+ */ 
+ODINFUNCTION1(BOOL, PathIsUNCA, 
+              LPCSTR, path)
+{  TRACE("%s\n",path); 
+ 
+   if ((path[0]=='\\') && (path[1]=='\\')) 
+     return TRUE; 
+   return FALSE; 
+} 
+ODINFUNCTION1(BOOL, PathIsUNCW, 
+              LPCWSTR, path)
+{  TRACE("%s\n",debugstr_w(path)); 
+ 
+   if ((path[0]=='\\') && (path[1]=='\\')) 
+     return TRUE; 
+   return FALSE; 
+} 
+ODINFUNCTION1(BOOL, PathIsUNCAW, 
+              LPCVOID, path)
+{  if (VERSION_OsIsUnicode()) 
+     return PathIsUNCW( (LPWSTR)path ); 
+   return PathIsUNCA( (LPSTR)path ); 
+} 
+/************************************************************************* 
+ *  PathIsRelativ [SHELL32.40] 
+ * 
+ */ 
+ODINFUNCTION1(BOOL, PathIsRelativeA, 
+              LPCSTR, path)
+{  TRACE("path=%s\n",path); 
+ 
+   if (path && (path[0]!='\\' && path[1]==':')) 
+     return TRUE; 
+   return FALSE; 
+} 
+ODINFUNCTION1(BOOL, PathIsRelativeW, 
+              LPCWSTR, path)
+{  TRACE("path=%s\n",debugstr_w(path)); 
+ 
+   if (path && (path[0]!='\\' && path[1]==':')) 
+     return TRUE; 
+   return FALSE; 
+} 
+ODINFUNCTION1(BOOL, PathIsRelativeAW, 
+              LPCVOID, path)
+{  if (VERSION_OsIsUnicode()) 
+     return PathIsRelativeW( (LPWSTR)path ); 
+   return PathIsRelativeA( (LPSTR)path ); 
+} 
+/************************************************************************* 
+ *  PathIsExe [SHELL32.43] 
+ * 
+ */ 
+ODINFUNCTION1(BOOL, PathIsExeA, 
+              LPCSTR, path)
+{  FIXME("path=%s\n",path); 
+   return FALSE; 
+} 
+ODINFUNCTION1(BOOL, PathIsExeW, 
+              LPCWSTR, path)
+{  FIXME("path=%s\n",debugstr_w(path)); 
+   return FALSE; 
+} 
+ODINFUNCTION1(BOOL, PathIsExeAW, 
+              LPCVOID, path)
+{  if (VERSION_OsIsUnicode()) 
+     return PathIsExeW ((LPWSTR)path); 
+   return PathIsExeA((LPSTR)path); 
+} 
+ 
+/************************************************************************* 
+ * PathFileExists [SHELL32.45] 
+ * 
+ * NOTES 
+ *     file_exists(char *fn); 
+ */ 
+ODINFUNCTION1(BOOL, PathFileExistsA, 
+              LPSTR, fn)
+{ 
+  TRACE("%s\n",fn); 
+   if (GetFileAttributesA(fn)==-1) 
+      return FALSE; 
+    else 
+      return TRUE; 
+} 
+/************************************************************************* 
+ * PathMatchSingleMask 
+ * 
+ * NOTES 
+ *     internal (used by PathMatchSpec) 
+ */ 
+static BOOL PathMatchSingleMaskA(LPCSTR name, LPCSTR mask) 
+{ 
+  while (*name && *mask && *mask!=';') { 
+    if (*mask=='*') { 
+      do { 
+   if (PathMatchSingleMaskA(name,mask+1)) return 1;  /* try substrings */ 
+      } while (*name++); 
+      return 0; 
+    } 
+    if (toupper(*mask)!=toupper(*name) && *mask!='?') return 0; 
+    name++; 
+    mask++; 
+  } 
+  if (!*name) { 
+    while (*mask=='*') mask++; 
+    if (!*mask || *mask==';') return 1; 
+  } 
+  return 0; 
+} 
+static BOOL PathMatchSingleMaskW(LPCWSTR name, LPCWSTR mask) 
+{ 
+  while (*name && *mask && *mask!=';') { 
+    if (*mask=='*') { 
+      do { 
+   if (PathMatchSingleMaskW(name,mask+1)) return 1;  /* try substrings */ 
+      } while (*name++); 
+      return 0; 
+    } 
+    if (towupper(*mask)!=towupper(*name) && *mask!='?') return 0; 
+    name++; 
+    mask++; 
+  } 
+  if (!*name) { 
+    while (*mask=='*') mask++; 
+    if (!*mask || *mask==';') return 1; 
+  } 
+  return 0; 
+} 
+/************************************************************************* 
+ * PathMatchSpec [SHELL32.46] 
+ * 
+ * NOTES 
+ *     used from COMDLG32 
+ */ 
+ODINFUNCTION2(BOOL, PathMatchSpecA, 
+              LPCSTR, name, 
+              LPCSTR, mask)
+{ 
+  TRACE("%s %s\n",name,mask); 
+ 
+  if (!lstrcmpA( mask, "*.*" )) return 1;   /* we don't require a period */ 
+ 
+  while (*mask) { 
+    if (PathMatchSingleMaskA(name,mask)) return 1;    /* helper function */ 
+    while (*mask && *mask!=';') mask++; 
+    if (*mask==';') { 
+      mask++; 
+      while (*mask==' ') mask++;      /*  masks may be separated by "; " */ 
+     } 
+   } 
+  return 0; 
+} 
+ODINFUNCTION2(BOOL, PathMatchSpecW, 
+              LPCWSTR, name, 
+              LPCWSTR, mask)
+{  WCHAR stemp[4]; 
+  TRACE("%ls %ls\n",name,mask); 
+   lstrcpyAtoW(stemp,"*.*"); 
+  if (!lstrcmpW( mask, stemp )) return 1;   /* we don't require a period */ 
+ 
+  while (*mask) { 
+    if (PathMatchSingleMaskW(name,mask)) return 1;    /* helper function */ 
+    while (*mask && *mask!=';') mask++; 
+    if (*mask==';') { 
+      mask++; 
+      while (*mask==' ') mask++;       /* masks may be separated by "; " */ 
+     } 
+   } 
+  return 0; 
+} 
+ODINFUNCTION2(BOOL, PathMatchSpecAW, 
+              LPVOID, name, 
+              LPVOID, mask)
+{  if (VERSION_OsIsUnicode()) 
+     return PathMatchSpecW( (LPWSTR)name, (LPWSTR)mask ); 
+   return PathMatchSpecA( (LPSTR)name, (LPSTR)mask ); 
+} 
+/************************************************************************* 
+ * PathSetDlgItemPathAW [SHELL32.48] 
+ * NOTES 
+ *  use PathCompactPath to make sure, the path fits into the control 
+ */ 
+ 
+ODINFUNCTION3(BOOL, PathSetDlgItemPathA, 
+              HWND, hDlg, 
+              int, id, 
+              LPCSTR, pszPath)
+{  TRACE("%x %x %s\n",hDlg, id, pszPath); 
+   return SetDlgItemTextA(hDlg, id, pszPath); 
+} 
+ODINFUNCTION3(BOOL, PathSetDlgItemPathW, 
+              HWND, hDlg, 
+              int, id, 
+              LPCWSTR, pszPath)
+{  TRACE("%x %x %s\n",hDlg, id, debugstr_w(pszPath)); 
+   return SetDlgItemTextW(hDlg, id, pszPath); 
+} 
+ODINFUNCTION3(BOOL, PathSetDlgItemPathAW, 
+              HWND, hDlg, 
+              int, id, 
+              LPCVOID, pszPath)
+{  if (VERSION_OsIsUnicode()) 
+     return PathSetDlgItemPathW(hDlg, id, (LPWSTR)pszPath); 
+   return PathSetDlgItemPathA(hDlg, id, (LPSTR)pszPath); 
+} 
+ 
+/************************************************************************* 
+ * PathQualifyAW [SHELL32.49] 
+ */ 
+ 
+ODINFUNCTION1(BOOL, PathQualifyA, 
+              LPCSTR, pszPath)
+{  FIXME("%s\n",pszPath); 
+   return 0; 
+} 
+ODINFUNCTION1(BOOL, PathQualifyW, 
+              LPCWSTR, pszPath)
+{  FIXME("%s\n",debugstr_w(pszPath)); 
+   return 0; 
+} 
+ODINFUNCTION1(BOOL, PathQualifyAW, 
+              LPCVOID, pszPath)
+{  if (VERSION_OsIsUnicode()) 
+     return PathQualifyW((LPWSTR)pszPath); 
+   return PathQualifyA((LPSTR)pszPath); 
+} 
+ 
+/************************************************************************* 
+ * PathResolve [SHELL32.51] 
+ */ 
+ODINFUNCTION3(DWORD, PathResolve, 
+              LPCSTR, s, 
+              DWORD, x2, 
+              DWORD, x3)
+{ 
+   FIXME("(%s,0x%08lx,0x%08lx),stub!\n",s,x2,x3); 
+   return 0; 
+} 
+ 
+/************************************************************************* 
+ * PathGetArgs [SHELL32.52] 
+ * 
+ * NOTES 
+ *     look for next arg in string. handle "quoted" strings 
+ *     returns pointer to argument *AFTER* the space. Or to the \0. 
+ */ 
+ODINFUNCTION1(LPCSTR, PathGetArgsA, 
+              LPCSTR, cmdline)
+{  BOOL  qflag = FALSE; 
+ 
+   TRACE("%s\n",cmdline); 
+ 
+   while (*cmdline) 
+   { if ((*cmdline==' ') && !qflag) 
+       return cmdline+1; 
+     if (*cmdline=='"') 
+       qflag=!qflag; 
+     cmdline++; 
+   } 
+   return cmdline; 
+ 
+} 
+ODINFUNCTION1(LPCWSTR, PathGetArgsW, 
+              LPCWSTR, cmdline)
+{  BOOL  qflag = FALSE; 
+ 
+   TRACE("%sL\n",debugstr_w(cmdline)); 
+ 
+   while (*cmdline) 
+   { if ((*cmdline==' ') && !qflag) 
+       return cmdline+1; 
+     if (*cmdline=='"') 
+       qflag=!qflag; 
+     cmdline++; 
+   } 
+   return cmdline; 
+} 
+ODINFUNCTION1(LPCVOID, PathGetArgsAW, 
+              LPVOID, cmdline)
+{  if (VERSION_OsIsUnicode()) 
+     return PathGetArgsW((LPWSTR)cmdline); 
+   return PathGetArgsA((LPSTR)cmdline); 
+} 
+/************************************************************************* 
+ * PathQuoteSpaces [SHELL32.55] 
+ * 
+ * NOTES 
+ *     basename(char *fn); 
+ */ 
+ODINFUNCTION1(LPSTR, PathQuoteSpacesA, 
+              LPCSTR, aptr)
+{  FIXME("%s\n",aptr); 
+   return 0; 
+ 
+} 
+ODINFUNCTION1(LPWSTR, PathQuoteSpacesW, 
+              LPCWSTR, wptr)
+{  FIXME("L%s\n",debugstr_w(wptr)); 
+   return 0; 
+} 
+ODINFUNCTION1(LPVOID, PathQuoteSpacesAW, 
+              LPCVOID, fn)
+{  if(VERSION_OsIsUnicode()) 
+     return PathQuoteSpacesW((LPWSTR)fn); 
+   return PathQuoteSpacesA((LPSTR)fn); 
+} 
+ 
+ 
+/************************************************************************* 
+ * PathUnquoteSpaces [SHELL32.56] 
+ * 
+ * NOTES 
+ *     unquote string (remove ") 
+ */ 
+ODINPROCEDURE1(PathUnquoteSpacesA, 
+               LPSTR, str)
+{  DWORD      len = lstrlenA(str); 
+   TRACE("%s\n",str); 
+   if (*str!='"') 
+     return; 
+   if (str[len-1]!='"') 
+     return; 
+   str[len-1]='\0'; 
+   lstrcpyA(str,str+1); 
+   return; 
+} 
+ODINPROCEDURE1(PathUnquoteSpacesW, 
+               LPWSTR, str)
+{  DWORD len = lstrlenW(str); 
+ 
+   TRACE("%s\n",debugstr_w(str)); 
+ 
+   if (*str!='"') 
+     return; 
+   if (str[len-1]!='"') 
+     return; 
+   str[len-1]='\0'; 
+   lstrcpyW(str,str+1); 
+   return; 
+} 
+ODINPROCEDURE1(PathUnquoteSpacesAW, 
+               LPVOID, str)
+{  if(VERSION_OsIsUnicode()) 
+     PathUnquoteSpacesW((LPWSTR)str); 
+   PathUnquoteSpacesA((LPSTR)str); 
+} 
+ 
+ 
+/************************************************************************* 
+ * PathGetDriveNumber32 [SHELL32.57] 
+ * 
+ */ 
+ODINFUNCTION1(HRESULT, PathGetDriveNumber, 
+              LPSTR, u)
+{  FIXME("%s stub\n",debugstr_a(u)); 
+   return 0; 
+} 
+ 
+/************************************************************************* 
+ * PathYetAnotherMakeUniqueName [SHELL32.75] 
+ * 
+ * NOTES 
+ *     exported by ordinal 
+ */ 
+ODINFUNCTION2(BOOL, PathYetAnotherMakeUniqueNameA, 
+              LPDWORD, x, 
+              LPDWORD, y)
+{ 
+    FIXME("(%p,%p):stub.\n",x,y); 
+    return TRUE; 
+} 
+ 
+/************************************************************************* 
+ * IsLFNDrive [SHELL32.119] 
+ * 
+ * NOTES 
+ *     exported by ordinal Name 
+ */ 
+ODINFUNCTION1(BOOL, IsLFNDriveA, 
+              LPCSTR, path)
+{ 
+    DWORD   fnlen; 
+ 
+    if (!GetVolumeInformationA(path,NULL,0,NULL,&fnlen,NULL,NULL,0)) 
+   return FALSE; 
+    return fnlen>12; 
+} 
+/************************************************************************* 
+ * PathFindOnPath [SHELL32.145] 
+ */ 
+ODINFUNCTION2(BOOL, PathFindOnPathA, 
+              LPSTR, sFile, 
+              LPCSTR, sOtherDirs)
+{  FIXME("%s %s\n",sFile, sOtherDirs); 
+   return FALSE; 
+} 
+ODINFUNCTION2(BOOL, PathFindOnPathW, 
+              LPWSTR, sFile, 
+              LPCWSTR, sOtherDirs)
+{  FIXME("%s %s\n",debugstr_w(sFile), debugstr_w(sOtherDirs)); 
+   return FALSE; 
+} 
+ODINFUNCTION2(BOOL, PathFindOnPathAW, 
+              LPVOID, sFile, 
+              LPCVOID, sOtherDirs)
+{  if (VERSION_OsIsUnicode()) 
+     return PathFindOnPathW((LPWSTR)sFile, (LPWSTR)sOtherDirs); 
+   return PathFindOnPathA((LPSTR)sFile, (LPSTR)sOtherDirs); 
+} 
+ 
+/************************************************************************* 
+ * PathGetExtension [SHELL32.158] 
+ * 
+ * NOTES 
+ *     exported by ordinal 
+ */ 
+ODINFUNCTION3(LPCSTR, PathGetExtensionA, 
+              LPCSTR, path, 
+              DWORD, y, 
+              DWORD, z)
+{  TRACE("(%s,%08lx,%08lx)\n",path,y,z); 
+   path = PathFindExtensionA(path); 
+   return *path?(path+1):path; 
+} 
+ODINFUNCTION3(LPCWSTR, PathGetExtensionW, 
+              LPCWSTR, path, 
+              DWORD, y, 
+              DWORD, z)
+{  TRACE("(L%s,%08lx,%08lx)\n",debugstr_w(path),y,z); 
+   path = PathFindExtensionW(path); 
+   return *path?(path+1):path; 
+} 
+ODINFUNCTION3(LPCVOID, PathGetExtensionAW, 
+              LPCVOID, path, 
+              DWORD, y, 
+              DWORD, z)
+{  if (VERSION_OsIsUnicode()) 
+     return PathGetExtensionW((LPWSTR)path,y,z); 
+   return PathGetExtensionA((LPSTR)path,y,z); 
+} 
+ 
+/************************************************************************* 
+ * PathCleanupSpec                                [SHELL32.171] 
+ * 
+ */ 
+ODINFUNCTION2(DWORD, PathCleanupSpecA, 
+              LPSTR, x, 
+              LPSTR, y)
+{ 
+   FIXME("%p(%s) %p(%s) stub\n",x,x,y,y); 
+   return TRUE; 
+} 
+ 
+ODINFUNCTION2(DWORD, PathCleanupSpecW, 
+              LPWSTR, x, 
+              LPWSTR, y)
+{ 
+   FIXME("%p(%s) %p(%s) stub\n",x,debugstr_w(x),y,debugstr_w(y)); 
+   return TRUE; 
+} 
+ 
+ODINFUNCTION2(DWORD, PathCleanupSpecAW, 
+              LPVOID, x, 
+              LPVOID, y)
+{ 
+   if (VERSION_OsIsUnicode()) 
+     return PathCleanupSpecW((LPWSTR)x,(LPWSTR)y); 
+   return PathCleanupSpecA((LPSTR)x,(LPSTR)y); 
+} 
+ 
+/************************************************************************* 
+ * SheGetDirW [SHELL32.281] 
+ * 
+ */ 
+ODINFUNCTION2(HRESULT, SheGetDirW, 
+              LPWSTR, u, 
+              LPWSTR, v)
+{  FIXME("%p %p stub\n",u,v); 
+   return 0; 
+} 
+ 
+/************************************************************************* 
+ * SheChangeDirW [SHELL32.274] 
+ * 
+ */ 
+ODINFUNCTION1(HRESULT, SheChangeDirW, 
+              LPWSTR, u)
+{  FIXME("(%s),stub\n",debugstr_w(u)); 
+   return 0; 
+} 
+ 
+/************************************************************************* 
+*  PathProcessCommand                    [SHELL32.653] 
+*/ 
+ODINFUNCTION4(HRESULT, PathProcessCommandA, 
+              LPSTR, lpCommand, 
+              LPSTR, v, 
+              DWORD, w, 
+              DWORD, x)
+{ 
+   FIXME("%p(%s) %p 0x%04lx 0x%04lx stub\n", 
+   lpCommand, lpCommand, v, w,x ); 
+   return 0; 
+} 
+ 
+ODINFUNCTION4(HRESULT, PathProcessCommandW, 
+              LPWSTR, lpCommand, 
+              LPSTR, v, 
+              DWORD, w, 
+              DWORD, x)
+{ 
+   FIXME("%p(%s) %p 0x%04lx 0x%04lx stub\n", 
+   lpCommand, debugstr_w(lpCommand), v, w,x ); 
+   return 0; 
+} 
+ 
+ODINFUNCTION4(HRESULT, PathProcessCommandAW, 
+              LPVOID, lpCommand, 
+              LPSTR, v, 
+              DWORD, w, 
+              DWORD, x)
+{ 
+   if (VERSION_OsIsUnicode()) 
+     return PathProcessCommandW((LPWSTR)lpCommand, v, w, x); 
+   return PathProcessCommandA((LPSTR)lpCommand, v, w, x); 
+} 
+ 
+/************************************************************************* 
+ * SHGetSpecialFolderPath [SHELL32.175] 
+ * 
+ * converts csidl to path 
+ * 
+ */ 
+ 
+static char * szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"; 
+ 
+ODINFUNCTION4(BOOL, SHGetSpecialFolderPathA, 
+              HWND, hwndOwner, 
+              LPSTR, szPath, 
+              DWORD, csidl, 
+              BOOL, bCreate)
+{ 
+   CHAR  szValueName[MAX_PATH], szDefaultPath[MAX_PATH]; 
+   HKEY  hRootKey, hKey; 
+   BOOL  bRelative = TRUE; 
+   DWORD dwType, dwDisp, dwPathLen = MAX_PATH; 
+ 
+   TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate); 
+ 
+   /* build default values */ 
+   switch(csidl) 
+   { 
+     case CSIDL_APPDATA: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy (szValueName, "AppData"); 
+       strcpy (szDefaultPath, "AppData"); 
+       break; 
+ 
+     case CSIDL_COOKIES: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy (szValueName, "Cookies"); 
+       strcpy(szDefaultPath, "Cookies"); 
+       break; 
+ 
+     case CSIDL_DESKTOPDIRECTORY: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Desktop"); 
+       strcpy(szDefaultPath, "Desktop"); 
+       break; 
+ 
+     case CSIDL_COMMON_DESKTOPDIRECTORY: 
+       hRootKey = HKEY_LOCAL_MACHINE; 
+       strcpy(szValueName, "Common Desktop"); 
+       strcpy(szDefaultPath, "Desktop"); 
+       break; 
+ 
+     case CSIDL_FAVORITES: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Favorites"); 
+       strcpy(szDefaultPath, "Favorites"); 
+       break; 
+ 
+     case CSIDL_FONTS: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Fonts"); 
+       strcpy(szDefaultPath, "Fonts"); 
+       break; 
+ 
+     case CSIDL_HISTORY: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "History"); 
+       strcpy(szDefaultPath, "History"); 
+       break; 
+ 
+     case CSIDL_NETHOOD: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "NetHood"); 
+       strcpy(szDefaultPath, "NetHood"); 
+       break; 
+ 
+     case CSIDL_INTERNET_CACHE: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Cache"); 
+       strcpy(szDefaultPath, "Temporary Internet Files"); 
+       break; 
+ 
+     case CSIDL_PERSONAL: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Personal"); 
+       strcpy(szDefaultPath, "My Own Files"); 
+       bRelative = FALSE; 
+       break; 
+ 
+     case CSIDL_PRINTHOOD: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "PrintHood"); 
+       strcpy(szDefaultPath, "PrintHood"); 
+       break; 
+ 
+     case CSIDL_PROGRAMS: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Programs"); 
+       strcpy(szDefaultPath, "StatrMenu\\Programs"); 
+       break; 
+ 
+     case CSIDL_COMMON_PROGRAMS: 
+       hRootKey = HKEY_LOCAL_MACHINE; 
+       strcpy(szValueName, "Common Programs"); 
+       strcpy(szDefaultPath, ""); 
+       break; 
+ 
+     case CSIDL_RECENT: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Recent"); 
+       strcpy(szDefaultPath, "Recent"); 
+       break; 
+ 
+     case CSIDL_SENDTO: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "SendTo"); 
+       strcpy(szDefaultPath, "SendTo"); 
+       break; 
+ 
+     case CSIDL_STARTMENU: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "StartMenu"); 
+       strcpy(szDefaultPath, "StartMenu"); 
+       break; 
+ 
+     case CSIDL_COMMON_STARTMENU: 
+       hRootKey = HKEY_LOCAL_MACHINE; 
+       strcpy(szValueName, "Common StartMenu"); 
+       strcpy(szDefaultPath, "StartMenu"); 
+       break; 
+ 
+     case CSIDL_STARTUP: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Startup"); 
+       strcpy(szDefaultPath, "StartMenu\\Programs\\Startup"); 
+       break; 
+ 
+     case CSIDL_COMMON_STARTUP: 
+       hRootKey = HKEY_LOCAL_MACHINE; 
+       strcpy(szValueName, "Common Startup"); 
+       strcpy(szDefaultPath, "StartMenu\\Programs\\Startup"); 
+       break; 
+ 
+     case CSIDL_TEMPLATES: 
+       hRootKey = HKEY_CURRENT_USER; 
+       strcpy(szValueName, "Templates"); 
+       strcpy(szDefaultPath, "ShellNew"); 
+       break; 
+ 
+     default: 
+       ERR("folder unknown or not allowed\n"); 
+       return FALSE; 
+   } 
+ 
+   if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&hKey,&dwDisp)) 
+   { 
+     return FALSE; 
+   } 
+ 
+   if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen)) 
+   { 
+     /* value not existing */ 
+     if (bRelative) 
+     { 
+       GetWindowsDirectoryA(szPath, MAX_PATH); 
+       PathAddBackslashA(szPath); 
+       strcat(szPath, szDefaultPath); 
+     } 
+     else 
+     { 
+       strcpy(szPath, szDefaultPath); 
+     } 
+     if (bCreate) 
+     { 
+       CreateDirectoryA(szPath,NULL); 
+     } 
+     RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1); 
+   } 
+   RegCloseKey(hKey); 
+ 
+   return TRUE; 
+} 
+ODINFUNCTION4(BOOL, SHGetSpecialFolderPathW, 
+              HWND, hwndOwner, 
+              LPWSTR, szPath, 
+              DWORD, csidl, 
+              BOOL, bCreate)
+{ 
+   char szTemp[MAX_PATH]; 
+ 
+   if (SHGetSpecialFolderPathA(hwndOwner, szTemp, csidl, bCreate)) 
+   { 
+     lstrcpynAtoW(szPath, szTemp, MAX_PATH); 
+   } 
+ 
+   TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate); 
+ 
+   return TRUE; 
+} 
+ODINFUNCTION4(BOOL, SHGetSpecialFolderPathAW, 
+              HWND, hwndOwner, 
+              LPVOID, szPath, 
+              DWORD, csidl, 
+              BOOL, bCreate)
+{ 
+   if (VERSION_OsIsUnicode()) 
+     return SHGetSpecialFolderPathW (hwndOwner, (LPWSTR)szPath, csidl, bCreate); 
+   return SHGetSpecialFolderPathA (hwndOwner, (LPSTR)szPath, csidl, bCreate); 
+} 
 
-#define ICOM_CINTERFACE 1
-#define CINTERFACE 1
-
-#include "debugtools.h"
-#include "winnls.h"
-#include "winversion.h"
-#include "winreg.h"
-#include "crtdll.h"
-
-#include "shlobj.h"
-#include "shell32_main.h"
-
-#include <heapstring.h>
-#include <misc.h>
-
-DEFAULT_DEBUG_CHANNEL(shell)
-
-/*************************************************************************
- * PathIsRoot [SHELL32.29]
- */
-BOOL WINAPI PathIsRootA(LPCSTR x)
-{	TRACE("%s\n",x);
-	if (*(x+1)==':' && *(x+2)=='\\')		/* "X:\" */
-	  return 1;
-	if (*x=='\\')		/* "\" */
-	  return 0;
-	if (x[0]=='\\' && x[1]=='\\')		/* UNC "\\<xx>\" */
-	{ int	foundbackslash = 0;
-	  x=x+2;
-	  while (*x)
-	  { if (*x++=='\\')
-	      foundbackslash++;
-	  }
-	  if (foundbackslash<=1)	/* max 1 \ more ... */
-	    return 1;
-	}
-	return 0;
-}
-BOOL WINAPI PathIsRootW(LPCWSTR x)
-{	TRACE("%s\n",debugstr_w(x));
-	if (*(x+1)==':' && *(x+2)=='\\')		/* "X:\" */
-	  return 1;
-	if (*x == (WCHAR) '\\')		/* "\" */
-	  return 0;
-	if (x[0]==(WCHAR)'\\' && x[1]==(WCHAR)'\\')	/* UNC "\\<xx>\" */
-	{ int	foundbackslash = 0;
-	  x=x+2;
-	  while (*x)
-	  { if (*x++==(WCHAR)'\\')
-	      foundbackslash++;
-	  }
-	  if (foundbackslash<=1)	/* max 1 \ more ... */
-	    return 1;
-	}
-	return 0;
-}
-BOOL WINAPI PathIsRootAW(LPCVOID x)
-{	if (VERSION_OsIsUnicode())
-	  return PathIsRootW((LPWSTR)x);
-	return PathIsRootA((LPSTR)x);
-
-}
-/*************************************************************************
- * PathBuildRoot [SHELL32.30]
- */
-LPSTR WINAPI PathBuildRootA(LPSTR root,BYTE drive) {
-  TRACE("%p %i\n",root, drive);
-	strcpy(root,"A:\\");
-	root[0]+=drive;
-	return root;
-}
-
-/*************************************************************************
- * PathFindExtension [SHELL32.31]
- *
- * NOTES
- *     returns pointer to last . in last pathcomponent or at \0.
- */
-LPCSTR WINAPI PathFindExtensionA(LPCSTR path)
-{	LPCSTR   lastpoint = NULL;
-	TRACE("%p %s\n",path,path);
-	while (*path)
-	{ if (*path=='\\'||*path==' ')
-	    lastpoint=NULL;
-	  if (*path=='.')
-	    lastpoint=path;
-	  path++;
-	}
-	return lastpoint?lastpoint:path;
-}
-LPCWSTR WINAPI PathFindExtensionW(LPCWSTR path)
-{	LPCWSTR   lastpoint = NULL;
-	TRACE("%p L%s\n",path,debugstr_w(path));
-	while (*path)
-	{ if (*path==(WCHAR)'\\'||*path==(WCHAR)' ')
-	    lastpoint=NULL;
-	  if (*path==(WCHAR)'.')
-	    lastpoint=path;
-	  path++;
-	}
-	return lastpoint?lastpoint:path;
-}
-LPCVOID WINAPI PathFindExtensionAW(LPCVOID path)
-{	if (VERSION_OsIsUnicode())
-	  return PathFindExtensionW((LPWSTR)path);
-	return PathFindExtensionA((LPSTR)path);
-
-}
-
-/*************************************************************************
- * PathAddBackslash [SHELL32.32]
- *
- * NOTES
- *     append \ if there is none
- */
-LPSTR WINAPI PathAddBackslashA(LPSTR path)
-{	int len;
-	TRACE("%p->%s\n",path,path);
-
-	len = strlen(path);
-	if (len && path[len-1]!='\\')
-	{ path[len]  = '\\';
-	  path[len+1]= 0x00;
-	  return path+len+1;
-	}
-	return path+len;
-}
-LPWSTR WINAPI PathAddBackslashW(LPWSTR path)
-{	int len;
-	TRACE("%p->%s\n",path,debugstr_w(path));
-
-	len = lstrlenW(path);
-	if (len && path[len-1]!=(WCHAR)'\\')
-	{ path[len]  = (WCHAR)'\\';
-	  path[len+1]= 0x00;
-	  return path+len+1;
-	}
-	return path+len;
-}
-LPVOID WINAPI PathAddBackslashAW(LPVOID path)
-{	if(VERSION_OsIsUnicode())
-	  return PathAddBackslashW((LPWSTR)path);
-	return PathAddBackslashA((LPSTR)path);
-}
-
-/*************************************************************************
- * PathRemoveBlanks [SHELL32.33]
- *
- * NOTES
- *     remove spaces from beginning and end of passed string
- */
-LPSTR WINAPI PathRemoveBlanksA(LPSTR str)
-{	LPSTR x = str;
-	TRACE("%s\n",str);
-	while (*x==' ') x++;
-	if (x!=str)
-	  strcpy(str,x);
-	if (!*str)
-	  return str;
-	x=str+strlen(str)-1;
-	while (*x==' ')
-	  x--;
-	if (*x==' ')
-	  *x='\0';
-	return x;
-}
-LPWSTR WINAPI PathRemoveBlanksW(LPWSTR str)
-{	LPWSTR x = str;
-	TRACE("%s\n",debugstr_w(str));
-	while (*x==' ') x++;
-	if (x!=str)
-	  lstrcpyW(str,x);
-	if (!*str)
-	  return str;
-	x=str+lstrlenW(str)-1;
-	while (*x==' ')
-	  x--;
-	if (*x==' ')
-	  *x='\0';
-	return x;
-}
-LPVOID WINAPI PathRemoveBlanksAW(LPVOID str)
-{	if(VERSION_OsIsUnicode())
-	  return PathRemoveBlanksW((LPWSTR)str);
-	return PathRemoveBlanksA((LPSTR)str);
-}
-
-
-
-/*************************************************************************
- * PathFindFilename [SHELL32.34]
- *
- * NOTES
- *     basename(char *fn);
- */
-LPCSTR WINAPI PathFindFilenameA(LPCSTR aptr)
-{	LPCSTR aslash;
-	aslash = aptr;
-
-	TRACE("%s\n",aslash);
-	while (aptr[0])
-	{ if (((aptr[0]=='\\') || (aptr[0]==':')) && aptr[1] && aptr[1]!='\\')
-	      aslash = aptr+1;
-	  aptr++;
-	}
-	return aslash;
-
-}
-LPCWSTR WINAPI PathFindFilenameW(LPCWSTR wptr)
-{	LPCWSTR wslash;
-	wslash = wptr;
-
-	TRACE("L%s\n",debugstr_w(wslash));
-	while (wptr[0])
-	{ if (((wptr[0]=='\\') || (wptr[0]==':')) && wptr[1] && wptr[1]!='\\')
-	    wslash = wptr+1;
-	  wptr++;
-	}
-	return wslash;	
-}
-LPCVOID WINAPI PathFindFilenameAW(LPCVOID fn)
-{
-	if(VERSION_OsIsUnicode())
-	  return PathFindFilenameW((LPWSTR)fn);
-	return PathFindFilenameA((LPSTR)fn);
-}
-
-/*************************************************************************
- * PathRemoveFileSpec [SHELL32.35]
- *
- * NOTES
- *     bool getpath(char *pathname); truncates passed argument to a valid path
- *     returns if the string was modified or not.
- *     "\foo\xx\foo"-> "\foo\xx"
- *     "\" -> "\"
- *     "a:\foo"	-> "a:\"
- */
-DWORD WINAPI PathRemoveFileSpecA(LPSTR fn) {
-	LPSTR	x,cutplace;
-  TRACE("%s\n",fn);
-	if (!fn[0])
-		return 0;
-	x=fn;
-	cutplace = fn;
-	while (*x) {
-		if (*x=='\\') {
-			cutplace=x++;
-			continue;
-		}
-		if (*x==':') {
-			x++;
-			if (*x=='\\')
-				cutplace=++x;
-			continue; /* already x++ed */
-		}
-		x++;
-	}
-	if (!*cutplace)
-		return 0;
-	if (cutplace==fn) {
-		if (fn[0]=='\\') {
-			if (!fn[1])
-				return 0;
-			fn[0]='\0';
-			return 1;
-		}
-	}
-	*cutplace='\0';
-	return 1;
-}
-
-/*************************************************************************
- * PathAppend [SHELL32.36]
- *
- * NOTES
- *     concat_paths(char*target,const char*add);
- *     concats "target\\add" and writes them to target
- */
-LPSTR WINAPI PathAppendA(LPSTR x1,LPSTR x2) {
-  TRACE("%s %s\n",x1,x2);
-  while (x2[0]=='\\') x2++;
-  return PathCombineA(x1,x1,x2);
-}
-
-/*************************************************************************
- * PathCombine [SHELL32.37]
- *
- * NOTES
- *  if lpszFile='.' skip it
- *  szDest can be equal to lpszFile. Thats why we use sTemp
- */
-LPSTR WINAPI PathCombineA(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile)
-{	char sTemp[MAX_PATH];
-	TRACE("%p %p->%s %p->%s\n",szDest, lpszDir, lpszDir, lpszFile, lpszFile);
-	
-	
-	if (!lpszFile || !lpszFile[0] || (lpszFile[0]=='.' && !lpszFile[1]) )
-	{ strcpy(szDest,lpszDir);
-	  return szDest;
-	}
-
-	/*  if lpszFile is a complete path don't care about lpszDir */
-	if (PathIsRootA(lpszFile))
-	{ strcpy(szDest,lpszFile);
-	}
-	else
-	{ strcpy(sTemp,lpszDir);
-	  PathAddBackslashA(sTemp);
-	  strcat(sTemp,lpszFile);
-	  strcpy(szDest,sTemp);
-	}
-	return szDest;
-}
-LPWSTR WINAPI PathCombineW(LPWSTR szDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
-{	WCHAR sTemp[MAX_PATH];
-	TRACE("%p %p->%s %p->%s\n",szDest, lpszDir, debugstr_w(lpszDir),
-			 lpszFile, debugstr_w(lpszFile));
-	
-	
-	if (!lpszFile || !lpszFile[0] || (lpszFile[0]==(WCHAR)'.' && !lpszFile[1]) )
-	{ lstrcpyW(szDest,lpszDir);
-	  return szDest;
-	}
-
-	/*  if lpszFile is a complete path don't care about lpszDir */
-	if (PathIsRootW(lpszFile))
-	{ lstrcpyW(szDest,lpszFile);
-	}
-	else
-	{ lstrcpyW(sTemp,lpszDir);
-	  PathAddBackslashW(sTemp);
-	  lstrcatW(sTemp,lpszFile);
-	  lstrcpyW(szDest,sTemp);
-	}
-	return szDest;
-}
-LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile)
-{	if (VERSION_OsIsUnicode())
-	  return PathCombineW( (LPWSTR)szDest, (LPWSTR)lpszDir, (LPWSTR)lpszFile );
-	return PathCombineA( (LPSTR)szDest, (LPSTR)lpszDir, (LPSTR)lpszFile );
-}
-
-/*************************************************************************
- * PathIsUNC [SHELL32.39]
- *
- * NOTES
- *     PathIsUNC(char*path);
- */
-BOOL WINAPI PathIsUNCA(LPCSTR path)
-{	TRACE("%s\n",path);
-
-	if ((path[0]=='\\') && (path[1]=='\\'))
-	  return TRUE;
-	return FALSE;
-}
-BOOL WINAPI PathIsUNCW(LPCWSTR path)
-{	TRACE("%s\n",debugstr_w(path));
-
-	if ((path[0]=='\\') && (path[1]=='\\'))
-	  return TRUE;
-	return FALSE;
-}
-BOOL WINAPI PathIsUNCAW (LPCVOID path)
-{	if (VERSION_OsIsUnicode())
-	  return PathIsUNCW( (LPWSTR)path );
-	return PathIsUNCA( (LPSTR)path );
-}
-/*************************************************************************
- *  PathIsRelativ [SHELL32.40]
- *
- */
-BOOL WINAPI PathIsRelativeA (LPCSTR path)
-{	TRACE("path=%s\n",path);
-
-	if (path && (path[0]!='\\' && path[1]==':'))
-	  return TRUE;
-	return FALSE;
-}
-BOOL WINAPI PathIsRelativeW (LPCWSTR path)
-{	TRACE("path=%s\n",debugstr_w(path));
-
-	if (path && (path[0]!='\\' && path[1]==':'))
-	  return TRUE;
-	return FALSE;
-}
-BOOL WINAPI PathIsRelativeAW (LPCVOID path)
-{	if (VERSION_OsIsUnicode())
-	  return PathIsRelativeW( (LPWSTR)path );
-	return PathIsRelativeA( (LPSTR)path );
-}
-/*************************************************************************
- *  PathIsExe [SHELL32.43]
- *
- */
-BOOL WINAPI PathIsExeA (LPCSTR path)
-{	FIXME("path=%s\n",path);
-	return FALSE;
-}
-BOOL WINAPI PathIsExeW (LPCWSTR path)
-{	FIXME("path=%s\n",debugstr_w(path));
-	return FALSE;
-}
-BOOL WINAPI PathIsExeAW (LPCVOID path)
-{	if (VERSION_OsIsUnicode())
-	  return PathIsExeW ((LPWSTR)path);
-	return PathIsExeA((LPSTR)path);
-}
-
-/*************************************************************************
- * PathFileExists [SHELL32.45]
- *
- * NOTES
- *     file_exists(char *fn);
- */
-BOOL WINAPI PathFileExistsA(LPSTR fn) {
-  TRACE("%s\n",fn);
-   if (GetFileAttributesA(fn)==-1)
-    	return FALSE;
-    else
-    	return TRUE;
-}
-/*************************************************************************
- * PathMatchSingleMask
- *
- * NOTES
- *     internal (used by PathMatchSpec)
- */
-static BOOL PathMatchSingleMaskA(LPCSTR name, LPCSTR mask)
-{
-  while (*name && *mask && *mask!=';') {
-    if (*mask=='*') {
-      do {
-	if (PathMatchSingleMaskA(name,mask+1)) return 1;  /* try substrings */
-      } while (*name++);
-      return 0;
-    }
-    if (toupper(*mask)!=toupper(*name) && *mask!='?') return 0;
-    name++;
-    mask++;
-  }
-  if (!*name) {
-    while (*mask=='*') mask++;
-    if (!*mask || *mask==';') return 1;
-  }
-  return 0;
-}
-static BOOL PathMatchSingleMaskW(LPCWSTR name, LPCWSTR mask)
-{
-  while (*name && *mask && *mask!=';') {
-    if (*mask=='*') {
-      do {
-	if (PathMatchSingleMaskW(name,mask+1)) return 1;  /* try substrings */
-      } while (*name++);
-      return 0;
-    }
-    if (towupper(*mask)!=towupper(*name) && *mask!='?') return 0;
-    name++;
-    mask++;
-  }
-  if (!*name) {
-    while (*mask=='*') mask++;
-    if (!*mask || *mask==';') return 1;
-  }
-  return 0;
-}
-/*************************************************************************
- * PathMatchSpec [SHELL32.46]
- *
- * NOTES
- *     used from COMDLG32
- */
-BOOL WINAPI PathMatchSpecA(LPCSTR name, LPCSTR mask)
-{
-  TRACE("%s %s\n",name,mask);
-
-  if (!lstrcmpA( mask, "*.*" )) return 1;   /* we don't require a period */
-
-  while (*mask) {
-    if (PathMatchSingleMaskA(name,mask)) return 1;    /* helper function */
-    while (*mask && *mask!=';') mask++;
-    if (*mask==';') {
-      mask++;
-      while (*mask==' ') mask++;      /*  masks may be separated by "; " */
-	  }
-	}
-  return 0;
-}
-BOOL WINAPI PathMatchSpecW(LPCWSTR name, LPCWSTR mask)
-{	WCHAR stemp[4];
-  TRACE("%ls %ls\n",name,mask);
-	lstrcpyAtoW(stemp,"*.*");	
-  if (!lstrcmpW( mask, stemp )) return 1;   /* we don't require a period */
-
-  while (*mask) {
-    if (PathMatchSingleMaskW(name,mask)) return 1;    /* helper function */
-    while (*mask && *mask!=';') mask++;
-    if (*mask==';') {
-      mask++;
-      while (*mask==' ') mask++;       /* masks may be separated by "; " */
-	  }
-	}
-  return 0;
-}
-BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
-{	if (VERSION_OsIsUnicode())
-	  return PathMatchSpecW( (LPWSTR)name, (LPWSTR)mask );
-	return PathMatchSpecA( (LPSTR)name, (LPSTR)mask );
-}
-/*************************************************************************
- * PathSetDlgItemPathAW [SHELL32.48]
- * NOTES
- *  use PathCompactPath to make sure, the path fits into the control
- */
-
-BOOL WINAPI PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath)
-{	TRACE("%x %x %s\n",hDlg, id, pszPath);
-	return SetDlgItemTextA(hDlg, id, pszPath);
-}
-BOOL WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath)
-{	TRACE("%x %x %s\n",hDlg, id, debugstr_w(pszPath));
-	return SetDlgItemTextW(hDlg, id, pszPath);
-}
-BOOL WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath)
-{	if (VERSION_OsIsUnicode())
-	  return PathSetDlgItemPathW(hDlg, id, (LPWSTR)pszPath);
-	return PathSetDlgItemPathA(hDlg, id, (LPSTR)pszPath);
-}
-
-/*************************************************************************
- * PathQualifyAW [SHELL32.49]
- */
-
-BOOL WINAPI PathQualifyA(LPCSTR pszPath)
-{	FIXME("%s\n",pszPath);
-	return 0;
-}
-BOOL WINAPI PathQualifyW(LPCWSTR pszPath)
-{	FIXME("%s\n",debugstr_w(pszPath));
-	return 0;
-}
-BOOL WINAPI PathQualifyAW(LPCVOID pszPath)
-{	if (VERSION_OsIsUnicode())
-	  return PathQualifyW((LPWSTR)pszPath);
-	return PathQualifyA((LPSTR)pszPath);
-}
-
-/*************************************************************************
- * PathResolve [SHELL32.51]
- */
-DWORD WINAPI PathResolve(LPCSTR s,DWORD x2,DWORD x3) {
-	FIXME("(%s,0x%08lx,0x%08lx),stub!\n",s,x2,x3);
-	return 0;
-}
-
-/*************************************************************************
- * PathGetArgs [SHELL32.52]
- *
- * NOTES
- *     look for next arg in string. handle "quoted" strings
- *     returns pointer to argument *AFTER* the space. Or to the \0.
- */
-LPCSTR WINAPI PathGetArgsA(LPCSTR cmdline)
-{	BOOL	qflag = FALSE;
-
-	TRACE("%s\n",cmdline);
-
-	while (*cmdline)
-	{ if ((*cmdline==' ') && !qflag)
-	    return cmdline+1;
-	  if (*cmdline=='"')
-	    qflag=!qflag;
-	  cmdline++;
-	}
-	return cmdline;
-
-}
-LPCWSTR WINAPI PathGetArgsW(LPCWSTR cmdline)
-{	BOOL	qflag = FALSE;
-
-	TRACE("%sL\n",debugstr_w(cmdline));
-
-	while (*cmdline)
-	{ if ((*cmdline==' ') && !qflag)
-	    return cmdline+1;
-	  if (*cmdline=='"')
-	    qflag=!qflag;
-	  cmdline++;
-	}
-	return cmdline;
-}
-LPCVOID WINAPI PathGetArgsAW(LPVOID cmdline)
-{	if (VERSION_OsIsUnicode())
-	  return PathGetArgsW((LPWSTR)cmdline);
-	return PathGetArgsA((LPSTR)cmdline);
-}
-/*************************************************************************
- * PathQuoteSpaces [SHELL32.55]
- *
- * NOTES
- *     basename(char *fn);
- */
-LPSTR WINAPI PathQuoteSpacesA(LPCSTR aptr)
-{	FIXME("%s\n",aptr);
-	return 0;
-
-}
-LPWSTR WINAPI PathQuoteSpacesW(LPCWSTR wptr)
-{	FIXME("L%s\n",debugstr_w(wptr));
-	return 0;	
-}
-LPVOID WINAPI PathQuoteSpacesAW (LPCVOID fn)
-{	if(VERSION_OsIsUnicode())
-	  return PathQuoteSpacesW((LPWSTR)fn);
-	return PathQuoteSpacesA((LPSTR)fn);
-}
-
-
-/*************************************************************************
- * PathUnquoteSpaces [SHELL32.56]
- *
- * NOTES
- *     unquote string (remove ")
- */
-VOID WINAPI PathUnquoteSpacesA(LPSTR str)
-{	DWORD      len = lstrlenA(str);
-	TRACE("%s\n",str);
-	if (*str!='"')
-	  return;
-	if (str[len-1]!='"')
-	  return;
-	str[len-1]='\0';
-	lstrcpyA(str,str+1);
-	return;
-}
-VOID WINAPI PathUnquoteSpacesW(LPWSTR str)
-{	DWORD len = lstrlenW(str);
-
-	TRACE("%s\n",debugstr_w(str));
-
-	if (*str!='"')
-	  return;
-	if (str[len-1]!='"')
-	  return;
-	str[len-1]='\0';
-	lstrcpyW(str,str+1);
-	return;
-}
-VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
-{	if(VERSION_OsIsUnicode())
-	  PathUnquoteSpacesW((LPWSTR)str);
-	PathUnquoteSpacesA((LPSTR)str);
-}
-
-
-/*************************************************************************
- * PathGetDriveNumber32 [SHELL32.57]
- *
- */
-HRESULT WINAPI PathGetDriveNumber(LPSTR u)
-{	FIXME("%s stub\n",debugstr_a(u));
-	return 0;
-}
-
-/*************************************************************************
- * PathYetAnotherMakeUniqueName [SHELL32.75]
- *
- * NOTES
- *     exported by ordinal
- */
-BOOL WINAPI PathYetAnotherMakeUniqueNameA(LPDWORD x,LPDWORD y) {
-    FIXME("(%p,%p):stub.\n",x,y);
-    return TRUE;
-}
-
-/*************************************************************************
- * IsLFNDrive [SHELL32.119]
- *
- * NOTES
- *     exported by ordinal Name
- */
-BOOL WINAPI IsLFNDriveA(LPCSTR path) {
-    DWORD	fnlen;
-
-    if (!GetVolumeInformationA(path,NULL,0,NULL,&fnlen,NULL,NULL,0))
-	return FALSE;
-    return fnlen>12;
-}
-/*************************************************************************
- * PathFindOnPath [SHELL32.145]
- */
-BOOL WINAPI PathFindOnPathA(LPSTR sFile, LPCSTR sOtherDirs)
-{	FIXME("%s %s\n",sFile, sOtherDirs);
-	return FALSE;
-}
-BOOL WINAPI PathFindOnPathW(LPWSTR sFile, LPCWSTR sOtherDirs)
-{	FIXME("%s %s\n",debugstr_w(sFile), debugstr_w(sOtherDirs));
-	return FALSE;
-}
-BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
-{	if (VERSION_OsIsUnicode())
-	  return PathFindOnPathW((LPWSTR)sFile, (LPWSTR)sOtherDirs);
-	return PathFindOnPathA((LPSTR)sFile, (LPSTR)sOtherDirs);
-}
-
-/*************************************************************************
- * PathGetExtension [SHELL32.158]
- *
- * NOTES
- *     exported by ordinal
- */
-LPCSTR WINAPI PathGetExtensionA(LPCSTR path,DWORD y,DWORD z)
-{	TRACE("(%s,%08lx,%08lx)\n",path,y,z);
-	path = PathFindExtensionA(path);
-	return *path?(path+1):path;
-}
-LPCWSTR WINAPI PathGetExtensionW(LPCWSTR path,DWORD y,DWORD z)
-{	TRACE("(L%s,%08lx,%08lx)\n",debugstr_w(path),y,z);
-	path = PathFindExtensionW(path);
-	return *path?(path+1):path;
-}
-LPCVOID WINAPI PathGetExtensionAW(LPCVOID path,DWORD y,DWORD z)
-{	if (VERSION_OsIsUnicode())
-	  return PathGetExtensionW((LPWSTR)path,y,z);
-	return PathGetExtensionA((LPSTR)path,y,z);
-}
-
-/*************************************************************************
- * PathCleanupSpec				[SHELL32.171]
- *
- */
-DWORD WINAPI PathCleanupSpecA(LPSTR x, LPSTR y)
-{
-	FIXME("%p(%s) %p(%s) stub\n",x,x,y,y);
-	return TRUE;
-}
-
-DWORD WINAPI PathCleanupSpecW(LPWSTR x, LPWSTR y)
-{
-	FIXME("%p(%s) %p(%s) stub\n",x,debugstr_w(x),y,debugstr_w(y));
-	return TRUE;
-}
-
-DWORD WINAPI PathCleanupSpecAW (LPVOID x, LPVOID y)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathCleanupSpecW((LPWSTR)x,(LPWSTR)y);
-	return PathCleanupSpecA((LPSTR)x,(LPSTR)y);
-}
-
-/*************************************************************************
- * SheGetDirW [SHELL32.281]
- *
- */
-HRESULT WINAPI SheGetDirW(LPWSTR u, LPWSTR v)
-{	FIXME("%p %p stub\n",u,v);
-	return 0;
-}
-
-/*************************************************************************
- * SheChangeDirW [SHELL32.274]
- *
- */
-HRESULT WINAPI SheChangeDirW(LPWSTR u)
-{	FIXME("(%s),stub\n",debugstr_w(u));
-	return 0;
-}
-
-/*************************************************************************
-*	PathProcessCommand	[SHELL32.653]
-*/
-HRESULT WINAPI PathProcessCommandA (LPSTR lpCommand, LPSTR v, DWORD w, DWORD x)
-{
-	FIXME("%p(%s) %p 0x%04lx 0x%04lx stub\n",
-	lpCommand, lpCommand, v, w,x );
-	return 0;
-}
-
-HRESULT WINAPI PathProcessCommandW (LPWSTR lpCommand, LPSTR v, DWORD w, DWORD x)
-{
-	FIXME("%p(%s) %p 0x%04lx 0x%04lx stub\n",
-	lpCommand, debugstr_w(lpCommand), v, w,x );
-	return 0;
-}
-
-HRESULT WINAPI PathProcessCommandAW (LPVOID lpCommand, LPSTR v, DWORD w, DWORD x)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathProcessCommandW((LPWSTR)lpCommand, v, w, x);
-	return PathProcessCommandA((LPSTR)lpCommand, v, w, x);
-}
-
-/*************************************************************************
- * SHGetSpecialFolderPath [SHELL32.175]
- *
- * converts csidl to path
- *
- */
-
-static char * szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
-
-BOOL WINAPI SHGetSpecialFolderPathA (
-	HWND hwndOwner,
-	LPSTR szPath,
-	DWORD csidl,
-	BOOL bCreate)
-{
-	CHAR	szValueName[MAX_PATH], szDefaultPath[MAX_PATH];
-	HKEY	hRootKey, hKey;
-	BOOL	bRelative = TRUE;
-	DWORD	dwType, dwDisp, dwPathLen = MAX_PATH;
-
-	TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
-
-	/* build default values */
-	switch(csidl)
-	{
-	  case CSIDL_APPDATA:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy (szValueName, "AppData");
-	    strcpy (szDefaultPath, "AppData");
-	    break;
-
-	  case CSIDL_COOKIES:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy (szValueName, "Cookies");
-	    strcpy(szDefaultPath, "Cookies");
-	    break;
-
-	  case CSIDL_DESKTOPDIRECTORY:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Desktop");
-	    strcpy(szDefaultPath, "Desktop");
-	    break;
-
-	  case CSIDL_COMMON_DESKTOPDIRECTORY:
-	    hRootKey = HKEY_LOCAL_MACHINE;
-	    strcpy(szValueName, "Common Desktop");
-	    strcpy(szDefaultPath, "Desktop");
-	    break;
-
-	  case CSIDL_FAVORITES:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Favorites");
-	    strcpy(szDefaultPath, "Favorites");
-	    break;
-
-	  case CSIDL_FONTS:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Fonts");
-	    strcpy(szDefaultPath, "Fonts");
-	    break;
-
-	  case CSIDL_HISTORY:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "History");
-	    strcpy(szDefaultPath, "History");
-	    break;
-
-	  case CSIDL_NETHOOD:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "NetHood");
-	    strcpy(szDefaultPath, "NetHood");
-	    break;
-
-	  case CSIDL_INTERNET_CACHE:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Cache");
-	    strcpy(szDefaultPath, "Temporary Internet Files");
-	    break;
-
-	  case CSIDL_PERSONAL:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Personal");
-	    strcpy(szDefaultPath, "My Own Files");
-	    bRelative = FALSE;
-	    break;
-
-	  case CSIDL_PRINTHOOD:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "PrintHood");
-	    strcpy(szDefaultPath, "PrintHood");
-	    break;
-
-	  case CSIDL_PROGRAMS:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Programs");
-	    strcpy(szDefaultPath, "StatrMenu\\Programs");
-	    break;
-
-	  case CSIDL_COMMON_PROGRAMS:
-	    hRootKey = HKEY_LOCAL_MACHINE;
-	    strcpy(szValueName, "Common Programs");
-	    strcpy(szDefaultPath, "");
-	    break;
-
-	  case CSIDL_RECENT:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Recent");
-	    strcpy(szDefaultPath, "Recent");
-	    break;
-
-	  case CSIDL_SENDTO:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "SendTo");
-	    strcpy(szDefaultPath, "SendTo");
-	    break;
-
-	  case CSIDL_STARTMENU:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "StartMenu");
-	    strcpy(szDefaultPath, "StartMenu");
-	    break;
-
-	  case CSIDL_COMMON_STARTMENU:
-	    hRootKey = HKEY_LOCAL_MACHINE;
-	    strcpy(szValueName, "Common StartMenu");
-	    strcpy(szDefaultPath, "StartMenu");
-	    break;
-
-	  case CSIDL_STARTUP:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Startup");
-	    strcpy(szDefaultPath, "StartMenu\\Programs\\Startup");
-	    break;
-
-	  case CSIDL_COMMON_STARTUP:
-	    hRootKey = HKEY_LOCAL_MACHINE;
-	    strcpy(szValueName, "Common Startup");
-	    strcpy(szDefaultPath, "StartMenu\\Programs\\Startup");
-	    break;
-
-	  case CSIDL_TEMPLATES:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Templates");
-	    strcpy(szDefaultPath, "ShellNew");
-	    break;
-
-	  default:
-	    ERR("folder unknown or not allowed\n");
-	    return FALSE;
-	}
-
-	if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&hKey,&dwDisp))
-	{
-	  return FALSE;
-	}
-
-	if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
-	{
-	  /* value not existing */
-	  if (bRelative)
-	  {
-	    GetWindowsDirectoryA(szPath, MAX_PATH);
-	    PathAddBackslashA(szPath);
-	    strcat(szPath, szDefaultPath);
-	  }
-	  else
-	  {
-	    strcpy(szPath, szDefaultPath);
-	  }
-	  if (bCreate)
-	  {
-	    CreateDirectoryA(szPath,NULL);
-	  }
-	  RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
-	}
-	RegCloseKey(hKey);
-
-	return TRUE;
-}
-BOOL WINAPI SHGetSpecialFolderPathW (
-	HWND hwndOwner,
-	LPWSTR szPath,
-	DWORD csidl,
-	BOOL bCreate)
-{
-	char szTemp[MAX_PATH];
-	
-	if (SHGetSpecialFolderPathA(hwndOwner, szTemp, csidl, bCreate))
-	{
-	  lstrcpynAtoW(szPath, szTemp, MAX_PATH);
-	}
-
-	TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
-
-	return TRUE;
-}
-BOOL WINAPI SHGetSpecialFolderPathAW (
-	HWND hwndOwner,
-	LPVOID szPath,
-	DWORD csidl,
-	BOOL bCreate)
-
-{
-	if (VERSION_OsIsUnicode())
-	  return SHGetSpecialFolderPathW (hwndOwner, (LPWSTR)szPath, csidl, bCreate);
-	return SHGetSpecialFolderPathA (hwndOwner, (LPSTR)szPath, csidl, bCreate);
-}
Index: trunk/src/shell32/shlmenu.cpp
===================================================================
--- trunk/src/shell32/shlmenu.cpp	(revision 1469)
+++ trunk/src/shell32/shlmenu.cpp	(revision 1470)
@@ -1,6 +1,29 @@
-/* $Id: shlmenu.cpp,v 1.2 1999-10-09 11:17:05 sandervl Exp $ */
+/* $Id: shlmenu.cpp,v 1.3 1999-10-27 09:33:48 phaller Exp $ */
+
+/*
+ * Win32 SHELL32 for OS/2
+ *
+ * Copyright 1999 Patrick Haller (haller@zebra.fh-weingarten.de)
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ * Path Functions
+ *
+ * Many of this functions are in SHLWAPI.DLL also
+ *
+ */
+
 /*
  * see www.geocities.com/SiliconValley/4942/filemenu.html
  */
+
+
+/*****************************************************************************
+ * Includes                                                                  *
+ *****************************************************************************/
+
+#include <odin.h>
+#include <odinwrap.h>
+#include <os2sel.h>
+
 #include <assert.h>
 #include <string.h>
@@ -25,564 +48,572 @@
 #include <misc.h>
 
+
+ODINDEBUGCHANNEL(SHELL32-SHLMENU)
+
+
+/*****************************************************************************
+ * Implementation                                                            *
+ *****************************************************************************/
+
 BOOL WINAPI FileMenu_DeleteAllItems (HMENU hMenu);
 BOOL WINAPI FileMenu_AppendItemA(HMENU hMenu, LPCSTR lpText, UINT uID, int icon, HMENU hMenuPopup, int nItemHeight);
 
 typedef struct
-{	BOOL		bInitialized;
-	BOOL		bIsMagic;
-
-	/* create */
-	COLORREF	crBorderColor;
-	int		nBorderWidth;
-	HBITMAP		hBorderBmp;
-
-	/* insert using pidl */
-	LPITEMIDLIST	pidl;
-	UINT		uID;
-	UINT		uFlags;
-	UINT		uEnumFlags;
-	LPFNFMCALLBACK lpfnCallback;
+{  BOOL     bInitialized;
+   BOOL     bIsMagic;
+
+   /* create */
+   COLORREF crBorderColor;
+   int      nBorderWidth;
+   HBITMAP     hBorderBmp;
+
+   /* insert using pidl */
+   LPITEMIDLIST   pidl;
+   UINT     uID;
+   UINT     uFlags;
+   UINT     uEnumFlags;
+   LPFNFMCALLBACK lpfnCallback;
 } FMINFO, *LPFMINFO;
 
 typedef struct
-{	int	cchItemText;
-	int	iIconIndex;
-	HMENU	hMenu;
-	char	szItemText[1];
+{  int   cchItemText;
+   int   iIconIndex;
+   HMENU hMenu;
+   char  szItemText[1];
 } FMITEM, * LPFMITEM;
 
 static BOOL bAbortInit;
 
-#define	CCH_MAXITEMTEXT 256
-
-DEFAULT_DEBUG_CHANNEL(shell)
+#define  CCH_MAXITEMTEXT 256
 
 LPFMINFO FM_GetMenuInfo(HMENU hmenu)
-{	MENUINFO	MenuInfo;
-	LPFMINFO	menudata;
-
-	MenuInfo.cbSize = sizeof(MENUINFO);
-	MenuInfo.fMask = MIM_MENUDATA;
-
-	if (! GetMenuInfo(hmenu, &MenuInfo))
-	  return NULL;
-
-	menudata = (LPFMINFO)MenuInfo.dwMenuData;
-
-	assert ((menudata != 0) && (MenuInfo.cbSize == sizeof(MENUINFO)));
-	
-	return menudata;
-
-}
-/*************************************************************************
- * FM_SetMenuParameter				[internal]
+{  MENUINFO MenuInfo;
+   LPFMINFO menudata;
+
+   MenuInfo.cbSize = sizeof(MENUINFO);
+   MenuInfo.fMask = MIM_MENUDATA;
+
+   if (! GetMenuInfo(hmenu, &MenuInfo))
+     return NULL;
+
+   menudata = (LPFMINFO)MenuInfo.dwMenuData;
+
+   assert ((menudata != 0) && (MenuInfo.cbSize == sizeof(MENUINFO)));
+
+   return menudata;
+
+}
+/*************************************************************************
+ * FM_SetMenuParameter                            [internal]
  *
  */
 static LPFMINFO FM_SetMenuParameter(
-	HMENU hmenu,
-	UINT uID,
-	LPCITEMIDLIST pidl,
-	UINT uFlags,
-	UINT uEnumFlags,
-	LPFNFMCALLBACK lpfnCallback)
-{
-	LPFMINFO	menudata;
-
-	TRACE("\n");
-	
-	menudata = FM_GetMenuInfo(hmenu);
-	
-	if ( menudata->pidl)
-	{ SHFree(menudata->pidl);
-	}
-	
-	menudata->uID = uID;
-	menudata->pidl = ILClone(pidl);
-	menudata->uFlags = uFlags;
-	menudata->uEnumFlags = uEnumFlags;
-	menudata->lpfnCallback = lpfnCallback;
-
-	return menudata;
-}
-
-/*************************************************************************
- * FM_InitMenuPopup				[internal]
+   HMENU hmenu,
+   UINT uID,
+   LPCITEMIDLIST pidl,
+   UINT uFlags,
+   UINT uEnumFlags,
+   LPFNFMCALLBACK lpfnCallback)
+{
+   LPFMINFO menudata;
+
+   TRACE("\n");
+
+   menudata = FM_GetMenuInfo(hmenu);
+
+   if ( menudata->pidl)
+   { SHFree(menudata->pidl);
+   }
+
+   menudata->uID = uID;
+   menudata->pidl = ILClone(pidl);
+   menudata->uFlags = uFlags;
+   menudata->uEnumFlags = uEnumFlags;
+   menudata->lpfnCallback = lpfnCallback;
+
+   return menudata;
+}
+
+/*************************************************************************
+ * FM_InitMenuPopup                               [internal]
  *
  */
 static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl)
-{	IShellFolder	*lpsf, *lpsf2;
-	ULONG		ulItemAttr;
-	UINT		uID, uFlags, uEnumFlags;
-	LPFNFMCALLBACK	lpfnCallback;
-	LPITEMIDLIST	pidl;
-	char		sTemp[MAX_PATH];
-	int		NumberOfItems = 0, iIcon;
-	MENUINFO	MenuInfo;
-	LPFMINFO	menudata;
-
-	TRACE("0x%04x %p\n", hmenu, pAlternatePidl);
-
-	MenuInfo.cbSize = sizeof(MENUINFO);
-	MenuInfo.fMask = MIM_MENUDATA;
-
-	if (! GetMenuInfo(hmenu, &MenuInfo))
-	  return FALSE;
-
-	menudata = (LPFMINFO)MenuInfo.dwMenuData;
-	
-	assert ((menudata != 0) && (MenuInfo.cbSize == sizeof(MENUINFO)));
-	
-	if (menudata->bInitialized)
-	  return 0;
-	
-	uID = menudata->uID;
-	pidl = ((pAlternatePidl) ? pAlternatePidl : menudata->pidl);
-	uFlags = menudata->uFlags;
-	uEnumFlags = menudata->uEnumFlags;
-	lpfnCallback = menudata->lpfnCallback;
-
-	menudata->bInitialized = FALSE;
-	SetMenuInfo(hmenu, &MenuInfo);
-	
-	if (SUCCEEDED (SHGetDesktopFolder(&lpsf)))
-	{
-	  if (SUCCEEDED(IShellFolder_BindToObject(lpsf, pidl,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2)))
-	  {
-	    IEnumIDList	*lpe = NULL;
-
-	    if (SUCCEEDED (IShellFolder_EnumObjects(lpsf2, 0, uEnumFlags, &lpe )))
-	    {
-
-	      LPITEMIDLIST pidlTemp = NULL;
-	      ULONG ulFetched;
-
-	      while ((!bAbortInit) && (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched)))
-	      {
-		if (SUCCEEDED (IShellFolder_GetAttributesOf(lpsf, 1, &pidlTemp, &ulItemAttr)))
-		{
-		  ILGetDisplayName( pidlTemp, sTemp);
-		  if (! (PidlToSicIndex(lpsf, pidlTemp, FALSE, (UINT*)&iIcon)))
-		    iIcon = FM_BLANK_ICON;
-		  if ( SFGAO_FOLDER & ulItemAttr)
-		  {
-		    LPFMINFO lpFmMi;
-		    MENUINFO MenuInfo;
-		    HMENU hMenuPopup = CreatePopupMenu();
-	
-		    lpFmMi = (LPFMINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
-
-		    lpFmMi->pidl = ILCombine(pidl, pidlTemp);
-		    lpFmMi->uEnumFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
-
-		    MenuInfo.cbSize = sizeof(MENUINFO);
-		    MenuInfo.fMask = MIM_MENUDATA;
-		    MenuInfo.dwMenuData = (DWORD) lpFmMi;
-		    SetMenuInfo (hMenuPopup, &MenuInfo);
-
-		    FileMenu_AppendItemA (hmenu, sTemp, uID, iIcon, hMenuPopup, FM_DEFAULT_HEIGHT);
-		  }
-		  else
-		  {
-		    ((LPSTR)PathFindExtensionA(sTemp))[0] = 0x00;
-		    FileMenu_AppendItemA (hmenu, sTemp, uID, iIcon, 0, FM_DEFAULT_HEIGHT);
-		  }
-		}
-
-		if (lpfnCallback)
-		{
-		  TRACE("enter callback\n");
-		  lpfnCallback ( pidl, pidlTemp);
-		  TRACE("leave callback\n");
-		}
-
-		NumberOfItems++;
-	      }
-	      IEnumIDList_Release (lpe);
-	    }
-	    IShellFolder_Release(lpsf2);
-	  }
-	  IShellFolder_Release(lpsf);
-	}
-
-	if ( GetMenuItemCount (hmenu) == 0 )
-	{ FileMenu_AppendItemA (hmenu, "(empty)", uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT);
-	  NumberOfItems++;
-	}
-
-	menudata->bInitialized = TRUE;
-	SetMenuInfo(hmenu, &MenuInfo);
-
-	return NumberOfItems;
-}
-/*************************************************************************
- * FileMenu_Create				[SHELL32.114]
- *
- */
-HMENU WINAPI FileMenu_Create (
-	COLORREF crBorderColor,
-	int nBorderWidth,
-	HBITMAP hBorderBmp,
-	int nSelHeight,
-	UINT uFlags)
-{
-	MENUINFO	MenuInfo;
-	LPFMINFO	menudata;
-
-	HMENU hMenu = CreatePopupMenu();
-
-	TRACE("0x%08lx 0x%08x 0x%08x 0x%08x 0x%08x  hMenu=0x%08x\n",
-	crBorderColor, nBorderWidth, hBorderBmp, nSelHeight, uFlags, hMenu);
-
-	menudata = (LPFMINFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
-	menudata->bIsMagic = TRUE;
-	menudata->crBorderColor = crBorderColor;
-	menudata->nBorderWidth = nBorderWidth;
-	menudata->hBorderBmp = hBorderBmp;
-
-	MenuInfo.cbSize = sizeof(MENUINFO);
-	MenuInfo.fMask = MIM_MENUDATA;
-	MenuInfo.dwMenuData = (DWORD) menudata;
-	SetMenuInfo (hMenu, &MenuInfo);
-
-	return hMenu;
-}
-
-/*************************************************************************
- * FileMenu_Destroy				[SHELL32.118]
+{  IShellFolder   *lpsf, *lpsf2;
+   ULONG    ulItemAttr;
+   UINT     uID, uFlags, uEnumFlags;
+   LPFNFMCALLBACK lpfnCallback;
+   LPITEMIDLIST   pidl;
+   char     sTemp[MAX_PATH];
+   int      NumberOfItems = 0, iIcon;
+   MENUINFO MenuInfo;
+   LPFMINFO menudata;
+
+   TRACE("0x%04x %p\n", hmenu, pAlternatePidl);
+
+   MenuInfo.cbSize = sizeof(MENUINFO);
+   MenuInfo.fMask = MIM_MENUDATA;
+
+   if (! GetMenuInfo(hmenu, &MenuInfo))
+     return FALSE;
+
+   menudata = (LPFMINFO)MenuInfo.dwMenuData;
+
+   assert ((menudata != 0) && (MenuInfo.cbSize == sizeof(MENUINFO)));
+
+   if (menudata->bInitialized)
+     return 0;
+
+   uID = menudata->uID;
+   pidl = ((pAlternatePidl) ? pAlternatePidl : menudata->pidl);
+   uFlags = menudata->uFlags;
+   uEnumFlags = menudata->uEnumFlags;
+   lpfnCallback = menudata->lpfnCallback;
+
+   menudata->bInitialized = FALSE;
+   SetMenuInfo(hmenu, &MenuInfo);
+
+   if (SUCCEEDED (SHGetDesktopFolder(&lpsf)))
+   {
+     if (SUCCEEDED(IShellFolder_BindToObject(lpsf, pidl,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2)))
+     {
+       IEnumIDList                       *lpe = NULL;
+
+       if (SUCCEEDED (IShellFolder_EnumObjects(lpsf2, 0, uEnumFlags, &lpe )))
+       {
+
+         LPITEMIDLIST pidlTemp = NULL;
+         ULONG ulFetched;
+
+         while ((!bAbortInit) && (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched)))
+         {
+      if (SUCCEEDED (IShellFolder_GetAttributesOf(lpsf, 1, &pidlTemp, &ulItemAttr)))
+      {
+        ILGetDisplayName( pidlTemp, sTemp);
+        if (! (PidlToSicIndex(lpsf, pidlTemp, FALSE, (UINT*)&iIcon)))
+          iIcon = FM_BLANK_ICON;
+        if ( SFGAO_FOLDER & ulItemAttr)
+        {
+          LPFMINFO lpFmMi;
+          MENUINFO MenuInfo;
+          HMENU hMenuPopup = CreatePopupMenu();
+
+          lpFmMi = (LPFMINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
+
+          lpFmMi->pidl = ILCombine(pidl, pidlTemp);
+          lpFmMi->uEnumFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
+
+          MenuInfo.cbSize = sizeof(MENUINFO);
+          MenuInfo.fMask = MIM_MENUDATA;
+          MenuInfo.dwMenuData = (DWORD) lpFmMi;
+          SetMenuInfo (hMenuPopup, &MenuInfo);
+
+          FileMenu_AppendItemA (hmenu, sTemp, uID, iIcon, hMenuPopup, FM_DEFAULT_HEIGHT);
+        }
+        else
+        {
+          ((LPSTR)PathFindExtensionA(sTemp))[0] = 0x00;
+          FileMenu_AppendItemA (hmenu, sTemp, uID, iIcon, 0, FM_DEFAULT_HEIGHT);
+        }
+      }
+
+      if (lpfnCallback)
+      {
+        TRACE("enter callback\n");
+        lpfnCallback ( pidl, pidlTemp);
+        TRACE("leave callback\n");
+      }
+
+      NumberOfItems++;
+         }
+         IEnumIDList_Release (lpe);
+       }
+       IShellFolder_Release(lpsf2);
+     }
+     IShellFolder_Release(lpsf);
+   }
+
+   if ( GetMenuItemCount (hmenu) == 0 )
+   { FileMenu_AppendItemA (hmenu, "(empty)", uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT);
+     NumberOfItems++;
+   }
+
+   menudata->bInitialized = TRUE;
+   SetMenuInfo(hmenu, &MenuInfo);
+
+   return NumberOfItems;
+}
+/*************************************************************************
+ * FileMenu_Create                                [SHELL32.114]
+ *
+ */
+ODINFUNCTION5(HMENU, FileMenu_Create,
+              COLORREF, crBorderColor,
+              int, nBorderWidth,
+              HBITMAP, hBorderBmp,
+              int, nSelHeight,
+              UINT, uFlags)
+{
+   MENUINFO MenuInfo;
+   LPFMINFO menudata;
+
+   HMENU hMenu = CreatePopupMenu();
+
+   TRACE("0x%08lx 0x%08x 0x%08x 0x%08x 0x%08x  hMenu=0x%08x\n",
+   crBorderColor, nBorderWidth, hBorderBmp, nSelHeight, uFlags, hMenu);
+
+   menudata = (LPFMINFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
+   menudata->bIsMagic = TRUE;
+   menudata->crBorderColor = crBorderColor;
+   menudata->nBorderWidth = nBorderWidth;
+   menudata->hBorderBmp = hBorderBmp;
+
+   MenuInfo.cbSize = sizeof(MENUINFO);
+   MenuInfo.fMask = MIM_MENUDATA;
+   MenuInfo.dwMenuData = (DWORD) menudata;
+   SetMenuInfo (hMenu, &MenuInfo);
+
+   return hMenu;
+}
+
+/*************************************************************************
+ * FileMenu_Destroy                               [SHELL32.118]
  *
  * NOTES
  *  exported by name
  */
-void WINAPI FileMenu_Destroy (HMENU hmenu)
-{
-	LPFMINFO	menudata;
-
-	TRACE("0x%08x\n", hmenu);
-
-	FileMenu_DeleteAllItems (hmenu);
-	
-	menudata = FM_GetMenuInfo(hmenu);
-
-	if ( menudata->pidl)
-	{ SHFree( menudata->pidl);
-	}
-	HeapFree(GetProcessHeap(), 0, menudata);
-
-	DestroyMenu (hmenu);
-}
-
-/*************************************************************************
- * FileMenu_AppendItemAW			[SHELL32.115]
- *
- */
-BOOL WINAPI FileMenu_AppendItemA(
-	HMENU hMenu,
-	LPCSTR lpText,
-	UINT uID,
-	int icon,
-	HMENU hMenuPopup,
-	int nItemHeight)
-{
-	LPSTR lpszText = (LPSTR)lpText;
-	MENUITEMINFOA	mii;
-	LPFMITEM myItem;
-
-	TRACE("0x%08x %s 0x%08x 0x%08x 0x%08x 0x%08x\n",
-	hMenu, (lpszText!=FM_SEPARATOR) ? lpText: NULL,
-	uID, icon, hMenuPopup, nItemHeight);
-	
-	ZeroMemory (&mii, sizeof(MENUITEMINFOA));
-	
-	mii.cbSize = sizeof(MENUITEMINFOA);
-
-	if (lpText != FM_SEPARATOR)
-	{ int len = strlen (lpText);
-	  myItem = (LPFMITEM) SHAlloc( sizeof(FMITEM) + len);
-	  strcpy (myItem->szItemText, lpText);
-	  myItem->cchItemText = len;
-	  myItem->iIconIndex = icon;
-	  myItem->hMenu = hMenu;
-	  mii.fMask = MIIM_DATA;
-	  mii.dwItemData = (DWORD) myItem;
-	}
-	
-	if ( hMenuPopup )
-	{ /* sub menu */
-	  mii.fMask |= MIIM_TYPE | MIIM_SUBMENU;
-	  mii.fType = MFT_OWNERDRAW;
-	  mii.hSubMenu = hMenuPopup;
-	}
-	else if (lpText == FM_SEPARATOR )
-	{ mii.fMask |= MIIM_ID | MIIM_TYPE;
-	  mii.fType = MFT_SEPARATOR;
-	}
-	else
-	{ /* normal item */
-	  mii.fMask |= MIIM_ID | MIIM_TYPE | MIIM_STATE;
-	  mii.fState = MFS_ENABLED | MFS_DEFAULT;
-	  mii.fType = MFT_OWNERDRAW;
-	}
-	mii.wID = uID;
-
-	InsertMenuItemA (hMenu, (UINT)-1, TRUE, &mii);
-
-	return TRUE;
-
-}
-BOOL WINAPI FileMenu_AppendItemAW(
-	HMENU hMenu,
-	LPCVOID lpText,
-	UINT uID,
-	int icon,
-	HMENU hMenuPopup,
-	int nItemHeight)
-{
-	BOOL ret;
-	LPSTR lpszText=NULL;
-
-	if (VERSION_OsIsUnicode() && (lpText!=FM_SEPARATOR))
-	  lpszText = (LPSTR)HEAP_strdupWtoA ( GetProcessHeap(),0, (LPCWSTR)lpText);
-
-	ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : (LPCSTR)lpText, uID, icon, hMenuPopup, nItemHeight);
-
-	if (lpszText)
-	  HeapFree( GetProcessHeap(), 0, lpszText );
-
-	return ret;
-}
-/*************************************************************************
- * FileMenu_InsertUsingPidl			[SHELL32.110]
+ODINPROCEDURE1(FileMenu_Destroy,
+               HMENU, hmenu)
+{
+   LPFMINFO menudata;
+
+   TRACE("0x%08x\n", hmenu);
+
+   FileMenu_DeleteAllItems (hmenu);
+
+   menudata = FM_GetMenuInfo(hmenu);
+
+   if ( menudata->pidl)
+   { SHFree( menudata->pidl);
+   }
+   HeapFree(GetProcessHeap(), 0, menudata);
+
+   DestroyMenu (hmenu);
+}
+
+/*************************************************************************
+ * FileMenu_AppendItemAW                       [SHELL32.115]
+ *
+ */
+ODINFUNCTION6(BOOL, FileMenu_AppendItemA,
+              HMENU, hMenu,
+              LPCSTR, lpText,
+              UINT, uID,
+              int, icon,
+              HMENU, hMenuPopup,
+              int, nItemHeight)
+{
+   LPSTR lpszText = (LPSTR)lpText;
+   MENUITEMINFOA  mii;
+   LPFMITEM myItem;
+
+   TRACE("0x%08x %s 0x%08x 0x%08x 0x%08x 0x%08x\n",
+   hMenu, (lpszText!=FM_SEPARATOR) ? lpText: NULL,
+   uID, icon, hMenuPopup, nItemHeight);
+
+   ZeroMemory (&mii, sizeof(MENUITEMINFOA));
+
+   mii.cbSize = sizeof(MENUITEMINFOA);
+
+   if (lpText != FM_SEPARATOR)
+   { int len = strlen (lpText);
+     myItem = (LPFMITEM) SHAlloc( sizeof(FMITEM) + len);
+     strcpy (myItem->szItemText, lpText);
+     myItem->cchItemText = len;
+     myItem->iIconIndex = icon;
+     myItem->hMenu = hMenu;
+     mii.fMask = MIIM_DATA;
+     mii.dwItemData = (DWORD) myItem;
+   }
+
+   if ( hMenuPopup )
+   { /* sub menu */
+     mii.fMask |= MIIM_TYPE | MIIM_SUBMENU;
+     mii.fType = MFT_OWNERDRAW;
+     mii.hSubMenu = hMenuPopup;
+   }
+   else if (lpText == FM_SEPARATOR )
+   { mii.fMask |= MIIM_ID | MIIM_TYPE;
+     mii.fType = MFT_SEPARATOR;
+   }
+   else
+   { /* normal item */
+     mii.fMask |= MIIM_ID | MIIM_TYPE | MIIM_STATE;
+     mii.fState = MFS_ENABLED | MFS_DEFAULT;
+     mii.fType = MFT_OWNERDRAW;
+   }
+   mii.wID = uID;
+
+   InsertMenuItemA (hMenu, (UINT)-1, TRUE, &mii);
+
+   return TRUE;
+
+}
+ODINFUNCTION6(BOOL, FileMenu_AppendItemAW,
+              HMENU, hMenu,
+              LPCVOID, lpText,
+              UINT, uID,
+              int, icon,
+              HMENU, hMenuPopup,
+              int, nItemHeight)
+{
+   BOOL ret;
+   LPSTR lpszText=NULL;
+
+   if (VERSION_OsIsUnicode() && (lpText!=FM_SEPARATOR))
+     lpszText = (LPSTR)HEAP_strdupWtoA ( GetProcessHeap(),0, (LPCWSTR)lpText);
+
+   ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : (LPCSTR)lpText, uID, icon, hMenuPopup, nItemHeight);
+
+   if (lpszText)
+     HeapFree( GetProcessHeap(), 0, lpszText );
+
+   return ret;
+}
+/*************************************************************************
+ * FileMenu_InsertUsingPidl                    [SHELL32.110]
  *
  * NOTES
- *	uEnumFlags	any SHCONTF flag
- */
-int WINAPI FileMenu_InsertUsingPidl (
-	HMENU hmenu,
-	UINT uID,
-	LPCITEMIDLIST pidl,
-	UINT uFlags,
-	UINT uEnumFlags,
-	LPFNFMCALLBACK lpfnCallback)
-{	
-	TRACE("0x%08x 0x%08x %p 0x%08x 0x%08x %p\n",
-	hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
-
-	pdump (pidl);
-
-	bAbortInit = FALSE;
-
-	FM_SetMenuParameter(hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);	
-
-	return FM_InitMenuPopup(hmenu, NULL);
-}
-
-/*************************************************************************
- * FileMenu_ReplaceUsingPidl			[SHELL32.113]
- *
- */
-int WINAPI FileMenu_ReplaceUsingPidl(
-	HMENU	hmenu,
-	UINT	uID,
-	LPCITEMIDLIST	pidl,
-	UINT	uEnumFlags,
-	LPFNFMCALLBACK lpfnCallback)
-{
-	TRACE("0x%08x 0x%08x %p 0x%08x %p\n",
-	hmenu, uID, pidl, uEnumFlags, lpfnCallback);
-	
-	FileMenu_DeleteAllItems (hmenu);
-
-	FM_SetMenuParameter(hmenu, uID, pidl, 0, uEnumFlags, lpfnCallback);	
-
-	return FM_InitMenuPopup(hmenu, NULL);
-}
-
-/*************************************************************************
- * FileMenu_Invalidate			[SHELL32.111]
- */
-void WINAPI FileMenu_Invalidate (HMENU hMenu)
-{
-	FIXME("0x%08x\n",hMenu);	
-}
-
-/*************************************************************************
- * FileMenu_FindSubMenuByPidl			[SHELL32.106]
- */
-HMENU WINAPI FileMenu_FindSubMenuByPidl(
-	HMENU	hMenu,
-	LPCITEMIDLIST	pidl)
-{
-	FIXME("0x%08x %p\n",hMenu, pidl);	
-	return 0;
-}
-
-/*************************************************************************
- * FileMenu_AppendFilesForPidl			[SHELL32.124]
- */
-HMENU WINAPI FileMenu_AppendFilesForPidl(
-	HMENU	hmenu,
-	LPCITEMIDLIST	pidl,
-	BOOL	bAddSeperator)
-{
-	LPFMINFO	menudata;
-
-	menudata = FM_GetMenuInfo(hmenu);
-	
-	menudata->bInitialized = FALSE;
-	
-	FM_InitMenuPopup(hmenu, pidl);
-
-	if (bAddSeperator)
-	  FileMenu_AppendItemA (hmenu, FM_SEPARATOR, 0, 0, 0, FM_DEFAULT_HEIGHT);
-
-	TRACE("0x%08x %p 0x%08x\n",hmenu, pidl,bAddSeperator);	
-
-	return 0;
-}
-/*************************************************************************
- * FileMenu_AddFilesForPidl			[SHELL32.125]
+ * uEnumFlags  any SHCONTF flag
+ */
+ODINFUNCTION6(int, FileMenu_InsertUsingPidl,
+              HMENU, hmenu,
+              UINT, uID,
+              LPCITEMIDLIST, pidl,
+              UINT, uFlags,
+              UINT, uEnumFlags,
+              LPFNFMCALLBACK, lpfnCallback)
+{
+   TRACE("0x%08x 0x%08x %p 0x%08x 0x%08x %p\n",
+   hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
+
+   pdump (pidl);
+
+   bAbortInit = FALSE;
+
+   FM_SetMenuParameter(hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
+
+   return FM_InitMenuPopup(hmenu, NULL);
+}
+
+/*************************************************************************
+ * FileMenu_ReplaceUsingPidl                   [SHELL32.113]
+ *
+ */
+ODINFUNCTION5(int, FileMenu_ReplaceUsingPidl,
+              HMENU, hmenu,
+              UINT, uID,
+              LPCITEMIDLIST, pidl,
+              UINT, uEnumFlags,
+              LPFNFMCALLBACK, lpfnCallback)
+{
+   TRACE("0x%08x 0x%08x %p 0x%08x %p\n",
+   hmenu, uID, pidl, uEnumFlags, lpfnCallback);
+
+   FileMenu_DeleteAllItems (hmenu);
+
+   FM_SetMenuParameter(hmenu, uID, pidl, 0, uEnumFlags, lpfnCallback);
+
+   return FM_InitMenuPopup(hmenu, NULL);
+}
+
+/*************************************************************************
+ * FileMenu_Invalidate                         [SHELL32.111]
+ */
+ODINPROCEDURE1(FileMenu_Invalidate,
+               HMENU, hMenu)
+{
+   FIXME("0x%08x\n",hMenu);
+}
+
+/*************************************************************************
+ * FileMenu_FindSubMenuByPidl                  [SHELL32.106]
+ */
+ODINFUNCTION2(HMENU, FileMenu_FindSubMenuByPidl,
+              HMENU, hMenu,
+              LPCITEMIDLIST, pidl)
+{
+   FIXME("0x%08x %p\n",hMenu, pidl);
+   return 0;
+}
+
+/*************************************************************************
+ * FileMenu_AppendFilesForPidl                 [SHELL32.124]
+ */
+ODINFUNCTION3(HMENU, FileMenu_AppendFilesForPidl,
+              HMENU, hmenu,
+              LPCITEMIDLIST, pidl,
+              BOOL, bAddSeperator)
+{
+   LPFMINFO menudata;
+
+   menudata = FM_GetMenuInfo(hmenu);
+
+   menudata->bInitialized = FALSE;
+
+   FM_InitMenuPopup(hmenu, pidl);
+
+   if (bAddSeperator)
+     FileMenu_AppendItemA (hmenu, FM_SEPARATOR, 0, 0, 0, FM_DEFAULT_HEIGHT);
+
+   TRACE("0x%08x %p 0x%08x\n",hmenu, pidl,bAddSeperator);
+
+   return 0;
+}
+/*************************************************************************
+ * FileMenu_AddFilesForPidl                    [SHELL32.125]
  *
  * NOTES
- *	uEnumFlags	any SHCONTF flag
- */
-int WINAPI FileMenu_AddFilesForPidl (
-	HMENU	hmenu,
-	UINT	uReserved,
-	UINT	uID,
-	LPCITEMIDLIST	pidl,
-	UINT	uFlags,
-	UINT	uEnumFlags,
-	LPFNFMCALLBACK	lpfnCallback)
-{
-	TRACE("0x%08x 0x%08x 0x%08x %p 0x%08x 0x%08x %p\n",
-	hmenu, uReserved, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
-
-	return FileMenu_InsertUsingPidl ( hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
-
-}
-
-
-/*************************************************************************
- * FileMenu_TrackPopupMenuEx			[SHELL32.116]
- */
-HRESULT WINAPI FileMenu_TrackPopupMenuEx (
-	HMENU hMenu,
-	UINT uFlags,
-	int x,
-	int y,
-	HWND hWnd,
-	LPTPMPARAMS lptpm)
-{
-	TRACE("0x%08x 0x%08x 0x%x 0x%x 0x%08x %p\n",
-	hMenu, uFlags, x, y, hWnd, lptpm);
-	return TrackPopupMenuEx(hMenu, uFlags, x, y, hWnd, lptpm);
-}
-
-/*************************************************************************
- * FileMenu_GetLastSelectedItemPidls		[SHELL32.107]
- */
-BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
-	UINT	uReserved,
-	LPCITEMIDLIST	*ppidlFolder,
-	LPCITEMIDLIST	*ppidlItem)
-{
-	FIXME("0x%08x %p %p\n",uReserved, ppidlFolder, ppidlItem);
-	return 0;
-}
-
-#define FM_ICON_SIZE	16
-#define FM_Y_SPACE	4
-#define FM_SPACE1	4
-#define FM_SPACE2	2
-#define FM_LEFTBORDER	2
-#define FM_RIGHTBORDER	8
-/*************************************************************************
- * FileMenu_MeasureItem				[SHELL32.112]
- */
-LRESULT WINAPI FileMenu_MeasureItem(
-	HWND	hWnd,
-	LPMEASUREITEMSTRUCT	lpmis)
-{
-	LPFMITEM pMyItem = (LPFMITEM)(lpmis->itemData);
-	HDC hdc = GetDC(hWnd);
-	SIZE size;
-	LPFMINFO menuinfo;
-		
-	TRACE("0x%08x %p %s\n", hWnd, lpmis, pMyItem->szItemText);
-	
-	GetTextExtentPoint32A(hdc, pMyItem->szItemText, pMyItem->cchItemText, &size);
-	
-	lpmis->itemWidth = size.cx + FM_LEFTBORDER + FM_ICON_SIZE + FM_SPACE1 + FM_SPACE2 + FM_RIGHTBORDER;
-	lpmis->itemHeight = (size.cy > (FM_ICON_SIZE + FM_Y_SPACE)) ? size.cy : (FM_ICON_SIZE + FM_Y_SPACE);
-
-	/* add the menubitmap */
-	menuinfo = FM_GetMenuInfo(pMyItem->hMenu);
-	if (menuinfo->bIsMagic)
-	  lpmis->itemWidth += menuinfo->nBorderWidth;
-	
-	TRACE("-- 0x%04x 0x%04x\n", lpmis->itemWidth, lpmis->itemHeight);
-	ReleaseDC (hWnd, hdc);
-	return 0;
-}
-/*************************************************************************
- * FileMenu_DrawItem				[SHELL32.105]
- */
-LRESULT WINAPI FileMenu_DrawItem(
-	HWND			hWnd,
-	LPDRAWITEMSTRUCT	lpdis)
-{
-	LPFMITEM pMyItem = (LPFMITEM)(lpdis->itemData);
-	COLORREF clrPrevText, clrPrevBkgnd;
-	int xi,yi,xt,yt;
-	HIMAGELIST hImageList;
-	RECT TextRect, BorderRect;
-	LPFMINFO menuinfo;
-	
-	TRACE("0x%08x %p %s\n", hWnd, lpdis, pMyItem->szItemText);
-	
-	if (lpdis->itemState & ODS_SELECTED)
-	{
-	  clrPrevText = SetTextColor(lpdis->hDC, GetSysColor (COLOR_HIGHLIGHTTEXT));
-	  clrPrevBkgnd = SetBkColor(lpdis->hDC, GetSysColor (COLOR_HIGHLIGHT));
-	}
-	else
-	{
-	  clrPrevText = SetTextColor(lpdis->hDC, GetSysColor (COLOR_MENUTEXT));
-	  clrPrevBkgnd = SetBkColor(lpdis->hDC, GetSysColor (COLOR_MENU));
-	}
-	
-	CopyRect(&TextRect, &(lpdis->rcItem));
-
-	/* add the menubitmap */
-	menuinfo = FM_GetMenuInfo(pMyItem->hMenu);
-	if (menuinfo->bIsMagic)
-	  TextRect.left += menuinfo->nBorderWidth;
-	
-	BorderRect.right = menuinfo->nBorderWidth;
-/*	FillRect(lpdis->hDC, &BorderRect, CreateSolidBrush( menuinfo->crBorderColor));
+ * uEnumFlags  any SHCONTF flag
+ */
+ODINFUNCTION7(int, FileMenu_AddFilesForPidl,
+              HMENU, hmenu,
+              UINT, uReserved,
+              UINT, uID,
+              LPCITEMIDLIST, pidl,
+              UINT, uFlags,
+              UINT, uEnumFlags,
+              LPFNFMCALLBACK, lpfnCallback)
+{
+   TRACE("0x%08x 0x%08x 0x%08x %p 0x%08x 0x%08x %p\n",
+   hmenu, uReserved, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
+
+   return FileMenu_InsertUsingPidl ( hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
+
+}
+
+
+/*************************************************************************
+ * FileMenu_TrackPopupMenuEx                   [SHELL32.116]
+ */
+ODINFUNCTION6(HRESULT, FileMenu_TrackPopupMenuEx,
+              HMENU, hMenu,
+              UINT, uFlags,
+              int, x,
+              int, y,
+              HWND, hWnd,
+              LPTPMPARAMS, lptpm)
+{
+   TRACE("0x%08x 0x%08x 0x%x 0x%x 0x%08x %p\n",
+   hMenu, uFlags, x, y, hWnd, lptpm);
+   return TrackPopupMenuEx(hMenu, uFlags, x, y, hWnd, lptpm);
+}
+
+/*************************************************************************
+ * FileMenu_GetLastSelectedItemPidls        [SHELL32.107]
+ */
+ODINFUNCTION3(BOOL, FileMenu_GetLastSelectedItemPidls,
+              UINT, uReserved,
+              LPCITEMIDLIST *, ppidlFolder,
+              LPCITEMIDLIST *, ppidlItem)
+{
+   FIXME("0x%08x %p %p\n",uReserved, ppidlFolder, ppidlItem);
+   return 0;
+}
+
+#define FM_ICON_SIZE                     16
+#define FM_Y_SPACE                       4
+#define FM_SPACE1 4
+#define FM_SPACE2 2
+#define FM_LEFTBORDER                    2
+#define FM_RIGHTBORDER                   8
+/*************************************************************************
+ * FileMenu_MeasureItem                           [SHELL32.112]
+ */
+ODINFUNCTION2(LRESULT, FileMenu_MeasureItem,
+              HWND, hWnd,
+              LPMEASUREITEMSTRUCT, lpmis)
+{
+   LPFMITEM pMyItem = (LPFMITEM)(lpmis->itemData);
+   HDC hdc = GetDC(hWnd);
+   SIZE size;
+   LPFMINFO menuinfo;
+
+   TRACE("0x%08x %p %s\n", hWnd, lpmis, pMyItem->szItemText);
+
+   GetTextExtentPoint32A(hdc, pMyItem->szItemText, pMyItem->cchItemText, &size);
+
+   lpmis->itemWidth = size.cx + FM_LEFTBORDER + FM_ICON_SIZE + FM_SPACE1 + FM_SPACE2 + FM_RIGHTBORDER;
+   lpmis->itemHeight = (size.cy > (FM_ICON_SIZE + FM_Y_SPACE)) ? size.cy : (FM_ICON_SIZE + FM_Y_SPACE);
+
+   /* add the menubitmap */
+   menuinfo = FM_GetMenuInfo(pMyItem->hMenu);
+   if (menuinfo->bIsMagic)
+     lpmis->itemWidth += menuinfo->nBorderWidth;
+
+   TRACE("-- 0x%04x 0x%04x\n", lpmis->itemWidth, lpmis->itemHeight);
+   ReleaseDC (hWnd, hdc);
+   return 0;
+}
+/*************************************************************************
+ * FileMenu_DrawItem                              [SHELL32.105]
+ */
+ODINFUNCTION2(LRESULT, FileMenu_DrawItem,
+              HWND, hWnd,
+              LPDRAWITEMSTRUCT, lpdis)
+{
+   LPFMITEM pMyItem = (LPFMITEM)(lpdis->itemData);
+   COLORREF clrPrevText, clrPrevBkgnd;
+   int xi,yi,xt,yt;
+   HIMAGELIST hImageList;
+   RECT TextRect, BorderRect;
+   LPFMINFO menuinfo;
+
+   TRACE("0x%08x %p %s\n", hWnd, lpdis, pMyItem->szItemText);
+
+   if (lpdis->itemState & ODS_SELECTED)
+   {
+     clrPrevText = SetTextColor(lpdis->hDC, GetSysColor (COLOR_HIGHLIGHTTEXT));
+     clrPrevBkgnd = SetBkColor(lpdis->hDC, GetSysColor (COLOR_HIGHLIGHT));
+   }
+   else
+   {
+     clrPrevText = SetTextColor(lpdis->hDC, GetSysColor (COLOR_MENUTEXT));
+     clrPrevBkgnd = SetBkColor(lpdis->hDC, GetSysColor (COLOR_MENU));
+   }
+
+   CopyRect(&TextRect, &(lpdis->rcItem));
+
+   /* add the menubitmap */
+   menuinfo = FM_GetMenuInfo(pMyItem->hMenu);
+   if (menuinfo->bIsMagic)
+     TextRect.left += menuinfo->nBorderWidth;
+
+   BorderRect.right = menuinfo->nBorderWidth;
+/* FillRect(lpdis->hDC, &BorderRect, CreateSolidBrush( menuinfo->crBorderColor));
 */
-	TextRect.left += FM_LEFTBORDER;
-	xi = TextRect.left + FM_SPACE1;
-	yi = TextRect.top + FM_Y_SPACE/2;
-	TextRect.bottom -= FM_Y_SPACE/2;
-
-	xt = xi + FM_ICON_SIZE + FM_SPACE2;
-	yt = yi;
-
-	ExtTextOutA (lpdis->hDC, xt , yt, ETO_OPAQUE, &TextRect, pMyItem->szItemText, pMyItem->cchItemText, NULL);
-	
-	Shell_GetImageList(0, &hImageList);
-	pImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL);
-
-	TRACE("-- 0x%04x 0x%04x 0x%04x 0x%04x\n", TextRect.left, TextRect.top, TextRect.right, TextRect.bottom);
-	
-	SetTextColor(lpdis->hDC, clrPrevText);
-	SetBkColor(lpdis->hDC, clrPrevBkgnd);
-
-	return TRUE;
-}
-
-/*************************************************************************
- * FileMenu_InitMenuPopup			[SHELL32.109]
+   TextRect.left += FM_LEFTBORDER;
+   xi = TextRect.left + FM_SPACE1;
+   yi = TextRect.top + FM_Y_SPACE/2;
+   TextRect.bottom -= FM_Y_SPACE/2;
+
+   xt = xi + FM_ICON_SIZE + FM_SPACE2;
+   yt = yi;
+
+   ExtTextOutA (lpdis->hDC, xt , yt, ETO_OPAQUE, &TextRect, pMyItem->szItemText, pMyItem->cchItemText, NULL);
+
+   Shell_GetImageList(0, &hImageList);
+   pImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL);
+
+   TRACE("-- 0x%04x 0x%04x 0x%04x 0x%04x\n", TextRect.left, TextRect.top, TextRect.right, TextRect.bottom);
+
+   SetTextColor(lpdis->hDC, clrPrevText);
+   SetBkColor(lpdis->hDC, clrPrevBkgnd);
+
+   return TRUE;
+}
+
+/*************************************************************************
+ * FileMenu_InitMenuPopup                      [SHELL32.109]
  *
  * NOTES
@@ -591,340 +622,360 @@
  *
  */
-BOOL WINAPI FileMenu_InitMenuPopup (HMENU hmenu)
-{
-	FM_InitMenuPopup(hmenu, NULL);
-	return TRUE;
-}
-
-/*************************************************************************
- * FileMenu_HandleMenuChar			[SHELL32.108]
- */
-LRESULT WINAPI FileMenu_HandleMenuChar(
-	HMENU	hMenu,
-	WPARAM	wParam)
-{
-	FIXME("0x%08x 0x%08x\n",hMenu,wParam);
-	return 0;
-}
-
-/*************************************************************************
- * FileMenu_DeleteAllItems			[SHELL32.104]
+ODINFUNCTION1(BOOL, FileMenu_InitMenuPopup,
+              HMENU, hmenu)
+{
+   FM_InitMenuPopup(hmenu, NULL);
+   return TRUE;
+}
+
+/*************************************************************************
+ * FileMenu_HandleMenuChar                     [SHELL32.108]
+ */
+ODINFUNCTION2(LRESULT, FileMenu_HandleMenuChar,
+              HMENU, hMenu,
+              WPARAM, wParam)
+{
+   FIXME("0x%08x 0x%08x\n",hMenu,wParam);
+   return 0;
+}
+
+/*************************************************************************
+ * FileMenu_DeleteAllItems                     [SHELL32.104]
  *
  * NOTES
  *  exported by name
  */
-BOOL WINAPI FileMenu_DeleteAllItems (HMENU hmenu)
-{	
-	MENUITEMINFOA	mii;
-	LPFMINFO	menudata;
-
-	int i;
-	
-	TRACE("0x%08x\n", hmenu);
-	
-	ZeroMemory ( &mii, sizeof(MENUITEMINFOA));
-	mii.cbSize = sizeof(MENUITEMINFOA);
-	mii.fMask = MIIM_SUBMENU|MIIM_DATA;
-
-	for (i = 0; i < GetMenuItemCount( hmenu ); i++)
-	{ GetMenuItemInfoA(hmenu, i, TRUE, &mii );
-
-	  if (mii.dwItemData)
-	    SHFree((LPFMINFO)mii.dwItemData);
-
-	  if (mii.hSubMenu)
-	    FileMenu_Destroy(mii.hSubMenu);
-	}
-	
-	while (DeleteMenu (hmenu, 0, MF_BYPOSITION)){};
-
-	menudata = FM_GetMenuInfo(hmenu);
-	
-	menudata->bInitialized = FALSE;
-	
-	return TRUE;
-}
-
-/*************************************************************************
- * FileMenu_DeleteItemByCmd 			[SHELL32.]
- *
- */
-BOOL WINAPI FileMenu_DeleteItemByCmd (HMENU hMenu, UINT uID)
-{
-	MENUITEMINFOA mii;
-
-	TRACE("0x%08x 0x%08x\n", hMenu, uID);
-	
-	ZeroMemory ( &mii, sizeof(MENUITEMINFOA));
-	mii.cbSize = sizeof(MENUITEMINFOA);
-	mii.fMask = MIIM_SUBMENU;
-
-	GetMenuItemInfoA(hMenu, uID, FALSE, &mii );
-	if ( mii.hSubMenu );
-
-	DeleteMenu(hMenu, MF_BYCOMMAND, uID);
-	return TRUE;
-}
-
-/*************************************************************************
- * FileMenu_DeleteItemByIndex			[SHELL32.140]
- */
-BOOL WINAPI FileMenu_DeleteItemByIndex ( HMENU hMenu, UINT uPos)
-{
-	MENUITEMINFOA mii;
-
-	TRACE("0x%08x 0x%08x\n", hMenu, uPos);
-
-	ZeroMemory ( &mii, sizeof(MENUITEMINFOA));
-	mii.cbSize = sizeof(MENUITEMINFOA);
-	mii.fMask = MIIM_SUBMENU;
-
-	GetMenuItemInfoA(hMenu, uPos, TRUE, &mii );
-	if ( mii.hSubMenu );
-
-	DeleteMenu(hMenu, MF_BYPOSITION, uPos);
-	return TRUE;
-}
-
-/*************************************************************************
- * FileMenu_DeleteItemByFirstID			[SHELL32.141]
- */
-BOOL WINAPI FileMenu_DeleteItemByFirstID(
-	HMENU	hMenu,
-	UINT	uID)
-{
-	TRACE("0x%08x 0x%08x\n", hMenu, uID);
-	return 0;
-}
-
-/*************************************************************************
- * FileMenu_DeleteSeparator			[SHELL32.142]
- */
-BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu)
-{
-	TRACE("0x%08x\n", hMenu);
-	return 0;
-}
-
-/*************************************************************************
- * FileMenu_EnableItemByCmd			[SHELL32.143]
- */
-BOOL WINAPI FileMenu_EnableItemByCmd(
-	HMENU	hMenu,
-	UINT	uID,
-	BOOL	bEnable)
-{
-	TRACE("0x%08x 0x%08x 0x%08x\n", hMenu, uID,bEnable);
-	return 0;
-}
-
-/*************************************************************************
- * FileMenu_GetItemExtent			[SHELL32.144]
+ODINFUNCTION1(BOOL, FileMenu_DeleteAllItems,
+              HMENU, hmenu)
+{
+   MENUITEMINFOA  mii;
+   LPFMINFO menudata;
+
+   int i;
+
+   TRACE("0x%08x\n", hmenu);
+
+   ZeroMemory ( &mii, sizeof(MENUITEMINFOA));
+   mii.cbSize = sizeof(MENUITEMINFOA);
+   mii.fMask = MIIM_SUBMENU|MIIM_DATA;
+
+   for (i = 0; i < GetMenuItemCount( hmenu ); i++)
+   { GetMenuItemInfoA(hmenu, i, TRUE, &mii );
+
+     if (mii.dwItemData)
+       SHFree((LPFMINFO)mii.dwItemData);
+
+     if (mii.hSubMenu)
+       FileMenu_Destroy(mii.hSubMenu);
+   }
+
+   while (DeleteMenu (hmenu, 0, MF_BYPOSITION)){};
+
+   menudata = FM_GetMenuInfo(hmenu);
+
+   menudata->bInitialized = FALSE;
+
+   return TRUE;
+}
+
+/*************************************************************************
+ * FileMenu_DeleteItemByCmd                    [SHELL32.]
+ *
+ */
+ODINFUNCTION2(BOOL, FileMenu_DeleteItemByCmd,
+              HMENU, hMenu,
+              UINT, uID)
+{
+   MENUITEMINFOA mii;
+
+   TRACE("0x%08x 0x%08x\n", hMenu, uID);
+
+   ZeroMemory ( &mii, sizeof(MENUITEMINFOA));
+   mii.cbSize = sizeof(MENUITEMINFOA);
+   mii.fMask = MIIM_SUBMENU;
+
+   GetMenuItemInfoA(hMenu, uID, FALSE, &mii );
+   if ( mii.hSubMenu );
+
+   DeleteMenu(hMenu, MF_BYCOMMAND, uID);
+   return TRUE;
+}
+
+/*************************************************************************
+ * FileMenu_DeleteItemByIndex                  [SHELL32.140]
+ */
+ODINFUNCTION2(BOOL, FileMenu_DeleteItemByIndex,
+              HMENU, hMenu,
+              UINT, uPos)
+{
+   MENUITEMINFOA mii;
+
+   TRACE("0x%08x 0x%08x\n", hMenu, uPos);
+
+   ZeroMemory ( &mii, sizeof(MENUITEMINFOA));
+   mii.cbSize = sizeof(MENUITEMINFOA);
+   mii.fMask = MIIM_SUBMENU;
+
+   GetMenuItemInfoA(hMenu, uPos, TRUE, &mii );
+   if ( mii.hSubMenu );
+
+   DeleteMenu(hMenu, MF_BYPOSITION, uPos);
+   return TRUE;
+}
+
+/*************************************************************************
+ * FileMenu_DeleteItemByFirstID                [SHELL32.141]
+ */
+ODINFUNCTION2(BOOL, FileMenu_DeleteItemByFirstID,
+              HMENU, hMenu,
+              UINT, uID)
+{
+   TRACE("0x%08x 0x%08x\n", hMenu, uID);
+   return 0;
+}
+
+/*************************************************************************
+ * FileMenu_DeleteSeparator                    [SHELL32.142]
+ */
+ODINFUNCTION1(BOOL, FileMenu_DeleteSeparator,
+              HMENU, hMenu)
+{
+   TRACE("0x%08x\n", hMenu);
+   return 0;
+}
+
+/*************************************************************************
+ * FileMenu_EnableItemByCmd                    [SHELL32.143]
+ */
+ODINFUNCTION3(BOOL, FileMenu_EnableItemByCmd,
+              HMENU, hMenu,
+              UINT, uID,
+              BOOL, bEnable)
+{
+   TRACE("0x%08x 0x%08x 0x%08x\n", hMenu, uID,bEnable);
+   return 0;
+}
+
+/*************************************************************************
+ * FileMenu_GetItemExtent                      [SHELL32.144]
  *
  * NOTES
  *  if the menu is to big, entrys are getting cut away!!
  */
-DWORD WINAPI FileMenu_GetItemExtent (HMENU hMenu, UINT uPos)
-{	RECT rect;
-	
-	FIXME("0x%08x 0x%08x\n", hMenu, uPos);
-
-	if (GetMenuItemRect(0, hMenu, uPos, &rect))
-	{ FIXME("0x%04x 0x%04x 0x%04x 0x%04x\n",
-	  rect.right, rect.left, rect.top, rect.bottom);
-	  return ((rect.right-rect.left)<<16) + (rect.top-rect.bottom);
-	}
-	return 0x00100010; /*fixme*/
-}
-
-/*************************************************************************
- * FileMenu_AbortInitMenu 			[SHELL32.120]
- *
- */
-void WINAPI FileMenu_AbortInitMenu (void)
-{	TRACE("\n");
-	bAbortInit = TRUE;
-}
-
-/*************************************************************************
- * SHFind_InitMenuPopup				[SHELL32.149]
+ODINFUNCTION2(DWORD, FileMenu_GetItemExtent,
+              HMENU, hMenu,
+              UINT, uPos)
+{  RECT rect;
+
+   FIXME("0x%08x 0x%08x\n", hMenu, uPos);
+
+   if (GetMenuItemRect(0, hMenu, uPos, &rect))
+   { FIXME("0x%04x 0x%04x 0x%04x 0x%04x\n",
+     rect.right, rect.left, rect.top, rect.bottom);
+     return ((rect.right-rect.left)<<16) + (rect.top-rect.bottom);
+   }
+   return 0x00100010; /*fixme*/
+}
+
+/*************************************************************************
+ * FileMenu_AbortInitMenu                      [SHELL32.120]
+ *
+ */
+ODINPROCEDURE0(FileMenu_AbortInitMenu)
+{
+   bAbortInit = TRUE;
+}
+
+/*************************************************************************
+ * SHFind_InitMenuPopup                           [SHELL32.149]
  *
  *
  * PARAMETERS
- *  hMenu		[in] handel of menu previously created
- *  hWndParent	[in] parent window
- *  w			[in] no pointer
- *  x			[in] no pointer
- */
-HRESULT WINAPI SHFind_InitMenuPopup (HMENU hMenu, HWND hWndParent, DWORD w, DWORD x)
-{	FIXME("hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
-		hMenu,hWndParent,w,x);
-	return TRUE;
-}
-
-/*************************************************************************
- * Shell_MergeMenus				[SHELL32.67]
+ *  hMenu      [in] handel of menu previously created
+ *  hWndParent [in] parent window
+ *  w       [in] no pointer
+ *  x       [in] no pointer
+ */
+ODINFUNCTION4(HRESULT, SHFind_InitMenuPopup,
+              HMENU, hMenu,
+              HWND, hWndParent,
+              DWORD, w,
+              DWORD, x)
+{  FIXME("hmenu=0x%08x hwnd=0x%08x 0x%08lx 0x%08lx stub\n",
+      hMenu,hWndParent,w,x);
+   return TRUE;
+}
+
+/*************************************************************************
+ * Shell_MergeMenus                               [SHELL32.67]
  *
  */
 BOOL _SHIsMenuSeparator(HMENU hm, int i)
 {
-	MENUITEMINFOA mii;
-
-	mii.cbSize = sizeof(MENUITEMINFOA);
-	mii.fMask = MIIM_TYPE;
-	mii.cch = 0;    /* WARNING: We MUST initialize it to 0*/
-	if (!GetMenuItemInfoA(hm, i, TRUE, &mii))
-	{
-	  return(FALSE);
-	}
-
-	if (mii.fType & MFT_SEPARATOR)
-	{
-	  return(TRUE);
-	}
-
-	return(FALSE);
-}
-
-HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
-{	int		nItem;
-	HMENU		hmSubMenu;
-	BOOL		bAlreadySeparated;
-	MENUITEMINFOA	miiSrc;
-	char		szName[256];
-	UINT		uTemp, uIDMax = uIDAdjust;
-
-	TRACE("hmenu1=0x%04x hmenu2=0x%04x 0x%04x 0x%04x 0x%04x  0x%04lx\n",
-		 hmDst, hmSrc, uInsert, uIDAdjust, uIDAdjustMax, uFlags);
-
-	if (!hmDst || !hmSrc)
-	{ return uIDMax;
-	}
-
-	nItem = GetMenuItemCount(hmDst);
-
-	if (uInsert >= (UINT)nItem)	/* insert position inside menu? */
-	{
-	  uInsert = (UINT)nItem;	/* append on the end */
-	  bAlreadySeparated = TRUE;
-	}
-	else
-	{
-	  bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert);;
-	}
-
-	if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
-	{
-	  /* Add a separator between the menus */
-	  InsertMenuA(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
-	  bAlreadySeparated = TRUE;
-	}
-
-
-	/* Go through the menu items and clone them*/
-	for (nItem = GetMenuItemCount(hmSrc) - 1; nItem >= 0; nItem--)
-	{
-	  miiSrc.cbSize = sizeof(MENUITEMINFOA);
-	  miiSrc.fMask =  MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_TYPE | MIIM_DATA;
-
-	  /* We need to reset this every time through the loop in case menus DON'T have IDs*/
-	  miiSrc.fType = MFT_STRING;
-	  miiSrc.dwTypeData = szName;
-	  miiSrc.dwItemData = 0;
-	  miiSrc.cch = sizeof(szName);
-
-	  if (!GetMenuItemInfoA(hmSrc, nItem, TRUE, &miiSrc))
-	  {
-	    continue;
-	  }
-
-/*	  TRACE("found menu=0x%04x %s id=0x%04x mask=0x%08x smenu=0x%04x\n", hmSrc, debugstr_a(miiSrc.dwTypeData), miiSrc.wID, miiSrc.fMask,  miiSrc.hSubMenu);
+   MENUITEMINFOA mii;
+
+   mii.cbSize = sizeof(MENUITEMINFOA);
+   mii.fMask = MIIM_TYPE;
+   mii.cch = 0;    /* WARNING: We MUST initialize it to 0*/
+   if (!GetMenuItemInfoA(hm, i, TRUE, &mii))
+   {
+     return(FALSE);
+   }
+
+   if (mii.fType & MFT_SEPARATOR)
+   {
+     return(TRUE);
+   }
+
+   return(FALSE);
+}
+
+ODINFUNCTION6(HRESULT, Shell_MergeMenus,
+              HMENU, hmDst,
+              HMENU, hmSrc,
+              UINT, uInsert,
+              UINT, uIDAdjust,
+              UINT, uIDAdjustMax,
+              ULONG, uFlags)
+{  int      nItem;
+   HMENU    hmSubMenu;
+   BOOL     bAlreadySeparated;
+   MENUITEMINFOA  miiSrc;
+   char     szName[256];
+   UINT     uTemp, uIDMax = uIDAdjust;
+
+   TRACE("hmenu1=0x%04x hmenu2=0x%04x 0x%04x 0x%04x 0x%04x  0x%04lx\n",
+       hmDst, hmSrc, uInsert, uIDAdjust, uIDAdjustMax, uFlags);
+
+   if (!hmDst || !hmSrc)
+   { return uIDMax;
+   }
+
+   nItem = GetMenuItemCount(hmDst);
+
+   if (uInsert >= (UINT)nItem)           /* insert position inside menu? */
+   {
+     uInsert = (UINT)nItem;              /* append on the end */
+     bAlreadySeparated = TRUE;
+   }
+   else
+   {
+     bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert);;
+   }
+
+   if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
+   {
+     /* Add a separator between the menus */
+     InsertMenuA(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
+     bAlreadySeparated = TRUE;
+   }
+
+
+   /* Go through the menu items and clone them*/
+   for (nItem = GetMenuItemCount(hmSrc) - 1; nItem >= 0; nItem--)
+   {
+     miiSrc.cbSize = sizeof(MENUITEMINFOA);
+     miiSrc.fMask =  MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_TYPE | MIIM_DATA;
+
+     /* We need to reset this every time through the loop in case menus DON'T have IDs*/
+     miiSrc.fType = MFT_STRING;
+     miiSrc.dwTypeData = szName;
+     miiSrc.dwItemData = 0;
+     miiSrc.cch = sizeof(szName);
+
+     if (!GetMenuItemInfoA(hmSrc, nItem, TRUE, &miiSrc))
+     {
+       continue;
+     }
+
+/*   TRACE("found menu=0x%04x %s id=0x%04x mask=0x%08x smenu=0x%04x\n", hmSrc, debugstr_a(miiSrc.dwTypeData), miiSrc.wID, miiSrc.fMask,  miiSrc.hSubMenu);
 */
-	  if (miiSrc.fType & MFT_SEPARATOR)
-	  {
-	    /* This is a separator; don't put two of them in a row */
-	    if (bAlreadySeparated)
-	      continue;
-
-	    bAlreadySeparated = TRUE;
-	  }
-	  else if (miiSrc.hSubMenu)
-	  {
-	    if (uFlags & MM_SUBMENUSHAVEIDS)
-	    {
-	      miiSrc.wID += uIDAdjust;			/* add uIDAdjust to the ID */
-
-	      if (miiSrc.wID > uIDAdjustMax)		/* skip ID's higher uIDAdjustMax */
-	        continue;
-
-	      if (uIDMax <= miiSrc.wID)			/* remember the highest ID */
-	        uIDMax = miiSrc.wID + 1;
-	    }
-	    else
-	    {
-	      miiSrc.fMask &= ~MIIM_ID;			/* Don't set IDs for submenus that didn't have them already */
-	    }
-	    hmSubMenu = miiSrc.hSubMenu;
-
-	    miiSrc.hSubMenu = CreatePopupMenu();
-
-	    if (!miiSrc.hSubMenu) return(uIDMax);
-
-	    uTemp = Shell_MergeMenus(miiSrc.hSubMenu, hmSubMenu, 0, uIDAdjust, uIDAdjustMax, uFlags & MM_SUBMENUSHAVEIDS);
-
-	    if (uIDMax <= uTemp)
-	      uIDMax = uTemp;
-
-	    bAlreadySeparated = FALSE;
-	  }
-	  else						/* normal menu item */
-	  {
-	    miiSrc.wID += uIDAdjust;			/* add uIDAdjust to the ID */
-
-	    if (miiSrc.wID > uIDAdjustMax)		/* skip ID's higher uIDAdjustMax */
-	      continue;
-
-	    if (uIDMax <= miiSrc.wID)			/* remember the highest ID */
-	      uIDMax = miiSrc.wID + 1;
-
-	    bAlreadySeparated = FALSE;
-	  }
-
-/*	  TRACE("inserting menu=0x%04x %s id=0x%04x mask=0x%08x smenu=0x%04x\n", hmDst, debugstr_a(miiSrc.dwTypeData), miiSrc.wID, miiSrc.fMask, miiSrc.hSubMenu);
+     if (miiSrc.fType & MFT_SEPARATOR)
+     {
+       /* This is a separator; don't put two of them in a row */
+       if (bAlreadySeparated)
+         continue;
+
+       bAlreadySeparated = TRUE;
+     }
+     else if (miiSrc.hSubMenu)
+     {
+       if (uFlags & MM_SUBMENUSHAVEIDS)
+       {
+         miiSrc.wID += uIDAdjust;              /* add uIDAdjust to the ID */
+
+         if (miiSrc.wID > uIDAdjustMax)     /* skip ID's higher uIDAdjustMax */
+           continue;
+
+         if (uIDMax <= miiSrc.wID)             /* remember the highest ID */
+           uIDMax = miiSrc.wID + 1;
+       }
+       else
+       {
+         miiSrc.fMask &= ~MIIM_ID;             /* Don't set IDs for submenus that didn't have them already */
+       }
+       hmSubMenu = miiSrc.hSubMenu;
+
+       miiSrc.hSubMenu = CreatePopupMenu();
+
+       if (!miiSrc.hSubMenu) return(uIDMax);
+
+       uTemp = Shell_MergeMenus(miiSrc.hSubMenu, hmSubMenu, 0, uIDAdjust, uIDAdjustMax, uFlags & MM_SUBMENUSHAVEIDS);
+
+       if (uIDMax <= uTemp)
+         uIDMax = uTemp;
+
+       bAlreadySeparated = FALSE;
+     }
+     else                                      /* normal menu item */
+     {
+       miiSrc.wID += uIDAdjust;                /* add uIDAdjust to the ID */
+
+       if (miiSrc.wID > uIDAdjustMax)       /* skip ID's higher uIDAdjustMax */
+         continue;
+
+       if (uIDMax <= miiSrc.wID)               /* remember the highest ID */
+         uIDMax = miiSrc.wID + 1;
+
+       bAlreadySeparated = FALSE;
+     }
+
+/*   TRACE("inserting menu=0x%04x %s id=0x%04x mask=0x%08x smenu=0x%04x\n", hmDst, debugstr_a(miiSrc.dwTypeData), miiSrc.wID, miiSrc.fMask, miiSrc.hSubMenu);
 */
-	  if (!InsertMenuItemA(hmDst, uInsert, TRUE, &miiSrc))
-	  {
-	    return(uIDMax);
-	  }
-	}
-
-	/* Ensure the correct number of separators at the beginning of the
-	inserted menu items*/
-	if (uInsert == 0)
-	{
-	  if (bAlreadySeparated)
-	  {
-	    DeleteMenu(hmDst, uInsert, MF_BYPOSITION);
-	  }
-	}
-	else
-	{
-	  if (_SHIsMenuSeparator(hmDst, uInsert-1))
-	  {
-	    if (bAlreadySeparated)
-	    {
-	      DeleteMenu(hmDst, uInsert, MF_BYPOSITION);
-	    }
-	  }
-	  else
-	  {
-	    if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
-	    {
-	      /* Add a separator between the menus*/
-	      InsertMenuA(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
-	    }
-	  }
-	}
-	return(uIDMax);
-}
-
+     if (!InsertMenuItemA(hmDst, uInsert, TRUE, &miiSrc))
+     {
+       return(uIDMax);
+     }
+   }
+
+   /* Ensure the correct number of separators at the beginning of the
+   inserted menu items*/
+   if (uInsert == 0)
+   {
+     if (bAlreadySeparated)
+     {
+       DeleteMenu(hmDst, uInsert, MF_BYPOSITION);
+     }
+   }
+   else
+   {
+     if (_SHIsMenuSeparator(hmDst, uInsert-1))
+     {
+       if (bAlreadySeparated)
+       {
+         DeleteMenu(hmDst, uInsert, MF_BYPOSITION);
+       }
+     }
+     else
+     {
+       if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
+       {
+         /* Add a separator between the menus*/
+         InsertMenuA(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
+       }
+     }
+   }
+   return(uIDMax);
+}
+
+
