Split out the resource functions for finer control of debug output.

svn path=/trunk/; revision=3832
This commit is contained in:
Robert Dickenson 2002-12-08 15:57:40 +00:00
parent 688e9b05d9
commit 61bb7ba7ad
9 changed files with 1407 additions and 1194 deletions

269
reactos/lib/ntdll/ldr/res.c Normal file
View file

@ -0,0 +1,269 @@
/* $Id: res.c,v 1.1 2002/12/08 15:57:40 robd Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/ntdll/ldr/res.c
* PURPOSE: Resource access for PE executables
* PROGRAMMERS: Jean Michault
* Rex Jolliff (rex@lvcablemodem.com)
* Robert Dickenson (robd@mok.lvcm.com)
*/
/*
* TODO:
* - any comments ??
*/
/* INCLUDES *****************************************************************/
#include <reactos/config.h>
#include <ddk/ntddk.h>
#include <windows.h>
#include <string.h>
#include <wchar.h>
#include <ntdll/ldr.h>
#include <ntos/minmax.h>
//#define NDEBUG
#define DBG
#include <ntdll/ntdll.h>
/* PROTOTYPES ****************************************************************/
/* FUNCTIONS *****************************************************************/
/*
Status = LdrFindResource_U (hModule,
&ResourceInfo,
RESOURCE_DATA_LEVEL,
&ResourceDataEntry);
*/
NTSTATUS STDCALL
LdrFindResource_U(PVOID BaseAddress,
PLDR_RESOURCE_INFO ResourceInfo,
ULONG Level,
PIMAGE_RESOURCE_DATA_ENTRY* ResourceDataEntry)
{
PIMAGE_RESOURCE_DIRECTORY ResDir;
PIMAGE_RESOURCE_DIRECTORY ResBase;
PIMAGE_RESOURCE_DIRECTORY_ENTRY ResEntry;
NTSTATUS Status = STATUS_SUCCESS;
ULONG EntryCount;
PWCHAR ws;
ULONG i;
ULONG Id;
//DPRINT("LdrFindResource_U()\n");
DPRINT("LdrFindResource_U(%08x, %08x, %d, %08x)\n", BaseAddress, ResourceInfo, Level, ResourceDataEntry);
/* Get the pointer to the resource directory */
ResDir = (PIMAGE_RESOURCE_DIRECTORY)RtlImageDirectoryEntryToData(BaseAddress,
TRUE, IMAGE_DIRECTORY_ENTRY_RESOURCE, &i);
if (ResDir == NULL) {
return STATUS_RESOURCE_DATA_NOT_FOUND;
}
DPRINT("ResourceDirectory: %x Size: %d\n", (ULONG)ResDir, (int)i);
ResBase = ResDir;
/* Let's go into resource tree */
for (i = 0; i < Level; i++) {
DPRINT("ResDir: %x Level: %d\n", (ULONG)ResDir, i);
Id = ((PULONG)ResourceInfo)[i];
// ResourceInfo.Type = (ULONG)lpType;
// ResourceInfo.Name = (ULONG)lpName;
// ResourceInfo.Language = (ULONG)wLanguage;
EntryCount = ResDir->NumberOfNamedEntries;
DPRINT(" Id: %d NumberOfNamedEntries: %d\n", Id, EntryCount);
ResEntry = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)(ResDir + 1);
//DPRINT("ResEntry %x\n", (ULONG)ResEntry);
if (Id & 0xFFFF0000) {
/* Resource name is a unicode string */
DPRINT("ResEntry %x - Resource name is a unicode string\n", (ULONG)ResEntry);
DPRINT("EntryCount %d\n", (ULONG)EntryCount);
for (; EntryCount--; ResEntry++) {
/* Scan entries for equal name */
if (ResEntry->Name & 0x80000000) {
ws = (PWCHAR)((ULONG)ResDir + (ResEntry->Name & 0x7FFFFFFF));
if (!wcsncmp((PWCHAR)Id, ws + 1, *ws) &&
wcslen((PWCHAR)Id) == (int)*ws) {
goto found;
}
}
}
} else {
/* We use ID number instead of string */
DPRINT("ResEntry %x - Resource ID number instead of string\n", (ULONG)ResEntry);
DPRINT("EntryCount %d\n", (ULONG)EntryCount);
ResEntry += EntryCount;
EntryCount = ResDir->NumberOfIdEntries;
DPRINT("EntryCount %d\n", (ULONG)EntryCount);
for (; EntryCount--; ResEntry++) {
/* Scan entries for equal name */
DPRINT("EntryCount %d ResEntry %x\n", (ULONG)EntryCount, ResEntry);
DPRINT("ResEntry->Name %x Id %x\n", (ULONG)ResEntry->Name, Id);
if (ResEntry->Name == Id) {
DPRINT("ID entry found %x\n", Id);
goto found;
}
}
}
//DPRINT("Error %lu\n", i);
switch (i) {
case 0:
DPRINT("Error %lu - STATUS_RESOURCE_TYPE_NOT_FOUND\n", i);
return STATUS_RESOURCE_TYPE_NOT_FOUND;
case 1:
DPRINT("Error %lu - STATUS_RESOURCE_NAME_NOT_FOUND\n", i);
return STATUS_RESOURCE_NAME_NOT_FOUND;
case 2:
if (ResDir->NumberOfNamedEntries || ResDir->NumberOfIdEntries) {
/* Use the first available language */
ResEntry = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)(ResDir + 1);
break;
}
DPRINT("Error %lu - STATUS_RESOURCE_LANG_NOT_FOUND\n", i);
return STATUS_RESOURCE_LANG_NOT_FOUND;
case 3:
DPRINT("Error %lu - STATUS_RESOURCE_DATA_NOT_FOUND\n", i);
return STATUS_RESOURCE_DATA_NOT_FOUND;
default:
DPRINT("Error %lu - STATUS_INVALID_PARAMETER\n", i);
return STATUS_INVALID_PARAMETER;
}
found:;
ResDir = (PIMAGE_RESOURCE_DIRECTORY)((ULONG)ResBase +
(ResEntry->OffsetToData & 0x7FFFFFFF));
}
DPRINT("ResourceDataEntry: %x\n", (ULONG)ResDir);
if (ResourceDataEntry) {
*ResourceDataEntry = (PVOID)ResDir;
}
return Status;
}
NTSTATUS STDCALL
LdrAccessResource(IN PVOID BaseAddress,
IN PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry,
OUT PVOID* Resource OPTIONAL,
OUT PULONG Size OPTIONAL)
{
PIMAGE_SECTION_HEADER Section;
PIMAGE_NT_HEADERS NtHeader;
ULONG SectionRva;
ULONG SectionVa;
ULONG DataSize;
ULONG Offset = 0;
ULONG Data;
Data = (ULONG)RtlImageDirectoryEntryToData(BaseAddress,
TRUE, IMAGE_DIRECTORY_ENTRY_RESOURCE, &DataSize);
if (Data == 0) {
return STATUS_RESOURCE_DATA_NOT_FOUND;
}
if ((ULONG)BaseAddress & 1) {
/* loaded as ordinary file */
NtHeader = RtlImageNtHeader((PVOID)((ULONG)BaseAddress & ~1UL));
Offset = (ULONG)BaseAddress - Data + NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress;
Section = RtlImageRvaToSection(NtHeader, BaseAddress, NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress);
if (Section == NULL) {
return STATUS_RESOURCE_DATA_NOT_FOUND;
}
if (Section->Misc.VirtualSize < ResourceDataEntry->OffsetToData) {
SectionRva = RtlImageRvaToSection (NtHeader, BaseAddress, ResourceDataEntry->OffsetToData)->VirtualAddress;
SectionVa = RtlImageRvaToVa(NtHeader, BaseAddress, SectionRva, NULL);
Offset = SectionRva - SectionVa + Data - Section->VirtualAddress;
}
}
if (Resource) {
*Resource = (PVOID)(ResourceDataEntry->OffsetToData - Offset + (ULONG)BaseAddress);
}
if (Size) {
*Size = ResourceDataEntry->Size;
}
return STATUS_SUCCESS;
}
NTSTATUS STDCALL
LdrFindResourceDirectory_U(IN PVOID BaseAddress,
WCHAR** name,
DWORD level,
OUT PVOID* addr)
{
PIMAGE_RESOURCE_DIRECTORY ResDir;
PIMAGE_RESOURCE_DIRECTORY_ENTRY ResEntry;
ULONG EntryCount;
ULONG i;
NTSTATUS Status = STATUS_SUCCESS;
WCHAR* ws;
/* Get the pointer to the resource directory */
ResDir = (PIMAGE_RESOURCE_DIRECTORY)
RtlImageDirectoryEntryToData(BaseAddress, TRUE, IMAGE_DIRECTORY_ENTRY_RESOURCE, &i);
if (ResDir == NULL) {
return STATUS_RESOURCE_DATA_NOT_FOUND;
}
/* Let's go into resource tree */
for (i = 0; i < level; i++, name++) {
EntryCount = ResDir->NumberOfNamedEntries;
ResEntry = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)(ResDir + 1);
if ((ULONG)(*name) & 0xFFFF0000) {
/* Resource name is a unicode string */
for (; EntryCount--; ResEntry++) {
/* Scan entries for equal name */
if (ResEntry->Name & 0x80000000) {
ws = (WCHAR*)((ULONG)ResDir + (ResEntry->Name & 0x7FFFFFFF));
if (!wcsncmp(*name, ws + 1, *ws) && wcslen(*name) == (int)*ws) {
goto found;
}
}
}
} else {
/* We use ID number instead of string */
ResEntry += EntryCount;
EntryCount = ResDir->NumberOfIdEntries;
for (; EntryCount--; ResEntry++) {
/* Scan entries for equal name */
if (ResEntry->Name == (ULONG)(*name))
goto found;
}
}
switch (i) {
case 0:
return STATUS_RESOURCE_TYPE_NOT_FOUND;
case 1:
return STATUS_RESOURCE_NAME_NOT_FOUND;
case 2:
Status = STATUS_RESOURCE_LANG_NOT_FOUND;
/* Just use first language entry */
if (ResDir->NumberOfNamedEntries || ResDir->NumberOfIdEntries) {
ResEntry = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)(ResDir + 1);
break;
}
return Status;
case 3:
return STATUS_RESOURCE_DATA_NOT_FOUND;
default:
return STATUS_INVALID_PARAMETER;
}
found:;
ResDir = (PIMAGE_RESOURCE_DIRECTORY)((ULONG)ResDir + ResEntry->OffsetToData);
}
if (addr) {
*addr = (PVOID)ResDir;
}
return Status;
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: startup.c,v 1.46 2002/11/15 22:06:01 ekohl Exp $ /* $Id: startup.c,v 1.47 2002/12/08 15:57:40 robd Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel

View file

@ -1,8 +1,8 @@
/* $Id: utils.c,v 1.57 2002/10/01 19:27:20 chorns Exp $ /* $Id: utils.c,v 1.58 2002/12/08 15:57:40 robd Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: lib/ntdll/ldr/startup.c * FILE: lib/ntdll/ldr/utils.c
* PURPOSE: Process startup for PE executables * PURPOSE: Process startup for PE executables
* PROGRAMMERS: Jean Michault * PROGRAMMERS: Jean Michault
* Rex Jolliff (rex@lvcablemodem.com) * Rex Jolliff (rex@lvcablemodem.com)
@ -136,8 +136,7 @@ LdrAdjustDllName (PUNICODE_STRING FullDllName,
memmove (Buffer + Length, L".dll", 10); memmove (Buffer + Length, L".dll", 10);
} }
RtlCreateUnicodeString (FullDllName, RtlCreateUnicodeString(FullDllName, Buffer);
Buffer);
} }
PLDR_MODULE PLDR_MODULE
@ -145,9 +144,7 @@ LdrAddModuleEntry(PVOID ImageBase, PIMAGE_NT_HEADERS NTHeaders,
PWSTR FullDosName) PWSTR FullDosName)
{ {
PLDR_MODULE Module; PLDR_MODULE Module;
Module = RtlAllocateHeap(RtlGetProcessHeap(), Module = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof (LDR_MODULE));
0,
sizeof (LDR_MODULE));
assert(Module); assert(Module);
Module->BaseAddress = (PVOID)ImageBase; Module->BaseAddress = (PVOID)ImageBase;
Module->EntryPoint = NTHeaders->OptionalHeader.AddressOfEntryPoint; Module->EntryPoint = NTHeaders->OptionalHeader.AddressOfEntryPoint;
@ -158,9 +155,7 @@ LdrAddModuleEntry(PVOID ImageBase, PIMAGE_NT_HEADERS NTHeaders,
{ {
/* loading while app is running */ /* loading while app is running */
Module->LoadCount = 1; Module->LoadCount = 1;
} } else {
else
{
/* /*
* loading while app is initializing * loading while app is initializing
* dll must not be unloaded * dll must not be unloaded
@ -384,8 +379,7 @@ LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
PAGE_READWRITE); PAGE_READWRITE);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DbgPrint("NTDLL.LDR: map view of section failed (Status %x)\n", DbgPrint("NTDLL.LDR: map view of section failed (Status %x)\n", Status);
Status);
ZwClose(FileHandle); ZwClose(FileHandle);
return(Status); return(Status);
} }
@ -1301,6 +1295,7 @@ LdrUnloadDll (IN PVOID BaseAddress)
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
#if 0 /*MOVED_TO_FILE_RES_C*/
NTSTATUS STDCALL NTSTATUS STDCALL
LdrFindResource_U(PVOID BaseAddress, LdrFindResource_U(PVOID BaseAddress,
@ -1467,6 +1462,7 @@ LdrAccessResource(IN PVOID BaseAddress,
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
#endif /*MOVED_TO_FILE_RES_C*/
NTSTATUS STDCALL NTSTATUS STDCALL
LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress) LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress)
@ -1476,38 +1472,29 @@ LdrDisableThreadCalloutsForDll (IN PVOID BaseAddress)
PLDR_MODULE Module; PLDR_MODULE Module;
NTSTATUS Status; NTSTATUS Status;
DPRINT("LdrDisableThreadCalloutsForDll (BaseAddress %x)\n", DPRINT("LdrDisableThreadCalloutsForDll (BaseAddress %x)\n", BaseAddress);
BaseAddress);
Status = STATUS_DLL_NOT_FOUND; Status = STATUS_DLL_NOT_FOUND;
ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList; ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList;
Entry = ModuleListHead->Flink; Entry = ModuleListHead->Flink;
while (Entry != ModuleListHead) {
while (Entry != ModuleListHead)
{
Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList); Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
DPRINT("BaseDllName %wZ BaseAddress %x\n", DPRINT("BaseDllName %wZ BaseAddress %x\n", &Module->BaseDllName, Module->BaseAddress);
&Module->BaseDllName,
Module->BaseAddress);
if (Module->BaseAddress == BaseAddress) if (Module->BaseAddress == BaseAddress) {
{ if (Module->TlsIndex == 0) {
if (Module->TlsIndex == 0)
{
Module->Flags |= 0x00040000; Module->Flags |= 0x00040000;
Status = STATUS_SUCCESS; Status = STATUS_SUCCESS;
} }
return Status; return Status;
} }
Entry = Entry->Flink; Entry = Entry->Flink;
} }
return Status; return Status;
} }
#if 0 /*MOVED_TO_FILE_RES_C*/
NTSTATUS STDCALL NTSTATUS STDCALL
LdrFindResourceDirectory_U (IN PVOID BaseAddress, LdrFindResourceDirectory_U (IN PVOID BaseAddress,
@ -1603,8 +1590,10 @@ found:;
return Status; return Status;
} }
#endif /*MOVED_TO_FILE_RES_C*/
NTSTATUS STDCALL NTSTATUS
STDCALL
LdrGetDllHandle(IN ULONG Unknown1, LdrGetDllHandle(IN ULONG Unknown1,
IN ULONG Unknown2, IN ULONG Unknown2,
IN PUNICODE_STRING DllName, IN PUNICODE_STRING DllName,
@ -1619,44 +1608,34 @@ LdrGetDllHandle (IN ULONG Unknown1,
Unknown1, Unknown2, DllName, BaseAddress); Unknown1, Unknown2, DllName, BaseAddress);
/* NULL is the current executable */ /* NULL is the current executable */
if ( DllName == NULL ) if (DllName == NULL) {
{
*BaseAddress = NtCurrentPeb()->ImageBaseAddress; *BaseAddress = NtCurrentPeb()->ImageBaseAddress;
DPRINT("BaseAddress %x\n", *BaseAddress); DPRINT("BaseAddress %x\n", *BaseAddress);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
LdrAdjustDllName(&FullDllName, DllName, TRUE);
LdrAdjustDllName (&FullDllName, DPRINT("FullDllName %wZ\n", &FullDllName);
DllName,
TRUE);
DPRINT("FullDllName %wZ\n",
&FullDllName);
ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList; ModuleListHead = &NtCurrentPeb()->Ldr->InLoadOrderModuleList;
Entry = ModuleListHead->Flink; Entry = ModuleListHead->Flink;
while (Entry != ModuleListHead) {
while (Entry != ModuleListHead)
{
Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList); Module = CONTAINING_RECORD(Entry, LDR_MODULE, InLoadOrderModuleList);
DPRINT("EntryPoint %x\n", Module->EntryPoint); DPRINT("EntryPoint %x\n", Module->EntryPoint);
DPRINT("Comparing %wZ and %wZ\n", DPRINT("Comparing %wZ and %wZ\n", &Module->BaseDllName, &FullDllName);
&Module->BaseDllName,
&FullDllName);
if (!RtlCompareUnicodeString(&Module->BaseDllName, &FullDllName, TRUE)) if (!RtlCompareUnicodeString(&Module->BaseDllName, &FullDllName, TRUE)) {
{
RtlFreeUnicodeString(&FullDllName); RtlFreeUnicodeString(&FullDllName);
*BaseAddress = Module->BaseAddress; *BaseAddress = Module->BaseAddress;
DPRINT("BaseAddress %x\n", *BaseAddress); DPRINT("BaseAddress %x\n", *BaseAddress);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
Entry = Entry->Flink; Entry = Entry->Flink;
} }
DPRINT("Failed to find dll %wZ\n", &FullDllName); DPRINT("Failed to find dll %wZ\n", &FullDllName);
RtlFreeUnicodeString(&FullDllName); RtlFreeUnicodeString(&FullDllName);
*BaseAddress = NULL; *BaseAddress = NULL;
return STATUS_DLL_NOT_FOUND; return STATUS_DLL_NOT_FOUND;

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.75 2002/10/26 00:32:18 chorns Exp $ # $Id: makefile,v 1.76 2002/12/08 15:57:39 robd Exp $
PATH_TO_TOP = ../.. PATH_TO_TOP = ../..
@ -68,6 +68,7 @@ TARGET_OBJECTS = \
$(STDLIB_OBJECTS) \ $(STDLIB_OBJECTS) \
$(STRING_OBJECTS) \ $(STRING_OBJECTS) \
stubs/stubs.o \ stubs/stubs.o \
ldr/res.o \
ldr/utils.o \ ldr/utils.o \
$(CSR_OBJECTS) $(CSR_OBJECTS)

View file

@ -1,4 +1,4 @@
/* $Id: error.c,v 1.11 2002/09/08 10:23:05 chorns Exp $ /* $Id: error.c,v 1.12 2002/12/08 15:57:38 robd Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -826,12 +826,10 @@ RPC_NT_SS_CONTEXT_MISMATCH ERROR_INVALID_HANDLE
VOID VOID
STDCALL STDCALL
RtlAssert ( RtlAssert(PVOID FailedAssertion,
PVOID FailedAssertion,
PVOID FileName, PVOID FileName,
ULONG LineNumber, ULONG LineNumber,
PCHAR Message PCHAR Message)
)
{ {
DbgPrint ("Assertion \'%s\' failed at %s line %d: %s\n", DbgPrint ("Assertion \'%s\' failed at %s line %d: %s\n",
(PCHAR)FailedAssertion, (PCHAR)FailedAssertion,

View file

@ -1,4 +1,4 @@
/* $Id: largeint.c,v 1.9 2002/09/08 10:23:05 chorns Exp $ /* $Id: largeint.c,v 1.10 2002/12/08 15:57:39 robd Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -121,11 +121,9 @@ RtlExtendedLargeIntegerDivide (
LARGE_INTEGER LARGE_INTEGER
STDCALL STDCALL
RtlExtendedMagicDivide ( RtlExtendedMagicDivide(LARGE_INTEGER Dividend,
LARGE_INTEGER Dividend,
LARGE_INTEGER MagicDivisor, LARGE_INTEGER MagicDivisor,
CCHAR ShiftCount CCHAR ShiftCount)
)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }

View file

@ -1,4 +1,4 @@
/* $Id: mem.c,v 1.11 2002/09/08 10:23:05 chorns Exp $ /* $Id: mem.c,v 1.12 2002/12/08 15:57:39 robd Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -18,7 +18,9 @@
ULONG ULONG
STDCALL STDCALL
RtlCompareMemory(PVOID Source1, PVOID Source2, ULONG Length) RtlCompareMemory(PVOID Source1,
PVOID Source2,
ULONG Length)
/* /*
* FUNCTION: Compares blocks of memory and returns the number of equal bytes * FUNCTION: Compares blocks of memory and returns the number of equal bytes
* ARGUMENTS: * ARGUMENTS:
@ -95,11 +97,7 @@ RtlFillMemory (
UCHAR Fill UCHAR Fill
) )
{ {
memset ( memset(Destination, Fill, Length);
Destination,
Fill,
Length
);
} }
VOID VOID
@ -122,21 +120,6 @@ RtlFillMemoryUlong (
} }
VOID
STDCALL
RtlZeroMemory (
PVOID Destination,
ULONG Length
)
{
RtlFillMemory (
Destination,
Length,
0
);
}
VOID VOID
STDCALL STDCALL
RtlMoveMemory ( RtlMoveMemory (
@ -153,4 +136,19 @@ RtlMoveMemory (
} }
VOID
STDCALL
RtlZeroMemory (
PVOID Destination,
ULONG Length
)
{
RtlFillMemory (
Destination,
Length,
0
);
}
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: time.c,v 1.13 2002/09/30 20:57:54 hbirr Exp $ /* $Id: time.c,v 1.14 2002/12/08 15:57:39 robd Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -55,42 +55,10 @@ static __inline void NormalizeTimeFields(CSHORT *FieldToNormalize,
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
VOID STDCALL VOID
RtlTimeToElapsedTimeFields(IN PLARGE_INTEGER Time, STDCALL
OUT PTIME_FIELDS TimeFields) RtlTimeToTimeFields(
{ PLARGE_INTEGER liTime,
ULONGLONG ElapsedSeconds;
ULONG SecondsInDay;
ULONG SecondsInMinute;
/* Extract millisecond from time */
TimeFields->Milliseconds = (CSHORT)((Time->QuadPart % TICKSPERSEC) / TICKSPERMSEC);
/* Compute elapsed seconds */
ElapsedSeconds = (ULONGLONG)Time->QuadPart / TICKSPERSEC;
/* Compute seconds within the day */
SecondsInDay = ElapsedSeconds % SECSPERDAY;
/* Compute elapsed minutes within the day */
SecondsInMinute = SecondsInDay % SECSPERHOUR;
/* Compute elapsed time of day */
TimeFields->Hour = (CSHORT)(SecondsInDay / SECSPERHOUR);
TimeFields->Minute = (CSHORT)(SecondsInMinute / SECSPERMIN);
TimeFields->Second = (CSHORT)(SecondsInMinute % SECSPERMIN);
/* Compute elapsed days */
TimeFields->Day = (CSHORT)(ElapsedSeconds / SECSPERDAY);
/* The elapsed number of months and days cannot be calculated */
TimeFields->Month = 0;
TimeFields->Year = 0;
}
VOID STDCALL
RtlTimeToTimeFields(PLARGE_INTEGER liTime,
PTIME_FIELDS TimeFields) PTIME_FIELDS TimeFields)
{ {
const int *Months; const int *Months;
@ -169,11 +137,14 @@ RtlTimeToTimeFields(PLARGE_INTEGER liTime,
} }
BOOLEAN STDCALL BOOLEAN
RtlTimeFieldsToTime(PTIME_FIELDS tfTimeFields, STDCALL
RtlTimeFieldsToTime(
PTIME_FIELDS tfTimeFields,
PLARGE_INTEGER Time) PLARGE_INTEGER Time)
{ {
int CurYear, CurMonth; int CurYear;
int CurMonth;
long long int rcTime; long long int rcTime;
TIME_FIELDS TimeFields = *tfTimeFields; TIME_FIELDS TimeFields = *tfTimeFields;
@ -233,8 +204,10 @@ RtlTimeFieldsToTime(PTIME_FIELDS tfTimeFields,
} }
VOID STDCALL VOID
RtlSecondsSince1970ToTime(ULONG SecondsSince1970, STDCALL
RtlSecondsSince1970ToTime(
ULONG SecondsSince1970,
PLARGE_INTEGER Time) PLARGE_INTEGER Time)
{ {
LONGLONG llTime; LONGLONG llTime;
@ -245,8 +218,10 @@ RtlSecondsSince1970ToTime(ULONG SecondsSince1970,
} }
VOID STDCALL VOID
RtlSecondsSince1980ToTime(ULONG SecondsSince1980, STDCALL
RtlSecondsSince1980ToTime(
ULONG SecondsSince1980,
PLARGE_INTEGER Time) PLARGE_INTEGER Time)
{ {
LONGLONG llTime; LONGLONG llTime;
@ -257,8 +232,10 @@ RtlSecondsSince1980ToTime(ULONG SecondsSince1980,
} }
BOOLEAN STDCALL BOOLEAN
RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, STDCALL
RtlTimeToSecondsSince1970(
PLARGE_INTEGER Time,
PULONG SecondsSince1970) PULONG SecondsSince1970)
{ {
LARGE_INTEGER liTime; LARGE_INTEGER liTime;
@ -267,16 +244,18 @@ RtlTimeToSecondsSince1970(PLARGE_INTEGER Time,
liTime.QuadPart = liTime.QuadPart / TICKSPERSEC; liTime.QuadPart = liTime.QuadPart / TICKSPERSEC;
if (liTime.u.HighPart != 0) if (liTime.u.HighPart != 0)
return(FALSE); return FALSE;
*SecondsSince1970 = liTime.u.LowPart; *SecondsSince1970 = liTime.u.LowPart;
return(TRUE); return TRUE;
} }
BOOLEAN STDCALL BOOLEAN
RtlTimeToSecondsSince1980(PLARGE_INTEGER Time, STDCALL
RtlTimeToSecondsSince1980(
PLARGE_INTEGER Time,
PULONG SecondsSince1980) PULONG SecondsSince1980)
{ {
LARGE_INTEGER liTime; LARGE_INTEGER liTime;
@ -285,15 +264,16 @@ RtlTimeToSecondsSince1980(PLARGE_INTEGER Time,
liTime.QuadPart = liTime.QuadPart / TICKSPERSEC; liTime.QuadPart = liTime.QuadPart / TICKSPERSEC;
if (liTime.u.HighPart != 0) if (liTime.u.HighPart != 0)
return(FALSE); return FALSE;
*SecondsSince1980 = liTime.u.LowPart; *SecondsSince1980 = liTime.u.LowPart;
return(TRUE); return TRUE;
} }
NTSTATUS STDCALL NTSTATUS
STDCALL
RtlLocalTimeToSystemTime(PLARGE_INTEGER LocalTime, RtlLocalTimeToSystemTime(PLARGE_INTEGER LocalTime,
PLARGE_INTEGER SystemTime) PLARGE_INTEGER SystemTime)
{ {
@ -314,7 +294,8 @@ RtlLocalTimeToSystemTime(PLARGE_INTEGER LocalTime,
} }
NTSTATUS STDCALL NTSTATUS
STDCALL
RtlSystemTimeToLocalTime(PLARGE_INTEGER SystemTime, RtlSystemTimeToLocalTime(PLARGE_INTEGER SystemTime,
PLARGE_INTEGER LocalTime) PLARGE_INTEGER LocalTime)
{ {
@ -334,4 +315,40 @@ RtlSystemTimeToLocalTime(PLARGE_INTEGER SystemTime,
return(STATUS_SUCCESS); return(STATUS_SUCCESS);
} }
VOID
STDCALL
RtlTimeToElapsedTimeFields(IN PLARGE_INTEGER Time,
OUT PTIME_FIELDS TimeFields)
{
ULONGLONG ElapsedSeconds;
ULONG SecondsInDay;
ULONG SecondsInMinute;
/* Extract millisecond from time */
TimeFields->Milliseconds = (CSHORT)((Time->QuadPart % TICKSPERSEC) / TICKSPERMSEC);
/* Compute elapsed seconds */
ElapsedSeconds = (ULONGLONG)Time->QuadPart / TICKSPERSEC;
/* Compute seconds within the day */
SecondsInDay = ElapsedSeconds % SECSPERDAY;
/* Compute elapsed minutes within the day */
SecondsInMinute = SecondsInDay % SECSPERHOUR;
/* Compute elapsed time of day */
TimeFields->Hour = (CSHORT)(SecondsInDay / SECSPERHOUR);
TimeFields->Minute = (CSHORT)(SecondsInMinute / SECSPERMIN);
TimeFields->Second = (CSHORT)(SecondsInMinute % SECSPERMIN);
/* Compute elapsed days */
TimeFields->Day = (CSHORT)(ElapsedSeconds / SECSPERDAY);
/* The elapsed number of months and days cannot be calculated */
TimeFields->Month = 0;
TimeFields->Year = 0;
}
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: unicode.c,v 1.24 2002/10/20 03:34:00 robd Exp $ /* $Id: unicode.c,v 1.25 2002/12/08 15:57:39 robd Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -22,8 +22,7 @@
WCHAR WCHAR
STDCALL STDCALL
RtlAnsiCharToUnicodeChar( RtlAnsiCharToUnicodeChar(
IN CHAR AnsiChar IN CHAR AnsiChar)
)
{ {
ULONG Size; ULONG Size;
WCHAR UnicodeChar; WCHAR UnicodeChar;
@ -46,8 +45,7 @@ RtlAnsiCharToUnicodeChar (
ULONG ULONG
STDCALL STDCALL
RtlAnsiStringToUnicodeSize( RtlAnsiStringToUnicodeSize(
IN PANSI_STRING AnsiString IN PANSI_STRING AnsiString)
)
{ {
ULONG Size; ULONG Size;
@ -64,8 +62,7 @@ STDCALL
RtlAnsiStringToUnicodeString( RtlAnsiStringToUnicodeString(
IN OUT PUNICODE_STRING DestinationString, IN OUT PUNICODE_STRING DestinationString,
IN PANSI_STRING SourceString, IN PANSI_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Length; ULONG Length;
@ -127,8 +124,7 @@ NTSTATUS
STDCALL STDCALL
RtlAppendAsciizToString( RtlAppendAsciizToString(
IN OUT PSTRING Destination, IN OUT PSTRING Destination,
IN PCSZ Source IN PCSZ Source)
)
{ {
ULONG Length; ULONG Length;
PCHAR Ptr; PCHAR Ptr;
@ -157,8 +153,7 @@ NTSTATUS
STDCALL STDCALL
RtlAppendStringToString( RtlAppendStringToString(
IN OUT PSTRING Destination, IN OUT PSTRING Destination,
IN PSTRING Source IN PSTRING Source)
)
{ {
PCHAR Ptr; PCHAR Ptr;
@ -185,8 +180,7 @@ NTSTATUS
STDCALL STDCALL
RtlAppendUnicodeStringToString( RtlAppendUnicodeStringToString(
IN OUT PUNICODE_STRING Destination, IN OUT PUNICODE_STRING Destination,
IN PUNICODE_STRING Source IN PUNICODE_STRING Source)
)
{ {
PWCHAR Src; PWCHAR Src;
PWCHAR Dest; PWCHAR Dest;
@ -288,8 +282,7 @@ STDCALL
RtlCompareString( RtlCompareString(
IN PSTRING String1, IN PSTRING String1,
IN PSTRING String2, IN PSTRING String2,
IN BOOLEAN CaseInsensitive IN BOOLEAN CaseInsensitive)
)
{ {
ULONG len1, len2; ULONG len1, len2;
PCHAR s1, s2; PCHAR s1, s2;
@ -336,8 +329,7 @@ STDCALL
RtlCompareUnicodeString( RtlCompareUnicodeString(
IN PUNICODE_STRING String1, IN PUNICODE_STRING String1,
IN PUNICODE_STRING String2, IN PUNICODE_STRING String2,
IN BOOLEAN CaseInsensitive IN BOOLEAN CaseInsensitive)
)
{ {
ULONG len1, len2; ULONG len1, len2;
PWCHAR s1, s2; PWCHAR s1, s2;
@ -383,8 +375,7 @@ VOID
STDCALL STDCALL
RtlCopyString( RtlCopyString(
IN OUT PSTRING DestinationString, IN OUT PSTRING DestinationString,
IN PSTRING SourceString IN PSTRING SourceString)
)
{ {
ULONG copylen, i; ULONG copylen, i;
PCHAR Src, Dest; PCHAR Src, Dest;
@ -416,8 +407,7 @@ VOID
STDCALL STDCALL
RtlCopyUnicodeString( RtlCopyUnicodeString(
IN OUT PUNICODE_STRING DestinationString, IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString IN PUNICODE_STRING SourceString)
)
{ {
ULONG copylen, i; ULONG copylen, i;
PWCHAR Src, Dest; PWCHAR Src, Dest;
@ -449,8 +439,7 @@ BOOLEAN
STDCALL STDCALL
RtlCreateUnicodeString( RtlCreateUnicodeString(
IN OUT PUNICODE_STRING Destination, IN OUT PUNICODE_STRING Destination,
IN PWSTR Source IN PWSTR Source)
)
{ {
ULONG Length; ULONG Length;
@ -473,8 +462,10 @@ RtlCreateUnicodeString (
} }
BOOLEAN STDCALL BOOLEAN
RtlCreateUnicodeStringFromAsciiz (OUT PUNICODE_STRING Destination, STDCALL
RtlCreateUnicodeStringFromAsciiz(
OUT PUNICODE_STRING Destination,
IN PCSZ Source) IN PCSZ Source)
{ {
ANSI_STRING AnsiString; ANSI_STRING AnsiString;
@ -496,8 +487,7 @@ STDCALL
RtlDowncaseUnicodeString( RtlDowncaseUnicodeString(
IN OUT PUNICODE_STRING DestinationString, IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString, IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
ULONG i; ULONG i;
PWCHAR Src, Dest; PWCHAR Src, Dest;
@ -547,8 +537,7 @@ BOOLEAN
STDCALL STDCALL
RtlEqualComputerName( RtlEqualComputerName(
IN PUNICODE_STRING ComputerName1, IN PUNICODE_STRING ComputerName1,
IN PUNICODE_STRING ComputerName2 IN PUNICODE_STRING ComputerName2)
)
{ {
return RtlEqualDomainName (ComputerName1, return RtlEqualDomainName (ComputerName1,
ComputerName2); ComputerName2);
@ -589,8 +578,7 @@ STDCALL
RtlEqualString( RtlEqualString(
IN PSTRING String1, IN PSTRING String1,
IN PSTRING String2, IN PSTRING String2,
IN BOOLEAN CaseInsensitive IN BOOLEAN CaseInsensitive)
)
{ {
ULONG i; ULONG i;
CHAR c1, c2; CHAR c1, c2;
@ -630,8 +618,7 @@ STDCALL
RtlEqualUnicodeString( RtlEqualUnicodeString(
IN PUNICODE_STRING String1, IN PUNICODE_STRING String1,
IN PUNICODE_STRING String2, IN PUNICODE_STRING String2,
IN BOOLEAN CaseInsensitive IN BOOLEAN CaseInsensitive)
)
{ {
ULONG i; ULONG i;
WCHAR wc1, wc2; WCHAR wc1, wc2;
@ -670,8 +657,7 @@ RtlEqualUnicodeString (
VOID VOID
STDCALL STDCALL
RtlEraseUnicodeString( RtlEraseUnicodeString(
IN PUNICODE_STRING String IN PUNICODE_STRING String)
)
{ {
if (String->Buffer == NULL) if (String->Buffer == NULL)
return; return;
@ -690,8 +676,7 @@ RtlEraseUnicodeString (
VOID VOID
STDCALL STDCALL
RtlFreeAnsiString( RtlFreeAnsiString(
IN PANSI_STRING AnsiString IN PANSI_STRING AnsiString)
)
{ {
if (AnsiString->Buffer == NULL) if (AnsiString->Buffer == NULL)
return; return;
@ -709,8 +694,7 @@ RtlFreeAnsiString (
VOID VOID
STDCALL STDCALL
RtlFreeOemString( RtlFreeOemString(
IN POEM_STRING OemString IN POEM_STRING OemString)
)
{ {
if (OemString->Buffer == NULL) if (OemString->Buffer == NULL)
return; return;
@ -728,8 +712,7 @@ RtlFreeOemString (
VOID VOID
STDCALL STDCALL
RtlFreeUnicodeString( RtlFreeUnicodeString(
IN PUNICODE_STRING UnicodeString IN PUNICODE_STRING UnicodeString)
)
{ {
if (UnicodeString->Buffer == NULL) if (UnicodeString->Buffer == NULL)
return; return;
@ -748,8 +731,7 @@ VOID
STDCALL STDCALL
RtlInitAnsiString( RtlInitAnsiString(
IN OUT PANSI_STRING DestinationString, IN OUT PANSI_STRING DestinationString,
IN PCSZ SourceString IN PCSZ SourceString)
)
{ {
ULONG DestSize; ULONG DestSize;
@ -772,8 +754,7 @@ VOID
STDCALL STDCALL
RtlInitString( RtlInitString(
IN OUT PSTRING DestinationString, IN OUT PSTRING DestinationString,
IN PCSZ SourceString IN PCSZ SourceString)
)
{ {
ULONG DestSize; ULONG DestSize;
@ -796,8 +777,7 @@ VOID
STDCALL STDCALL
RtlInitUnicodeString( RtlInitUnicodeString(
IN OUT PUNICODE_STRING DestinationString, IN OUT PUNICODE_STRING DestinationString,
IN PCWSTR SourceString IN PCWSTR SourceString)
)
{ {
ULONG DestSize; ULONG DestSize;
@ -822,8 +802,7 @@ RtlIntegerToChar (
IN ULONG Value, IN ULONG Value,
IN ULONG Base, IN ULONG Base,
IN ULONG Length, IN ULONG Length,
IN OUT PCHAR String IN OUT PCHAR String)
)
{ {
ULONG Radix; ULONG Radix;
CHAR temp[33]; CHAR temp[33];
@ -869,8 +848,7 @@ STDCALL
RtlIntegerToUnicodeString( RtlIntegerToUnicodeString(
IN ULONG Value, IN ULONG Value,
IN ULONG Base, /* optional */ IN ULONG Base, /* optional */
IN OUT PUNICODE_STRING String IN OUT PUNICODE_STRING String)
)
{ {
ANSI_STRING AnsiString; ANSI_STRING AnsiString;
CHAR Buffer[33]; CHAR Buffer[33];
@ -901,8 +879,7 @@ RtlLargeIntegerToChar (
IN PLARGE_INTEGER Value, IN PLARGE_INTEGER Value,
IN ULONG Base, IN ULONG Base,
IN ULONG Length, IN ULONG Length,
IN OUT PCHAR String IN OUT PCHAR String)
)
{ {
ULONG Radix; ULONG Radix;
CHAR temp[65]; CHAR temp[65];
@ -946,8 +923,7 @@ RtlLargeIntegerToChar (
ULONG ULONG
STDCALL STDCALL
RtlOemStringToUnicodeSize( RtlOemStringToUnicodeSize(
IN POEM_STRING OemString IN POEM_STRING OemString)
)
{ {
ULONG Size; ULONG Size;
@ -964,8 +940,7 @@ STDCALL
RtlOemStringToUnicodeString( RtlOemStringToUnicodeString(
IN OUT PUNICODE_STRING DestinationString, IN OUT PUNICODE_STRING DestinationString,
IN POEM_STRING SourceString, IN POEM_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Length; ULONG Length;
@ -1028,8 +1003,7 @@ STDCALL
RtlPrefixString( RtlPrefixString(
PANSI_STRING String1, PANSI_STRING String1,
PANSI_STRING String2, PANSI_STRING String2,
BOOLEAN CaseInsensitive BOOLEAN CaseInsensitive)
)
{ {
PCHAR pc1; PCHAR pc1;
PCHAR pc2; PCHAR pc2;
@ -1071,8 +1045,7 @@ STDCALL
RtlPrefixUnicodeString( RtlPrefixUnicodeString(
PUNICODE_STRING String1, PUNICODE_STRING String1,
PUNICODE_STRING String2, PUNICODE_STRING String2,
BOOLEAN CaseInsensitive BOOLEAN CaseInsensitive)
)
{ {
PWCHAR pc1; PWCHAR pc1;
PWCHAR pc2; PWCHAR pc2;
@ -1113,8 +1086,7 @@ RtlPrefixUnicodeString (
ULONG ULONG
STDCALL STDCALL
RtlUnicodeStringToAnsiSize( RtlUnicodeStringToAnsiSize(
IN PUNICODE_STRING UnicodeString IN PUNICODE_STRING UnicodeString)
)
{ {
ULONG Size; ULONG Size;
@ -1131,8 +1103,7 @@ STDCALL
RtlUnicodeStringToAnsiString( RtlUnicodeStringToAnsiString(
IN OUT PANSI_STRING DestinationString, IN OUT PANSI_STRING DestinationString,
IN PUNICODE_STRING SourceString, IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Length; ULONG Length;
@ -1189,8 +1160,7 @@ STDCALL
RtlUnicodeStringToInteger( RtlUnicodeStringToInteger(
IN PUNICODE_STRING String, IN PUNICODE_STRING String,
IN ULONG Base, IN ULONG Base,
OUT PULONG Value OUT PULONG Value)
)
{ {
PWCHAR Str; PWCHAR Str;
ULONG lenmin = 0; ULONG lenmin = 0;
@ -1277,8 +1247,7 @@ RtlUnicodeStringToInteger (
ULONG ULONG
STDCALL STDCALL
RtlUnicodeStringToOemSize( RtlUnicodeStringToOemSize(
IN PUNICODE_STRING UnicodeString IN PUNICODE_STRING UnicodeString)
)
{ {
ULONG Size; ULONG Size;
@ -1295,8 +1264,7 @@ STDCALL
RtlUnicodeStringToCountedOemString( RtlUnicodeStringToCountedOemString(
IN OUT POEM_STRING DestinationString, IN OUT POEM_STRING DestinationString,
IN PUNICODE_STRING SourceString, IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Length; ULONG Length;
@ -1362,8 +1330,7 @@ STDCALL
RtlUnicodeStringToOemString( RtlUnicodeStringToOemString(
IN OUT POEM_STRING DestinationString, IN OUT POEM_STRING DestinationString,
IN PUNICODE_STRING SourceString, IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Length; ULONG Length;
@ -1426,9 +1393,7 @@ RtlUnicodeStringToOemString (
WCHAR WCHAR
STDCALL STDCALL
RtlUpcaseUnicodeChar ( RtlUpcaseUnicodeChar(IN WCHAR Source)
IN WCHAR Source
)
{ {
if (Source < L'a') if (Source < L'a')
return Source; return Source;
@ -1447,8 +1412,7 @@ STDCALL
RtlUpcaseUnicodeString( RtlUpcaseUnicodeString(
IN OUT PUNICODE_STRING DestinationString, IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString, IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
ULONG i; ULONG i;
PWCHAR Src, Dest; PWCHAR Src, Dest;
@ -1488,8 +1452,7 @@ STDCALL
RtlUpcaseUnicodeStringToAnsiString( RtlUpcaseUnicodeStringToAnsiString(
IN OUT PANSI_STRING DestinationString, IN OUT PANSI_STRING DestinationString,
IN PUNICODE_STRING SourceString, IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Length; ULONG Length;
@ -1555,8 +1518,7 @@ STDCALL
RtlUpcaseUnicodeStringToCountedOemString( RtlUpcaseUnicodeStringToCountedOemString(
IN OUT POEM_STRING DestinationString, IN OUT POEM_STRING DestinationString,
IN PUNICODE_STRING SourceString, IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString IN BOOLEAN AllocateDestinationString)
)
{ {
NTSTATUS Status; NTSTATUS Status;
ULONG Length; ULONG Length;
@ -1726,8 +1688,7 @@ VOID
STDCALL STDCALL
RtlUpperString( RtlUpperString(
IN OUT PSTRING DestinationString, IN OUT PSTRING DestinationString,
IN PSTRING SourceString IN PSTRING SourceString)
)
{ {
ULONG Length; ULONG Length;
ULONG i; ULONG i;
@ -1752,9 +1713,7 @@ RtlUpperString (
ULONG ULONG
STDCALL STDCALL
RtlxAnsiStringToUnicodeSize ( RtlxAnsiStringToUnicodeSize(IN PANSI_STRING AnsiString)
IN PANSI_STRING AnsiString
)
{ {
return RtlAnsiStringToUnicodeSize(AnsiString); return RtlAnsiStringToUnicodeSize(AnsiString);
} }
@ -1762,9 +1721,7 @@ RtlxAnsiStringToUnicodeSize (
ULONG ULONG
STDCALL STDCALL
RtlxOemStringToUnicodeSize ( RtlxOemStringToUnicodeSize(IN POEM_STRING OemString)
IN POEM_STRING OemString
)
{ {
return RtlAnsiStringToUnicodeSize((PANSI_STRING)OemString); return RtlAnsiStringToUnicodeSize((PANSI_STRING)OemString);
} }
@ -1772,9 +1729,7 @@ RtlxOemStringToUnicodeSize (
ULONG ULONG
STDCALL STDCALL
RtlxUnicodeStringToAnsiSize ( RtlxUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString)
IN PUNICODE_STRING UnicodeString
)
{ {
return RtlUnicodeStringToAnsiSize(UnicodeString); return RtlUnicodeStringToAnsiSize(UnicodeString);
} }
@ -1782,9 +1737,7 @@ RtlxUnicodeStringToAnsiSize (
ULONG ULONG
STDCALL STDCALL
RtlxUnicodeStringToOemSize ( RtlxUnicodeStringToOemSize(IN PUNICODE_STRING UnicodeString)
IN PUNICODE_STRING UnicodeString
)
{ {
return RtlUnicodeStringToAnsiSize(UnicodeString); return RtlUnicodeStringToAnsiSize(UnicodeString);
} }