1998-11-25 16:47:05 +00:00
|
|
|
/*
|
|
|
|
* Path Functions
|
|
|
|
*
|
|
|
|
* Many of this functions are in SHLWAPI.DLL also
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
1999-06-12 15:45:58 +00:00
|
|
|
#include "debugtools.h"
|
1998-11-25 16:47:05 +00:00
|
|
|
#include "winnls.h"
|
|
|
|
#include "winversion.h"
|
1999-07-25 12:23:15 +00:00
|
|
|
#include "winreg.h"
|
1999-08-08 18:54:47 +00:00
|
|
|
#include "crtdll.h"
|
1999-01-23 14:12:48 +00:00
|
|
|
|
|
|
|
#include "shlobj.h"
|
1998-11-25 16:47:05 +00:00
|
|
|
#include "shell32_main.h"
|
|
|
|
|
1999-04-19 14:56:29 +00:00
|
|
|
DEFAULT_DEBUG_CHANNEL(shell)
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathIsRoot [SHELL32.29]
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsRootA(LPCSTR x)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("%s\n",x);
|
1998-11-25 16:47:05 +00:00
|
|
|
if (*(x+1)==':' && *(x+2)=='\\') /* "X:\" */
|
|
|
|
return 1;
|
|
|
|
if (*x=='\\') /* "\" */
|
|
|
|
return 0;
|
|
|
|
if (x[0]=='\\' && x[1]=='\\') /* UNC "\\<xx>\" */
|
|
|
|
{ int foundbackslash = 0;
|
|
|
|
x=x+2;
|
|
|
|
while (*x)
|
|
|
|
{ if (*x++=='\\')
|
|
|
|
foundbackslash++;
|
|
|
|
}
|
|
|
|
if (foundbackslash<=1) /* max 1 \ more ... */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsRootW(LPCWSTR x)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("%s\n",debugstr_w(x));
|
1998-11-25 16:47:05 +00:00
|
|
|
if (*(x+1)==':' && *(x+2)=='\\') /* "X:\" */
|
|
|
|
return 1;
|
|
|
|
if (*x == (WCHAR) '\\') /* "\" */
|
|
|
|
return 0;
|
|
|
|
if (x[0]==(WCHAR)'\\' && x[1]==(WCHAR)'\\') /* UNC "\\<xx>\" */
|
|
|
|
{ int foundbackslash = 0;
|
|
|
|
x=x+2;
|
|
|
|
while (*x)
|
|
|
|
{ if (*x++==(WCHAR)'\\')
|
|
|
|
foundbackslash++;
|
|
|
|
}
|
|
|
|
if (foundbackslash<=1) /* max 1 \ more ... */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsRootAW(LPCVOID x)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathIsRootW(x);
|
|
|
|
return PathIsRootA(x);
|
1998-11-25 16:47:05 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
/*************************************************************************
|
|
|
|
* PathBuildRoot [SHELL32.30]
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPSTR WINAPI PathBuildRootA(LPSTR root,BYTE drive) {
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p %i\n",root, drive);
|
1998-11-25 16:47:05 +00:00
|
|
|
strcpy(root,"A:\\");
|
|
|
|
root[0]+=drive;
|
|
|
|
return root;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathFindExtension [SHELL32.31]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* returns pointer to last . in last pathcomponent or at \0.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCSTR WINAPI PathFindExtensionA(LPCSTR path)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ LPCSTR lastpoint = NULL;
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p %s\n",path,path);
|
1998-11-25 16:47:05 +00:00
|
|
|
while (*path)
|
|
|
|
{ if (*path=='\\'||*path==' ')
|
|
|
|
lastpoint=NULL;
|
|
|
|
if (*path=='.')
|
|
|
|
lastpoint=path;
|
|
|
|
path++;
|
|
|
|
}
|
|
|
|
return lastpoint?lastpoint:path;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCWSTR WINAPI PathFindExtensionW(LPCWSTR path)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ LPCWSTR lastpoint = NULL;
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p L%s\n",path,debugstr_w(path));
|
1998-11-25 16:47:05 +00:00
|
|
|
while (*path)
|
|
|
|
{ if (*path==(WCHAR)'\\'||*path==(WCHAR)' ')
|
|
|
|
lastpoint=NULL;
|
|
|
|
if (*path==(WCHAR)'.')
|
|
|
|
lastpoint=path;
|
|
|
|
path++;
|
|
|
|
}
|
|
|
|
return lastpoint?lastpoint:path;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCVOID WINAPI PathFindExtensionAW(LPCVOID path)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathFindExtensionW(path);
|
|
|
|
return PathFindExtensionA(path);
|
1998-11-25 16:47:05 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathAddBackslash [SHELL32.32]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* append \ if there is none
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPSTR WINAPI PathAddBackslashA(LPSTR path)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ int len;
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p->%s\n",path,path);
|
1998-11-25 16:47:05 +00:00
|
|
|
|
|
|
|
len = strlen(path);
|
|
|
|
if (len && path[len-1]!='\\')
|
|
|
|
{ path[len] = '\\';
|
|
|
|
path[len+1]= 0x00;
|
|
|
|
return path+len+1;
|
|
|
|
}
|
|
|
|
return path+len;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPWSTR WINAPI PathAddBackslashW(LPWSTR path)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ int len;
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p->%s\n",path,debugstr_w(path));
|
1998-11-25 16:47:05 +00:00
|
|
|
|
1999-08-08 18:54:47 +00:00
|
|
|
len = CRTDLL_wcslen(path);
|
1998-11-25 16:47:05 +00:00
|
|
|
if (len && path[len-1]!=(WCHAR)'\\')
|
|
|
|
{ path[len] = (WCHAR)'\\';
|
|
|
|
path[len+1]= 0x00;
|
|
|
|
return path+len+1;
|
|
|
|
}
|
|
|
|
return path+len;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPVOID WINAPI PathAddBackslashAW(LPVOID path)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if(VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathAddBackslashW(path);
|
|
|
|
return PathAddBackslashA(path);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathRemoveBlanks [SHELL32.33]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* remove spaces from beginning and end of passed string
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPSTR WINAPI PathRemoveBlanksA(LPSTR str)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ LPSTR x = str;
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s\n",str);
|
1998-11-25 16:47:05 +00:00
|
|
|
while (*x==' ') x++;
|
|
|
|
if (x!=str)
|
|
|
|
strcpy(str,x);
|
|
|
|
if (!*str)
|
|
|
|
return str;
|
|
|
|
x=str+strlen(str)-1;
|
|
|
|
while (*x==' ')
|
|
|
|
x--;
|
|
|
|
if (*x==' ')
|
|
|
|
*x='\0';
|
|
|
|
return x;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPWSTR WINAPI PathRemoveBlanksW(LPWSTR str)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ LPWSTR x = str;
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s\n",debugstr_w(str));
|
1998-11-25 16:47:05 +00:00
|
|
|
while (*x==' ') x++;
|
|
|
|
if (x!=str)
|
1999-08-08 18:54:47 +00:00
|
|
|
CRTDLL_wcscpy(str,x);
|
1998-11-25 16:47:05 +00:00
|
|
|
if (!*str)
|
|
|
|
return str;
|
1999-08-08 18:54:47 +00:00
|
|
|
x=str+CRTDLL_wcslen(str)-1;
|
1998-11-25 16:47:05 +00:00
|
|
|
while (*x==' ')
|
|
|
|
x--;
|
|
|
|
if (*x==' ')
|
|
|
|
*x='\0';
|
|
|
|
return x;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPVOID WINAPI PathRemoveBlanksAW(LPVOID str)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if(VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathRemoveBlanksW(str);
|
|
|
|
return PathRemoveBlanksA(str);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathFindFilename [SHELL32.34]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* basename(char *fn);
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCSTR WINAPI PathFindFilenameA(LPCSTR aptr)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ LPCSTR aslash;
|
|
|
|
aslash = aptr;
|
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s\n",aslash);
|
1998-11-25 16:47:05 +00:00
|
|
|
while (aptr[0])
|
|
|
|
{ if (((aptr[0]=='\\') || (aptr[0]==':')) && aptr[1] && aptr[1]!='\\')
|
|
|
|
aslash = aptr+1;
|
|
|
|
aptr++;
|
|
|
|
}
|
|
|
|
return aslash;
|
|
|
|
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCWSTR WINAPI PathFindFilenameW(LPCWSTR wptr)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ LPCWSTR wslash;
|
|
|
|
wslash = wptr;
|
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("L%s\n",debugstr_w(wslash));
|
1998-11-25 16:47:05 +00:00
|
|
|
while (wptr[0])
|
|
|
|
{ if (((wptr[0]=='\\') || (wptr[0]==':')) && wptr[1] && wptr[1]!='\\')
|
|
|
|
wslash = wptr+1;
|
|
|
|
wptr++;
|
|
|
|
}
|
|
|
|
return wslash;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCVOID WINAPI PathFindFilenameAW(LPCVOID fn)
|
1998-11-25 16:47:05 +00:00
|
|
|
{
|
|
|
|
if(VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathFindFilenameW(fn);
|
|
|
|
return PathFindFilenameA(fn);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathRemoveFileSpec [SHELL32.35]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* bool getpath(char *pathname); truncates passed argument to a valid path
|
|
|
|
* returns if the string was modified or not.
|
|
|
|
* "\foo\xx\foo"-> "\foo\xx"
|
|
|
|
* "\" -> "\"
|
|
|
|
* "a:\foo" -> "a:\"
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
DWORD WINAPI PathRemoveFileSpecA(LPSTR fn) {
|
1998-11-25 16:47:05 +00:00
|
|
|
LPSTR x,cutplace;
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s\n",fn);
|
1998-11-25 16:47:05 +00:00
|
|
|
if (!fn[0])
|
|
|
|
return 0;
|
|
|
|
x=fn;
|
|
|
|
cutplace = fn;
|
|
|
|
while (*x) {
|
|
|
|
if (*x=='\\') {
|
|
|
|
cutplace=x++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (*x==':') {
|
|
|
|
x++;
|
|
|
|
if (*x=='\\')
|
|
|
|
cutplace=++x;
|
|
|
|
continue; /* already x++ed */
|
|
|
|
}
|
|
|
|
x++;
|
|
|
|
}
|
|
|
|
if (!*cutplace)
|
|
|
|
return 0;
|
|
|
|
if (cutplace==fn) {
|
|
|
|
if (fn[0]=='\\') {
|
|
|
|
if (!fn[1])
|
|
|
|
return 0;
|
|
|
|
fn[0]='\0';
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*cutplace='\0';
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathAppend [SHELL32.36]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* concat_paths(char*target,const char*add);
|
|
|
|
* concats "target\\add" and writes them to target
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPSTR WINAPI PathAppendA(LPSTR x1,LPSTR x2) {
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s %s\n",x1,x2);
|
1998-11-25 16:47:05 +00:00
|
|
|
while (x2[0]=='\\') x2++;
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathCombineA(x1,x1,x2);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathCombine [SHELL32.37]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* if lpszFile='.' skip it
|
|
|
|
* szDest can be equal to lpszFile. Thats why we use sTemp
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPSTR WINAPI PathCombineA(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ char sTemp[MAX_PATH];
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p %p->%s %p->%s\n",szDest, lpszDir, lpszDir, lpszFile, lpszFile);
|
1998-11-25 16:47:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!lpszFile || !lpszFile[0] || (lpszFile[0]=='.' && !lpszFile[1]) )
|
|
|
|
{ strcpy(szDest,lpszDir);
|
|
|
|
return szDest;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if lpszFile is a complete path don't care about lpszDir */
|
1999-02-26 11:11:13 +00:00
|
|
|
if (PathIsRootA(lpszFile))
|
1998-11-25 16:47:05 +00:00
|
|
|
{ strcpy(szDest,lpszFile);
|
|
|
|
}
|
1998-12-11 11:06:50 +00:00
|
|
|
else
|
|
|
|
{ strcpy(sTemp,lpszDir);
|
1999-02-26 11:11:13 +00:00
|
|
|
PathAddBackslashA(sTemp);
|
1998-12-11 11:06:50 +00:00
|
|
|
strcat(sTemp,lpszFile);
|
|
|
|
strcpy(szDest,sTemp);
|
|
|
|
}
|
1998-11-25 16:47:05 +00:00
|
|
|
return szDest;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPWSTR WINAPI PathCombineW(LPWSTR szDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ WCHAR sTemp[MAX_PATH];
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%p %p->%s %p->%s\n",szDest, lpszDir, debugstr_w(lpszDir),
|
1998-11-25 16:47:05 +00:00
|
|
|
lpszFile, debugstr_w(lpszFile));
|
|
|
|
|
|
|
|
|
|
|
|
if (!lpszFile || !lpszFile[0] || (lpszFile[0]==(WCHAR)'.' && !lpszFile[1]) )
|
1999-08-08 18:54:47 +00:00
|
|
|
{ CRTDLL_wcscpy(szDest,lpszDir);
|
1998-11-25 16:47:05 +00:00
|
|
|
return szDest;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if lpszFile is a complete path don't care about lpszDir */
|
1999-02-26 11:11:13 +00:00
|
|
|
if (PathIsRootW(lpszFile))
|
1999-08-08 18:54:47 +00:00
|
|
|
{ CRTDLL_wcscpy(szDest,lpszFile);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
1998-12-11 11:06:50 +00:00
|
|
|
else
|
1999-08-08 18:54:47 +00:00
|
|
|
{ CRTDLL_wcscpy(sTemp,lpszDir);
|
1999-02-26 11:11:13 +00:00
|
|
|
PathAddBackslashW(sTemp);
|
1999-08-08 18:54:47 +00:00
|
|
|
CRTDLL_wcscat(sTemp,lpszFile);
|
|
|
|
CRTDLL_wcscpy(szDest,sTemp);
|
1998-12-11 11:06:50 +00:00
|
|
|
}
|
1998-11-25 16:47:05 +00:00
|
|
|
return szDest;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathCombineW( szDest, lpszDir, lpszFile );
|
|
|
|
return PathCombineA( szDest, lpszDir, lpszFile );
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathIsUNC [SHELL32.39]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* PathIsUNC(char*path);
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsUNCA(LPCSTR path)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("%s\n",path);
|
1998-12-01 08:55:13 +00:00
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
if ((path[0]=='\\') && (path[1]=='\\'))
|
1998-12-01 08:55:13 +00:00
|
|
|
return TRUE;
|
1998-11-25 16:47:05 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsUNCW(LPCWSTR path)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("%s\n",debugstr_w(path));
|
1998-12-01 08:55:13 +00:00
|
|
|
|
|
|
|
if ((path[0]=='\\') && (path[1]=='\\'))
|
|
|
|
return TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsUNCAW (LPCVOID path)
|
1998-12-01 08:55:13 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathIsUNCW( path );
|
|
|
|
return PathIsUNCA( path );
|
1998-12-01 08:55:13 +00:00
|
|
|
}
|
|
|
|
/*************************************************************************
|
|
|
|
* PathIsRelativ [SHELL32.40]
|
|
|
|
*
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsRelativeA (LPCSTR path)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("path=%s\n",path);
|
1998-12-01 08:55:13 +00:00
|
|
|
|
|
|
|
if (path && (path[0]!='\\' && path[1]==':'))
|
|
|
|
return TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsRelativeW (LPCWSTR path)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("path=%s\n",debugstr_w(path));
|
1998-12-01 08:55:13 +00:00
|
|
|
|
|
|
|
if (path && (path[0]!='\\' && path[1]==':'))
|
|
|
|
return TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsRelativeAW (LPCVOID path)
|
1998-12-01 08:55:13 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathIsRelativeW( path );
|
|
|
|
return PathIsRelativeA( path );
|
1998-12-01 08:55:13 +00:00
|
|
|
}
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathIsExe [SHELL32.43]
|
|
|
|
*
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsExeA (LPCSTR path)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("path=%s\n",path);
|
1999-01-03 12:35:52 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsExeW (LPCWSTR path)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("path=%s\n",debugstr_w(path));
|
1999-01-03 12:35:52 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathIsExeAW (LPCVOID path)
|
1999-01-03 12:35:52 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathIsExeW (path);
|
|
|
|
return PathIsExeA(path);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathFileExists [SHELL32.45]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* file_exists(char *fn);
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathFileExistsA(LPSTR fn) {
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s\n",fn);
|
1999-02-26 11:11:13 +00:00
|
|
|
if (GetFileAttributesA(fn)==-1)
|
1998-11-25 16:47:05 +00:00
|
|
|
return FALSE;
|
|
|
|
else
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
/*************************************************************************
|
|
|
|
* PathMatchSpec [SHELL32.46]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* used from COMDLG32
|
|
|
|
*/
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathMatchSpecA(LPCSTR name, LPCSTR mask)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ LPCSTR _name;
|
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s %s stub\n",name,mask);
|
1998-11-25 16:47:05 +00:00
|
|
|
|
|
|
|
_name = name;
|
|
|
|
while (*_name && *mask)
|
|
|
|
{ if (*mask ==';')
|
|
|
|
{ mask++;
|
|
|
|
_name = name;
|
|
|
|
}
|
|
|
|
else if (*mask == '*')
|
|
|
|
{ mask++;
|
|
|
|
while (*mask == '*') mask++; /* Skip consecutive '*' */
|
|
|
|
if (!*mask || *mask==';') return TRUE; /* '*' matches everything */
|
|
|
|
while (*_name && (toupper(*_name) != toupper(*mask))) _name++;
|
|
|
|
if (!*_name)
|
|
|
|
{ while ( *mask && *mask != ';') mask++;
|
|
|
|
_name = name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( (*mask == '?') || (toupper(*mask) == toupper(*_name)) )
|
|
|
|
{ mask++;
|
|
|
|
_name++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ while ( *mask && *mask != ';') mask++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return (!*_name && (!*mask || *mask==';'));
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathMatchSpecW(LPCWSTR name, LPCWSTR mask)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ WCHAR stemp[4];
|
|
|
|
LPCWSTR _name;
|
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s %s stub\n",debugstr_w(name),debugstr_w(mask));
|
1998-11-25 16:47:05 +00:00
|
|
|
|
|
|
|
lstrcpyAtoW(stemp,"*.*");
|
1999-02-26 11:11:13 +00:00
|
|
|
if (!lstrcmpW( mask, stemp )) return 1;
|
1998-11-25 16:47:05 +00:00
|
|
|
|
|
|
|
_name = name;
|
|
|
|
while (*_name && *mask)
|
|
|
|
{ if (*mask ==';')
|
|
|
|
{ mask++;
|
|
|
|
_name = name;
|
|
|
|
}
|
|
|
|
else if (*mask == '*')
|
|
|
|
{ mask++;
|
|
|
|
while (*mask == '*') mask++; /* Skip consecutive '*' */
|
|
|
|
if (!*mask || *mask==';') return TRUE; /* '*' matches everything */
|
|
|
|
while (*_name && (towupper(*_name) != towupper(*mask))) _name++;
|
|
|
|
if (!*_name)
|
|
|
|
{ while ( *mask && *mask != ';') mask++;
|
|
|
|
_name = name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( (*mask == '?') || (towupper(*mask) == towupper(*_name)) )
|
|
|
|
{ mask++;
|
|
|
|
_name++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ while ( *mask && *mask != ';') mask++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return (!*_name && (!*mask || *mask==';'));
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathMatchSpecW( name, mask );
|
|
|
|
return PathMatchSpecA( name, mask );
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
/*************************************************************************
|
1999-03-13 17:10:36 +00:00
|
|
|
* PathSetDlgItemPathAW [SHELL32.48]
|
1998-11-25 16:47:05 +00:00
|
|
|
* NOTES
|
|
|
|
* use PathCompactPath to make sure, the path fits into the control
|
|
|
|
*/
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("%x %x %s\n",hDlg, id, pszPath);
|
1999-02-26 11:11:13 +00:00
|
|
|
return SetDlgItemTextA(hDlg, id, pszPath);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("%x %x %s\n",hDlg, id, debugstr_w(pszPath));
|
1999-02-26 11:11:13 +00:00
|
|
|
return SetDlgItemTextW(hDlg, id, pszPath);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathSetDlgItemPathW(hDlg, id, pszPath);
|
|
|
|
return PathSetDlgItemPathA(hDlg, id, pszPath);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
1999-01-31 10:00:26 +00:00
|
|
|
/*************************************************************************
|
1999-03-13 17:10:36 +00:00
|
|
|
* PathQualifyAW [SHELL32.49]
|
1999-01-31 10:00:26 +00:00
|
|
|
*/
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathQualifyA(LPCSTR pszPath)
|
1999-07-25 12:23:15 +00:00
|
|
|
{ FIXME("%s\n",pszPath);
|
1999-01-31 10:00:26 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathQualifyW(LPCWSTR pszPath)
|
1999-07-25 12:23:15 +00:00
|
|
|
{ FIXME("%s\n",debugstr_w(pszPath));
|
1999-01-31 10:00:26 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathQualifyAW(LPCVOID pszPath)
|
1999-01-31 10:00:26 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathQualifyW(pszPath);
|
|
|
|
return PathQualifyA(pszPath);
|
1999-01-31 10:00:26 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathResolve [SHELL32.51]
|
|
|
|
*/
|
|
|
|
DWORD WINAPI PathResolve(LPCSTR s,DWORD x2,DWORD x3) {
|
1999-06-12 15:45:58 +00:00
|
|
|
FIXME("(%s,0x%08lx,0x%08lx),stub!\n",s,x2,x3);
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathGetArgs [SHELL32.52]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* look for next arg in string. handle "quoted" strings
|
|
|
|
* returns pointer to argument *AFTER* the space. Or to the \0.
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCSTR WINAPI PathGetArgsA(LPCSTR cmdline)
|
|
|
|
{ BOOL qflag = FALSE;
|
1999-01-03 12:35:52 +00:00
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s\n",cmdline);
|
1999-01-03 12:35:52 +00:00
|
|
|
|
|
|
|
while (*cmdline)
|
|
|
|
{ if ((*cmdline==' ') && !qflag)
|
|
|
|
return cmdline+1;
|
|
|
|
if (*cmdline=='"')
|
|
|
|
qflag=!qflag;
|
|
|
|
cmdline++;
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
1999-01-03 12:35:52 +00:00
|
|
|
return cmdline;
|
|
|
|
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCWSTR WINAPI PathGetArgsW(LPCWSTR cmdline)
|
|
|
|
{ BOOL qflag = FALSE;
|
1999-01-03 12:35:52 +00:00
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%sL\n",debugstr_w(cmdline));
|
1999-01-03 12:35:52 +00:00
|
|
|
|
|
|
|
while (*cmdline)
|
|
|
|
{ if ((*cmdline==' ') && !qflag)
|
|
|
|
return cmdline+1;
|
|
|
|
if (*cmdline=='"')
|
1998-11-25 16:47:05 +00:00
|
|
|
qflag=!qflag;
|
1999-01-03 12:35:52 +00:00
|
|
|
cmdline++;
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
1999-01-03 12:35:52 +00:00
|
|
|
return cmdline;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCVOID WINAPI PathGetArgsAW(LPVOID cmdline)
|
1999-01-03 12:35:52 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathGetArgsW(cmdline);
|
|
|
|
return PathGetArgsA(cmdline);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
/*************************************************************************
|
|
|
|
* PathQuoteSpaces [SHELL32.55]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* basename(char *fn);
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPSTR WINAPI PathQuoteSpacesA(LPCSTR aptr)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("%s\n",aptr);
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPWSTR WINAPI PathQuoteSpacesW(LPCWSTR wptr)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("L%s\n",debugstr_w(wptr));
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPVOID WINAPI PathQuoteSpacesAW (LPCVOID fn)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if(VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathQuoteSpacesW(fn);
|
|
|
|
return PathQuoteSpacesA(fn);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathUnquoteSpaces [SHELL32.56]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* unquote string (remove ")
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
VOID WINAPI PathUnquoteSpacesA(LPSTR str)
|
|
|
|
{ DWORD len = lstrlenA(str);
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s\n",str);
|
1999-01-03 12:35:52 +00:00
|
|
|
if (*str!='"')
|
|
|
|
return;
|
|
|
|
if (str[len-1]!='"')
|
|
|
|
return;
|
|
|
|
str[len-1]='\0';
|
1999-02-26 11:11:13 +00:00
|
|
|
lstrcpyA(str,str+1);
|
1999-01-03 12:35:52 +00:00
|
|
|
return;
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
VOID WINAPI PathUnquoteSpacesW(LPWSTR str)
|
1999-08-08 18:54:47 +00:00
|
|
|
{ DWORD len = CRTDLL_wcslen(str);
|
1999-01-03 12:35:52 +00:00
|
|
|
|
1999-06-12 15:45:58 +00:00
|
|
|
TRACE("%s\n",debugstr_w(str));
|
1999-01-03 12:35:52 +00:00
|
|
|
|
|
|
|
if (*str!='"')
|
|
|
|
return;
|
|
|
|
if (str[len-1]!='"')
|
|
|
|
return;
|
|
|
|
str[len-1]='\0';
|
1999-08-08 18:54:47 +00:00
|
|
|
CRTDLL_wcscpy(str,str+1);
|
1999-01-03 12:35:52 +00:00
|
|
|
return;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
|
1999-01-03 12:35:52 +00:00
|
|
|
{ if(VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
PathUnquoteSpacesW(str);
|
|
|
|
PathUnquoteSpacesA(str);
|
1999-01-03 12:35:52 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathGetDriveNumber32 [SHELL32.57]
|
|
|
|
*
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI PathGetDriveNumber(LPSTR u)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("%s stub\n",debugstr_a(u));
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathYetAnotherMakeUniqueName [SHELL32.75]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* exported by ordinal
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathYetAnotherMakeUniqueNameA(LPDWORD x,LPDWORD y) {
|
1999-06-12 15:45:58 +00:00
|
|
|
FIXME("(%p,%p):stub.\n",x,y);
|
1998-11-25 16:47:05 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* IsLFNDrive [SHELL32.119]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* exported by ordinal Name
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI IsLFNDriveA(LPCSTR path) {
|
1998-11-25 16:47:05 +00:00
|
|
|
DWORD fnlen;
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
if (!GetVolumeInformationA(path,NULL,0,NULL,&fnlen,NULL,NULL,0))
|
1998-11-25 16:47:05 +00:00
|
|
|
return FALSE;
|
|
|
|
return fnlen>12;
|
|
|
|
}
|
1998-12-01 08:55:13 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathFindOnPath [SHELL32.145]
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathFindOnPathA(LPSTR sFile, LPCSTR sOtherDirs)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("%s %s\n",sFile, sOtherDirs);
|
1998-12-01 08:55:13 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathFindOnPathW(LPWSTR sFile, LPCWSTR sOtherDirs)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("%s %s\n",debugstr_w(sFile), debugstr_w(sOtherDirs));
|
1998-12-01 08:55:13 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
|
1998-12-01 08:55:13 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathFindOnPathW(sFile, sOtherDirs);
|
|
|
|
return PathFindOnPathA(sFile, sOtherDirs);
|
1998-12-01 08:55:13 +00:00
|
|
|
}
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathGetExtension [SHELL32.158]
|
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* exported by ordinal
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCSTR WINAPI PathGetExtensionA(LPCSTR path,DWORD y,DWORD z)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("(%s,%08lx,%08lx)\n",path,y,z);
|
1999-02-26 11:11:13 +00:00
|
|
|
path = PathFindExtensionA(path);
|
1998-11-25 16:47:05 +00:00
|
|
|
return *path?(path+1):path;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCWSTR WINAPI PathGetExtensionW(LPCWSTR path,DWORD y,DWORD z)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ TRACE("(L%s,%08lx,%08lx)\n",debugstr_w(path),y,z);
|
1999-02-26 11:11:13 +00:00
|
|
|
path = PathFindExtensionW(path);
|
1998-11-25 16:47:05 +00:00
|
|
|
return *path?(path+1):path;
|
|
|
|
}
|
1999-02-26 11:11:13 +00:00
|
|
|
LPCVOID WINAPI PathGetExtensionAW(LPCVOID path,DWORD y,DWORD z)
|
1998-11-25 16:47:05 +00:00
|
|
|
{ if (VERSION_OsIsUnicode())
|
1999-02-26 11:11:13 +00:00
|
|
|
return PathGetExtensionW(path,y,z);
|
|
|
|
return PathGetExtensionA(path,y,z);
|
1998-11-25 16:47:05 +00:00
|
|
|
}
|
|
|
|
|
1999-08-15 14:31:36 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* PathCleanupSpec [SHELL32.171]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
DWORD WINAPI PathCleanupSpecA(LPSTR x, LPSTR y)
|
|
|
|
{
|
|
|
|
FIXME("%p(%s) %p(%s) stub\n",x,x,y,y);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
DWORD WINAPI PathCleanupSpecW(LPWSTR x, LPWSTR y)
|
|
|
|
{
|
|
|
|
FIXME("%p(%s) %p(%s) stub\n",x,debugstr_w(x),y,debugstr_w(y));
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
DWORD WINAPI PathCleanupSpecAW (LPVOID x, LPVOID y)
|
|
|
|
{
|
|
|
|
if (VERSION_OsIsUnicode())
|
|
|
|
return PathCleanupSpecW(x,y);
|
|
|
|
return PathCleanupSpecA(x,y);
|
|
|
|
}
|
|
|
|
|
1998-11-25 16:47:05 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* SheGetDirW [SHELL32.281]
|
|
|
|
*
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI SheGetDirW(LPWSTR u, LPWSTR v)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("%p %p stub\n",u,v);
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SheChangeDirW [SHELL32.274]
|
|
|
|
*
|
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
HRESULT WINAPI SheChangeDirW(LPWSTR u)
|
1999-06-12 15:45:58 +00:00
|
|
|
{ FIXME("(%s),stub\n",debugstr_w(u));
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* PathProcessCommand [SHELL32.653]
|
|
|
|
*/
|
1999-07-10 11:56:34 +00:00
|
|
|
HRESULT WINAPI PathProcessCommandA (LPSTR lpCommand, LPSTR v, DWORD w, DWORD x)
|
|
|
|
{
|
|
|
|
FIXME("%p(%s) %p 0x%04lx 0x%04lx stub\n",
|
|
|
|
lpCommand, lpCommand, v, w,x );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI PathProcessCommandW (LPWSTR lpCommand, LPSTR v, DWORD w, DWORD x)
|
|
|
|
{
|
|
|
|
FIXME("%p(%s) %p 0x%04lx 0x%04lx stub\n",
|
|
|
|
lpCommand, debugstr_w(lpCommand), v, w,x );
|
1998-11-25 16:47:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1999-01-17 16:55:11 +00:00
|
|
|
|
1999-07-10 11:56:34 +00:00
|
|
|
HRESULT WINAPI PathProcessCommandAW (LPVOID lpCommand, LPSTR v, DWORD w, DWORD x)
|
|
|
|
{
|
|
|
|
if (VERSION_OsIsUnicode())
|
|
|
|
return PathProcessCommandW(lpCommand, v, w, x);
|
|
|
|
return PathProcessCommandA(lpCommand, v, w, x);
|
|
|
|
}
|
|
|
|
|
1999-01-17 16:55:11 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* SHGetSpecialFolderPath [SHELL32.175]
|
|
|
|
*
|
|
|
|
* converts csidl to path
|
|
|
|
*
|
|
|
|
*/
|
1999-07-25 12:23:15 +00:00
|
|
|
|
|
|
|
static char * szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
|
|
|
|
|
|
|
|
BOOL WINAPI SHGetSpecialFolderPathA (
|
|
|
|
HWND hwndOwner,
|
|
|
|
LPSTR szPath,
|
|
|
|
DWORD csidl,
|
|
|
|
BOOL bCreate)
|
|
|
|
{
|
|
|
|
CHAR szValueName[MAX_PATH], szDefaultPath[MAX_PATH];
|
|
|
|
HKEY hRootKey, hKey;
|
|
|
|
BOOL bRelative = TRUE;
|
|
|
|
DWORD dwType, dwDisp, dwPathLen = MAX_PATH;
|
|
|
|
|
|
|
|
TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
|
|
|
|
|
|
|
|
/* build default values */
|
|
|
|
switch(csidl)
|
|
|
|
{
|
|
|
|
case CSIDL_APPDATA:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy (szValueName, "AppData");
|
|
|
|
strcpy (szDefaultPath, "AppData");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_COOKIES:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy (szValueName, "Cookies");
|
|
|
|
strcpy(szDefaultPath, "Cookies");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_DESKTOPDIRECTORY:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Desktop");
|
|
|
|
strcpy(szDefaultPath, "Desktop");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_COMMON_DESKTOPDIRECTORY:
|
|
|
|
hRootKey = HKEY_LOCAL_MACHINE;
|
|
|
|
strcpy(szValueName, "Common Desktop");
|
|
|
|
strcpy(szDefaultPath, "Desktop");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_FAVORITES:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Favorites");
|
|
|
|
strcpy(szDefaultPath, "Favorites");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_FONTS:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Fonts");
|
|
|
|
strcpy(szDefaultPath, "Fonts");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_HISTORY:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "History");
|
|
|
|
strcpy(szDefaultPath, "History");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_NETHOOD:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "NetHood");
|
|
|
|
strcpy(szDefaultPath, "NetHood");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_INTERNET_CACHE:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Cache");
|
|
|
|
strcpy(szDefaultPath, "Temporary Internet Files");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_PERSONAL:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Personal");
|
|
|
|
strcpy(szDefaultPath, "My Own Files");
|
|
|
|
bRelative = FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_PRINTHOOD:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "PrintHood");
|
|
|
|
strcpy(szDefaultPath, "PrintHood");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_PROGRAMS:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Programs");
|
|
|
|
strcpy(szDefaultPath, "StatrMenu\\Programs");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_COMMON_PROGRAMS:
|
|
|
|
hRootKey = HKEY_LOCAL_MACHINE;
|
|
|
|
strcpy(szValueName, "Common Programs");
|
|
|
|
strcpy(szDefaultPath, "");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_RECENT:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Recent");
|
|
|
|
strcpy(szDefaultPath, "Recent");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_SENDTO:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "SendTo");
|
|
|
|
strcpy(szDefaultPath, "SendTo");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_STARTMENU:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "StartMenu");
|
|
|
|
strcpy(szDefaultPath, "StartMenu");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_COMMON_STARTMENU:
|
|
|
|
hRootKey = HKEY_LOCAL_MACHINE;
|
|
|
|
strcpy(szValueName, "Common StartMenu");
|
|
|
|
strcpy(szDefaultPath, "StartMenu");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_STARTUP:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Startup");
|
|
|
|
strcpy(szDefaultPath, "StartMenu\\Programs\\Startup");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_COMMON_STARTUP:
|
|
|
|
hRootKey = HKEY_LOCAL_MACHINE;
|
|
|
|
strcpy(szValueName, "Common Startup");
|
|
|
|
strcpy(szDefaultPath, "StartMenu\\Programs\\Startup");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CSIDL_TEMPLATES:
|
|
|
|
hRootKey = HKEY_CURRENT_USER;
|
|
|
|
strcpy(szValueName, "Templates");
|
|
|
|
strcpy(szDefaultPath, "ShellNew");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
ERR("folder unknown or not allowed\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&hKey,&dwDisp))
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
1999-01-17 16:55:11 +00:00
|
|
|
|
1999-07-25 12:23:15 +00:00
|
|
|
if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
|
|
|
|
{
|
|
|
|
/* value not existing */
|
|
|
|
if (bRelative)
|
|
|
|
{
|
|
|
|
GetWindowsDirectoryA(szPath, MAX_PATH);
|
|
|
|
PathAddBackslashA(szPath);
|
|
|
|
strcat(szPath, szDefaultPath);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
strcpy(szPath, szDefaultPath);
|
|
|
|
}
|
|
|
|
if (bCreate)
|
|
|
|
{
|
|
|
|
CreateDirectoryA(szPath,NULL);
|
|
|
|
}
|
|
|
|
RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
|
|
|
|
}
|
|
|
|
RegCloseKey(hKey);
|
1999-01-17 16:55:11 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
1999-07-25 12:23:15 +00:00
|
|
|
BOOL WINAPI SHGetSpecialFolderPathW (
|
|
|
|
HWND hwndOwner,
|
|
|
|
LPWSTR szPath,
|
|
|
|
DWORD csidl,
|
|
|
|
BOOL bCreate)
|
|
|
|
{
|
|
|
|
char szTemp[MAX_PATH];
|
|
|
|
|
|
|
|
if (SHGetSpecialFolderPathA(hwndOwner, szTemp, csidl, bCreate))
|
|
|
|
{
|
|
|
|
lstrcpynAtoW(szPath, szTemp, MAX_PATH);
|
|
|
|
}
|
1999-01-17 16:55:11 +00:00
|
|
|
|
1999-07-25 12:23:15 +00:00
|
|
|
TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
|
1999-01-17 16:55:11 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
1999-07-25 12:23:15 +00:00
|
|
|
BOOL WINAPI SHGetSpecialFolderPathAW (
|
|
|
|
HWND hwndOwner,
|
|
|
|
LPVOID szPath,
|
|
|
|
DWORD csidl,
|
|
|
|
BOOL bCreate)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (VERSION_OsIsUnicode())
|
|
|
|
return SHGetSpecialFolderPathW (hwndOwner, szPath, csidl, bCreate);
|
|
|
|
return SHGetSpecialFolderPathA (hwndOwner, szPath, csidl, bCreate);
|
1999-01-17 16:55:11 +00:00
|
|
|
}
|