Commit 35d5d06a authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Implemented RtlDosPathNameToNtPathName_U, RtlGetCurrentDirectory_U,

RtlGetFullPathName_U and RtlSetCurrentDirectory_U (the last one partially as we can't test whether a path exists or not).
parent caa44e6e
...@@ -348,9 +348,9 @@ ...@@ -348,9 +348,9 @@
@ stub RtlDestroyProcessParameters @ stub RtlDestroyProcessParameters
@ stub RtlDestroyQueryDebugBuffer @ stub RtlDestroyQueryDebugBuffer
@ stdcall RtlDetermineDosPathNameType_U(wstr) @ stdcall RtlDetermineDosPathNameType_U(wstr)
@ stub RtlDoesFileExists_U @ stub RtlDoesFileExists_U #(wstr)
@ stdcall RtlDosPathNameToNtPathName_U(ptr ptr long long) @ stdcall RtlDosPathNameToNtPathName_U(wstr ptr ptr ptr)
@ stub RtlDosSearchPath_U @ stub RtlDosSearchPath_U #(wstr wstr wstr long ptr ptr)
@ stdcall RtlDowncaseUnicodeChar(long) @ stdcall RtlDowncaseUnicodeChar(long)
@ stdcall RtlDowncaseUnicodeString(ptr ptr long) @ stdcall RtlDowncaseUnicodeString(ptr ptr long)
@ stdcall RtlDumpResource(ptr) @ stdcall RtlDumpResource(ptr)
...@@ -408,10 +408,10 @@ ...@@ -408,10 +408,10 @@
@ stub RtlGetCallersAddress @ stub RtlGetCallersAddress
@ stub RtlGetCompressionWorkSpaceSize @ stub RtlGetCompressionWorkSpaceSize
@ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr) @ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr)
@ stub RtlGetCurrentDirectory_U @ stdcall RtlGetCurrentDirectory_U(long ptr)
@ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) @ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr)
@ stub RtlGetElementGenericTable @ stub RtlGetElementGenericTable
@ stub RtlGetFullPathName_U @ stdcall RtlGetFullPathName_U(wstr long ptr ptr)
@ stdcall RtlGetGroupSecurityDescriptor(ptr ptr ptr) @ stdcall RtlGetGroupSecurityDescriptor(ptr ptr ptr)
@ stdcall RtlGetLongestNtPathLength() @ stdcall RtlGetLongestNtPathLength()
@ stub RtlGetNtGlobalFlags @ stub RtlGetNtGlobalFlags
...@@ -511,7 +511,7 @@ ...@@ -511,7 +511,7 @@
@ stub RtlSelfRelativeToAbsoluteSD @ stub RtlSelfRelativeToAbsoluteSD
@ stdcall RtlSetAllBits(ptr) @ stdcall RtlSetAllBits(ptr)
@ stdcall RtlSetBits(ptr long long) @ stdcall RtlSetBits(ptr long long)
@ stub RtlSetCurrentDirectory_U @ stdcall RtlSetCurrentDirectory_U(ptr)
@ stdcall RtlSetCurrentEnvironment(wstr ptr) @ stdcall RtlSetCurrentEnvironment(wstr ptr)
@ stdcall RtlSetDaclSecurityDescriptor(ptr long ptr long) @ stdcall RtlSetDaclSecurityDescriptor(ptr long ptr long)
@ stdcall RtlSetEnvironmentVariable(ptr ptr ptr) @ stdcall RtlSetEnvironmentVariable(ptr ptr ptr)
......
...@@ -370,55 +370,6 @@ void WINAPI NTDLL_alloca_probe( CONTEXT86 *context ) ...@@ -370,55 +370,6 @@ void WINAPI NTDLL_alloca_probe( CONTEXT86 *context )
context->Esp -= context->Eax; context->Esp -= context->Eax;
} }
/**************************************************************************
* RtlDosPathNameToNtPathName_U [NTDLL.@]
*
* szwDosPath: a fully qualified DOS path name
* ntpath: pointer to a UNICODE_STRING to hold the converted
* path name
*
* FIXME: Should we not allocate the ntpath buffer under some
* circumstances?
* Are the conversions static? (always prepend '\??\' ?)
* Not really sure about the last two arguments.
*/
BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(
LPWSTR szwDosPath,PUNICODE_STRING ntpath,
DWORD x2,DWORD x3)
{
ULONG length;
UNICODE_STRING pathprefix;
WCHAR szPrefix[] = { '\\', '?', '?', '\\', 0 };
FIXME("(%s,%p,%08lx,%08lx) partial stub\n",
debugstr_w(szwDosPath),ntpath,x2,x3);
if ( !szwDosPath )
return FALSE;
if ( !szwDosPath[0] )
return FALSE;
if ( szwDosPath[1]!= ':' )
return FALSE;
length = strlenW(szwDosPath) * sizeof (WCHAR) + sizeof szPrefix;
ntpath->Buffer = RtlAllocateHeap(ntdll_get_process_heap(), 0, length);
ntpath->Length = 0;
ntpath->MaximumLength = length;
if ( !ntpath->Buffer )
return FALSE;
RtlInitUnicodeString( &pathprefix, szPrefix );
RtlCopyUnicodeString( ntpath, &pathprefix );
RtlAppendUnicodeToString( ntpath, szwDosPath );
return TRUE;
}
/****************************************************************************** /******************************************************************************
* RtlInitializeGenericTable [NTDLL.@] * RtlInitializeGenericTable [NTDLL.@]
*/ */
...@@ -606,23 +557,6 @@ VOID WINAPI RtlFillMemoryUlong(ULONG* lpDest, ULONG ulCount, ULONG ulValue) ...@@ -606,23 +557,6 @@ VOID WINAPI RtlFillMemoryUlong(ULONG* lpDest, ULONG ulCount, ULONG ulValue)
*lpDest++ = ulValue; *lpDest++ = ulValue;
} }
/*************************************************************************
* RtlGetLongestNtPathLength [NTDLL.@]
*
* Get the longest allowed path length
*
* PARAMS
* None.
*
* RETURNS
* The longest allowed path length (277 characters under Win2k).
*/
DWORD WINAPI RtlGetLongestNtPathLength(void)
{
TRACE("()\n");
return 277;
}
/********************************************************************* /*********************************************************************
* RtlComputeCrc32 [NTDLL.@] * RtlComputeCrc32 [NTDLL.@]
* *
......
...@@ -95,6 +95,12 @@ typedef struct _CLIENT_ID ...@@ -95,6 +95,12 @@ typedef struct _CLIENT_ID
HANDLE UniqueThread; HANDLE UniqueThread;
} CLIENT_ID, *PCLIENT_ID; } CLIENT_ID, *PCLIENT_ID;
typedef struct _CURDIR
{
UNICODE_STRING DosPath;
PVOID Handle;
} CURDIR, *PCURDIR;
/*********************************************************************** /***********************************************************************
* Enums * Enums
*/ */
...@@ -965,7 +971,7 @@ DWORD WINAPI RtlDeleteSecurityObject(DWORD); ...@@ -965,7 +971,7 @@ DWORD WINAPI RtlDeleteSecurityObject(DWORD);
NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR); NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR);
HANDLE WINAPI RtlDestroyHeap(HANDLE); HANDLE WINAPI RtlDestroyHeap(HANDLE);
DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR); DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U(PCWSTR);
BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(LPWSTR,PUNICODE_STRING,DWORD,DWORD); BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(LPWSTR,PUNICODE_STRING,PWSTR*,CURDIR*);
WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR); WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN); NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
void WINAPI RtlDumpResource(LPRTL_RWLOCK); void WINAPI RtlDumpResource(LPRTL_RWLOCK);
...@@ -1014,9 +1020,11 @@ void WINAPI RtlFreeUnicodeString(PUNICODE_STRING); ...@@ -1014,9 +1020,11 @@ void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
DWORD WINAPI RtlGetAce(PACL,DWORD,LPVOID *); DWORD WINAPI RtlGetAce(PACL,DWORD,LPVOID *);
NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD); NTSTATUS WINAPI RtlGetControlSecurityDescriptor(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
NTSTATUS WINAPI RtlGetCurrentDirectory_U(ULONG, LPWSTR);
NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN); NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*); ULONG WINAPI RtlGetFullPathName_U(PCWSTR,ULONG,PWSTR,PWSTR*);
NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN); NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
DWORD WINAPI RtlGetLongestNtPathLength(void);
BOOLEAN WINAPI RtlGetNtProductType(LPDWORD); BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN); NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*); ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
...@@ -1093,6 +1101,7 @@ void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *); ...@@ -1093,6 +1101,7 @@ void WINAPI RtlSecondsSince1970ToTime(DWORD,LARGE_INTEGER *);
void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *); void WINAPI RtlSecondsSince1980ToTime(DWORD,LARGE_INTEGER *);
void WINAPI RtlSetAllBits(PRTL_BITMAP); void WINAPI RtlSetAllBits(PRTL_BITMAP);
void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG); void WINAPI RtlSetBits(PRTL_BITMAP,ULONG,ULONG);
NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING*);
void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*); void WINAPI RtlSetCurrentEnvironment(PWSTR, PWSTR*);
NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN); NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING); NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR*,PUNICODE_STRING,PUNICODE_STRING);
......
...@@ -471,6 +471,17 @@ static BOOL process_init( char *argv[] ) ...@@ -471,6 +471,17 @@ static BOOL process_init( char *argv[] )
/* Parse command line arguments */ /* Parse command line arguments */
OPTIONS_ParseOptions( !info_size ? argv : NULL ); OPTIONS_ParseOptions( !info_size ? argv : NULL );
/* <hack: to be changed later on> */
build_initial_environment();
process_pmts.CurrentDirectoryName.Length = 3 * sizeof(WCHAR);
process_pmts.CurrentDirectoryName.MaximumLength = RtlGetLongestNtPathLength() * sizeof(WCHAR);
process_pmts.CurrentDirectoryName.Buffer = RtlAllocateHeap( ntdll_get_process_heap(), 0, process_pmts.CurrentDirectoryName.MaximumLength);
process_pmts.CurrentDirectoryName.Buffer[0] = 'C';
process_pmts.CurrentDirectoryName.Buffer[1] = ':';
process_pmts.CurrentDirectoryName.Buffer[2] = '\\';
process_pmts.CurrentDirectoryName.Buffer[3] = '\0';
/* </hack: to be changed later on> */
ret = MAIN_MainInit(); ret = MAIN_MainInit();
if (TRACE_ON(relay) || TRACE_ON(snoop)) RELAY_InitDebugLists(); if (TRACE_ON(relay) || TRACE_ON(snoop)) RELAY_InitDebugLists();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment