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}
|
{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.
|
NOTES: Most functions exported by ordinal seem to be superflous.
|
||||||
The reason for these functions to be there is to provide a wraper
|
The reason for these functions to be there is to provide a wraper
|
||||||
|
@ -245,6 +238,73 @@ DWORD WINAPI SHLWAPI_2 (LPCWSTR x, UNKNOWN_SHLWAPI_2 *y)
|
||||||
return S_OK;
|
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
|
* SHLWAPI_DupSharedHandle
|
||||||
*
|
*
|
||||||
|
|
|
@ -43,3 +43,17 @@ typedef struct {
|
||||||
|
|
||||||
DWORD WINAPI SHLWAPI_2(LPCWSTR x, UNKNOWN_SHLWAPI_2 *y);
|
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);
|
||||||
|
|
3983
dlls/shlwapi/path.c
3983
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
|
1 stdcall @(str ptr) SHLWAPI_1
|
||||||
2 stdcall @(wstr ptr) SHLWAPI_2
|
2 stdcall @(wstr ptr) SHLWAPI_2
|
||||||
3 stub @
|
3 stdcall @(str long) SHLWAPI_3
|
||||||
4 stub @
|
4 stdcall @(wstr long) SHLWAPI_4
|
||||||
5 stub @
|
5 stdcall @(str ptr long) SHLWAPI_5
|
||||||
6 stub @
|
6 stdcall @(wstr ptr long) SHLWAPI_6
|
||||||
7 stdcall @(long long ptr) SHLWAPI_7
|
7 stdcall @(long long ptr) SHLWAPI_7
|
||||||
8 stdcall @(long long) SHLWAPI_8
|
8 stdcall @(long long) SHLWAPI_8
|
||||||
9 stdcall @(ptr) SHLWAPI_9
|
9 stdcall @(ptr) SHLWAPI_9
|
||||||
|
@ -702,17 +702,17 @@ debug_channels (shell)
|
||||||
@ stdcall SHRegGetPathW(long wstr wstr ptr long)SHRegGetPathW
|
@ stdcall SHRegGetPathW(long wstr wstr ptr long)SHRegGetPathW
|
||||||
@ stub MLLoadLibraryA
|
@ stub MLLoadLibraryA
|
||||||
@ stub MLLoadLibraryW
|
@ stub MLLoadLibraryW
|
||||||
@ stub PathIsDirectoryEmptyA
|
@ stdcall PathIsDirectoryEmptyA(str) PathIsDirectoryEmptyA
|
||||||
@ stub PathIsDirectoryEmptyW
|
@ stdcall PathIsDirectoryEmptyW(wstr) PathIsDirectoryEmptyW
|
||||||
@ stub PathIsNetworkPathA
|
@ stdcall PathIsNetworkPathA(str) PathIsNetworkPathA
|
||||||
@ stub PathIsNetworkPathW
|
@ stdcall PathIsNetworkPathW(wstr) PathIsNetworkPathW
|
||||||
@ stub PathIsLFNFileSpecA
|
@ stdcall PathIsLFNFileSpecA(str) PathIsLFNFileSpecA
|
||||||
@ stub PathIsLFNFileSpecW
|
@ stdcall PathIsLFNFileSpecW(wstr) PathIsLFNFileSpecW
|
||||||
@ stub PathFindSuffixArrayA
|
@ stdcall PathFindSuffixArrayA(str) PathFindSuffixArrayA
|
||||||
@ stub PathFindSuffixArrayW
|
@ stdcall PathFindSuffixArrayW(wstr) PathFindSuffixArrayW
|
||||||
@ stdcall _SHGetInstanceExplorer@4(ptr) _SHGetInstanceExplorer
|
@ stdcall _SHGetInstanceExplorer@4(ptr) _SHGetInstanceExplorer
|
||||||
@ stub PathUndecorateA
|
@ stdcall PathUndecorateA(str) PathUndecorateA
|
||||||
@ stub PathUndecorateW
|
@ stdcall PathUndecorateW(wstr) PathUndecorateW
|
||||||
@ stub PathUnExpandEnvStringsA
|
@ stub PathUnExpandEnvStringsA
|
||||||
@ stub PathUnExpandEnvStringsW
|
@ stub PathUnExpandEnvStringsW
|
||||||
@ stub SHCopyKeyA
|
@ stub SHCopyKeyA
|
||||||
|
|
|
@ -310,8 +310,8 @@ int WINAPI PathParseIconLocationA(LPSTR);
|
||||||
int WINAPI PathParseIconLocationW(LPWSTR);
|
int WINAPI PathParseIconLocationW(LPWSTR);
|
||||||
#define PathParseIconLocation WINELIB_NAME_AW(PathParseIconLocation)
|
#define PathParseIconLocation WINELIB_NAME_AW(PathParseIconLocation)
|
||||||
|
|
||||||
LPSTR WINAPI PathQuoteSpacesA(LPSTR);
|
VOID WINAPI PathQuoteSpacesA(LPSTR);
|
||||||
LPWSTR WINAPI PathQuoteSpacesW(LPWSTR);
|
VOID WINAPI PathQuoteSpacesW(LPWSTR);
|
||||||
#define PathQuoteSpaces WINELIB_NAME_AW(PathQuoteSpaces)
|
#define PathQuoteSpaces WINELIB_NAME_AW(PathQuoteSpaces)
|
||||||
|
|
||||||
BOOL WINAPI PathRelativePathToA(LPSTR,LPCSTR,DWORD,LPCSTR,DWORD);
|
BOOL WINAPI PathRelativePathToA(LPSTR,LPCSTR,DWORD,LPCSTR,DWORD);
|
||||||
|
@ -346,8 +346,8 @@ BOOL WINAPI PathSearchAndQualifyA(LPCSTR,LPSTR,UINT);
|
||||||
BOOL WINAPI PathSearchAndQualifyW(LPCWSTR,LPWSTR,UINT);
|
BOOL WINAPI PathSearchAndQualifyW(LPCWSTR,LPWSTR,UINT);
|
||||||
#define PathSearchAndQualify WINELIB_NAME_AW(PathSearchAndQualify)
|
#define PathSearchAndQualify WINELIB_NAME_AW(PathSearchAndQualify)
|
||||||
|
|
||||||
BOOL WINAPI PathSetDlgItemPathA(HWND,int,LPCSTR);
|
VOID WINAPI PathSetDlgItemPathA(HWND,int,LPCSTR);
|
||||||
BOOL WINAPI PathSetDlgItemPathW(HWND,int,LPCWSTR);
|
VOID WINAPI PathSetDlgItemPathW(HWND,int,LPCWSTR);
|
||||||
#define PathSetDlgItemPath WINELIB_NAME_AW(PathSetDlgItemPath)
|
#define PathSetDlgItemPath WINELIB_NAME_AW(PathSetDlgItemPath)
|
||||||
|
|
||||||
LPSTR WINAPI PathSkipRootA(LPCSTR);
|
LPSTR WINAPI PathSkipRootA(LPCSTR);
|
||||||
|
@ -386,8 +386,8 @@ BOOL WINAPI PathIsLFNFileSpecA(LPCSTR);
|
||||||
BOOL WINAPI PathIsLFNFileSpecW(LPCWSTR);
|
BOOL WINAPI PathIsLFNFileSpecW(LPCWSTR);
|
||||||
#define PathIsLFNFileSpec WINELIB_NAME_AW(PathIsLFNFileSpec)
|
#define PathIsLFNFileSpec WINELIB_NAME_AW(PathIsLFNFileSpec)
|
||||||
|
|
||||||
LPCSTR WINAPI PathFindSuffixArrayA(LPCSTR,LPCSTR *,int);
|
int WINAPI PathFindSuffixArrayA(LPCSTR,LPCSTR *,int);
|
||||||
LPCWSTR WINAPI PathFindSuffixArrayW(LPCWSTR,LPCWSTR *,int);
|
int WINAPI PathFindSuffixArrayW(LPCWSTR,LPCWSTR *,int);
|
||||||
#define PathFindSuffixArray WINELIB_NAME_AW(PathFindSuffixArray)
|
#define PathFindSuffixArray WINELIB_NAME_AW(PathFindSuffixArray)
|
||||||
|
|
||||||
VOID WINAPI PathUndecorateA(LPSTR);
|
VOID WINAPI PathUndecorateA(LPSTR);
|
||||||
|
|
Loading…
Reference in New Issue