1998-11-25 17:47:05 +01:00
|
|
|
/*
|
|
|
|
* Path Functions
|
|
|
|
*
|
2002-03-10 00:29:33 +01: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 17:47:05 +01:00
|
|
|
*
|
|
|
|
*/
|
2002-08-29 01:42:34 +02:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
|
|
|
|
1998-11-25 17:47:05 +01:00
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2000-11-28 23:40:56 +01:00
|
|
|
#include "windef.h"
|
1998-11-25 17:47:05 +01:00
|
|
|
#include "winnls.h"
|
1999-07-25 14:23:15 +02:00
|
|
|
#include "winreg.h"
|
1999-01-23 15:12:48 +01:00
|
|
|
|
|
|
|
#include "shlobj.h"
|
1998-11-25 17:47:05 +01:00
|
|
|
#include "shell32_main.h"
|
2001-08-16 20:49:56 +02:00
|
|
|
#include "undocshell.h"
|
2000-06-13 03:10:29 +02:00
|
|
|
#include "wine/unicode.h"
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
#include "shlwapi.h"
|
1998-11-25 17:47:05 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/*
|
2000-06-24 14:56:08 +02:00
|
|
|
########## Combining and Constructing paths ##########
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
2000-02-20 19:43:44 +01:00
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathAppend [SHELL32.36]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
2000-06-24 14:56:08 +02:00
|
|
|
BOOL WINAPI PathAppendAW(
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
LPVOID lpszPath1,
|
|
|
|
LPCVOID lpszPath2)
|
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathAppendW(lpszPath1, lpszPath2);
|
|
|
|
return PathAppendA(lpszPath1, lpszPath2);
|
|
|
|
}
|
|
|
|
|
1998-11-25 17:47:05 +01:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathCombine [SHELL32.37]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
LPVOID WINAPI PathCombineAW(
|
|
|
|
LPVOID szDest,
|
|
|
|
LPCVOID lpszDir,
|
2002-06-01 01:06:46 +02:00
|
|
|
LPCVOID lpszFile)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathCombineW( szDest, lpszDir, lpszFile );
|
|
|
|
return PathCombineA( szDest, lpszDir, lpszFile );
|
1998-11-25 17:47:05 +01:00
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathAddBackslash [SHELL32.32]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
|
|
|
LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath)
|
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if(SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathAddBackslashW(lpszPath);
|
|
|
|
return PathAddBackslashA(lpszPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathBuildRoot [SHELL32.30]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
|
|
|
LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
|
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if(SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathBuildRootW(lpszPath, drive);
|
|
|
|
return PathBuildRootA(lpszPath, drive);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Extracting Component Parts
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathFindFileName [SHELL32.34]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
|
|
|
LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath)
|
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if(SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathFindFileNameW(lpszPath);
|
|
|
|
return PathFindFileNameA(lpszPath);
|
|
|
|
}
|
|
|
|
|
2000-03-24 21:46:04 +01:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathFindExtension [SHELL32.31]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathFindExtensionW(lpszPath);
|
|
|
|
return PathFindExtensionA(lpszPath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2000-08-14 16:35:01 +02: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 22:23:46 +02:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathGetExtension [SHELL32.158]
|
2000-07-26 19:51:32 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathGetExtensionW(lpszPath);
|
|
|
|
return PathGetExtensionA(lpszPath);
|
1999-01-31 11:00:26 +01:00
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathGetArgs [SHELL32.52]
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathGetArgsW(lpszPath);
|
|
|
|
return PathGetArgsA(lpszPath);
|
1999-01-31 11:00:26 +01:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:47:05 +01:00
|
|
|
/*************************************************************************
|
2000-07-26 19:51:32 +02:00
|
|
|
* PathGetDriveNumber [SHELL32.57]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathGetDriveNumberW(lpszPath);
|
|
|
|
return PathGetDriveNumberA(lpszPath);
|
1998-11-25 17:47:05 +01:00
|
|
|
}
|
2000-07-26 19:51:32 +02:00
|
|
|
|
1998-11-25 17:47:05 +01:00
|
|
|
/*************************************************************************
|
2000-07-26 19:51:32 +02:00
|
|
|
* PathRemoveFileSpec [SHELL32.35]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathRemoveFileSpecW(lpszPath);
|
|
|
|
return PathRemoveFileSpecA(lpszPath);
|
1999-01-03 13:35:52 +01:00
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathStripPath [SHELL32.38]
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2002-07-03 03:20:07 +02:00
|
|
|
PathStripPathW(lpszPath);
|
|
|
|
else
|
|
|
|
PathStripPathA(lpszPath);
|
1999-01-03 13:35:52 +01:00
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathStripToRoot [SHELL32.50]
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathStripToRootW(lpszPath);
|
|
|
|
return PathStripToRootA(lpszPath);
|
1998-11-25 17:47:05 +01:00
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
1998-11-25 17:47:05 +01:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathRemoveArgs [SHELL32.251]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2002-07-03 03:20:07 +02:00
|
|
|
PathRemoveArgsW(lpszPath);
|
|
|
|
else
|
|
|
|
PathRemoveArgsA(lpszPath);
|
1998-11-25 17:47:05 +01:00
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathRemoveExtension [SHELL32.250]
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2002-07-03 03:20:07 +02:00
|
|
|
PathRemoveExtensionW(lpszPath);
|
|
|
|
else
|
|
|
|
PathRemoveExtensionA(lpszPath);
|
2000-07-26 19:51:32 +02:00
|
|
|
}
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
|
|
|
|
|
2000-07-26 19:51:32 +02:00
|
|
|
/*
|
|
|
|
Path Manipulations
|
|
|
|
*/
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2000-07-26 19:51:32 +02:00
|
|
|
* PathGetShortPathA [internal]
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
LPSTR WINAPI PathGetShortPathA(LPSTR lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
{
|
2000-07-26 19:51:32 +02:00
|
|
|
FIXME("%s stub\n", lpszPath);
|
|
|
|
return NULL;
|
1998-11-25 17:47:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2000-07-26 19:51:32 +02:00
|
|
|
* PathGetShortPathW [internal]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
LPWSTR WINAPI PathGetShortPathW(LPWSTR lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
{
|
2000-07-26 19:51:32 +02:00
|
|
|
FIXME("%s stub\n", debugstr_w(lpszPath));
|
|
|
|
return NULL;
|
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathGetShortPath [SHELL32.92]
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if(SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathGetShortPathW(lpszPath);
|
|
|
|
return PathGetShortPathA(lpszPath);
|
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathRemoveBlanks [SHELL32.33]
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
void WINAPI PathRemoveBlanksAW(LPVOID str)
|
2000-01-04 01:33:56 +01:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if(SHELL_OsIsUnicode())
|
2002-07-03 03:20:07 +02:00
|
|
|
PathRemoveBlanksW(str);
|
|
|
|
else
|
|
|
|
PathRemoveBlanksA(str);
|
1999-01-03 13:35:52 +01:00
|
|
|
}
|
|
|
|
|
2000-06-24 14:56:08 +02:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathQuoteSpaces [SHELL32.55]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2002-03-20 02:33:39 +01:00
|
|
|
VOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if(SHELL_OsIsUnicode())
|
2002-07-03 03:20:07 +02:00
|
|
|
PathQuoteSpacesW(lpszPath);
|
|
|
|
else
|
|
|
|
PathQuoteSpacesA(lpszPath);
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathUnquoteSpaces [SHELL32.56]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if(SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
PathUnquoteSpacesW(str);
|
|
|
|
else
|
|
|
|
PathUnquoteSpacesA(str);
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathParseIconLocation [SHELL32.249]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
int WINAPI PathParseIconLocationAW (LPVOID lpszPath)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if(SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathParseIconLocationW(lpszPath);
|
|
|
|
return PathParseIconLocationA(lpszPath);
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
2000-07-26 19:51:32 +02:00
|
|
|
/*
|
|
|
|
########## Path Testing ##########
|
|
|
|
*/
|
2000-06-24 14:56:08 +02:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathIsUNC [SHELL32.39]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathIsUNCW( lpszPath );
|
2002-06-01 01:06:46 +02:00
|
|
|
return PathIsUNCA( lpszPath );
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathIsRelative [SHELL32.40]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathIsRelativeW( lpszPath );
|
2002-06-01 01:06:46 +02:00
|
|
|
return PathIsRelativeA( lpszPath );
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathIsRoot [SHELL32.29]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
BOOL WINAPI PathIsRootAW(LPCVOID lpszPath)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathIsRootW(lpszPath);
|
|
|
|
return PathIsRootA(lpszPath);
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
2000-08-14 16:35:01 +02:00
|
|
|
/*************************************************************************
|
|
|
|
* PathIsExeA [internal]
|
|
|
|
*/
|
|
|
|
static BOOL PathIsExeA (LPCSTR lpszPath)
|
|
|
|
{
|
|
|
|
LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
|
2002-09-30 21:01:20 +02:00
|
|
|
int i;
|
|
|
|
static const char * const lpszExtensions[] =
|
|
|
|
{"exe", "com", "pif", "cmd", "bat", "scf", "scr", NULL };
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-08-14 16:35:01 +02:00
|
|
|
TRACE("path=%s\n",lpszPath);
|
|
|
|
|
|
|
|
for(i=0; lpszExtensions[i]; i++)
|
|
|
|
if (!strcasecmp(lpszExtension,lpszExtensions[i])) return TRUE;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-08-14 16:35:01 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathIsExeW [internal]
|
|
|
|
*/
|
|
|
|
static BOOL PathIsExeW (LPCWSTR lpszPath)
|
|
|
|
{
|
|
|
|
LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
|
2002-09-30 21:01:20 +02: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-06-01 01:06:46 +02:00
|
|
|
|
2000-08-14 16:35:01 +02:00
|
|
|
TRACE("path=%s\n",debugstr_w(lpszPath));
|
|
|
|
|
2001-08-09 01:24:15 +02:00
|
|
|
for(i=0; lpszExtensions[i][0]; i++)
|
2000-08-14 16:35:01 +02:00
|
|
|
if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-08-14 16:35:01 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-06-24 14:56:08 +02:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathIsExe [SHELL32.43]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
BOOL WINAPI PathIsExeAW (LPCVOID path)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathIsExeW (path);
|
|
|
|
return PathIsExeA(path);
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathIsDirectory [SHELL32.159]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathIsDirectoryW (lpszPath);
|
|
|
|
return PathIsDirectoryA (lpszPath);
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathFileExists [SHELL32.45]
|
2002-06-01 01:06:46 +02:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathFileExistsW (lpszPath);
|
|
|
|
return PathFileExistsA (lpszPath);
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathMatchSpec [SHELL32.46]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathMatchSpecW( name, mask );
|
|
|
|
return PathMatchSpecA( name, mask );
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathIsSameRoot [SHELL32.650]
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2000-07-26 19:51:32 +02:00
|
|
|
return PathIsSameRootW(lpszPath1, lpszPath2);
|
|
|
|
return PathIsSameRootA(lpszPath1, lpszPath2);
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* IsLFNDrive [SHELL32.119]
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
2000-07-26 19:51:32 +02:00
|
|
|
* NOTES
|
|
|
|
* exported by ordinal Name
|
2000-06-24 14:56:08 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath)
|
2000-06-24 14:56:08 +02:00
|
|
|
{
|
2000-07-26 19:51:32 +02:00
|
|
|
DWORD fnlen;
|
|
|
|
|
|
|
|
if (!GetVolumeInformationA(lpszPath,NULL,0,NULL,&fnlen,NULL,NULL,0))
|
2000-06-24 14:56:08 +02:00
|
|
|
return FALSE;
|
2000-07-26 19:51:32 +02:00
|
|
|
return fnlen>12;
|
2000-06-24 14:56:08 +02:00
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/*
|
2000-06-24 14:56:08 +02:00
|
|
|
########## Creating Something Unique ##########
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
1998-11-25 17:47:05 +01:00
|
|
|
/*************************************************************************
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
* PathMakeUniqueNameA [internal]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
BOOL WINAPI PathMakeUniqueNameA(
|
|
|
|
LPSTR lpszBuffer,
|
2002-06-01 01:06:46 +02:00
|
|
|
DWORD dwBuffSize,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02: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 17:47:05 +01:00
|
|
|
}
|
|
|
|
|
2000-04-06 22:21:16 +02:00
|
|
|
/*************************************************************************
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
* PathMakeUniqueNameW [internal]
|
2000-04-06 22:21:16 +02:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
BOOL WINAPI PathMakeUniqueNameW(
|
|
|
|
LPWSTR lpszBuffer,
|
2002-06-01 01:06:46 +02:00
|
|
|
DWORD dwBuffSize,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02: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 22:21:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathMakeUniqueName [SHELL32.47]
|
2000-04-06 22:21:16 +02:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
BOOL WINAPI PathMakeUniqueNameAW(
|
|
|
|
LPVOID lpszBuffer,
|
2002-06-01 01:06:46 +02:00
|
|
|
DWORD dwBuffSize,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
LPCVOID lpszShortName,
|
|
|
|
LPCVOID lpszLongName,
|
|
|
|
LPCVOID lpszPathName)
|
2000-04-06 22:21:16 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathMakeUniqueNameW(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
|
|
|
|
return PathMakeUniqueNameA(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
|
2000-04-06 22:21:16 +02:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:47:05 +01:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathYetAnotherMakeUniqueName [SHELL32.75]
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
1998-11-25 17:47:05 +01:00
|
|
|
* NOTES
|
|
|
|
* exported by ordinal
|
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
BOOL WINAPI PathYetAnotherMakeUniqueNameA(
|
|
|
|
LPSTR lpszBuffer,
|
|
|
|
LPCSTR lpszPathName,
|
|
|
|
LPCSTR lpszShortName,
|
|
|
|
LPCSTR lpszLongName)
|
|
|
|
{
|
|
|
|
FIXME("(%p,%p, %p ,%p):stub.\n",
|
|
|
|
lpszBuffer, lpszPathName, lpszShortName, lpszLongName);
|
1998-11-25 17:47:05 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/*
|
2000-06-24 14:56:08 +02:00
|
|
|
########## cleaning and resolving paths ##########
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathFindOnPath [SHELL32.145]
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
2000-07-26 19:51:32 +02:00
|
|
|
BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
|
1999-08-15 16:31:36 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
2001-12-11 01:30:17 +01:00
|
|
|
return PathFindOnPathW(sFile, (LPCWSTR *)sOtherDirs);
|
|
|
|
return PathFindOnPathA(sFile, (LPCSTR *)sOtherDirs);
|
1999-08-15 16:31:36 +02:00
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathCleanupSpec [SHELL32.171]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
2001-01-07 22:50:52 +01:00
|
|
|
DWORD WINAPI PathCleanupSpecAW (LPCVOID x, LPVOID y)
|
1999-08-15 16:31:36 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
FIXME("(%p, %p) stub\n",x,y);
|
|
|
|
return TRUE;
|
1999-08-15 16:31:36 +02:00
|
|
|
}
|
|
|
|
|
1998-11-25 17:47:05 +01:00
|
|
|
/*************************************************************************
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
* PathQualifyA [SHELL32]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
|
|
|
FIXME("%s\n",pszPath);
|
1998-11-25 17:47:05 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
* PathQualifyW [SHELL32]
|
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
|
|
|
FIXME("%s\n",debugstr_w(pszPath));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathQualify [SHELL32.49]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02: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 22:23:46 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathQualifyW(pszPath);
|
|
|
|
return PathQualifyA(pszPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathResolveA [SHELL32.51]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
BOOL WINAPI PathResolveA(
|
|
|
|
LPSTR lpszPath,
|
2002-06-01 01:06:46 +02:00
|
|
|
LPCSTR *alpszPaths,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
FIXME("(%s,%p,0x%08lx),stub!\n",
|
|
|
|
lpszPath, *alpszPaths, dwFlags);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathResolveW [SHELL32]
|
|
|
|
*/
|
|
|
|
BOOL WINAPI PathResolveW(
|
|
|
|
LPWSTR lpszPath,
|
2002-06-01 01:06:46 +02:00
|
|
|
LPCWSTR *alpszPaths,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
FIXME("(%s,%p,0x%08lx),stub!\n",
|
|
|
|
debugstr_w(lpszPath), debugstr_w(*alpszPaths), dwFlags);
|
1998-11-25 17:47:05 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathResolve [SHELL32.51]
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
|
|
|
BOOL WINAPI PathResolveAW(
|
|
|
|
LPVOID lpszPath,
|
2002-06-01 01:06:46 +02:00
|
|
|
LPCVOID *alpszPaths,
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathResolveW(lpszPath, (LPCWSTR*)alpszPaths, dwFlags);
|
|
|
|
return PathResolveA(lpszPath, (LPCSTR*)alpszPaths, dwFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathProcessCommandA [SHELL32.653]
|
1998-11-25 17:47:05 +01:00
|
|
|
*/
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
HRESULT WINAPI PathProcessCommandA (
|
|
|
|
LPCSTR lpszPath,
|
|
|
|
LPSTR lpszBuff,
|
|
|
|
DWORD dwBuffSize,
|
|
|
|
DWORD dwFlags)
|
1999-07-10 13:56:34 +02:00
|
|
|
{
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
FIXME("%s %p 0x%04lx 0x%04lx stub\n",
|
|
|
|
lpszPath, lpszBuff, dwBuffSize, dwFlags);
|
2000-08-14 16:35:01 +02:00
|
|
|
strcpy(lpszBuff, lpszPath);
|
1999-07-10 13:56:34 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/*************************************************************************
|
|
|
|
* PathProcessCommandW
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI PathProcessCommandW (
|
|
|
|
LPCWSTR lpszPath,
|
|
|
|
LPWSTR lpszBuff,
|
|
|
|
DWORD dwBuffSize,
|
|
|
|
DWORD dwFlags)
|
1999-07-10 13:56:34 +02:00
|
|
|
{
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
FIXME("(%s, %p, 0x%04lx, 0x%04lx) stub\n",
|
|
|
|
debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
|
2000-08-14 16:35:01 +02:00
|
|
|
strcpyW(lpszBuff, lpszPath);
|
1998-11-25 17:47:05 +01:00
|
|
|
return 0;
|
|
|
|
}
|
1999-01-17 17:55:11 +01:00
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathProcessCommand (SHELL32.653)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
|
|
|
HRESULT WINAPI PathProcessCommandAW (
|
|
|
|
LPCVOID lpszPath,
|
|
|
|
LPVOID lpszBuff,
|
|
|
|
DWORD dwBuffSize,
|
|
|
|
DWORD dwFlags)
|
1999-07-10 13:56:34 +02:00
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
return PathProcessCommandW(lpszPath, lpszBuff, dwBuffSize, dwFlags);
|
|
|
|
return PathProcessCommandA(lpszPath, lpszBuff, dwBuffSize, dwFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2000-06-24 14:56:08 +02:00
|
|
|
########## special ##########
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* PathSetDlgItemPath (SHELL32.48)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath)
|
2002-07-03 03:20:07 +02:00
|
|
|
{
|
|
|
|
if (SHELL_OsIsUnicode())
|
|
|
|
PathSetDlgItemPathW(hDlg, id, pszPath);
|
|
|
|
else
|
|
|
|
PathSetDlgItemPathA(hDlg, id, pszPath);
|
1999-07-10 13:56:34 +02:00
|
|
|
}
|
|
|
|
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
|
1999-01-17 17:55:11 +01:00
|
|
|
/*************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* SHGetSpecialFolderPathA [SHELL32.@]
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
1999-01-17 17:55:11 +01:00
|
|
|
* converts csidl to path
|
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
static const char * const szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
|
|
|
|
static const char * const szSHUserFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders";
|
|
|
|
static const char * const szSetup = "Software\\Microsoft\\Windows\\CurrentVersion\\Setup";
|
|
|
|
static const char * const szCurrentVersion = "Software\\Microsoft\\Windows\\CurrentVersion";
|
2000-07-15 23:32:26 +02:00
|
|
|
#if 0
|
2000-12-13 02:49:04 +01:00
|
|
|
static const char * const szEnvUserProfile = "%USERPROFILE%";
|
|
|
|
static const char * const szEnvSystemRoot = "%SYSTEMROOT%";
|
2000-07-15 23:32:26 +02:00
|
|
|
#endif
|
1999-07-25 14:23:15 +02:00
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DWORD dwFlags;
|
|
|
|
HKEY hRootKey;
|
|
|
|
LPCSTR szValueName;
|
|
|
|
LPCSTR szDefaultPath; /* fallback string; sub dir of windows directory */
|
|
|
|
} CSIDL_DATA;
|
|
|
|
|
|
|
|
#define CSIDL_MYFLAG_SHFOLDER 1
|
|
|
|
#define CSIDL_MYFLAG_SETUP 2
|
|
|
|
#define CSIDL_MYFLAG_CURRVER 4
|
|
|
|
#define CSIDL_MYFLAG_RELATIVE 8
|
|
|
|
|
|
|
|
#define HKLM HKEY_LOCAL_MACHINE
|
|
|
|
#define HKCU HKEY_CURRENT_USER
|
|
|
|
static const CSIDL_DATA CSIDL_Data[] =
|
|
|
|
{
|
|
|
|
{ /* CSIDL_DESKTOP */
|
|
|
|
9, HKCU,
|
|
|
|
"Desktop",
|
|
|
|
"Desktop"
|
|
|
|
},
|
2001-10-10 04:48:29 +02:00
|
|
|
{ /* CSIDL_INTERNET */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAMS */
|
|
|
|
9, HKCU,
|
|
|
|
"Programs",
|
|
|
|
"Start Menu\\Programs"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_CONTROLS (.CPL files) */
|
|
|
|
10, HKLM,
|
|
|
|
"SysDir",
|
|
|
|
"SYSTEM"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PRINTERS */
|
|
|
|
10, HKLM,
|
|
|
|
"SysDir",
|
|
|
|
"SYSTEM"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PERSONAL */
|
|
|
|
1, HKCU,
|
|
|
|
"Personal",
|
|
|
|
"My Documents"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_FAVORITES */
|
|
|
|
9, HKCU,
|
|
|
|
"Favorites",
|
|
|
|
"Favorites"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_STARTUP */
|
|
|
|
9, HKCU,
|
|
|
|
"StartUp",
|
|
|
|
"Start Menu\\Programs\\StartUp"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_RECENT */
|
|
|
|
9, HKCU,
|
|
|
|
"Recent",
|
|
|
|
"Recent"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_SENDTO */
|
|
|
|
9, HKCU,
|
|
|
|
"SendTo",
|
|
|
|
"SendTo"
|
|
|
|
},
|
2001-01-26 21:40:50 +01:00
|
|
|
{ /* CSIDL_BITBUCKET (is this c:\recycled ?) */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
2001-01-26 21:40:50 +01:00
|
|
|
"recycled"
|
2000-12-13 02:49:04 +01:00
|
|
|
},
|
|
|
|
{ /* CSIDL_STARTMENU */
|
|
|
|
9, HKCU,
|
|
|
|
"Start Menu",
|
|
|
|
"Start Menu"
|
|
|
|
},
|
2001-10-10 04:48:29 +02:00
|
|
|
{ /* CSIDL_MYDOCUMENTS */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
2001-10-10 04:48:29 +02:00
|
|
|
{ /* CSIDL_MYMUSIC */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
2001-10-10 04:48:29 +02:00
|
|
|
{ /* CSIDL_MYVIDEO */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
2001-10-10 04:48:29 +02:00
|
|
|
{ /* unassigned */
|
2000-12-13 02:49:04 +01:00
|
|
|
0, 0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_DESKTOPDIRECTORY */
|
|
|
|
9, HKCU,
|
|
|
|
"Desktop",
|
|
|
|
"Desktop"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_DRIVES */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
"My Computer"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_NETWORK */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
"Network Neighborhood"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_NETHOOD */
|
|
|
|
9, HKCU,
|
|
|
|
"NetHood",
|
|
|
|
"NetHood"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_FONTS */
|
|
|
|
9, HKCU,
|
|
|
|
"Fonts",
|
|
|
|
"Fonts"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_TEMPLATES */
|
|
|
|
9, HKCU,
|
|
|
|
"Templates",
|
|
|
|
"ShellNew"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_STARTMENU */
|
|
|
|
9, HKLM,
|
|
|
|
"Common Start Menu",
|
|
|
|
"Start Menu"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_PROGRAMS */
|
|
|
|
9, HKLM,
|
|
|
|
"Common Programs",
|
|
|
|
""
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_STARTUP */
|
|
|
|
9, HKLM,
|
|
|
|
"Common StartUp",
|
|
|
|
"All Users\\Start Menu\\Programs\\StartUp"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_DESKTOPDIRECTORY */
|
|
|
|
9, HKLM,
|
|
|
|
"Common Desktop",
|
|
|
|
"Desktop"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_APPDATA */
|
|
|
|
9, HKCU,
|
|
|
|
"AppData",
|
|
|
|
"Application Data"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PRINTHOOD */
|
|
|
|
9, HKCU,
|
|
|
|
"PrintHood",
|
|
|
|
"PrintHood"
|
|
|
|
},
|
2002-01-29 19:19:59 +01:00
|
|
|
{ /* CSIDL_LOCAL_APPDATA (win2k only/undocumented) */
|
|
|
|
1, HKCU,
|
|
|
|
"Local AppData",
|
|
|
|
"Local Settings\\Application Data",
|
2000-12-13 02:49:04 +01:00
|
|
|
},
|
|
|
|
{ /* CSIDL_ALTSTARTUP */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_ALTSTARTUP */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_FAVORITES */
|
|
|
|
9, HKCU,
|
|
|
|
"Favorites",
|
|
|
|
"Favorites"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_INTERNET_CACHE */
|
|
|
|
9, HKCU,
|
|
|
|
"Cache",
|
|
|
|
"Temporary Internet Files"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COOKIES */
|
|
|
|
9, HKCU,
|
|
|
|
"Cookies",
|
|
|
|
"Cookies"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_HISTORY */
|
|
|
|
9, HKCU,
|
|
|
|
"History",
|
|
|
|
"History"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_APPDATA */
|
|
|
|
9, HKLM,
|
|
|
|
"Common AppData",
|
|
|
|
"All Users\\Application Data"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_WINDOWS */
|
|
|
|
2, HKLM,
|
|
|
|
"WinDir",
|
|
|
|
"Windows"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_SYSTEM */
|
|
|
|
10, HKLM,
|
|
|
|
"SysDir",
|
|
|
|
"SYSTEM"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAM_FILES */
|
|
|
|
4, HKLM,
|
|
|
|
"ProgramFilesDir",
|
|
|
|
"Program Files"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_MYPICTURES */
|
|
|
|
1, HKCU,
|
|
|
|
"My Pictures",
|
|
|
|
"My Documents\\My Pictures"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PROFILE */
|
|
|
|
10, HKLM,
|
|
|
|
"WinDir", /* correct ? */
|
|
|
|
""
|
|
|
|
},
|
|
|
|
{ /* CSIDL_SYSTEMX86 */
|
|
|
|
10, HKLM,
|
|
|
|
"SysDir",
|
|
|
|
"SYSTEM"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAM_FILESX86 */
|
|
|
|
4, HKLM,
|
|
|
|
"ProgramFilesDir",
|
|
|
|
"Program Files"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAM_FILES_COMMON */
|
|
|
|
4, HKLM,
|
2002-06-01 01:06:46 +02:00
|
|
|
"CommonFilesDir",
|
2000-12-13 02:49:04 +01:00
|
|
|
"Program Files\\Common Files" /* ? */
|
|
|
|
},
|
|
|
|
{ /* CSIDL_PROGRAM_FILES_COMMONX86 */
|
|
|
|
4, HKLM,
|
|
|
|
"CommonFilesDir",
|
|
|
|
"Program Files\\Common Files" /* ? */
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_TEMPLATES */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_DOCUMENTS */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_ADMINTOOLS */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
},
|
|
|
|
{ /* CSIDL_ADMINTOOLS */
|
|
|
|
9, HKCU,
|
|
|
|
"Administrative Tools",
|
|
|
|
"Start Menu\\Programs\\Administrative Tools"
|
|
|
|
},
|
|
|
|
{ /* CSIDL_CONNECTIONS */
|
2002-09-24 05:09:12 +02:00
|
|
|
0, (HKEY)1, /* FIXME */
|
2000-12-13 02:49:04 +01:00
|
|
|
NULL,
|
|
|
|
NULL
|
2001-10-10 04:48:29 +02:00
|
|
|
},
|
|
|
|
{ /* unassigned 32*/
|
|
|
|
0, 0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* unassigned 33*/
|
2002-06-01 01:06:46 +02:00
|
|
|
0, 0,
|
2001-10-10 04:48:29 +02:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* unassigned 34*/
|
|
|
|
0, 0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_MUSIC */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_PICTURES */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_VIDEO */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_RESOURCES */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_RESOURCES_LOCALIZED */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMMON_OEM_LINKS */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_CDBURN_AREA */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* unassigned 3C */
|
|
|
|
0, 0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
},
|
|
|
|
{ /* CSIDL_COMPUTERSNEARME */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2003-03-17 05:42:45 +01:00
|
|
|
},
|
|
|
|
{ /* CSIDL_PROFILES */
|
|
|
|
0, 0, /* FIXME */
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2000-12-13 02:49:04 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
#undef HKCU
|
|
|
|
#undef HKLM
|
|
|
|
|
2000-12-16 22:55:05 +01:00
|
|
|
/**********************************************************************/
|
|
|
|
|
1999-07-25 14:23:15 +02:00
|
|
|
BOOL WINAPI SHGetSpecialFolderPathA (
|
|
|
|
HWND hwndOwner,
|
|
|
|
LPSTR szPath,
|
|
|
|
DWORD csidl,
|
|
|
|
BOOL bCreate)
|
|
|
|
{
|
2001-03-19 20:14:00 +01:00
|
|
|
CHAR szValueName[MAX_PATH], szDefaultPath[MAX_PATH], szBuildPath[MAX_PATH];
|
1999-07-25 14:23:15 +02:00
|
|
|
HKEY hRootKey, hKey;
|
2000-12-13 02:49:04 +01:00
|
|
|
DWORD dwFlags;
|
1999-07-25 14:23:15 +02:00
|
|
|
DWORD dwType, dwDisp, dwPathLen = MAX_PATH;
|
2000-12-13 02:49:04 +01:00
|
|
|
DWORD folder = csidl & CSIDL_FOLDER_MASK;
|
2001-03-19 20:14:00 +01:00
|
|
|
CHAR *p;
|
1999-07-25 14:23:15 +02:00
|
|
|
|
2002-11-22 00:56:42 +01:00
|
|
|
TRACE("%p,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
|
1999-07-25 14:23:15 +02:00
|
|
|
|
2003-03-17 05:42:45 +01:00
|
|
|
if ((folder >= sizeof(CSIDL_Data) / sizeof(CSIDL_Data[0])) ||
|
|
|
|
(CSIDL_Data[folder].hRootKey == 0))
|
1999-07-25 14:23:15 +02:00
|
|
|
{
|
2003-03-17 05:42:45 +01:00
|
|
|
ERR("folder 0x%04lx unknown or not allowed\n", folder);
|
1999-07-25 14:23:15 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
2002-09-24 05:09:12 +02:00
|
|
|
if (CSIDL_Data[folder].hRootKey == (HKEY)1)
|
2000-12-13 02:49:04 +01:00
|
|
|
{
|
2003-03-17 05:42:45 +01:00
|
|
|
FIXME("folder 0x%04lx unknown, please add.\n", folder);
|
2000-12-13 02:49:04 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
1999-07-25 14:23:15 +02:00
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
dwFlags = CSIDL_Data[folder].dwFlags;
|
|
|
|
hRootKey = CSIDL_Data[folder].hRootKey;
|
|
|
|
strcpy(szValueName, CSIDL_Data[folder].szValueName);
|
|
|
|
strcpy(szDefaultPath, CSIDL_Data[folder].szDefaultPath);
|
1999-01-17 17:55:11 +01:00
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
if (dwFlags & CSIDL_MYFLAG_SHFOLDER)
|
1999-07-25 14:23:15 +02:00
|
|
|
{
|
2000-12-13 02:49:04 +01:00
|
|
|
/* user shell folders */
|
|
|
|
if (RegCreateKeyExA(hRootKey,szSHUserFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
|
|
|
|
|
|
|
|
if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
|
|
|
|
{
|
|
|
|
RegCloseKey(hKey);
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
/* shell folders */
|
|
|
|
if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
|
|
|
|
|
|
|
|
if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
|
|
|
|
{
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
/* value not existing */
|
|
|
|
if (dwFlags & CSIDL_MYFLAG_RELATIVE)
|
|
|
|
{
|
|
|
|
GetWindowsDirectoryA(szPath, MAX_PATH);
|
|
|
|
PathAddBackslashA(szPath);
|
|
|
|
strcat(szPath, szDefaultPath);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
strcpy(szPath, "C:\\"); /* FIXME ??? */
|
|
|
|
strcat(szPath, szDefaultPath);
|
|
|
|
}
|
|
|
|
RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
LPCSTR pRegPath;
|
|
|
|
|
|
|
|
if (dwFlags & CSIDL_MYFLAG_SETUP)
|
|
|
|
pRegPath = szSetup;
|
|
|
|
else
|
|
|
|
if (dwFlags & CSIDL_MYFLAG_CURRVER)
|
|
|
|
pRegPath = szCurrentVersion;
|
|
|
|
else
|
1999-07-25 14:23:15 +02:00
|
|
|
{
|
2000-12-13 02:49:04 +01:00
|
|
|
ERR("folder settings broken, please correct !\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RegCreateKeyExA(hRootKey,pRegPath,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
|
|
|
|
{
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
/* value not existing */
|
2000-12-13 02:49:04 +01:00
|
|
|
if (dwFlags & CSIDL_MYFLAG_RELATIVE)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
{
|
|
|
|
GetWindowsDirectoryA(szPath, MAX_PATH);
|
|
|
|
PathAddBackslashA(szPath);
|
|
|
|
strcat(szPath, szDefaultPath);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-12-13 02:49:04 +01:00
|
|
|
strcpy(szPath, "C:\\"); /* FIXME ??? */
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
strcat(szPath, szDefaultPath);
|
|
|
|
}
|
|
|
|
RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
|
1999-07-25 14:23:15 +02:00
|
|
|
}
|
2000-12-13 02:49:04 +01:00
|
|
|
RegCloseKey(hKey);
|
1999-07-25 14:23:15 +02:00
|
|
|
}
|
1999-01-17 17:55:11 +01:00
|
|
|
|
2000-06-24 14:56:08 +02:00
|
|
|
/* expand paths like %USERPROFILE% */
|
|
|
|
if (dwType == REG_EXPAND_SZ)
|
|
|
|
{
|
|
|
|
ExpandEnvironmentStringsA(szPath, szDefaultPath, MAX_PATH);
|
|
|
|
strcpy(szPath, szDefaultPath);
|
|
|
|
}
|
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
/* if we don't care about existing directories we are ready */
|
2000-06-13 05:45:52 +02:00
|
|
|
if(csidl & CSIDL_FLAG_DONT_VERIFY) return TRUE;
|
|
|
|
|
|
|
|
if (PathFileExistsA(szPath)) return TRUE;
|
|
|
|
|
2000-12-13 02:49:04 +01:00
|
|
|
/* not existing but we are not allowed to create it */
|
2000-06-13 05:45:52 +02:00
|
|
|
if (!bCreate) return FALSE;
|
2001-03-19 20:14:00 +01:00
|
|
|
|
|
|
|
/* create directory/directories */
|
|
|
|
strcpy(szBuildPath, szPath);
|
|
|
|
p = strchr(szBuildPath, '\\');
|
|
|
|
while (p)
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
{
|
2001-03-19 20:14:00 +01:00
|
|
|
*p = 0;
|
|
|
|
if (!PathFileExistsA(szBuildPath))
|
|
|
|
{
|
|
|
|
if (!CreateDirectoryA(szBuildPath,NULL))
|
|
|
|
{
|
|
|
|
ERR("Failed to create directory '%s'.\n", szPath);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*p = '\\';
|
|
|
|
p = strchr(p+1, '\\');
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
}
|
2001-05-18 22:58:57 +02:00
|
|
|
/* last component must be created too. */
|
|
|
|
if (!PathFileExistsA(szBuildPath))
|
|
|
|
{
|
|
|
|
if (!CreateDirectoryA(szBuildPath,NULL))
|
|
|
|
{
|
|
|
|
ERR("Failed to create directory '%s'.\n", szPath);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
Complete cleanup, bugfixes.
New: PathStripPath, PathMakeUniqueName, PathStripToRoot,
PathGetShortPath, PathParseIconLocation, PathRemoveExtension,
PathRemoveArgs, PathAppend, PathBuildRoot, PathCanonicalize,
PathFindNextComponent, PathRemoveFileSpec.
2000-04-28 22:23:46 +02:00
|
|
|
|
2000-06-13 05:45:52 +02:00
|
|
|
MESSAGE("Created not existing system directory '%s'\n", szPath);
|
1999-01-17 17:55:11 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SHGetSpecialFolderPathW
|
|
|
|
*/
|
1999-07-25 14:23:15 +02:00
|
|
|
BOOL WINAPI SHGetSpecialFolderPathW (
|
|
|
|
HWND hwndOwner,
|
|
|
|
LPWSTR szPath,
|
|
|
|
DWORD csidl,
|
|
|
|
BOOL bCreate)
|
|
|
|
{
|
|
|
|
char szTemp[MAX_PATH];
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-25 14:23:15 +02:00
|
|
|
if (SHGetSpecialFolderPathA(hwndOwner, szTemp, csidl, bCreate))
|
|
|
|
{
|
2000-11-28 23:40:56 +01:00
|
|
|
if (!MultiByteToWideChar( CP_ACP, 0, szTemp, -1, szPath, MAX_PATH ))
|
|
|
|
szPath[MAX_PATH-1] = 0;
|
|
|
|
}
|
1999-01-17 17:55:11 +01:00
|
|
|
|
2002-11-22 00:56:42 +01:00
|
|
|
TRACE("%p,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
|
1999-01-17 17:55:11 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2000-03-24 21:46:04 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* SHGetSpecialFolderPath (SHELL32.175)
|
2000-03-24 21:46:04 +01:00
|
|
|
*/
|
1999-07-25 14:23:15 +02:00
|
|
|
BOOL WINAPI SHGetSpecialFolderPathAW (
|
|
|
|
HWND hwndOwner,
|
|
|
|
LPVOID szPath,
|
|
|
|
DWORD csidl,
|
|
|
|
BOOL bCreate)
|
|
|
|
|
|
|
|
{
|
2000-08-14 16:35:01 +02:00
|
|
|
if (SHELL_OsIsUnicode())
|
1999-07-25 14:23:15 +02:00
|
|
|
return SHGetSpecialFolderPathW (hwndOwner, szPath, csidl, bCreate);
|
|
|
|
return SHGetSpecialFolderPathA (hwndOwner, szPath, csidl, bCreate);
|
1999-01-17 17:55:11 +01:00
|
|
|
}
|
1999-10-23 20:54:21 +02:00
|
|
|
|
2000-06-13 05:45:52 +02:00
|
|
|
/*************************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* SHGetFolderPathA [SHELL32.@]
|
2000-06-13 05:45:52 +02:00
|
|
|
*/
|
2000-06-23 17:47:36 +02:00
|
|
|
HRESULT WINAPI SHGetFolderPathA(
|
2000-06-13 05:45:52 +02:00
|
|
|
HWND hwndOwner,
|
|
|
|
int nFolder,
|
2000-12-02 00:58:28 +01:00
|
|
|
HANDLE hToken, /* [in] FIXME: get paths for specific user */
|
|
|
|
DWORD dwFlags, /* [in] FIXME: SHGFP_TYPE_CURRENT|SHGFP_TYPE_DEFAULT */
|
2000-06-13 05:45:52 +02:00
|
|
|
LPSTR pszPath)
|
|
|
|
{
|
|
|
|
return (SHGetSpecialFolderPathA(
|
|
|
|
hwndOwner,
|
|
|
|
pszPath,
|
|
|
|
CSIDL_FOLDER_MASK & nFolder,
|
|
|
|
CSIDL_FLAG_CREATE & nFolder )) ? S_OK : E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* SHGetFolderPathW [SHELL32.@]
|
2000-06-13 05:45:52 +02:00
|
|
|
*/
|
2000-06-23 17:47:36 +02:00
|
|
|
HRESULT WINAPI SHGetFolderPathW(
|
2000-06-13 05:45:52 +02:00
|
|
|
HWND hwndOwner,
|
|
|
|
int nFolder,
|
|
|
|
HANDLE hToken,
|
|
|
|
DWORD dwFlags,
|
|
|
|
LPWSTR pszPath)
|
|
|
|
{
|
|
|
|
return (SHGetSpecialFolderPathW(
|
|
|
|
hwndOwner,
|
|
|
|
pszPath,
|
|
|
|
CSIDL_FOLDER_MASK & nFolder,
|
|
|
|
CSIDL_FLAG_CREATE & nFolder )) ? S_OK : E_FAIL;
|
|
|
|
}
|