mirror of
https://github.com/reactos/reactos.git
synced 2025-01-06 06:20:13 +00:00
- Implement RtlFindCharInUnicodeString
- Implement RtlInitializeSListHead, RtlFirstEntrySList, RtlQueryDepthSList Based on Wine implementation svn path=/trunk/; revision=36931
This commit is contained in:
parent
7661ad3e1c
commit
df2aabc6ab
2 changed files with 187 additions and 96 deletions
|
@ -19,21 +19,33 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlInitializeSListHead(IN PSLIST_HEADER ListHead)
|
RtlInitializeSListHead(IN PSLIST_HEADER ListHead)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN64
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
|
#else
|
||||||
|
ListHead->Alignment = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PSLIST_ENTRY
|
PSLIST_ENTRY
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlFirstEntrySList(IN const SLIST_HEADER *ListHead)
|
RtlFirstEntrySList(IN const SLIST_HEADER *ListHead)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN64
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#else
|
||||||
|
return ListHead->Next.Next;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
WORD
|
WORD
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlQueryDepthSList(IN PSLIST_HEADER ListHead)
|
RtlQueryDepthSList(IN PSLIST_HEADER ListHead)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN64
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return 0;
|
return 0;
|
||||||
|
#else
|
||||||
|
return ListHead->Depth;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -2240,6 +2240,85 @@ RtlFindCharInUnicodeString(IN ULONG Flags,
|
||||||
IN PCUNICODE_STRING MatchString,
|
IN PCUNICODE_STRING MatchString,
|
||||||
OUT PUSHORT Position)
|
OUT PUSHORT Position)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
int main_idx;
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
unsigned int search_idx;
|
||||||
|
|
||||||
|
switch (Flags)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
for (main_idx = 0; main_idx < SearchString->Length / sizeof(WCHAR); main_idx++)
|
||||||
|
{
|
||||||
|
for (search_idx = 0; search_idx < MatchString->Length / sizeof(WCHAR); search_idx++)
|
||||||
|
{
|
||||||
|
if (SearchString->Buffer[main_idx] == MatchString->Buffer[search_idx])
|
||||||
|
{
|
||||||
|
*Position = (main_idx + 1) * sizeof(WCHAR);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*Position = 0;
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
for (main_idx = SearchString->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--)
|
||||||
|
{
|
||||||
|
for (search_idx = 0; search_idx < MatchString->Length / sizeof(WCHAR); search_idx++)
|
||||||
|
{
|
||||||
|
if (SearchString->Buffer[main_idx] == MatchString->Buffer[search_idx])
|
||||||
|
{
|
||||||
|
*Position = main_idx * sizeof(WCHAR);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*Position = 0;
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
for (main_idx = 0; main_idx < SearchString->Length / sizeof(WCHAR); main_idx++)
|
||||||
|
{
|
||||||
|
search_idx = 0;
|
||||||
|
while (search_idx < MatchString->Length / sizeof(WCHAR) &&
|
||||||
|
SearchString->Buffer[main_idx] != MatchString->Buffer[search_idx])
|
||||||
|
{
|
||||||
|
search_idx++;
|
||||||
|
}
|
||||||
|
if (search_idx >= MatchString->Length / sizeof(WCHAR))
|
||||||
|
{
|
||||||
|
*Position = (main_idx + 1) * sizeof(WCHAR);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*Position = 0;
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
for (main_idx = SearchString->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--)
|
||||||
|
{
|
||||||
|
search_idx = 0;
|
||||||
|
while (search_idx < MatchString->Length / sizeof(WCHAR) &&
|
||||||
|
SearchString->Buffer[main_idx] != MatchString->Buffer[search_idx])
|
||||||
|
{
|
||||||
|
search_idx++;
|
||||||
|
}
|
||||||
|
if (search_idx >= MatchString->Length / sizeof(WCHAR))
|
||||||
|
{
|
||||||
|
*Position = main_idx * sizeof(WCHAR);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*Position = 0;
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
}
|
||||||
|
} /* switch */
|
||||||
|
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue