Document, implement/fix and test 110+ Path functions.
Share the GET_FUNC macro, other places than ordinal.c need it.
This commit is contained in:
parent
f9340ff94d
commit
4e75d1246f
|
@ -114,13 +114,6 @@ static const SHL_2_inet_scheme shlwapi_schemes[] = {
|
|||
{0, 0}
|
||||
};
|
||||
|
||||
/* Macro to get function pointer for a module*/
|
||||
#define GET_FUNC(module, name, fail) \
|
||||
if (!SHLWAPI_h##module) SHLWAPI_h##module = LoadLibraryA(#module ".dll"); \
|
||||
if (!SHLWAPI_h##module) return fail; \
|
||||
if (!pfnFunc) pfnFunc = (void*)GetProcAddress(SHLWAPI_h##module, name); \
|
||||
if (!pfnFunc) return fail
|
||||
|
||||
/*
|
||||
NOTES: Most functions exported by ordinal seem to be superflous.
|
||||
The reason for these functions to be there is to provide a wraper
|
||||
|
@ -199,7 +192,7 @@ DWORD WINAPI SHLWAPI_2 (LPCWSTR x, UNKNOWN_SHLWAPI_2 *y)
|
|||
INT len;
|
||||
|
||||
if (y->size != 0x18) return E_INVALIDARG;
|
||||
/* FIXME: leading white space generates error of 0x80041001 which
|
||||
/* FIXME: leading white space generates error of 0x80041001 which
|
||||
* is undefined
|
||||
*/
|
||||
if (*x <= L' ') return 0x80041001;
|
||||
|
@ -245,6 +238,73 @@ DWORD WINAPI SHLWAPI_2 (LPCWSTR x, UNKNOWN_SHLWAPI_2 *y)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* @ [SHLWAPI.3]
|
||||
*
|
||||
* Determine if a file exists locally and is of an executable type.
|
||||
*
|
||||
* PARAMS
|
||||
* lpszFile [O] File to search for
|
||||
* dwWhich [I] Type of executable to search for
|
||||
*
|
||||
* RETURNS
|
||||
* TRUE If the file was found. lpszFile contains the file name.
|
||||
* FALSE Otherwise.
|
||||
*
|
||||
* NOTES
|
||||
* lpszPath is modified in place and must be at least MAX_PATH in length.
|
||||
* If the function returns FALSE, the path is modified to its orginal state.
|
||||
* If the given path contains an extension or dwWhich is 0, executable
|
||||
* extensions are not checked.
|
||||
*
|
||||
* Ordinals 3-6 are a classic case of MS exposing limited functionality to
|
||||
* users (here through PathFindOnPath) and keeping advanced functionality for
|
||||
* their own developers exclusive use. Monopoly, anyone?
|
||||
*/
|
||||
BOOL WINAPI SHLWAPI_3(LPSTR lpszFile,DWORD dwWhich)
|
||||
{
|
||||
return SHLWAPI_PathFindLocalExeA(lpszFile,dwWhich);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* @ [SHLWAPI.4]
|
||||
*
|
||||
* Unicode version of SHLWAPI_3.
|
||||
*/
|
||||
BOOL WINAPI SHLWAPI_4(LPWSTR lpszFile,DWORD dwWhich)
|
||||
{
|
||||
return SHLWAPI_PathFindLocalExeW(lpszFile,dwWhich);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* @ [SHLWAPI.5]
|
||||
*
|
||||
* Search a range of paths for a specific type of executable.
|
||||
*
|
||||
* PARAMS
|
||||
* lpszFile [O] File to search for
|
||||
* lppszOtherDirs [I] Other directories to look in
|
||||
* dwWhich [I] Type of executable to search for
|
||||
*
|
||||
* RETURNS
|
||||
* Success: TRUE. The path to the executable is stored in sFile.
|
||||
* Failure: FALSE. The path to the executable is unchanged.
|
||||
*/
|
||||
BOOL WINAPI SHLWAPI_5(LPSTR lpszFile,LPCSTR *lppszOtherDirs,DWORD dwWhich)
|
||||
{
|
||||
return SHLWAPI_PathFindOnPathExA(lpszFile,lppszOtherDirs,dwWhich);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* @ [SHLWAPI.6]
|
||||
*
|
||||
* Unicode version of SHLWAPI_5.
|
||||
*/
|
||||
BOOL WINAPI SHLWAPI_6(LPWSTR lpszFile,LPCWSTR *lppszOtherDirs,DWORD dwWhich)
|
||||
{
|
||||
return SHLWAPI_PathFindOnPathExW(lpszFile,lppszOtherDirs,dwWhich);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHLWAPI_DupSharedHandle
|
||||
*
|
||||
|
|
|
@ -43,3 +43,17 @@ typedef struct {
|
|||
|
||||
DWORD WINAPI SHLWAPI_2(LPCWSTR x, UNKNOWN_SHLWAPI_2 *y);
|
||||
|
||||
/* Macro to get function pointer for a module*/
|
||||
#define GET_FUNC(module, name, fail) \
|
||||
if (!SHLWAPI_h##module) SHLWAPI_h##module = LoadLibraryA(#module ".dll"); \
|
||||
if (!SHLWAPI_h##module) return fail; \
|
||||
if (!pfnFunc) pfnFunc = (void*)GetProcAddress(SHLWAPI_h##module, name); \
|
||||
if (!pfnFunc) return fail
|
||||
|
||||
extern HMODULE SHLWAPI_hshell32;
|
||||
|
||||
/* Shared internal functions */
|
||||
BOOL WINAPI SHLWAPI_PathFindLocalExeA(LPSTR lpszPath, DWORD dwWhich);
|
||||
BOOL WINAPI SHLWAPI_PathFindLocalExeW(LPWSTR lpszPath, DWORD dwWhich);
|
||||
BOOL WINAPI SHLWAPI_PathFindOnPathExA(LPSTR lpszFile,LPCSTR *lppszOtherDirs,DWORD dwWhich);
|
||||
BOOL WINAPI SHLWAPI_PathFindOnPathExW(LPWSTR lpszFile,LPCWSTR *lppszOtherDirs,DWORD dwWhich);
|
||||
|
|
4081
dlls/shlwapi/path.c
4081
dlls/shlwapi/path.c
File diff suppressed because it is too large
Load Diff
|
@ -12,10 +12,10 @@ debug_channels (shell)
|
|||
|
||||
1 stdcall @(str ptr) SHLWAPI_1
|
||||
2 stdcall @(wstr ptr) SHLWAPI_2
|
||||
3 stub @
|
||||
4 stub @
|
||||
5 stub @
|
||||
6 stub @
|
||||
3 stdcall @(str long) SHLWAPI_3
|
||||
4 stdcall @(wstr long) SHLWAPI_4
|
||||
5 stdcall @(str ptr long) SHLWAPI_5
|
||||
6 stdcall @(wstr ptr long) SHLWAPI_6
|
||||
7 stdcall @(long long ptr) SHLWAPI_7
|
||||
8 stdcall @(long long) SHLWAPI_8
|
||||
9 stdcall @(ptr) SHLWAPI_9
|
||||
|
@ -702,17 +702,17 @@ debug_channels (shell)
|
|||
@ stdcall SHRegGetPathW(long wstr wstr ptr long)SHRegGetPathW
|
||||
@ stub MLLoadLibraryA
|
||||
@ stub MLLoadLibraryW
|
||||
@ stub PathIsDirectoryEmptyA
|
||||
@ stub PathIsDirectoryEmptyW
|
||||
@ stub PathIsNetworkPathA
|
||||
@ stub PathIsNetworkPathW
|
||||
@ stub PathIsLFNFileSpecA
|
||||
@ stub PathIsLFNFileSpecW
|
||||
@ stub PathFindSuffixArrayA
|
||||
@ stub PathFindSuffixArrayW
|
||||
@ stdcall PathIsDirectoryEmptyA(str) PathIsDirectoryEmptyA
|
||||
@ stdcall PathIsDirectoryEmptyW(wstr) PathIsDirectoryEmptyW
|
||||
@ stdcall PathIsNetworkPathA(str) PathIsNetworkPathA
|
||||
@ stdcall PathIsNetworkPathW(wstr) PathIsNetworkPathW
|
||||
@ stdcall PathIsLFNFileSpecA(str) PathIsLFNFileSpecA
|
||||
@ stdcall PathIsLFNFileSpecW(wstr) PathIsLFNFileSpecW
|
||||
@ stdcall PathFindSuffixArrayA(str) PathFindSuffixArrayA
|
||||
@ stdcall PathFindSuffixArrayW(wstr) PathFindSuffixArrayW
|
||||
@ stdcall _SHGetInstanceExplorer@4(ptr) _SHGetInstanceExplorer
|
||||
@ stub PathUndecorateA
|
||||
@ stub PathUndecorateW
|
||||
@ stdcall PathUndecorateA(str) PathUndecorateA
|
||||
@ stdcall PathUndecorateW(wstr) PathUndecorateW
|
||||
@ stub PathUnExpandEnvStringsA
|
||||
@ stub PathUnExpandEnvStringsW
|
||||
@ stub SHCopyKeyA
|
||||
|
|
|
@ -310,8 +310,8 @@ int WINAPI PathParseIconLocationA(LPSTR);
|
|||
int WINAPI PathParseIconLocationW(LPWSTR);
|
||||
#define PathParseIconLocation WINELIB_NAME_AW(PathParseIconLocation)
|
||||
|
||||
LPSTR WINAPI PathQuoteSpacesA(LPSTR);
|
||||
LPWSTR WINAPI PathQuoteSpacesW(LPWSTR);
|
||||
VOID WINAPI PathQuoteSpacesA(LPSTR);
|
||||
VOID WINAPI PathQuoteSpacesW(LPWSTR);
|
||||
#define PathQuoteSpaces WINELIB_NAME_AW(PathQuoteSpaces)
|
||||
|
||||
BOOL WINAPI PathRelativePathToA(LPSTR,LPCSTR,DWORD,LPCSTR,DWORD);
|
||||
|
@ -346,8 +346,8 @@ BOOL WINAPI PathSearchAndQualifyA(LPCSTR,LPSTR,UINT);
|
|||
BOOL WINAPI PathSearchAndQualifyW(LPCWSTR,LPWSTR,UINT);
|
||||
#define PathSearchAndQualify WINELIB_NAME_AW(PathSearchAndQualify)
|
||||
|
||||
BOOL WINAPI PathSetDlgItemPathA(HWND,int,LPCSTR);
|
||||
BOOL WINAPI PathSetDlgItemPathW(HWND,int,LPCWSTR);
|
||||
VOID WINAPI PathSetDlgItemPathA(HWND,int,LPCSTR);
|
||||
VOID WINAPI PathSetDlgItemPathW(HWND,int,LPCWSTR);
|
||||
#define PathSetDlgItemPath WINELIB_NAME_AW(PathSetDlgItemPath)
|
||||
|
||||
LPSTR WINAPI PathSkipRootA(LPCSTR);
|
||||
|
@ -386,8 +386,8 @@ BOOL WINAPI PathIsLFNFileSpecA(LPCSTR);
|
|||
BOOL WINAPI PathIsLFNFileSpecW(LPCWSTR);
|
||||
#define PathIsLFNFileSpec WINELIB_NAME_AW(PathIsLFNFileSpec)
|
||||
|
||||
LPCSTR WINAPI PathFindSuffixArrayA(LPCSTR,LPCSTR *,int);
|
||||
LPCWSTR WINAPI PathFindSuffixArrayW(LPCWSTR,LPCWSTR *,int);
|
||||
int WINAPI PathFindSuffixArrayA(LPCSTR,LPCSTR *,int);
|
||||
int WINAPI PathFindSuffixArrayW(LPCWSTR,LPCWSTR *,int);
|
||||
#define PathFindSuffixArray WINELIB_NAME_AW(PathFindSuffixArray)
|
||||
|
||||
VOID WINAPI PathUndecorateA(LPSTR);
|
||||
|
|
Loading…
Reference in New Issue