CVS: winex/dlls/shell32 shellpath.c,1.8,1.9

[email protected]
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/dlls/shell32 shellpath.c,1.8,1.9Update of /var/lib/cvsd/cvsroot/winex/dlls/shell32
In directory agravaine:/tmp/cvs-serv12702/dlls/shell32

Modified Files:
	shellpath.c 
Log Message:

- support @USERPREFS@ in a drive path
- on MacOS X, map "My Documents" to P:\ (if it exists) instead of C:\


Index: shellpath.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/shell32/shellpath.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- shellpath.c	29 Mar 2007 14:04:46 -0000	1.8
+++ shellpath.c	30 Mar 2007 20:05:29 -0000	1.9
@@ -655,11 +655,12 @@
     LPCSTR szDefaultPath; /* fallback string; sub dir of windows directory */
 } CSIDL_DATA;
 
-#define CSIDL_MYFLAG_SHFOLDER	1
-#define CSIDL_MYFLAG_SETUP	2
-#define CSIDL_MYFLAG_CURRVER	4
-#define CSIDL_MYFLAG_RELATIVE	8
-#define CSIDL_MYFLAG_DOCANDSET  16
+#define CSIDL_MYFLAG_SHFOLDER   0x01
+#define CSIDL_MYFLAG_SETUP      0x02
+#define CSIDL_MYFLAG_CURRVER    0x04
+#define CSIDL_MYFLAG_RELATIVE   0x08
+#define CSIDL_MYFLAG_DOCANDSET  0x10
+#define CSIDL_MYFLAG_USERPREFS  0x20
 
 #define HKLM HKEY_LOCAL_MACHINE
 #define HKCU HKEY_CURRENT_USER
@@ -691,7 +692,7 @@
 	"SYSTEM"
     },
     { /* CSIDL_PERSONAL */
-	1, HKCU,
+	CSIDL_MYFLAG_USERPREFS | CSIDL_MYFLAG_SHFOLDER, HKCU,
 	"Personal",
 	"My Documents"
     },
@@ -1038,9 +1039,23 @@
                  strcpy (szPath, "C:\\Documents and Settings\\");
                  strcat (szPath, szDefaultPath);
               }
+#ifdef __APPLE__
+              /* On the Apple, user prefs are stored on P:\ which gets
+                 mapped into the user's preferences folder */
+              else if ((dwFlags & CSIDL_MYFLAG_USERPREFS) &&
+                       PathIsDirectoryA ("P:\\"))
+              {
+                 strcpy (szPath, "P:\\");
+                 strcat (szPath, szDefaultPath);
+
+                 /* To minimize the number of empty directories we have to
+                    manually have created in our app packages */
+                 bCreate = TRUE;
+              }
+#endif
 	      else
 	      {
-	        strcpy(szPath, "C:\\");	/* FIXME ??? */
+	        strcpy(szPath, "C:\\");
 	        strcat(szPath, szDefaultPath);
 	      }
 	      RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
@@ -1079,9 +1094,23 @@
                strcpy (szPath, "C:\\Documents and Settings\\");
                strcat (szPath, szDefaultPath);
             }
+#ifdef __APPLE__
+            /* On the Apple, user prefs are stored on P:\ which gets
+               mapped into the user's preferences folder */
+            else if ((dwFlags & CSIDL_MYFLAG_USERPREFS) &&
+                     PathIsDirectoryA ("P:\\"))
+            {
+               strcpy (szPath, "P:\\");
+               strcat (szPath, szDefaultPath);
+
+               /* To minimize the number of empty directories we have to
+                  manually have created in our app packages */
+               bCreate = TRUE;
+            }
+#endif
 	    else
 	    {
-	      strcpy(szPath, "C:\\");	/* FIXME ??? */
+	      strcpy(szPath, "C:\\");
 	      strcat(szPath, szDefaultPath);
 	    }
 	    RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.