mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 02:34:53 +00:00
[KERNEL32]: Write out the 3 internal APIs which will do path resolution, and define the structures that determine the search path order which each one will use. No functional change.
svn path=/trunk/; revision=54536
This commit is contained in:
parent
267dcf71eb
commit
c0fa34f162
|
@ -33,8 +33,121 @@ DWORD IllegalMask[4] =
|
|||
0x10000000 // 7C not allowed
|
||||
};
|
||||
|
||||
BASE_SEARCH_PATH_TYPE BaseDllOrderCurrent[BaseCurrentDirMax][BaseSearchPathMax] =
|
||||
{
|
||||
{
|
||||
BaseSearchPathApp,
|
||||
BaseSearchPathCurrent,
|
||||
BaseSearchPathDefault,
|
||||
BaseSearchPathEnv,
|
||||
BaseSearchPathInvalid
|
||||
},
|
||||
{
|
||||
BaseSearchPathApp,
|
||||
BaseSearchPathDefault,
|
||||
BaseSearchPathCurrent,
|
||||
BaseSearchPathEnv,
|
||||
BaseSearchPathInvalid
|
||||
}
|
||||
};
|
||||
|
||||
BASE_SEARCH_PATH_TYPE BaseProcessOrderNoCurrent[BaseSearchPathMax] =
|
||||
{
|
||||
BaseSearchPathApp,
|
||||
BaseSearchPathDefault,
|
||||
BaseSearchPathEnv,
|
||||
BaseSearchPathInvalid,
|
||||
BaseSearchPathInvalid
|
||||
};
|
||||
|
||||
BASE_SEARCH_PATH_TYPE BaseDllOrderNoCurrent[BaseSearchPathMax] =
|
||||
{
|
||||
BaseSearchPathApp,
|
||||
BaseSearchPathDll,
|
||||
BaseSearchPathDefault,
|
||||
BaseSearchPathEnv,
|
||||
BaseSearchPathInvalid
|
||||
};
|
||||
|
||||
BASE_SEARCH_PATH_TYPE BaseProcessOrder[BaseSearchPathMax] =
|
||||
{
|
||||
BaseSearchPathApp,
|
||||
BaseSearchPathCurrent,
|
||||
BaseSearchPathDefault,
|
||||
BaseSearchPathEnv,
|
||||
BaseSearchPathInvalid
|
||||
};
|
||||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
|
||||
LPWSTR
|
||||
WINAPI
|
||||
BasepComputeProcessPath(IN PBASE_SEARCH_PATH_TYPE PathOrder,
|
||||
IN LPWSTR AppName,
|
||||
IN LPVOID Environment)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LPWSTR
|
||||
WINAPI
|
||||
BaseComputeProcessSearchPath(VOID)
|
||||
{
|
||||
DPRINT1("Computing Process Search path\n");
|
||||
|
||||
/* Compute the path using default process order */
|
||||
return BasepComputeProcessPath(BaseProcessOrder, NULL, NULL);
|
||||
}
|
||||
|
||||
LPWSTR
|
||||
WINAPI
|
||||
BaseComputeProcessExePath(IN LPWSTR FullPath)
|
||||
{
|
||||
PBASE_SEARCH_PATH_TYPE PathOrder;
|
||||
DPRINT1("Computing EXE path: %wZ\n", FullPath);
|
||||
|
||||
/* Check if we should use the current directory */
|
||||
PathOrder = NeedCurrentDirectoryForExePathW(FullPath) ?
|
||||
BaseProcessOrder : BaseProcessOrderNoCurrent;
|
||||
|
||||
/* And now compute the path */
|
||||
return BasepComputeProcessPath(PathOrder, NULL, NULL);
|
||||
}
|
||||
|
||||
LPWSTR
|
||||
WINAPI
|
||||
BaseComputeProcessDllPath(IN LPWSTR FullPath,
|
||||
IN PVOID Environment)
|
||||
{
|
||||
LPWSTR DllPath = NULL;
|
||||
DPRINT1("Computing DLL path: %wZ with BaseDll: %wZ\n", FullPath, &BaseDllDirectory);
|
||||
|
||||
/* Acquire DLL directory lock */
|
||||
RtlEnterCriticalSection(&BaseDllDirectoryLock);
|
||||
|
||||
/* Check if we have a base dll directory */
|
||||
if (BaseDllDirectory.Buffer)
|
||||
{
|
||||
/* Then compute the process path using DLL order (without curdir) */
|
||||
DllPath = BasepComputeProcessPath(BaseDllOrderNoCurrent, FullPath, Environment);
|
||||
|
||||
/* Release DLL directory lock */
|
||||
RtlLeaveCriticalSection(&BaseDllDirectoryLock);
|
||||
|
||||
/* Return dll path */
|
||||
return DllPath;
|
||||
}
|
||||
|
||||
/* Release DLL directory lock */
|
||||
RtlLeaveCriticalSection(&BaseDllDirectoryLock);
|
||||
|
||||
/* There is no base DLL directory */
|
||||
UNIMPLEMENTED;
|
||||
|
||||
/* Return dll path */
|
||||
return DllPath;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
WINAPI
|
||||
CheckForSameCurdir(IN PUNICODE_STRING DirName)
|
||||
|
|
|
@ -88,6 +88,24 @@ typedef struct tagLOADPARMS32 {
|
|||
DWORD dwReserved;
|
||||
} LOADPARMS32;
|
||||
|
||||
typedef enum _BASE_CURRENT_DIR_PRIORITY
|
||||
{
|
||||
BaseCurrentDirInvalid = -1,
|
||||
BaseCurrentDirFirst,
|
||||
BaseCurrentDirLast,
|
||||
BaseCurrentDirMax
|
||||
} BASE_CURRENT_DIR_PRIORITY;
|
||||
|
||||
typedef enum _BASE_SEARCH_PATH_TYPE
|
||||
{
|
||||
BaseSearchPathInvalid,
|
||||
BaseSearchPathDll,
|
||||
BaseSearchPathApp,
|
||||
BaseSearchPathDefault,
|
||||
BaseSearchPathEnv,
|
||||
BaseSearchPathCurrent,
|
||||
BaseSearchPathMax
|
||||
} BASE_SEARCH_PATH_TYPE, *PBASE_SEARCH_PATH_TYPE;
|
||||
|
||||
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_ERROR 1
|
||||
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_SUCCESS 2
|
||||
|
|
|
@ -1626,6 +1626,12 @@ HMODULE WINAPI GetModuleHandleW(LPCWSTR);
|
|||
BOOL WINAPI GetModuleHandleExA(DWORD,LPCSTR,HMODULE*);
|
||||
BOOL WINAPI GetModuleHandleExW(DWORD,LPCWSTR,HMODULE*);
|
||||
#endif
|
||||
|
||||
#if _WIN32_WINNT >= 0x0502
|
||||
WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathA(LPCSTR ExeName);
|
||||
WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathW(LPCWSTR ExeName);
|
||||
#endif
|
||||
|
||||
BOOL WINAPI GetNamedPipeHandleStateA(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD,LPSTR,DWORD);
|
||||
BOOL WINAPI GetNamedPipeHandleStateW(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD,LPWSTR,DWORD);
|
||||
BOOL WINAPI GetNamedPipeInfo(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD);
|
||||
|
|
Loading…
Reference in a new issue