1998-11-25 16:47:05 +00:00
|
|
|
/*
|
|
|
|
* Path Functions
|
|
|
|
*
|
2002-03-09 23:29:33 +00:00
|
|
|
* Copyright 1998, 1999, 2000 Juergen Schmied
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
* NOTES:
|
|
|
|
*
|
|
|
|
* Many of these functions are in SHLWAPI.DLL also
|
1998-11-25 16:47:05 +00:00
|
|
|
*
|
|
|
|
*/
|
2002-08-28 23:42:34 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
1998-11-25 16:47:05 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
2002-03-09 23:29:33 +00:00
|
|
|
#include "wine/debug.h"
|
2000-11-28 22:40:56 +00:00
|
|
|
#include "windef.h"
|
2003-08-20 18:22:31 +00:00
|
|
|
#include "winbase.h"
|
1998-11-25 16:47:05 +00:00
|
|
|
#include "winnls.h"
|
1999-07-25 12:23:15 +00:00
|
|
|
#include "winreg.h"
|
2003-09-05 23:08:26 +00:00
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
1999-01-23 14:12:48 +00:00
|
|
|
|
|
|
|
#include "shlobj.h"
|
1998-11-25 16:47:05 +00:00
|
|
|
#include "shell32_main.h"
|
2001-08-16 18:49:56 +00:00
|
|
|
#include "undocshell.h"
|
2004-04-07 19:45:48 +00:00
|
|
|
#include "pidl.h"
|
2000-06-13 01:10:29 +00:00
|
|
|
#include "wine/unicode.h"
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
#include "shlwapi.h"
|
1998-11-25 16:47:05 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
1999-04-19 14:56:29 +00:00
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*
|
2000-06-24 12:56:08 +00:00
|
|
|
########## Combining and Constructing paths ##########
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
2000-02-20 18:43:44 +00:00
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathAppend [SHELL32.36]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
2000-06-24 12:56:08 +00:00
|
|
|
BOOL WINAPI PathAppendAW(
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
LPVOID lpszPath1,
|
|
|
|
LPCVOID lpszPath2)
|
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathAppendW(lpszPath1, lpszPath2);
|
|
|
|
return PathAppendA(lpszPath1, lpszPath2);
|
|
|
|
}
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathCombine [SHELL32.37]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
LPVOID WINAPI PathCombineAW(
|
|
|
|
LPVOID szDest,
|
|
|
|
LPCVOID lpszDir,
|
2002-05-31 23:06:46 +00:00
|
|
|
LPCVOID lpszFile)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathCombineW( szDest, lpszDir, lpszFile );
|
|
|
|
return PathCombineA( szDest, lpszDir, lpszFile );
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathAddBackslash [SHELL32.32]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
|
|
|
LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath)
|
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if(SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathAddBackslashW(lpszPath);
|
|
|
|
return PathAddBackslashA(lpszPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathBuildRoot [SHELL32.30]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
|
|
|
LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
|
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if(SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathBuildRootW(lpszPath, drive);
|
|
|
|
return PathBuildRootA(lpszPath, drive);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Extracting Component Parts
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathFindFileName [SHELL32.34]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
|
|
|
LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath)
|
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if(SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathFindFileNameW(lpszPath);
|
|
|
|
return PathFindFileNameA(lpszPath);
|
|
|
|
}
|
|
|
|
|
2000-03-24 20:46:04 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathFindExtension [SHELL32.31]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
LPVOID WINAPI PathFindExtensionAW(LPCVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathFindExtensionW(lpszPath);
|
|
|
|
return PathFindExtensionA(lpszPath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2000-08-14 14:35:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathGetExtensionA [internal]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* exported by ordinal
|
|
|
|
* return value points to the first char after the dot
|
|
|
|
*/
|
|
|
|
static LPSTR PathGetExtensionA(LPCSTR lpszPath)
|
|
|
|
{
|
|
|
|
TRACE("(%s)\n",lpszPath);
|
|
|
|
|
|
|
|
lpszPath = PathFindExtensionA(lpszPath);
|
|
|
|
return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathGetExtensionW [internal]
|
|
|
|
*/
|
|
|
|
static LPWSTR PathGetExtensionW(LPCWSTR lpszPath)
|
|
|
|
{
|
|
|
|
TRACE("(%s)\n",debugstr_w(lpszPath));
|
|
|
|
|
|
|
|
lpszPath = PathFindExtensionW(lpszPath);
|
|
|
|
return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
|
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathGetExtension [SHELL32.158]
|
2000-07-26 17:51:32 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath,DWORD void1, DWORD void2)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathGetExtensionW(lpszPath);
|
|
|
|
return PathGetExtensionA(lpszPath);
|
1999-01-31 10:00:26 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathGetArgs [SHELL32.52]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathGetArgsW(lpszPath);
|
|
|
|
return PathGetArgsA(lpszPath);
|
1999-01-31 10:00:26 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
2000-07-26 17:51:32 +00:00
|
|
|
* PathGetDriveNumber [SHELL32.57]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
int WINAPI PathGetDriveNumberAW(LPVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathGetDriveNumberW(lpszPath);
|
|
|
|
return PathGetDriveNumberA(lpszPath);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
2000-07-26 17:51:32 +00:00
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
2000-07-26 17:51:32 +00:00
|
|
|
* PathRemoveFileSpec [SHELL32.35]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathRemoveFileSpecW(lpszPath);
|
|
|
|
return PathRemoveFileSpecA(lpszPath);
|
1999-01-03 12:35:52 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathStripPath [SHELL32.38]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
void WINAPI PathStripPathAW(LPVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2002-07-03 01:20:07 +00:00
|
|
|
PathStripPathW(lpszPath);
|
|
|
|
else
|
|
|
|
PathStripPathA(lpszPath);
|
1999-01-03 12:35:52 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathStripToRoot [SHELL32.50]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
BOOL WINAPI PathStripToRootAW(LPVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathStripToRootW(lpszPath);
|
|
|
|
return PathStripToRootA(lpszPath);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathRemoveArgs [SHELL32.251]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
void WINAPI PathRemoveArgsAW(LPVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2002-07-03 01:20:07 +00:00
|
|
|
PathRemoveArgsW(lpszPath);
|
|
|
|
else
|
|
|
|
PathRemoveArgsA(lpszPath);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathRemoveExtension [SHELL32.250]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
void WINAPI PathRemoveExtensionAW(LPVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2002-07-03 01:20:07 +00:00
|
|
|
PathRemoveExtensionW(lpszPath);
|
|
|
|
else
|
|
|
|
PathRemoveExtensionA(lpszPath);
|
2000-07-26 17:51:32 +00:00
|
|
|
}
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
|
|
|
|
|
2000-07-26 17:51:32 +00:00
|
|
|
/*
|
|
|
|
Path Manipulations
|
|
|
|
*/
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2000-07-26 17:51:32 +00:00
|
|
|
* PathGetShortPathA [internal]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2004-01-21 23:51:57 +00:00
|
|
|
static void PathGetShortPathA(LPSTR pszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2004-01-21 23:51:57 +00:00
|
|
|
CHAR path[MAX_PATH];
|
|
|
|
|
|
|
|
TRACE("%s\n", pszPath);
|
|
|
|
|
|
|
|
if (GetShortPathNameA(pszPath, path, MAX_PATH))
|
|
|
|
{
|
|
|
|
lstrcpyA(pszPath, path);
|
|
|
|
}
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2000-07-26 17:51:32 +00:00
|
|
|
* PathGetShortPathW [internal]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
2004-01-21 23:51:57 +00:00
|
|
|
static void PathGetShortPathW(LPWSTR pszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2004-01-21 23:51:57 +00:00
|
|
|
WCHAR path[MAX_PATH];
|
|
|
|
|
|
|
|
TRACE("%s\n", debugstr_w(pszPath));
|
|
|
|
|
|
|
|
if (GetShortPathNameW(pszPath, path, MAX_PATH))
|
|
|
|
{
|
|
|
|
lstrcpyW(pszPath, path);
|
|
|
|
}
|
2000-07-26 17:51:32 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathGetShortPath [SHELL32.92]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2004-01-21 23:51:57 +00:00
|
|
|
VOID WINAPI PathGetShortPathAW(LPVOID pszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if(SHELL_OsIsUnicode())
|
2004-01-21 23:51:57 +00:00
|
|
|
PathGetShortPathW(pszPath);
|
|
|
|
PathGetShortPathA(pszPath);
|
2000-07-26 17:51:32 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathRemoveBlanks [SHELL32.33]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
void WINAPI PathRemoveBlanksAW(LPVOID str)
|
2000-01-04 00:33:56 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if(SHELL_OsIsUnicode())
|
2002-07-03 01:20:07 +00:00
|
|
|
PathRemoveBlanksW(str);
|
|
|
|
else
|
|
|
|
PathRemoveBlanksA(str);
|
1999-01-03 12:35:52 +00:00
|
|
|
}
|
|
|
|
|
2000-06-24 12:56:08 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathQuoteSpaces [SHELL32.55]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2002-03-20 01:33:39 +00:00
|
|
|
VOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if(SHELL_OsIsUnicode())
|
2002-07-03 01:20:07 +00:00
|
|
|
PathQuoteSpacesW(lpszPath);
|
|
|
|
else
|
|
|
|
PathQuoteSpacesA(lpszPath);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathUnquoteSpaces [SHELL32.56]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if(SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
PathUnquoteSpacesW(str);
|
|
|
|
else
|
|
|
|
PathUnquoteSpacesA(str);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathParseIconLocation [SHELL32.249]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
int WINAPI PathParseIconLocationAW (LPVOID lpszPath)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if(SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathParseIconLocationW(lpszPath);
|
|
|
|
return PathParseIconLocationA(lpszPath);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
2000-07-26 17:51:32 +00:00
|
|
|
/*
|
|
|
|
########## Path Testing ##########
|
|
|
|
*/
|
2000-06-24 12:56:08 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathIsUNC [SHELL32.39]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathIsUNCW( lpszPath );
|
2002-05-31 23:06:46 +00:00
|
|
|
return PathIsUNCA( lpszPath );
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathIsRelative [SHELL32.40]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathIsRelativeW( lpszPath );
|
2002-05-31 23:06:46 +00:00
|
|
|
return PathIsRelativeA( lpszPath );
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathIsRoot [SHELL32.29]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
BOOL WINAPI PathIsRootAW(LPCVOID lpszPath)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathIsRootW(lpszPath);
|
|
|
|
return PathIsRootA(lpszPath);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
2000-08-14 14:35:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathIsExeA [internal]
|
|
|
|
*/
|
|
|
|
static BOOL PathIsExeA (LPCSTR lpszPath)
|
|
|
|
{
|
|
|
|
LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
|
2002-09-30 19:01:20 +00:00
|
|
|
int i;
|
|
|
|
static const char * const lpszExtensions[] =
|
|
|
|
{"exe", "com", "pif", "cmd", "bat", "scf", "scr", NULL };
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2000-08-14 14:35:01 +00:00
|
|
|
TRACE("path=%s\n",lpszPath);
|
|
|
|
|
|
|
|
for(i=0; lpszExtensions[i]; i++)
|
|
|
|
if (!strcasecmp(lpszExtension,lpszExtensions[i])) return TRUE;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2000-08-14 14:35:01 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathIsExeW [internal]
|
|
|
|
*/
|
|
|
|
static BOOL PathIsExeW (LPCWSTR lpszPath)
|
|
|
|
{
|
|
|
|
LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
|
2002-09-30 19:01:20 +00:00
|
|
|
int i;
|
|
|
|
static const WCHAR lpszExtensions[][4] =
|
|
|
|
{{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','f','\0'},
|
|
|
|
{'c','m','d','\0'}, {'b','a','t','\0'}, {'s','c','f','\0'},
|
|
|
|
{'s','c','r','\0'}, {'\0'} };
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2000-08-14 14:35:01 +00:00
|
|
|
TRACE("path=%s\n",debugstr_w(lpszPath));
|
|
|
|
|
2001-08-08 23:24:15 +00:00
|
|
|
for(i=0; lpszExtensions[i][0]; i++)
|
2000-08-14 14:35:01 +00:00
|
|
|
if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2000-08-14 14:35:01 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-06-24 12:56:08 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathIsExe [SHELL32.43]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
BOOL WINAPI PathIsExeAW (LPCVOID path)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathIsExeW (path);
|
|
|
|
return PathIsExeA(path);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathIsDirectory [SHELL32.159]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathIsDirectoryW (lpszPath);
|
|
|
|
return PathIsDirectoryA (lpszPath);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathFileExists [SHELL32.45]
|
2002-05-31 23:06:46 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathFileExistsW (lpszPath);
|
|
|
|
return PathFileExistsA (lpszPath);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathMatchSpec [SHELL32.46]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathMatchSpecW( name, mask );
|
|
|
|
return PathMatchSpecA( name, mask );
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathIsSameRoot [SHELL32.650]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 17:51:32 +00:00
|
|
|
return PathIsSameRootW(lpszPath1, lpszPath2);
|
|
|
|
return PathIsSameRootA(lpszPath1, lpszPath2);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2003-09-30 00:19:44 +00:00
|
|
|
* IsLFNDriveA [SHELL32.41]
|
2000-06-24 12:56:08 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath)
|
2000-06-24 12:56:08 +00:00
|
|
|
{
|
2000-07-26 17:51:32 +00:00
|
|
|
DWORD fnlen;
|
|
|
|
|
2003-09-30 00:19:44 +00:00
|
|
|
if (!GetVolumeInformationA(lpszPath, NULL, 0, NULL, &fnlen, NULL, NULL, 0))
|
|
|
|
return FALSE;
|
|
|
|
return fnlen > 12;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* IsLFNDriveW [SHELL32.42]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsLFNDriveW(LPCWSTR lpszPath)
|
|
|
|
{
|
|
|
|
DWORD fnlen;
|
|
|
|
|
|
|
|
if (!GetVolumeInformationW(lpszPath, NULL, 0, NULL, &fnlen, NULL, NULL, 0))
|
2000-06-24 12:56:08 +00:00
|
|
|
return FALSE;
|
2003-10-16 19:12:49 +00:00
|
|
|
return fnlen > 12;
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
2003-09-30 00:19:44 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* IsLFNDrive [SHELL32.119]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsLFNDriveAW(LPCVOID lpszPath)
|
|
|
|
{
|
|
|
|
if (SHELL_OsIsUnicode())
|
|
|
|
return IsLFNDriveW(lpszPath);
|
|
|
|
return IsLFNDriveA(lpszPath);
|
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*
|
2000-06-24 12:56:08 +00:00
|
|
|
########## Creating Something Unique ##########
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
* PathMakeUniqueNameA [internal]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
BOOL WINAPI PathMakeUniqueNameA(
|
|
|
|
LPSTR lpszBuffer,
|
2002-05-31 23:06:46 +00:00
|
|
|
DWORD dwBuffSize,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
LPCSTR lpszShortName,
|
|
|
|
LPCSTR lpszLongName,
|
|
|
|
LPCSTR lpszPathName)
|
|
|
|
{
|
|
|
|
FIXME("%p %lu %s %s %s stub\n",
|
|
|
|
lpszBuffer, dwBuffSize, debugstr_a(lpszShortName),
|
|
|
|
debugstr_a(lpszLongName), debugstr_a(lpszPathName));
|
|
|
|
return TRUE;
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
2000-04-06 20:21:16 +00:00
|
|
|
/*************************************************************************
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
* PathMakeUniqueNameW [internal]
|
2000-04-06 20:21:16 +00:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
BOOL WINAPI PathMakeUniqueNameW(
|
|
|
|
LPWSTR lpszBuffer,
|
2002-05-31 23:06:46 +00:00
|
|
|
DWORD dwBuffSize,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
LPCWSTR lpszShortName,
|
|
|
|
LPCWSTR lpszLongName,
|
|
|
|
LPCWSTR lpszPathName)
|
|
|
|
{
|
|
|
|
FIXME("%p %lu %s %s %s stub\n",
|
|
|
|
lpszBuffer, dwBuffSize, debugstr_w(lpszShortName),
|
|
|
|
debugstr_w(lpszLongName), debugstr_w(lpszPathName));
|
|
|
|
return TRUE;
|
2000-04-06 20:21:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathMakeUniqueName [SHELL32.47]
|
2000-04-06 20:21:16 +00:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
BOOL WINAPI PathMakeUniqueNameAW(
|
|
|
|
LPVOID lpszBuffer,
|
2002-05-31 23:06:46 +00:00
|
|
|
DWORD dwBuffSize,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
LPCVOID lpszShortName,
|
|
|
|
LPCVOID lpszLongName,
|
|
|
|
LPCVOID lpszPathName)
|
2000-04-06 20:21:16 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathMakeUniqueNameW(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
|
|
|
|
return PathMakeUniqueNameA(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
|
2000-04-06 20:21:16 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathYetAnotherMakeUniqueName [SHELL32.75]
|
2002-05-31 23:06:46 +00:00
|
|
|
*
|
1998-11-25 16:47:05 +00:00
|
|
|
* NOTES
|
|
|
|
* exported by ordinal
|
|
|
|
*/
|
2004-01-16 23:04:41 +00:00
|
|
|
BOOL WINAPI PathYetAnotherMakeUniqueName(
|
|
|
|
LPWSTR lpszBuffer,
|
|
|
|
LPCWSTR lpszPathName,
|
|
|
|
LPCWSTR lpszShortName,
|
|
|
|
LPCWSTR lpszLongName)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2004-01-16 23:04:41 +00:00
|
|
|
FIXME("(%p, %s, %s ,%s):stub.\n",
|
|
|
|
lpszBuffer, debugstr_w(lpszPathName), debugstr_w(lpszShortName), debugstr_w(lpszLongName));
|
1998-11-25 16:47:05 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*
|
2000-06-24 12:56:08 +00:00
|
|
|
########## cleaning and resolving paths ##########
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathFindOnPath [SHELL32.145]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2000-07-26 17:51:32 +00:00
|
|
|
BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
|
1999-08-15 14:31:36 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
2001-12-11 00:30:17 +00:00
|
|
|
return PathFindOnPathW(sFile, (LPCWSTR *)sOtherDirs);
|
|
|
|
return PathFindOnPathA(sFile, (LPCSTR *)sOtherDirs);
|
1999-08-15 14:31:36 +00:00
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathCleanupSpec [SHELL32.171]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
2001-01-07 21:50:52 +00:00
|
|
|
DWORD WINAPI PathCleanupSpecAW (LPCVOID x, LPVOID y)
|
1999-08-15 14:31:36 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
FIXME("(%p, %p) stub\n",x,y);
|
|
|
|
return TRUE;
|
1999-08-15 14:31:36 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
* PathQualifyA [SHELL32]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
BOOL WINAPI PathQualifyA(LPCSTR pszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
|
|
|
FIXME("%s\n",pszPath);
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
* PathQualifyW [SHELL32]
|
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
BOOL WINAPI PathQualifyW(LPCWSTR pszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
|
|
|
FIXME("%s\n",debugstr_w(pszPath));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathQualify [SHELL32.49]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
BOOL WINAPI PathQualifyAW(LPCVOID pszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathQualifyW(pszPath);
|
|
|
|
return PathQualifyA(pszPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathResolveA [SHELL32.51]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
BOOL WINAPI PathResolveA(
|
|
|
|
LPSTR lpszPath,
|
2002-05-31 23:06:46 +00:00
|
|
|
LPCSTR *alpszPaths,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
FIXME("(%s,%p,0x%08lx),stub!\n",
|
|
|
|
lpszPath, *alpszPaths, dwFlags);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathResolveW [SHELL32]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PathResolveW(
|
|
|
|
LPWSTR lpszPath,
|
2002-05-31 23:06:46 +00:00
|
|
|
LPCWSTR *alpszPaths,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
FIXME("(%s,%p,0x%08lx),stub!\n",
|
|
|
|
debugstr_w(lpszPath), debugstr_w(*alpszPaths), dwFlags);
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathResolve [SHELL32.51]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
|
|
|
BOOL WINAPI PathResolveAW(
|
|
|
|
LPVOID lpszPath,
|
2002-05-31 23:06:46 +00:00
|
|
|
LPCVOID *alpszPaths,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathResolveW(lpszPath, (LPCWSTR*)alpszPaths, dwFlags);
|
|
|
|
return PathResolveA(lpszPath, (LPCSTR*)alpszPaths, dwFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathProcessCommandA [SHELL32.653]
|
1998-11-25 16:47:05 +00:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
HRESULT WINAPI PathProcessCommandA (
|
|
|
|
LPCSTR lpszPath,
|
|
|
|
LPSTR lpszBuff,
|
|
|
|
DWORD dwBuffSize,
|
|
|
|
DWORD dwFlags)
|
1999-07-10 11:56:34 +00:00
|
|
|
{
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
FIXME("%s %p 0x%04lx 0x%04lx stub\n",
|
|
|
|
lpszPath, lpszBuff, dwBuffSize, dwFlags);
|
2000-08-14 14:35:01 +00:00
|
|
|
strcpy(lpszBuff, lpszPath);
|
1999-07-10 11:56:34 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathProcessCommandW
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI PathProcessCommandW (
|
|
|
|
LPCWSTR lpszPath,
|
|
|
|
LPWSTR lpszBuff,
|
|
|
|
DWORD dwBuffSize,
|
|
|
|
DWORD dwFlags)
|
1999-07-10 11:56:34 +00:00
|
|
|
{
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
FIXME("(%s, %p, 0x%04lx, 0x%04lx) stub\n",
|
|
|
|
debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
|
2000-08-14 14:35:01 +00:00
|
|
|
strcpyW(lpszBuff, lpszPath);
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1999-01-17 16:55:11 +00:00
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathProcessCommand (SHELL32.653)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI PathProcessCommandAW (
|
|
|
|
LPCVOID lpszPath,
|
|
|
|
LPVOID lpszBuff,
|
|
|
|
DWORD dwBuffSize,
|
|
|
|
DWORD dwFlags)
|
1999-07-10 11:56:34 +00:00
|
|
|
{
|
2000-08-14 14:35:01 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
return PathProcessCommandW(lpszPath, lpszBuff, dwBuffSize, dwFlags);
|
|
|
|
return PathProcessCommandA(lpszPath, lpszBuff, dwBuffSize, dwFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2000-06-24 12:56:08 +00:00
|
|
|
########## special ##########
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* PathSetDlgItemPath (SHELL32.48)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath)
|
2002-07-03 01:20:07 +00:00
|
|
|
{
|
|
|
|
if (SHELL_OsIsUnicode())
|
|
|
|
PathSetDlgItemPathW(hDlg, id, pszPath);
|
|
|
|
else
|
|
|
|
PathSetDlgItemPathA(hDlg, id, pszPath);
|
1999-07-10 11:56:34 +00:00
|
|
|
}
|
|
|
|
|
1999-01-17 16:55:11 +00:00
|
|
|
/*************************************************************************
|
2004-01-16 04:46:36 +00:00
|
|
|
* SHGetFolderPathW [SHELL32.@]
|
2002-05-31 23:06:46 +00:00
|
|
|
*
|
1999-01-17 16:55:11 +00:00
|
|
|
* converts csidl to path
|
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2004-01-16 04:46:36 +00:00
|
|
|
static const WCHAR szSHFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'};
|
|
|
|
static const WCHAR szSHUserFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'};
|
|
|
|
static const WCHAR szSetup[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','S','e','t','u','p','\0'};
|
|
|
|
static const WCHAR szCurrentVersion[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\0'};
|
1999-07-25 12:23:15 +00:00
|
|
|
|
2004-08-20 19:57:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
static const WCHAR Administrative_ToolsW[] = {'A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'};
|
|
|
|
static const WCHAR All_Users__Application_DataW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'};
|
2004-09-21 20:05:54 +00:00
|
|
|
static const WCHAR All_Users__DesktopW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'D','e','s','k','t','o','p','\0'};
|
2004-08-20 19:57:50 +00:00
|
|
|
static const WCHAR All_Users__DocumentsW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'D','o','c','u','m','e','n','t','s','\0'};
|
|
|
|
static const WCHAR All_Users__Documents__My_MusicW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'D','o','c','u','m','e','n','t','s','\\',
|
|
|
|
'M','y',' ','M','u','s','i','c','\0'};
|
|
|
|
static const WCHAR All_Users__Documents__My_PicturesW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'D','o','c','u','m','e','n','t','s','\\',
|
|
|
|
'M','y',' ','P','i','c','t','u','r','e','s','\0'};
|
|
|
|
static const WCHAR All_Users__Documents__My_VideoW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'D','o','c','u','m','e','n','t','s','\\',
|
|
|
|
'M','y',' ','V','i','d','e','o','\0'};
|
2004-09-21 20:05:54 +00:00
|
|
|
static const WCHAR All_Users__Start_MenuW[] = {'A','l','l',' ','U','s','e','r','s','\\','S','t','a','r','t',' ','M','e','n','u','\0'};
|
|
|
|
static const WCHAR All_Users__Start_Menu__ProgramsW[] = {'A','l','l',' ','U','s','e','r','s','\\','S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\0'};
|
2004-08-20 19:57:50 +00:00
|
|
|
static const WCHAR All_Users__Start_Menu__Programs__Administrative_ToolsW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\\',
|
|
|
|
'A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'};
|
|
|
|
static const WCHAR All_Users__Start_Menu__Programs__StartUpW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'S','t','a','r','t',' ','M','e','n','u','\\',
|
|
|
|
'P','r','o','g','r','a','m','s','\\',
|
|
|
|
'S','t','a','r','t','U','p','\0'};
|
|
|
|
static const WCHAR All_Users__TemplatesW[] = {'A','l','l',' ','U','s','e','r','s','\\',
|
|
|
|
'T','e','m','p','l','a','t','e','s','\0'};
|
|
|
|
static const WCHAR AppDataW[] = {'A','p','p','D','a','t','a','\0'};
|
|
|
|
static const WCHAR Application_DataW[] = {'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'};
|
|
|
|
static const WCHAR CacheW[] = {'C','a','c','h','e','\0'};
|
|
|
|
static const WCHAR CD_BurningW[] = {'C','D',' ','B','u','r','n','i','n','g','\0'};
|
|
|
|
static const WCHAR Common_Administrative_ToolsW[] = {'C','o','m','m','o','n',' ','A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'};
|
|
|
|
static const WCHAR Common_AppDataW[] = {'C','o','m','m','o','n',' ','A','p','p','D','a','t','a','\0'};
|
|
|
|
static const WCHAR Common_DesktopW[] = {'C','o','m','m','o','n',' ','D','e','s','k','t','o','p','\0'};
|
|
|
|
static const WCHAR Common_DocumentsW[] = {'C','o','m','m','o','n',' ','D','o','c','u','m','e','n','t','s','\0'};
|
|
|
|
static const WCHAR CommonFilesDirW[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r','\0'};
|
|
|
|
static const WCHAR CommonMusicW[] = {'C','o','m','m','o','n','M','u','s','i','c','\0'};
|
|
|
|
static const WCHAR CommonPicturesW[] = {'C','o','m','m','o','n','P','i','c','t','u','r','e','s','\0'};
|
|
|
|
static const WCHAR Common_ProgramsW[] = {'C','o','m','m','o','n',' ','P','r','o','g','r','a','m','s','\0'};
|
|
|
|
static const WCHAR Common_StartUpW[] = {'C','o','m','m','o','n',' ','S','t','a','r','t','U','p','\0'};
|
|
|
|
static const WCHAR Common_Start_MenuW[] = {'C','o','m','m','o','n',' ','S','t','a','r','t',' ','M','e','n','u','\0'};
|
|
|
|
static const WCHAR Common_TemplatesW[] = {'C','o','m','m','o','n',' ','T','e','m','p','l','a','t','e','s','\0'};
|
|
|
|
static const WCHAR CommonVideoW[] = {'C','o','m','m','o','n','V','i','d','e','o','\0'};
|
|
|
|
static const WCHAR CookiesW[] = {'C','o','o','k','i','e','s','\0'};
|
|
|
|
static const WCHAR DesktopW[] = {'D','e','s','k','t','o','p','\0'};
|
|
|
|
static const WCHAR Empty_StringW[] = {'\0'};
|
|
|
|
static const WCHAR FavoritesW[] = {'F','a','v','o','r','i','t','e','s','\0'};
|
|
|
|
static const WCHAR FontsW[] = {'F','o','n','t','s','\0'};
|
|
|
|
static const WCHAR HistoryW[] = {'H','i','s','t','o','r','y','\0'};
|
|
|
|
static const WCHAR Local_AppDataW[] = {'L','o','c','a','l',' ','A','p','p','D','a','t','a','\0'};
|
|
|
|
static const WCHAR Local_Settings__Application_DataW[] = {'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\',
|
|
|
|
'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\0'};
|
|
|
|
static const WCHAR Local_Settings__Application_Data__Microsoft__CD_BurningW[] = {
|
|
|
|
'L','o','c','a','l',' ','S','e','t','t','i','n','g','s','\\',
|
|
|
|
'A','p','p','l','i','c','a','t','i','o','n',' ','D','a','t','a','\\',
|
|
|
|
'M','i','c','r','o','s','o','f','t','\\','C','D',' ','B','u','r','n','i','n','g','\0'};
|
|
|
|
static const WCHAR My_DocumentsW[] = {'M','y',' ','D','o','c','u','m','e','n','t','s','\0'};
|
|
|
|
static const WCHAR My_Documents__My_MusicW[] = {'M','y',' ','D','o','c','u','m','e','n','t','s','\\',
|
|
|
|
'M','y',' ','M','u','s','i','c','\0'};
|
|
|
|
static const WCHAR My_Documents__My_PicturesW[] = {'M','y',' ','D','o','c','u','m','e','n','t','s','\\',
|
|
|
|
'M','y',' ','P','i','c','t','u','r','e','s','\0'};
|
|
|
|
static const WCHAR My_Documents__My_VideoW[] = {'M','y',' ','D','o','c','u','m','e','n','t','s','\\',
|
|
|
|
'M','y',' ','V','i','d','e','o','\0'};
|
|
|
|
static const WCHAR My_MusicW[] = {'M','y',' ','M','u','s','i','c','\0'};
|
|
|
|
static const WCHAR My_PicturesW[] = {'M','y',' ','P','i','c','t','u','r','e','s','\0'};
|
|
|
|
static const WCHAR My_VideoW[] = {'M','y',' ','V','i','d','e','o','\0'};
|
|
|
|
static const WCHAR NetHoodW[] = {'N','e','t','H','o','o','d','\0'};
|
|
|
|
static const WCHAR PersonalW[] = {'P','e','r','s','o','n','a','l','\0'};
|
|
|
|
static const WCHAR PrintHoodW[] = {'P','r','i','n','t','H','o','o','d','\0'};
|
|
|
|
static const WCHAR ProgramFilesDirW[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r','\0'};
|
|
|
|
static const WCHAR Program_FilesW[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s','\0'};
|
|
|
|
static const WCHAR Program_Files__Common_FilesW[] = {'P','r','o','g','r','a','m',' ','F','i','l','e','s','\\',
|
|
|
|
'C','o','m','m','o','n',' ','F','i','l','e','s','\0'};
|
2004-10-04 20:49:51 +00:00
|
|
|
static const WCHAR ProgramsW[] = {'P','r','o','g','r','a','m','s','\0'};
|
2004-08-20 19:57:50 +00:00
|
|
|
static const WCHAR RecentW[] = {'R','e','c','e','n','t','\0'};
|
|
|
|
static const WCHAR ResourcesW[] = {'R','e','s','o','u','r','c','e','s','\0'};
|
|
|
|
static const WCHAR SendToW[] = {'S','e','n','d','T','o','\0'};
|
|
|
|
static const WCHAR ShellNewW[] = {'S','h','e','l','l','N','e','w','\0'};
|
|
|
|
static const WCHAR Start_Menu__ProgramsW[] = {'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\0'};
|
|
|
|
static const WCHAR SysDirW[] = {'S','y','s','D','i','r','\0'};
|
2004-10-04 20:49:51 +00:00
|
|
|
static const WCHAR SystemW[] = {'s','y','s','t','e','m','\0'};
|
2004-08-20 19:57:50 +00:00
|
|
|
static const WCHAR StartUpW[] = {'S','t','a','r','t','U','p','\0'};
|
|
|
|
static const WCHAR Start_MenuW[] = {'S','t','a','r','t',' ','M','e','n','u','\0'};
|
|
|
|
static const WCHAR Start_Menu__Programs__Administrative_ToolsW[] = {
|
|
|
|
'S','t','a','r','t',' ','M','e','n','u','\\','P','r','o','g','r','a','m','s','\\',
|
|
|
|
'A','d','m','i','n','i','s','t','r','a','t','i','v','e',' ','T','o','o','l','s','\0'};
|
|
|
|
static const WCHAR Start_Menu__Programs__StartUpW[] = {'S','t','a','r','t',' ','M','e','n','u','\\',
|
|
|
|
'P','r','o','g','r','a','m','s','\\',
|
|
|
|
'S','t','a','r','t','U','p','\0'};
|
|
|
|
static const WCHAR TemplatesW[] = {'T','e','m','p','l','a','t','e','s','\0'};
|
|
|
|
static const WCHAR Temporary_Internet_FilesW[] = {'T','e','m','p','o','r','a','r','y',' ','I','n','t','e','r','n','e','t',' ','F','i','l','e','s','\0'};
|
|
|
|
static const WCHAR WinDirW[] = {'W','i','n','D','i','r','\0'};
|
2004-10-04 20:49:51 +00:00
|
|
|
static const WCHAR WindowsW[] = {'w','i','n','d','o','w','s','\0'};
|
2004-08-20 19:57:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-12-13 01:49:04 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DWORD dwFlags;
|
|
|
|
HKEY hRootKey;
|
2004-08-20 19:57:50 +00:00
|
|
|
LPCWSTR szValueName;
|
|
|
|
LPCWSTR szDefaultPath; /* fallback string; sub dir of windows directory */
|
2000-12-13 01:49:04 +00:00
|
|
|
} CSIDL_DATA;
|
|
|
|
|
|
|
|
#define CSIDL_MYFLAG_SHFOLDER 1
|
|
|
|
#define CSIDL_MYFLAG_SETUP 2
|
|
|
|
#define CSIDL_MYFLAG_CURRVER 4
|
|
|
|
#define CSIDL_MYFLAG_RELATIVE 8
|
|
|
|
|
|
|
|
#define HKLM HKEY_LOCAL_MACHINE
|
|
|
|
#define HKCU HKEY_CURRENT_USER
|
2004-04-07 19:45:48 +00:00
|
|
|
#define HKEY_DISALLOWED (HKEY)0
|
2004-04-05 23:13:20 +00:00
|
|
|
#define HKEY_UNIMPLEMENTED (HKEY)1
|
|
|
|
#define HKEY_WINDOWSPATH (HKEY)2
|
2004-04-07 19:45:48 +00:00
|
|
|
#define HKEY_NONEXISTENT (HKEY)3
|
2000-12-13 01:49:04 +00:00
|
|
|
static const CSIDL_DATA CSIDL_Data[] =
|
|
|
|
{
|
|
|
|
{ /* CSIDL_DESKTOP */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
DesktopW,
|
|
|
|
DesktopW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2001-10-10 02:48:29 +00:00
|
|
|
{ /* CSIDL_INTERNET */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
2004-08-20 19:57:50 +00:00
|
|
|
NULL
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAMS */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
ProgramsW,
|
|
|
|
Start_Menu__ProgramsW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_CONTROLS (.CPL files) */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SETUP | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
SysDirW,
|
2004-10-04 20:49:51 +00:00
|
|
|
SystemW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PRINTERS */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SETUP | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
SysDirW,
|
2004-10-04 20:49:51 +00:00
|
|
|
SystemW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PERSONAL */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER,
|
|
|
|
HKCU,
|
|
|
|
PersonalW,
|
|
|
|
My_DocumentsW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_FAVORITES */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
FavoritesW,
|
|
|
|
FavoritesW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_STARTUP */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
StartUpW,
|
|
|
|
Start_Menu__Programs__StartUpW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_RECENT */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
RecentW,
|
|
|
|
RecentW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_SENDTO */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
SendToW,
|
|
|
|
SendToW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2004-01-26 20:09:10 +00:00
|
|
|
{ /* CSIDL_BITBUCKET - Recycle Bin */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2004-04-07 19:45:48 +00:00
|
|
|
NULL,
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_STARTMENU */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
Start_MenuW,
|
|
|
|
Start_MenuW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2001-10-10 02:48:29 +00:00
|
|
|
{ /* CSIDL_MYDOCUMENTS */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_UNIMPLEMENTED, /* FIXME */
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
2004-01-26 20:09:10 +00:00
|
|
|
NULL
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2001-10-10 02:48:29 +00:00
|
|
|
{ /* CSIDL_MYMUSIC */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER,
|
|
|
|
HKCU,
|
|
|
|
My_MusicW,
|
|
|
|
My_Documents__My_MusicW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2004-04-07 19:45:48 +00:00
|
|
|
{ /* CSIDL_MYVIDEO */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER,
|
|
|
|
HKCU,
|
|
|
|
My_VideoW,
|
|
|
|
My_Documents__My_VideoW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2001-10-10 02:48:29 +00:00
|
|
|
{ /* unassigned */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_DESKTOPDIRECTORY */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
DesktopW,
|
|
|
|
DesktopW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_DRIVES */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2004-04-07 19:45:48 +00:00
|
|
|
NULL,
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_NETWORK */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2004-04-07 19:45:48 +00:00
|
|
|
NULL,
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_NETHOOD */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
NetHoodW,
|
|
|
|
NetHoodW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_FONTS */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
FontsW,
|
|
|
|
FontsW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_TEMPLATES */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
TemplatesW,
|
|
|
|
ShellNewW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_STARTMENU */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
Common_Start_MenuW,
|
2004-09-21 20:05:54 +00:00
|
|
|
All_Users__Start_MenuW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_PROGRAMS */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
Common_ProgramsW,
|
2004-09-21 20:05:54 +00:00
|
|
|
All_Users__Start_Menu__ProgramsW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_STARTUP */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
Common_StartUpW,
|
|
|
|
All_Users__Start_Menu__Programs__StartUpW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_DESKTOPDIRECTORY */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
Common_DesktopW,
|
2004-09-21 20:05:54 +00:00
|
|
|
All_Users__DesktopW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_APPDATA */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
AppDataW,
|
|
|
|
Application_DataW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PRINTHOOD */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
PrintHoodW,
|
|
|
|
PrintHoodW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2002-01-29 18:19:59 +00:00
|
|
|
{ /* CSIDL_LOCAL_APPDATA (win2k only/undocumented) */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER,
|
|
|
|
HKCU,
|
|
|
|
Local_AppDataW,
|
|
|
|
Local_Settings__Application_DataW,
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_ALTSTARTUP */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_NONEXISTENT,
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_ALTSTARTUP */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_NONEXISTENT,
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_FAVORITES */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
FavoritesW,
|
|
|
|
FavoritesW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2004-01-26 20:09:10 +00:00
|
|
|
{ /* CSIDL_INTERNET_CACHE (32) */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
CacheW,
|
|
|
|
Temporary_Internet_FilesW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2004-01-26 20:09:10 +00:00
|
|
|
{ /* CSIDL_COOKIES (33) */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
CookiesW,
|
|
|
|
CookiesW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
2004-01-26 20:09:10 +00:00
|
|
|
{ /* CSIDL_HISTORY (34) */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
HistoryW,
|
|
|
|
HistoryW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_APPDATA */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
Common_AppDataW,
|
|
|
|
All_Users__Application_DataW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_WINDOWS */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SETUP,
|
|
|
|
HKLM,
|
|
|
|
WinDirW,
|
|
|
|
WindowsW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_SYSTEM */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SETUP | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
SysDirW,
|
2004-10-04 20:49:51 +00:00
|
|
|
SystemW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAM_FILES */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_CURRVER,
|
|
|
|
HKLM,
|
|
|
|
ProgramFilesDirW,
|
|
|
|
Program_FilesW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_MYPICTURES */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER,
|
|
|
|
HKCU,
|
|
|
|
My_PicturesW,
|
|
|
|
My_Documents__My_PicturesW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PROFILE */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SETUP | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
WinDirW, /* correct ? */
|
|
|
|
Empty_StringW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_SYSTEMX86 */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SETUP | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
SysDirW,
|
2004-10-04 20:49:51 +00:00
|
|
|
SystemW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAM_FILESX86 */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_CURRVER,
|
|
|
|
HKLM,
|
|
|
|
ProgramFilesDirW,
|
|
|
|
Program_FilesW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAM_FILES_COMMON */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_CURRVER,
|
|
|
|
HKLM,
|
|
|
|
CommonFilesDirW,
|
|
|
|
Program_Files__Common_FilesW /* ? */
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAM_FILES_COMMONX86 */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_CURRVER,
|
|
|
|
HKLM,
|
|
|
|
CommonFilesDirW,
|
|
|
|
Program_Files__Common_FilesW /* ? */
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_TEMPLATES */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
Common_TemplatesW,
|
|
|
|
/*"Documents and Settings\\"*/ All_Users__TemplatesW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_DOCUMENTS */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
Common_DocumentsW,
|
|
|
|
/*"Documents and Settings\\"*/ All_Users__DocumentsW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_ADMINTOOLS */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
Common_Administrative_ToolsW,
|
|
|
|
/*"Documents and Settings\\"*/ All_Users__Start_Menu__Programs__Administrative_ToolsW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_ADMINTOOLS */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKCU,
|
|
|
|
Administrative_ToolsW,
|
|
|
|
Start_Menu__Programs__Administrative_ToolsW
|
2000-12-13 01:49:04 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_CONNECTIONS */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2000-12-13 01:49:04 +00:00
|
|
|
NULL,
|
|
|
|
NULL
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
2004-02-24 00:58:20 +00:00
|
|
|
{ /* unassigned 32 */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2004-02-24 00:58:20 +00:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* unassigned 33 */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2004-02-24 00:58:20 +00:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* unassigned 34 */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2004-02-24 00:58:20 +00:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
2001-10-10 02:48:29 +00:00
|
|
|
{ /* CSIDL_COMMON_MUSIC */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
CommonMusicW,
|
|
|
|
/*"Documents and Settings\\"*/ All_Users__Documents__My_MusicW
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_PICTURES */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
CommonPicturesW,
|
|
|
|
/*"Documents and Settings\\"*/ All_Users__Documents__My_PicturesW
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_VIDEO */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER | CSIDL_MYFLAG_RELATIVE,
|
|
|
|
HKLM,
|
|
|
|
CommonVideoW,
|
|
|
|
/*"Documents and Settings\\"*/ All_Users__Documents__My_VideoW
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_RESOURCES */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_WINDOWSPATH,
|
2001-10-10 02:48:29 +00:00
|
|
|
NULL,
|
2004-08-20 19:57:50 +00:00
|
|
|
ResourcesW
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_RESOURCES_LOCALIZED */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED, /* FIXME */
|
2001-10-10 02:48:29 +00:00
|
|
|
NULL,
|
2004-01-26 20:09:10 +00:00
|
|
|
NULL
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_OEM_LINKS */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED, /* FIXME */
|
2001-10-10 02:48:29 +00:00
|
|
|
NULL,
|
2004-01-26 20:09:10 +00:00
|
|
|
NULL
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_CDBURN_AREA */
|
2004-08-20 19:57:50 +00:00
|
|
|
CSIDL_MYFLAG_SHFOLDER,
|
|
|
|
HKCU,
|
|
|
|
CD_BurningW,
|
|
|
|
Local_Settings__Application_Data__Microsoft__CD_BurningW
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
|
|
|
{ /* unassigned 3C */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED,
|
2001-10-10 02:48:29 +00:00
|
|
|
NULL,
|
2004-01-26 20:09:10 +00:00
|
|
|
NULL
|
2001-10-10 02:48:29 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_COMPUTERSNEARME */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED, /* FIXME */
|
2001-10-10 02:48:29 +00:00
|
|
|
NULL,
|
2004-01-26 20:09:10 +00:00
|
|
|
NULL
|
2003-03-17 04:42:45 +00:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PROFILES */
|
2004-08-20 19:57:50 +00:00
|
|
|
0,
|
|
|
|
HKEY_DISALLOWED, /* FIXME */
|
2003-03-17 04:42:45 +00:00
|
|
|
NULL,
|
2004-01-26 20:09:10 +00:00
|
|
|
NULL
|
2000-12-13 01:49:04 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
#undef HKCU
|
|
|
|
#undef HKLM
|
|
|
|
|
2004-02-20 20:19:23 +00:00
|
|
|
/**********************************************************************/
|
|
|
|
|
2004-01-16 04:46:36 +00:00
|
|
|
HRESULT WINAPI SHGetFolderPathW(
|
1999-07-25 12:23:15 +00:00
|
|
|
HWND hwndOwner,
|
2003-09-08 18:47:10 +00:00
|
|
|
int csidl,
|
2004-01-16 04:46:36 +00:00
|
|
|
HANDLE hToken, /* [in] FIXME: get paths for specific user */
|
|
|
|
DWORD dwFlags, /* [in] FIXME: SHGFP_TYPE_CURRENT|SHGFP_TYPE_DEFAULT */
|
|
|
|
LPWSTR pszPath)
|
1999-07-25 12:23:15 +00:00
|
|
|
{
|
2004-08-20 19:57:50 +00:00
|
|
|
WCHAR szBuildPath[MAX_PATH];
|
1999-07-25 12:23:15 +00:00
|
|
|
HKEY hRootKey, hKey;
|
2004-01-16 04:46:36 +00:00
|
|
|
DWORD dwCsidlFlags;
|
1999-07-25 12:23:15 +00:00
|
|
|
DWORD dwType, dwDisp, dwPathLen = MAX_PATH;
|
2000-12-13 01:49:04 +00:00
|
|
|
DWORD folder = csidl & CSIDL_FOLDER_MASK;
|
2004-01-16 04:46:36 +00:00
|
|
|
WCHAR *p;
|
1999-07-25 12:23:15 +00:00
|
|
|
|
2004-01-16 04:46:36 +00:00
|
|
|
TRACE("%p,%p,csidl=0x%04x\n", hwndOwner,pszPath,csidl);
|
1999-07-25 12:23:15 +00:00
|
|
|
|
2004-04-07 19:45:48 +00:00
|
|
|
if (!pszPath)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*pszPath = '\0';
|
2003-03-17 04:42:45 +00:00
|
|
|
if ((folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0])) ||
|
2004-04-07 19:45:48 +00:00
|
|
|
(CSIDL_Data[folder].hRootKey == HKEY_DISALLOWED))
|
|
|
|
return E_INVALIDARG;
|
2004-04-05 23:13:20 +00:00
|
|
|
if (CSIDL_Data[folder].hRootKey == HKEY_UNIMPLEMENTED)
|
2000-12-13 01:49:04 +00:00
|
|
|
{
|
2003-03-17 04:42:45 +00:00
|
|
|
FIXME("folder 0x%04lx unknown, please add.\n", folder);
|
2004-01-16 04:46:36 +00:00
|
|
|
return E_FAIL;
|
2000-12-13 01:49:04 +00:00
|
|
|
}
|
2004-04-07 19:45:48 +00:00
|
|
|
if (CSIDL_Data[folder].hRootKey == HKEY_NONEXISTENT)
|
|
|
|
return S_FALSE;
|
1999-01-17 16:55:11 +00:00
|
|
|
|
2004-04-01 02:01:33 +00:00
|
|
|
/* Special case for some values that don't exist in registry */
|
2004-04-05 23:13:20 +00:00
|
|
|
if (CSIDL_Data[folder].hRootKey == HKEY_WINDOWSPATH)
|
2004-04-01 02:01:33 +00:00
|
|
|
{
|
|
|
|
GetWindowsDirectoryW(pszPath, MAX_PATH);
|
|
|
|
PathAddBackslashW(pszPath);
|
2004-08-20 19:57:50 +00:00
|
|
|
strcatW(pszPath, CSIDL_Data[folder].szDefaultPath);
|
2004-04-01 02:01:33 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2004-04-05 23:13:20 +00:00
|
|
|
dwCsidlFlags = CSIDL_Data[folder].dwFlags;
|
|
|
|
hRootKey = CSIDL_Data[folder].hRootKey;
|
|
|
|
|
2004-01-16 04:46:36 +00:00
|
|
|
if (dwCsidlFlags & CSIDL_MYFLAG_SHFOLDER)
|
1999-07-25 12:23:15 +00:00
|
|
|
{
|
2000-12-13 01:49:04 +00:00
|
|
|
/* user shell folders */
|
2004-01-16 04:46:36 +00:00
|
|
|
if (RegCreateKeyExW(hRootKey,szSHUserFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return E_FAIL;
|
2000-12-13 01:49:04 +00:00
|
|
|
|
2004-08-20 19:57:50 +00:00
|
|
|
if (RegQueryValueExW(hKey,CSIDL_Data[folder].szValueName,NULL,&dwType,(LPBYTE)pszPath,&dwPathLen))
|
2000-12-13 01:49:04 +00:00
|
|
|
{
|
|
|
|
RegCloseKey(hKey);
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
|
2000-12-13 01:49:04 +00:00
|
|
|
/* shell folders */
|
2004-01-16 04:46:36 +00:00
|
|
|
if (RegCreateKeyExW(hRootKey,szSHFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return E_FAIL;
|
2000-12-13 01:49:04 +00:00
|
|
|
|
2004-08-20 19:57:50 +00:00
|
|
|
if (RegQueryValueExW(hKey,CSIDL_Data[folder].szValueName,NULL,&dwType,(LPBYTE)pszPath,&dwPathLen))
|
2000-12-13 01:49:04 +00:00
|
|
|
{
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
|
2000-12-13 01:49:04 +00:00
|
|
|
/* value not existing */
|
2004-01-16 04:46:36 +00:00
|
|
|
if (dwCsidlFlags & CSIDL_MYFLAG_RELATIVE)
|
2000-12-13 01:49:04 +00:00
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
GetWindowsDirectoryW(pszPath, MAX_PATH);
|
|
|
|
PathAddBackslashW(pszPath);
|
2004-08-20 19:57:50 +00:00
|
|
|
strcatW(pszPath, CSIDL_Data[folder].szDefaultPath);
|
2000-12-13 01:49:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
GetSystemDirectoryW(pszPath, MAX_PATH);
|
2004-08-20 19:57:50 +00:00
|
|
|
strcpyW(pszPath + 3, CSIDL_Data[folder].szDefaultPath);
|
2000-12-13 01:49:04 +00:00
|
|
|
}
|
2003-11-20 04:21:12 +00:00
|
|
|
dwType=REG_SZ;
|
2004-08-20 19:57:50 +00:00
|
|
|
RegSetValueExW(hKey,CSIDL_Data[folder].szValueName,0,REG_SZ,(LPBYTE)pszPath,
|
2004-05-28 19:28:41 +00:00
|
|
|
(strlenW(pszPath)+1)*sizeof(WCHAR));
|
2000-12-13 01:49:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
LPCWSTR pRegPath;
|
2000-12-13 01:49:04 +00:00
|
|
|
|
2004-01-16 04:46:36 +00:00
|
|
|
if (dwCsidlFlags & CSIDL_MYFLAG_SETUP)
|
2000-12-13 01:49:04 +00:00
|
|
|
pRegPath = szSetup;
|
2004-01-16 04:46:36 +00:00
|
|
|
else if (dwCsidlFlags & CSIDL_MYFLAG_CURRVER)
|
2000-12-13 01:49:04 +00:00
|
|
|
pRegPath = szCurrentVersion;
|
|
|
|
else
|
1999-07-25 12:23:15 +00:00
|
|
|
{
|
2000-12-13 01:49:04 +00:00
|
|
|
ERR("folder settings broken, please correct !\n");
|
2004-01-16 04:46:36 +00:00
|
|
|
return E_FAIL;
|
2000-12-13 01:49:04 +00:00
|
|
|
}
|
|
|
|
|
2004-01-16 04:46:36 +00:00
|
|
|
if (RegCreateKeyExW(hRootKey,pRegPath,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return E_FAIL;
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
|
2004-08-20 19:57:50 +00:00
|
|
|
if (RegQueryValueExW(hKey,CSIDL_Data[folder].szValueName,NULL,&dwType,(LPBYTE)pszPath,&dwPathLen))
|
2000-12-13 01:49:04 +00:00
|
|
|
{
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
/* value not existing */
|
2004-01-16 04:46:36 +00:00
|
|
|
if (dwCsidlFlags & CSIDL_MYFLAG_RELATIVE)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
GetWindowsDirectoryW(pszPath, MAX_PATH);
|
|
|
|
PathAddBackslashW(pszPath);
|
2004-08-20 19:57:50 +00:00
|
|
|
strcatW(pszPath, CSIDL_Data[folder].szDefaultPath);
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
GetSystemDirectoryW(pszPath, MAX_PATH);
|
2004-08-20 19:57:50 +00:00
|
|
|
strcpyW(pszPath + 3, CSIDL_Data[folder].szDefaultPath);
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
}
|
2003-11-20 04:21:12 +00:00
|
|
|
dwType=REG_SZ;
|
2004-08-20 19:57:50 +00:00
|
|
|
RegSetValueExW(hKey,CSIDL_Data[folder].szValueName,0,REG_SZ,(LPBYTE)pszPath,
|
2004-05-28 19:28:41 +00:00
|
|
|
(strlenW(pszPath)+1)*sizeof(WCHAR));
|
1999-07-25 12:23:15 +00:00
|
|
|
}
|
2000-12-13 01:49:04 +00:00
|
|
|
RegCloseKey(hKey);
|
1999-07-25 12:23:15 +00:00
|
|
|
}
|
1999-01-17 16:55:11 +00:00
|
|
|
|
2000-06-24 12:56:08 +00:00
|
|
|
/* expand paths like %USERPROFILE% */
|
|
|
|
if (dwType == REG_EXPAND_SZ)
|
|
|
|
{
|
2004-08-20 19:57:50 +00:00
|
|
|
ExpandEnvironmentStringsW(pszPath, szBuildPath, MAX_PATH);
|
|
|
|
strcpyW(pszPath, szBuildPath);
|
2000-06-24 12:56:08 +00:00
|
|
|
}
|
|
|
|
|
2000-12-13 01:49:04 +00:00
|
|
|
/* if we don't care about existing directories we are ready */
|
2004-01-16 04:46:36 +00:00
|
|
|
if(csidl & CSIDL_FLAG_DONT_VERIFY) return S_OK;
|
2000-06-13 03:45:52 +00:00
|
|
|
|
2004-01-16 04:46:36 +00:00
|
|
|
if (PathFileExistsW(pszPath)) return S_OK;
|
2000-06-13 03:45:52 +00:00
|
|
|
|
2000-12-13 01:49:04 +00:00
|
|
|
/* not existing but we are not allowed to create it */
|
2004-01-16 04:46:36 +00:00
|
|
|
if (!(csidl & CSIDL_FLAG_CREATE)) return E_FAIL;
|
2001-03-19 19:14:00 +00:00
|
|
|
|
|
|
|
/* create directory/directories */
|
2004-01-16 04:46:36 +00:00
|
|
|
strcpyW(szBuildPath, pszPath);
|
|
|
|
p = strchrW(szBuildPath, '\\');
|
2001-03-19 19:14:00 +00:00
|
|
|
while (p)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
{
|
2001-03-19 19:14:00 +00:00
|
|
|
*p = 0;
|
2004-01-16 04:46:36 +00:00
|
|
|
if (!PathFileExistsW(szBuildPath))
|
2001-03-19 19:14:00 +00:00
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
if (!CreateDirectoryW(szBuildPath,NULL))
|
2001-03-19 19:14:00 +00:00
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
ERR("Failed to create directory '%s'.\n", debugstr_w(pszPath));
|
|
|
|
return E_FAIL;
|
2001-03-19 19:14:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
*p = '\\';
|
2004-01-16 04:46:36 +00:00
|
|
|
p = strchrW(p+1, '\\');
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
}
|
2001-05-18 20:58:57 +00:00
|
|
|
/* last component must be created too. */
|
2004-01-16 04:46:36 +00:00
|
|
|
if (!PathFileExistsW(szBuildPath))
|
2001-05-18 20:58:57 +00:00
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
if (!CreateDirectoryW(szBuildPath,NULL))
|
2001-05-18 20:58:57 +00:00
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
ERR("Failed to create directory '%s'.\n", debugstr_w(pszPath));
|
|
|
|
return E_FAIL;
|
2001-05-18 20:58:57 +00:00
|
|
|
}
|
|
|
|
}
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 20:23:46 +00:00
|
|
|
|
2004-01-16 04:46:36 +00:00
|
|
|
TRACE("Created missing system directory '%s'\n", debugstr_w(pszPath));
|
|
|
|
return S_OK;
|
1999-01-17 16:55:11 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2004-01-16 04:46:36 +00:00
|
|
|
* SHGetFolderPathA [SHELL32.@]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2004-01-16 04:46:36 +00:00
|
|
|
HRESULT WINAPI SHGetFolderPathA(
|
1999-07-25 12:23:15 +00:00
|
|
|
HWND hwndOwner,
|
2003-09-08 18:47:10 +00:00
|
|
|
int csidl,
|
2004-01-16 04:46:36 +00:00
|
|
|
HANDLE hToken,
|
|
|
|
DWORD dwFlags,
|
|
|
|
LPSTR pszPath)
|
1999-07-25 12:23:15 +00:00
|
|
|
{
|
2004-04-07 19:45:48 +00:00
|
|
|
WCHAR szTemp[MAX_PATH];
|
|
|
|
HRESULT hr;
|
2002-05-31 23:06:46 +00:00
|
|
|
|
2004-04-07 19:45:48 +00:00
|
|
|
if (!pszPath)
|
|
|
|
return E_INVALIDARG;
|
1999-01-17 16:55:11 +00:00
|
|
|
|
2004-04-07 19:45:48 +00:00
|
|
|
*pszPath = '\0';
|
|
|
|
hr = SHGetFolderPathW(hwndOwner, csidl, hToken, dwFlags, szTemp);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, szTemp, -1, pszPath, MAX_PATH, NULL,
|
|
|
|
NULL);
|
1999-01-17 16:55:11 +00:00
|
|
|
|
2004-04-07 19:45:48 +00:00
|
|
|
TRACE("%p,%p,csidl=0x%04x\n",hwndOwner,pszPath,csidl);
|
|
|
|
|
|
|
|
return hr;
|
1999-01-17 16:55:11 +00:00
|
|
|
}
|
2000-03-24 20:46:04 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2004-01-16 04:46:36 +00:00
|
|
|
* SHGetSpecialFolderPathA [SHELL32.@]
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
2004-01-16 04:46:36 +00:00
|
|
|
BOOL WINAPI SHGetSpecialFolderPathA (
|
1999-07-25 12:23:15 +00:00
|
|
|
HWND hwndOwner,
|
2004-01-16 04:46:36 +00:00
|
|
|
LPSTR szPath,
|
2003-09-08 18:47:10 +00:00
|
|
|
int csidl,
|
1999-07-25 12:23:15 +00:00
|
|
|
BOOL bCreate)
|
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
return (SHGetFolderPathA(
|
|
|
|
hwndOwner,
|
|
|
|
csidl + (bCreate ? CSIDL_FLAG_CREATE : 0),
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
szPath)) == S_OK ? TRUE : FALSE;
|
1999-01-17 16:55:11 +00:00
|
|
|
}
|
1999-10-23 18:54:21 +00:00
|
|
|
|
2000-06-13 03:45:52 +00:00
|
|
|
/*************************************************************************
|
2004-01-16 04:46:36 +00:00
|
|
|
* SHGetSpecialFolderPathW
|
2000-06-13 03:45:52 +00:00
|
|
|
*/
|
2004-01-16 04:46:36 +00:00
|
|
|
BOOL WINAPI SHGetSpecialFolderPathW (
|
2000-06-13 03:45:52 +00:00
|
|
|
HWND hwndOwner,
|
2004-01-16 04:46:36 +00:00
|
|
|
LPWSTR szPath,
|
|
|
|
int csidl,
|
|
|
|
BOOL bCreate)
|
2000-06-13 03:45:52 +00:00
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
return (SHGetFolderPathW(
|
2000-06-13 03:45:52 +00:00
|
|
|
hwndOwner,
|
2004-01-16 04:46:36 +00:00
|
|
|
csidl + (bCreate ? CSIDL_FLAG_CREATE : 0),
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
szPath)) == S_OK ? TRUE : FALSE;
|
2000-06-13 03:45:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2004-01-16 04:46:36 +00:00
|
|
|
* SHGetSpecialFolderPath (SHELL32.175)
|
2000-06-13 03:45:52 +00:00
|
|
|
*/
|
2004-01-16 04:46:36 +00:00
|
|
|
BOOL WINAPI SHGetSpecialFolderPathAW (
|
2000-06-13 03:45:52 +00:00
|
|
|
HWND hwndOwner,
|
2004-01-16 04:46:36 +00:00
|
|
|
LPVOID szPath,
|
|
|
|
int csidl,
|
|
|
|
BOOL bCreate)
|
|
|
|
|
2000-06-13 03:45:52 +00:00
|
|
|
{
|
2004-01-16 04:46:36 +00:00
|
|
|
if (SHELL_OsIsUnicode())
|
|
|
|
return SHGetSpecialFolderPathW (hwndOwner, szPath, csidl, bCreate);
|
|
|
|
return SHGetSpecialFolderPathA (hwndOwner, szPath, csidl, bCreate);
|
2000-06-13 03:45:52 +00:00
|
|
|
}
|
2004-04-07 19:45:48 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SHGetSpecialFolderLocation [SHELL32.@]
|
|
|
|
*
|
|
|
|
* gets the folder locations from the registry and creates a pidl
|
|
|
|
* creates missing reg keys and directories
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* hwndOwner [I]
|
|
|
|
* nFolder [I] CSIDL_xxxxx
|
|
|
|
* ppidl [O] PIDL of a special folder
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* In NT5, SHGetSpecialFolderLocation needs the <winntdir>/Recent
|
|
|
|
* directory. If the directory is missing it returns a x80070002.
|
|
|
|
* In most cases, this forwards to SHGetSpecialFolderPath, but
|
|
|
|
* CSIDLs with virtual folders (not real paths) must be handled
|
|
|
|
* here.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI SHGetSpecialFolderLocation(
|
|
|
|
HWND hwndOwner,
|
|
|
|
INT nFolder,
|
|
|
|
LPITEMIDLIST * ppidl)
|
|
|
|
{
|
|
|
|
HRESULT hr = E_INVALIDARG;
|
|
|
|
|
|
|
|
TRACE("(%p,0x%x,%p)\n", hwndOwner,nFolder,ppidl);
|
|
|
|
|
|
|
|
if (!ppidl)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*ppidl = NULL;
|
|
|
|
switch (nFolder)
|
|
|
|
{
|
|
|
|
case CSIDL_DESKTOP:
|
|
|
|
*ppidl = _ILCreateDesktop();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_INTERNET:
|
|
|
|
*ppidl = _ILCreateIExplore();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_CONTROLS:
|
|
|
|
*ppidl = _ILCreateControlPanel();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_PRINTERS:
|
|
|
|
*ppidl = _ILCreatePrinters();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_BITBUCKET:
|
|
|
|
*ppidl = _ILCreateBitBucket();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_DRIVES:
|
|
|
|
*ppidl = _ILCreateMyComputer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_NETWORK:
|
|
|
|
*ppidl = _ILCreateNetwork();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_ALTSTARTUP:
|
|
|
|
case CSIDL_COMMON_ALTSTARTUP:
|
|
|
|
hr = E_FAIL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_COMPUTERSNEARME:
|
|
|
|
hr = E_FAIL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
WCHAR szPath[MAX_PATH];
|
|
|
|
|
|
|
|
if (SHGetSpecialFolderPathW(hwndOwner, szPath, nFolder, TRUE))
|
|
|
|
{
|
|
|
|
DWORD attributes=0;
|
|
|
|
|
|
|
|
TRACE("Value=%s\n", debugstr_w(szPath));
|
|
|
|
hr = SHILCreateFromPathW(szPath, ppidl, &attributes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(*ppidl)
|
|
|
|
hr = NOERROR;
|
|
|
|
|
|
|
|
TRACE("-- (new pidl %p)\n",*ppidl);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SHGetFolderLocation [SHELL32.@]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* the pidl can be a simple one. since we can't get the path out of the pidl
|
|
|
|
* we have to take all data from the pidl
|
|
|
|
* Mostly we forward to SHGetSpecialFolderLocation, but a few special cases
|
|
|
|
* we handle here.
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI SHGetFolderLocation(
|
|
|
|
HWND hwnd,
|
|
|
|
int csidl,
|
|
|
|
HANDLE hToken,
|
|
|
|
DWORD dwFlags,
|
|
|
|
LPITEMIDLIST *ppidl)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE_(shell)("%p 0x%08x %p 0x%08lx %p\n",
|
|
|
|
hwnd, csidl, hToken, dwFlags, ppidl);
|
|
|
|
|
|
|
|
if (!ppidl)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
switch (csidl)
|
|
|
|
{
|
|
|
|
case CSIDL_ALTSTARTUP:
|
|
|
|
case CSIDL_COMMON_ALTSTARTUP:
|
|
|
|
*ppidl = NULL;
|
|
|
|
hr = S_FALSE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
hr = SHGetSpecialFolderLocation(hwnd, csidl, ppidl);
|
|
|
|
}
|
|
|
|
return hr;
|
|
|
|
}
|