Major update to Rtl string functions.

svn path=/trunk/; revision=786
This commit is contained in:
Eric Kohl 1999-11-20 21:49:23 +00:00
parent 174adb3955
commit b09592bf32
16 changed files with 2399 additions and 1499 deletions

View file

@ -1,4 +1,4 @@
/* $Id: rtl.h,v 1.17 1999/11/15 15:55:00 ekohl Exp $
/* $Id: rtl.h,v 1.18 1999/11/20 21:44:09 ekohl Exp $
*
*/
@ -18,13 +18,6 @@ typedef struct _CONTROLLER_OBJECT
} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT;
typedef struct _STRING
{
USHORT Length;
USHORT MaximumLength;
PCHAR Buffer;
} STRING, *PSTRING;
typedef struct _ANSI_STRING
{
/*
* Length in bytes of the string stored in buffer
@ -40,7 +33,14 @@ typedef struct _ANSI_STRING
* String
*/
PCHAR Buffer;
} ANSI_STRING, *PANSI_STRING;
} STRING, *PSTRING;
typedef STRING ANSI_STRING;
typedef PSTRING PANSI_STRING;
typedef STRING OEM_STRING;
typedef PSTRING POEM_STRING;
typedef struct _TIME_FIELDS
{
@ -189,10 +189,18 @@ RemoveTailList (
PLIST_ENTRY ListHead
);
PVOID
STDCALL
RtlAllocateHeap (
HANDLE Heap,
ULONG Flags,
ULONG Size
);
WCHAR
STDCALL
RtlAnsiCharToUnicodeChar (
PCHAR AnsiChar
CHAR AnsiChar
);
ULONG
@ -330,8 +338,15 @@ RtlCreateSecurityDescriptor (
BOOLEAN
STDCALL
RtlCreateUnicodeString (
PUNICODE_STRING Destination,
PWSTR Source
OUT PUNICODE_STRING Destination,
IN PWSTR Source
);
BOOLEAN
STDCALL
RtlCreateUnicodeStringFromAsciiz (
OUT PUNICODE_STRING Destination,
IN PCSZ Source
);
NTSTATUS
@ -342,6 +357,14 @@ RtlDeleteRegistryValue (
PWSTR ValueName
);
NTSTATUS
STDCALL
RtlDowncaseUnicodeString (
IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
);
LARGE_INTEGER
RtlEnlargedIntegerMultiply (
LONG Multiplicand,
@ -377,6 +400,13 @@ RtlEqualUnicodeString (
BOOLEAN CaseInSensitive
);
/* RtlEraseUnicodeString is exported by ntdll.dll only! */
VOID
STDCALL
RtlEraseUnicodeString (
IN PUNICODE_STRING String
);
LARGE_INTEGER
RtlExtendedIntegerMultiply (
LARGE_INTEGER Multiplicand,
@ -422,7 +452,7 @@ RtlFreeAnsiString (
VOID
STDCALL
RtlFreeOemString (
PSTRING OemString
POEM_STRING OemString
);
VOID
@ -459,73 +489,21 @@ RtlInitUnicodeString (
PCWSTR SourceString
);
NTSTATUS
STDCALL
RtlIntegerToChar (
IN ULONG Value,
IN ULONG Base,
IN ULONG Length,
IN OUT PCHAR String
);
NTSTATUS
STDCALL
RtlIntegerToUnicodeString (
ULONG Value,
ULONG Base,
PUNICODE_STRING String
);
LARGE_INTEGER
RtlLargeIntegerAdd (
LARGE_INTEGER Addend1,
LARGE_INTEGER Addend2
);
VOID
RtlLargeIntegerAnd (
PLARGE_INTEGER Result,
LARGE_INTEGER Source,
LARGE_INTEGER Mask
);
/* MISSING FUNCTIONS GO HERE */
LARGE_INTEGER
RtlEnlargedIntegerMultiply (
LONG Multiplicand,
LONG Multiplier
);
ULONG
RtlEnlargedUnsignedDivide (
ULARGE_INTEGER Dividend,
ULONG Divisor,
PULONG Remainder
);
LARGE_INTEGER
RtlEnlargedUnsignedMultiply (
ULONG Multiplicand,
ULONG Multipler
);
LARGE_INTEGER
RtlExtendedIntegerMultiply (
LARGE_INTEGER Multiplicand,
LONG Multiplier
);
LARGE_INTEGER
RtlExtendedLargeIntegerDivide (
LARGE_INTEGER Dividend,
ULONG Divisor,
PULONG Remainder
);
LARGE_INTEGER
RtlExtendedMagicDivide (
LARGE_INTEGER Dividend,
LARGE_INTEGER MagicDivisor,
CCHAR ShiftCount
);
LARGE_INTEGER
ExInterlockedAddLargeInteger (
PLARGE_INTEGER Addend,
LARGE_INTEGER Increment,
PKSPIN_LOCK Lock
IN ULONG Value,
IN ULONG Base,
IN OUT PUNICODE_STRING String
);
LARGE_INTEGER
@ -677,14 +655,14 @@ RtlMultiByteToUnicodeSize (
ULONG
STDCALL
RtlOemStringToUnicodeSize (
PANSI_STRING AnsiString
POEM_STRING AnsiString
);
NTSTATUS
STDCALL
RtlOemStringToUnicodeString (
PUNICODE_STRING DestinationString,
PANSI_STRING SourceString,
POEM_STRING SourceString,
BOOLEAN AllocateDestinationString
);
@ -789,14 +767,6 @@ RtlCreateHeap (
PRTL_HEAP_DEFINITION Definition
);
PVOID
STDCALL
RtlAllocateHeap (
HANDLE Heap,
ULONG Flags,
ULONG Size
);
BOOLEAN
STDCALL
@ -837,7 +807,7 @@ RtlUnicodeStringToOemSize (
NTSTATUS
STDCALL
RtlUnicodeStringToOemString (
IN OUT PANSI_STRING DestinationString,
IN OUT POEM_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
);
@ -870,12 +840,60 @@ RtlUnicodeToOemN (
ULONG UnicodeSize
);
WCHAR
STDCALL
RtlUpcaseUnicodeChar (
WCHAR Source
);
NTSTATUS
STDCALL
RtlUpcaseUnicodeString (
PUNICODE_STRING DestinationString,
PUNICODE_STRING SourceString,
BOOLEAN AllocateDestinationString
IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
);
NTSTATUS
STDCALL
RtlUpcaseUnicodeStringToAnsiString (
IN OUT PANSI_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
);
NTSTATUS
STDCALL
RtlUpcaseUnicodeStringToOemString (
IN OUT POEM_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
);
NTSTATUS
STDCALL
RtlUpcaseUnicodeToMultiByteN (
PCHAR MbString,
ULONG MbSize,
PULONG ResultSize,
PWCHAR UnicodeString,
ULONG UnicodeSize
);
NTSTATUS
STDCALL
RtlUpcaseUnicodeToOemN (
PCHAR OemString,
ULONG OemSize,
PULONG ResultSize,
PWCHAR UnicodeString,
ULONG UnicodeSize
);
CHAR
STDCALL
RtlUpperChar (
CHAR Source
);
VOID

View file

@ -1,4 +1,4 @@
; $Id: ntdll.def,v 1.22 1999/11/15 15:57:55 ekohl Exp $
; $Id: ntdll.def,v 1.23 1999/11/20 21:46:16 ekohl Exp $
;
; ReactOS Operating System
;
@ -433,10 +433,14 @@ RtlAllocateHeap@12
RtlAnsiCharToUnicodeChar@4
RtlAnsiStringToUnicodeSize@4
RtlAnsiStringToUnicodeString@12
RtlAppendAsciizToString@12
RtlAppendStringToString@12
RtlAppendUnicodeStringToString@12
RtlAppendUnicodeToString@12
RtlCharToInteger@12
RtlCreateHeap@24
RtlCreateUnicodeString@8
RtlCreateUnicodeStringFromAsciiz@8
RtlCreateUserProcess@32
RtlCreateUserThread@40
RtlCompactHeap@8
@ -447,23 +451,27 @@ RtlConvertUlongToLargeInteger
RtlCopyString@8
RtlCopyUnicodeString@8
RtlDestroyHeap@4
RtlDowncaseUnicodeString@12
RtlEnlargedIntegerMultiply
RtlEnlargedUnsignedDivide
RtlEnlargedUnsignedMultiply
RtlEqualString@12
RtlEqualUnicodeString@12
RtlEraseUnicodeString@4
RtlExtendedIntegerMultiply
RtlExtendedLargeIntegerDivide
RtlExtendedMagicDivide
RtlFillMemory@12
RtlFreeAnsiString@4
RtlFreeHeap@12
RtlFreeOemString@4
RtlFreeUnicodeString@4
RtlGetProcessHeap@0
RtlInitAnsiString@8
RtlInitializeContext@20
RtlInitString@8
RtlInitUnicodeString@8
RtlIntegerToChar@16
RtlIntegerToUnicodeString@12
RtlLargeIntegerAdd
RtlLargeIntegerArithmeticShift
@ -477,19 +485,29 @@ RtlLockHeap@4
RtlMoveMemory@12
RtlMultiByteToUnicodeN@20
RtlNtStatusToDosError
RtlOemStringToUnicodeSize@4
RtlOemStringToUnicodeString@12
RtlOemToUnicodeN@20
RtlReAllocateHeap@16
RtlSizeHeap@12
RtlUnlockHeap@4
RtlUnicodeStringToAnsiSize@4
RtlUnicodeStringToAnsiString@12
RtlUnicodeStringToInteger@12
RtlUnicodeStringToOemSize@4
RtlUnicodeStringToOemString@12
RtlUnicodeToMultiByteN@20
RtlUnicodeToMultiByteSize@12
RtlUnicodeToOemN@20
RtlUnwind@0
RtlUpcaseString@8
RtlUpcaseUnicodeChar
RtlUpcaseUnicodeChar@4
RtlUpcaseUnicodeString@12
RtlUpcaseUnicodeToMultiByteN@0
RtlUpcaseUnicodeStringToAnsiString@12
RtlUpcaseUnicodeStringToOemString@12
RtlUpcaseUnicodeToMultiByteN@20
RtlUpcaseUnicodeToOemN@20
RtlUpperChar@4
RtlUpperString@8
RtlValidateHeap@12
RtlZeroMemory@8
_memccpy

View file

@ -1,4 +1,4 @@
; $Id: ntdll.edf,v 1.11 1999/11/15 15:57:55 ekohl Exp $
; $Id: ntdll.edf,v 1.12 1999/11/20 21:46:16 ekohl Exp $
;
; ReactOS Operating System
;
@ -437,6 +437,8 @@ RtlAppendUnicodeStringToString=RtlAppendUnicodeStringToString@8
RtlAppendUnicodeToString=RtlAppendUnicodeToString@8
RtlCharToInteger=RtlCharToInteger@12
RtlCreateHeap=RtlCreateHeap@24
RtlCreateUnicodeString=RtlCreateUnicodeString@8
RtlCreateUnicodeStringFromAsciiz=RtlCreateUnicodeStringFromAsciiz@8
RtlCreateUserProcess=RtlCreateUserProcess@32
RtlCreateUserThread=RtlCreateUserThread@40
RtlCompactHeap=RtlCompactHeap@8
@ -447,11 +449,13 @@ RtlConvertUlongToLargeInteger
RtlCopyString=RtlCopyString@8
RtlCopyUnicodeString=RtlCopyUnicodeString@8
RtlDestroyHeap=RtlDestroyHeap@4
RtlDowncaseUnicodeString=RtlDowncaseUnicodeString@12
RtlEnlargedIntegerMultiply
RtlEnlargedUnsignedDivide
RtlEnlargedUnsignedMultiply
RtlEqualString=RtlEqualString@12
RtlEqualUnicodeString=RtlEqualUnicodeString@12
RtlEraseUnicodeString=RtlEraseUnicodeString@4
RtlExtendedIntegerMultiply
RtlExtendedLargeIntegerDivide
RtlExtendedMagicDivide
@ -464,6 +468,7 @@ RtlInitAnsiString=RtlInitAnsiString@8
RtlInitializeContext=RtlInitializeContext@20
RtlInitString=RtlInitString@8
RtlInitUnicodeString=RtlInitUnicodeString@8
RtlIntegerToChar=RtlIntegerToChar@16
RtlIntegerToUnicodeString=RtlIntegerToUnicodeString@12
RtlLargeIntegerAdd
RtlLargeIntegerArithmeticShift
@ -486,10 +491,14 @@ RtlUnicodeStringToInteger=RtlUnicodeStringToInteger@12
RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20
RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12
RtlUnwind=RtlUnwind@0
RtlUpcaseString=RtlUpcaseString@8
RtlUpcaseUnicodeChar=RtlUpcaseUnicodeChar@0
RtlUpcaseUnicodeChar=RtlUpcaseUnicodeChar@4
RtlUpcaseUnicodeString=RtlUpcaseUnicodeString@12
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@0
RtlUpcaseUnicodeStringToAnsiString=RtlUpcaseUnicodeStringToAnsiString@12
RtlUpcaseUnicodeStringToOemString=RtlUpcaseUnicodeStringToOemString@12
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20
RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20
RtlUpperChar=RtlUpperChar@4
RtlUpperString=RtlUpperString@8
RtlValidateHeap=RtlValidateHeap@12
RtlZeroMemory=RtlZeroMemory@8
_memccpy

View file

@ -1,8 +1,8 @@
/* $Id: nls.c,v 1.1 1999/11/15 15:59:29 ekohl Exp $
/* $Id: nls.c,v 1.2 1999/11/20 21:46:46 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/rtl/nls.c
* FILE: lib/ntdll/rtl/nls.c
* PURPOSE: National Language Support (NLS) functions
* UPDATE HISTORY:
* 20/08/99 Created by Emanuele Aliberti
@ -95,7 +95,7 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
UnicodeString++;
MbString++;
};
}
}
else
{
@ -130,6 +130,50 @@ RtlMultiByteToUnicodeSize(PULONG UnicodeSize,
}
NTSTATUS
STDCALL
RtlOemToUnicodeN(PWCHAR UnicodeString,
ULONG UnicodeSize,
PULONG ResultSize,
PCHAR OemString,
ULONG OemSize)
{
ULONG Size = 0;
ULONG i;
if (NlsMbOemCodePageTag == FALSE)
{
/* single-byte code page */
if (OemSize > (UnicodeSize / sizeof(WCHAR)))
Size = UnicodeSize / sizeof(WCHAR);
else
Size = OemSize;
if (ResultSize != NULL)
*ResultSize = Size * sizeof(WCHAR);
for (i = 0; i < Size; i++)
{
*UnicodeString = *OemString;
#if 0
*UnicodeString = OemToUnicodeTable[*OemString];
#endif
UnicodeString++;
OemString++;
};
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
NTSTATUS
STDCALL
RtlUnicodeToMultiByteN(PCHAR MbString,
@ -161,7 +205,7 @@ RtlUnicodeToMultiByteN(PCHAR MbString,
MbString++;
UnicodeString++;
};
}
}
else
{
@ -195,4 +239,142 @@ RtlUnicodeToMultiByteSize(PULONG MbSize,
return STATUS_SUCCESS;
}
NTSTATUS
STDCALL
RtlUnicodeToOemN(PCHAR OemString,
ULONG OemSize,
PULONG ResultSize,
PWCHAR UnicodeString,
ULONG UnicodeSize)
{
ULONG Size = 0;
ULONG i;
if (NlsMbOemCodePageTag == FALSE)
{
/* single-byte code page */
if (UnicodeSize > (OemSize * sizeof(WCHAR)))
Size = OemSize;
else
Size = UnicodeSize / sizeof(WCHAR);
if (ResultSize != NULL)
*ResultSize = Size;
for (i = 0; i < Size; i++)
{
*OemString = *UnicodeString;
#if 0
*OemString = UnicodeToOemTable[*UnicodeString];
#endif
OemString++;
UnicodeString++;
};
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
NTSTATUS
STDCALL
RtlUpcaseUnicodeToMultiByteN (
PCHAR MbString,
ULONG MbSize,
PULONG ResultSize,
PWCHAR UnicodeString,
ULONG UnicodeSize
)
{
ULONG Size = 0;
ULONG i;
if (NLS_MB_CODE_PAGE_TAG == FALSE)
{
/* single-byte code page */
if (UnicodeSize > (MbSize * sizeof(WCHAR)))
Size = MbSize;
else
Size = UnicodeSize / sizeof(WCHAR);
if (ResultSize != NULL)
*ResultSize = Size;
for (i = 0; i < Size; i++)
{
/* FIXME: Upcase!! */
*MbString = *UnicodeString;
#if 0
*MbString = UnicodeToAnsiTable[*UnicodeString];
#endif
MbString++;
UnicodeString++;
}
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
NTSTATUS
STDCALL
RtlUpcaseUnicodeToOemN (
PCHAR OemString,
ULONG OemSize,
PULONG ResultSize,
PWCHAR UnicodeString,
ULONG UnicodeSize
)
{
ULONG Size = 0;
ULONG i;
if (NLS_MB_OEM_CODE_PAGE_TAG == FALSE)
{
/* single-byte code page */
if (UnicodeSize > (OemSize * sizeof(WCHAR)))
Size = OemSize;
else
Size = UnicodeSize / sizeof(WCHAR);
if (ResultSize != NULL)
*ResultSize = Size;
for (i = 0; i < Size; i++)
{
/* FIXME: Upcase !! */
*OemString = *UnicodeString;
#if 0
*OemString = UnicodeToOemTable[*UnicodeString];
#endif
OemString++;
UnicodeString++;
}
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
/* EOF */

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: rtl.c,v 1.2 1999/11/15 16:02:50 ekohl Exp $
/* $Id: rtl.c,v 1.3 1999/11/20 21:47:38 ekohl Exp $
*
* reactos/lib/psxdll/misc/rtl.c
*
@ -12,16 +12,28 @@
#include <ntos.h>
#include <wchar.h>
WCHAR
STDCALL
RtlAnsiCharToUnicodeChar (
PCHAR AnsiChar
CHAR AnsiChar
)
{
/* FIXME: it should probably call RtlMultiByteToUnicodeN
* with length==1.
*/
return (WCHAR) *AnsiChar;
ULONG Size;
WCHAR UnicodeChar;
Size = 1;
#if 0
Size = (NlsLeadByteInfo[AnsiChar] == 0) ? 1 : 2;
#endif
RtlMultiByteToUnicodeN (&UnicodeChar,
sizeof(WCHAR),
NULL,
&AnsiChar,
Size);
return UnicodeChar;
}
@ -59,15 +71,45 @@ RtlMoveMemory (
NTSTATUS
STDCALL
RtlMultiByteToUnicodeN (
PWCHAR UnicodeString,
RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
ULONG UnicodeSize,
PULONG ResultSize,
PCHAR MbString,
ULONG MbSize
)
ULONG MbSize)
{
return STATUS_NOT_IMPLEMENTED;
ULONG Size = 0;
ULONG i;
if (NLS_MB_CODE_PAGE_TAG == FALSE)
{
/* single-byte code page */
if (MbSize > (UnicodeSize / sizeof(WCHAR)))
Size = UnicodeSize / sizeof(WCHAR);
else
Size = MbSize;
if (ResultSize != NULL)
*ResultSize = Size * sizeof(WCHAR);
for (i = 0; i < Size; i++)
{
*UnicodeString = *MbString;
#if 0
*UnicodeString = AnsiToUnicodeTable[*MbString];
#endif
UnicodeString++;
MbString++;
}
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
@ -81,7 +123,39 @@ RtlUnicodeToMultiByteN (
ULONG UnicodeSize
)
{
return STATUS_NOT_IMPLEMENTED;
ULONG Size = 0;
ULONG i;
if (NLS_MB_CODE_PAGE_TAG == FALSE)
{
/* single-byte code page */
if (UnicodeSize > (MbSize * sizeof(WCHAR)))
Size = MbSize;
else
Size = UnicodeSize / sizeof(WCHAR);
if (ResultSize != NULL)
*ResultSize = Size;
for (i = 0; i < Size; i++)
{
*MbString = *UnicodeString;
#if 0
*MbString = UnicodeToAnsiTable[*UnicodeString];
#endif
MbString++;
UnicodeString++;
}
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
@ -93,7 +167,18 @@ RtlUnicodeToMultiByteSize (
ULONG UnicodeSize
)
{
return STATUS_NOT_IMPLEMENTED;
if (NLS_MB_CODE_PAGE_TAG == FALSE)
{
/* single-byte code page */
*MbSize = UnicodeSize / sizeof (WCHAR);
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
@ -106,24 +191,69 @@ RtlUnwind (
}
VOID
WCHAR
STDCALL
RtlUpcaseUnicodeChar (
VOID
WCHAR Source
)
{
if (Source < L'a')
return Source;
if (Source <= L'z')
return (Source - (L'a' - L'A'));
/* FIXME: characters above 'z' */
return Source;
}
VOID
NTSTATUS
STDCALL
RtlUpcaseUnicodeToMultiByteN (
VOID
PCHAR MbString,
ULONG MbSize,
PULONG ResultSize,
PWCHAR UnicodeString,
ULONG UnicodeSize
)
{
ULONG Size = 0;
ULONG i;
if (NLS_MB_CODE_PAGE_TAG == FALSE)
{
/* single-byte code page */
if (UnicodeSize > (MbSize * sizeof(WCHAR)))
Size = MbSize;
else
Size = UnicodeSize / sizeof(WCHAR);
if (ResultSize != NULL)
*ResultSize = Size;
for (i = 0; i < Size; i++)
{
/* FIXME: Upcase!! */
*MbString = *UnicodeString;
#if 0
*MbString = UnicodeToAnsiTable[*UnicodeString];
#endif
MbString++;
UnicodeString++;
}
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
VOID

View file

@ -1,4 +1,4 @@
; $Id: psxdll.def,v 1.5 1999/11/15 16:02:36 ekohl Exp $
; $Id: psxdll.def,v 1.6 1999/11/20 21:47:22 ekohl Exp $
;
; psxdll.def
;
@ -18,8 +18,8 @@ ntdll.RtlMultiByteToUnicodeN@20
ntdll.RtlUnicodeToMultiByteN@20
ntdll.RtlUnicodeToMultiByteSize@12
ntdll.RtlUnwind@0
ntdll.RtlUpcaseUnicodeChar@0
ntdll.RtlUpcaseUnicodeToMultiByteN@0
ntdll.RtlUpcaseUnicodeChar@4
ntdll.RtlUpcaseUnicodeToMultiByteN@20
ntdll.RtlZeroMemory@8
EXPORTS
@ -35,8 +35,8 @@ RtlMultiByteToUnicodeN@20
RtlUnicodeToMultiByteN@20
RtlUnicodeToMultiByteSize@12
RtlUnwind@0
RtlUpcaseUnicodeChar@0
RtlUpcaseUnicodeToMultiByteN@0
RtlUpcaseUnicodeChar@4
RtlUpcaseUnicodeToMultiByteN@20
RtlZeroMemory@8
__PdxGetCmdLine@0
__PdxInitializeData@8

View file

@ -1,4 +1,4 @@
; $Id: psxdll.edf,v 1.4 1999/11/15 16:02:36 ekohl Exp $
; $Id: psxdll.edf,v 1.5 1999/11/20 21:47:22 ekohl Exp $
;
; psxdll.edf
;
@ -18,8 +18,8 @@ ntdll.RtlMultiByteToUnicodeN@20
ntdll.RtlUnicodeToMultiByteN@20
ntdll.RtlUnicodeToMultiByteSize@12
ntdll.RtlUnwind@0
ntdll.RtlUpcaseUnicodeChar@0
ntdll.RtlUpcaseUnicodeToMultiByteN@0
ntdll.RtlUpcaseUnicodeChar@4
ntdll.RtlUpcaseUnicodeToMultiByteN@20
ntdll.RtlZeroMemory@8
EXPORTS
@ -35,8 +35,8 @@ RtlMultiByteToUnicodeN=RtlMultiByteToUnicodeN@20
RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20
RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12
RtlUnwind=RtlUnwind@0
RtlUpcaseUnicodeChar=RtlUpcaseUnicodeChar@0
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@0
RtlUpcaseUnicodeChar=RtlUpcaseUnicodeChar@4
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20
RtlZeroMemory=RtlZeroMemory@8
__PdxGetCmdLine=__PdxGetCmdLine@0
__PdxInitializeData=__PdxInitializeData@8

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.def,v 1.25 1999/11/15 15:56:16 ekohl Exp $
; $Id: ntoskrnl.def,v 1.26 1999/11/20 21:44:34 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -191,6 +191,7 @@ RtlCopyMemory
RtlCopyString@8
RtlCopyUnicodeString@8
RtlCreateUnicodeString@8
RtlDowncaseUnicodeString@12
RtlEnlargedIntegerMultiply
RtlEnlargedUnsignedDivide
RtlEnlargedUnsignedMultiply
@ -208,6 +209,7 @@ RtlGetDefaultCodePage@8
RtlInitAnsiString@8
RtlInitString@8
RtlInitUnicodeString@8
RtlIntegerToChar@16
RtlIntegerToUnicodeString@12
RtlLargeIntegerAdd
RtlLargeIntegerArithmeticShift
@ -236,8 +238,13 @@ RtlUnicodeStringToOemString@12
RtlUnicodeToMultiByteN@20
RtlUnicodeToMultiByteSize@12
RtlUnicodeToOemN@20
RtlUpcaseUnicodeChar@4
RtlUpcaseUnicodeString@12
RtlUpcaseString@8
RtlUpcaseUnicodeStringToAnsiString@12
RtlUpcaseUnicodeStringToOemString@12
RtlUpcaseUnicodeToMultiByteN@20
RtlUpcaseUnicodeToOemN@20
RtlUpperChar@4
RtlUpperString@8
RtlZeroMemory@8
ZwAccessCheckAndAuditAlarm@44

View file

@ -1,4 +1,4 @@
; $Id: ntoskrnl.edf,v 1.12 1999/11/15 15:56:16 ekohl Exp $
; $Id: ntoskrnl.edf,v 1.13 1999/11/20 21:44:34 ekohl Exp $
;
; reactos/ntoskrnl/ntoskrnl.def
;
@ -191,6 +191,7 @@ RtlCopyMemory
RtlCopyString=RtlCopyString@8
RtlCopyUnicodeString=RtlCopyUnicodeString@8
RtlCreateUnicodeString=RtlCreateUnicodeString@8
RtlDowncaseUnicodeString=RtlDowncaseUnicodeString@12
RtlEnlargedIntegerMultiply
RtlEnlargedUnsignedDivide
RtlEnlargedUnsignedMultiply
@ -208,6 +209,7 @@ RtlGetDefaultCodePage=RtlGetDefaultCodePage@8
RtlInitAnsiString=RtlInitAnsiString@8
RtlInitString=RtlInitString@8
RtlInitUnicodeString=RtlInitUnicodeString@8
RtlIntegerToChar=RtlIntegerToChar@16
RtlIntegerToUnicodeString=RtlIntegerToUnicodeString@12
RtlLargeIntegerAdd
RtlLargeIntegerArithmeticShift
@ -234,8 +236,13 @@ RtlUnicodeStringToOemSize=RtlUnicodeStringToOemSize@4
RtlUnicodeStringToOemString=RtlUnicodeStringToOemString@12
RtlUnicodeToMultiByteN=RtlUnicodeToMultiByteN@20
RtlUnicodeToMultiByteSize=RtlUnicodeToMultiByteSize@12
RtlUpcaseUnicodeChar=RtlUpcaseUnicodeChar@4
RtlUpcaseUnicodeString=RtlUpcaseUnicodeString@12
RtlUpcaseString=RtlUpcaseString@8
RtlUpcaseUnicodeStringToAnsiString=RtlUpcaseUnicodeStringToAnsiString@12
RtlUpcaseUnicodeStringToOemString=RtlUpcaseUnicodeStringToOemString@12
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20
RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20
RtlUpperChar=RtlUpperChar@4
RtlUpperString=RtlUpperString@8
RtlZeroMemory=RtlZeroMemory@8
ZwAccessCheckAndAuditAlarm=ZwAccessCheckAndAuditAlarm@44

View file

@ -1,4 +1,4 @@
/* $Id: nls.c,v 1.1 1999/11/15 15:57:01 ekohl Exp $
/* $Id: nls.c,v 1.2 1999/11/20 21:45:20 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -56,8 +56,10 @@ CHAR UnicodeToOemTable [65536];
VOID
STDCALL
RtlGetDefaultCodePage (PUSHORT AnsiCodePage,
PUSHORT OemCodePage)
RtlGetDefaultCodePage (
PUSHORT AnsiCodePage,
PUSHORT OemCodePage
)
{
*AnsiCodePage = NlsAnsiCodePage;
*OemCodePage = NlsOemCodePage;
@ -66,11 +68,13 @@ RtlGetDefaultCodePage (PUSHORT AnsiCodePage,
NTSTATUS
STDCALL
RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
RtlMultiByteToUnicodeN (
PWCHAR UnicodeString,
ULONG UnicodeSize,
PULONG ResultSize,
PCHAR MbString,
ULONG MbSize)
ULONG MbSize
)
{
ULONG Size = 0;
ULONG i;
@ -95,7 +99,7 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
UnicodeString++;
MbString++;
};
}
}
else
{
@ -110,9 +114,11 @@ RtlMultiByteToUnicodeN(PWCHAR UnicodeString,
NTSTATUS
STDCALL
RtlMultiByteToUnicodeSize(PULONG UnicodeSize,
RtlMultiByteToUnicodeSize (
PULONG UnicodeSize,
PCHAR MbString,
ULONG MbSize)
ULONG MbSize
)
{
if (NlsMbCodePageTag == FALSE)
{
@ -161,7 +167,7 @@ RtlOemToUnicodeN(PWCHAR UnicodeString,
UnicodeString++;
OemString++;
};
}
}
else
{
@ -205,7 +211,7 @@ RtlUnicodeToMultiByteN(PCHAR MbString,
MbString++;
UnicodeString++;
};
}
}
else
{
@ -271,7 +277,101 @@ RtlUnicodeToOemN(PCHAR OemString,
OemString++;
UnicodeString++;
};
}
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
NTSTATUS
STDCALL
RtlUpcaseUnicodeToMultiByteN (
PCHAR MbString,
ULONG MbSize,
PULONG ResultSize,
PWCHAR UnicodeString,
ULONG UnicodeSize
)
{
ULONG Size = 0;
ULONG i;
if (NlsMbCodePageTag == FALSE)
{
/* single-byte code page */
if (UnicodeSize > (MbSize * sizeof(WCHAR)))
Size = MbSize;
else
Size = UnicodeSize / sizeof(WCHAR);
if (ResultSize != NULL)
*ResultSize = Size;
for (i = 0; i < Size; i++)
{
/* FIXME: Upcase !! */
*MbString = *UnicodeString;
#if 0
*MbString = UnicodeToAnsiTable[*UnicodeString];
#endif
MbString++;
UnicodeString++;
}
}
else
{
/* multi-byte code page */
/* FIXME */
}
return STATUS_SUCCESS;
}
NTSTATUS
STDCALL
RtlUpcaseUnicodeToOemN (
PCHAR OemString,
ULONG OemSize,
PULONG ResultSize,
PWCHAR UnicodeString,
ULONG UnicodeSize
)
{
ULONG Size = 0;
ULONG i;
if (NlsMbOemCodePageTag == FALSE)
{
/* single-byte code page */
if (UnicodeSize > (OemSize * sizeof(WCHAR)))
Size = OemSize;
else
Size = UnicodeSize / sizeof(WCHAR);
if (ResultSize != NULL)
*ResultSize = Size;
for (i = 0; i < Size; i++)
{
/* FIXME: Upcase !! */
*OemString = *UnicodeString;
#if 0
*OemString = UnicodeToOemTable[*UnicodeString];
#endif
OemString++;
UnicodeString++;
}
}
else
{

View file

@ -1,4 +1,4 @@
/* $Id: unicode.c,v 1.8 1999/11/15 15:57:01 ekohl Exp $
/* $Id: unicode.c,v 1.9 1999/11/20 21:45:20 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -10,16 +10,11 @@
*/
#include <ddk/ntddk.h>
#include <ctype.h>
//#include <internal/nls.h>
#define NDEBUG
#include <internal/debug.h>
#define STR_FIX
extern unsigned long simple_strtoul(const char *cp, char **endp,
unsigned int base);
@ -28,20 +23,20 @@ extern unsigned long simple_strtoul(const char *cp, char **endp,
WCHAR
STDCALL
RtlAnsiCharToUnicodeChar(PCHAR AnsiChar)
RtlAnsiCharToUnicodeChar(CHAR AnsiChar)
{
ULONG Size;
WCHAR UnicodeChar;
Size = 1;
#if 0
Size = (NlsLeadByteInfo[*AnsiChar] == 0) ? 1 : 2;
Size = (NlsLeadByteInfo[AnsiChar] == 0) ? 1 : 2;
#endif
RtlMultiByteToUnicodeN (&UnicodeChar,
sizeof(WCHAR),
NULL,
AnsiChar,
&AnsiChar,
Size);
return UnicodeChar;
@ -64,9 +59,11 @@ RtlAnsiStringToUnicodeSize(PANSI_STRING AnsiString)
NTSTATUS
STDCALL
RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString,
RtlAnsiStringToUnicodeString (
PUNICODE_STRING DestinationString,
PANSI_STRING SourceString,
BOOLEAN AllocateDestinationString)
BOOLEAN AllocateDestinationString
)
{
NTSTATUS Status;
ULONG Length;
@ -120,8 +117,10 @@ RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString,
NTSTATUS
STDCALL
RtlAppendAsciizToString(IN OUT PSTRING Destination,
IN PCSZ Source)
RtlAppendAsciizToString (
IN OUT PSTRING Destination,
IN PCSZ Source
)
{
ULONG Length;
PCHAR Ptr;
@ -148,8 +147,10 @@ RtlAppendAsciizToString(IN OUT PSTRING Destination,
NTSTATUS
STDCALL
RtlAppendStringToString(PSTRING Destination,
PSTRING Source)
RtlAppendStringToString (
PSTRING Destination,
PSTRING Source
)
{
PCHAR Ptr;
@ -174,8 +175,10 @@ RtlAppendStringToString(PSTRING Destination,
NTSTATUS
STDCALL
RtlAppendUnicodeStringToString(IN OUT PUNICODE_STRING Destination,
IN PUNICODE_STRING Source)
RtlAppendUnicodeStringToString (
IN OUT PUNICODE_STRING Destination,
IN PUNICODE_STRING Source
)
{
PWCHAR Src, Dest;
ULONG i;
@ -201,8 +204,10 @@ RtlAppendUnicodeStringToString(IN OUT PUNICODE_STRING Destination,
NTSTATUS
STDCALL
RtlAppendUnicodeToString(IN OUT PUNICODE_STRING Destination,
IN PWSTR Source)
RtlAppendUnicodeToString (
IN OUT PUNICODE_STRING Destination,
IN PWSTR Source
)
{
PWCHAR Src;
PWCHAR Dest;
@ -242,9 +247,11 @@ RtlCharToInteger(IN PCSZ String, IN ULONG Base, IN OUT PULONG Value)
LONG
STDCALL
RtlCompareString(PSTRING String1,
RtlCompareString (
PSTRING String1,
PSTRING String2,
BOOLEAN CaseInsensitive)
BOOLEAN CaseInsensitive
)
{
unsigned long i;
char c1, c2;
@ -256,8 +263,8 @@ RtlCompareString(PSTRING String1,
{
if (CaseInsensitive == TRUE)
{
c1 = toupper(*String1->Buffer);
c2 = toupper(*String2->Buffer);
c1 = RtlUpperChar (*String1->Buffer);
c2 = RtlUpperChar (*String2->Buffer);
}
else
{
@ -285,9 +292,11 @@ RtlCompareString(PSTRING String1,
LONG
STDCALL
RtlCompareUnicodeString(PUNICODE_STRING String1,
RtlCompareUnicodeString (
PUNICODE_STRING String1,
PUNICODE_STRING String2,
BOOLEAN CaseInsensitive)
BOOLEAN CaseInsensitive
)
{
unsigned long i;
WCHAR wc1, wc2;
@ -303,8 +312,8 @@ RtlCompareUnicodeString(PUNICODE_STRING String1,
{
if(CaseInsensitive == TRUE)
{
wc1 = towupper (*pw1);
wc2 = towupper (*pw2);
wc1 = RtlUpcaseUnicodeChar (*pw1);
wc2 = RtlUpcaseUnicodeChar (*pw2);
}
else
{
@ -313,9 +322,7 @@ RtlCompareUnicodeString(PUNICODE_STRING String1,
}
if (wc1 != wc2)
{
return wc1 - wc2;
}
pw1++;
pw2++;
@ -327,53 +334,53 @@ RtlCompareUnicodeString(PUNICODE_STRING String1,
VOID
STDCALL
RtlCopyString(IN OUT PSTRING DestinationString, IN PSTRING SourceString)
RtlCopyString (
IN OUT PSTRING DestinationString,
IN PSTRING SourceString
)
{
unsigned long copylen, i;
ULONG copylen, i;
PCHAR Src, Dest;
if(SourceString == NULL)
{
DestinationString->Length = 0;
return;
}
else
{
if(SourceString->Length < DestinationString->MaximumLength)
{
copylen = SourceString->Length;
}
else
{
copylen = DestinationString->MaximumLength;
}
copylen = min (DestinationString->MaximumLength - sizeof(CHAR),
SourceString->Length);
Src = SourceString->Buffer;
Dest = DestinationString->Buffer;
for (i = 0; i < copylen; i++)
{
*DestinationString->Buffer = *SourceString->Buffer;
DestinationString->Buffer++;
SourceString->Buffer++;
*Dest = *Src;
Dest++;
Src++;
}
*Dest = 0;
*DestinationString->Buffer = 0;
DestinationString->Buffer -= copylen;
SourceString->Buffer -= copylen;
}
DestinationString->Length = copylen;
}
VOID
STDCALL
RtlCopyUnicodeString(IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString)
RtlCopyUnicodeString (
IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString
)
{
unsigned long copylen, i;
ULONG copylen, i;
PWCHAR Src, Dest;
if(SourceString==NULL)
{
DestinationString->Length=0;
return;
}
else
{
copylen = min(DestinationString->MaximumLength - sizeof(WCHAR),
SourceString->Length);
Src = SourceString->Buffer;
@ -389,13 +396,14 @@ RtlCopyUnicodeString(IN OUT PUNICODE_STRING DestinationString,
DestinationString->Length = copylen;
}
}
BOOLEAN
STDCALL
RtlCreateUnicodeString (PUNICODE_STRING Destination,
PWSTR Source)
RtlCreateUnicodeString (
IN OUT PUNICODE_STRING Destination,
IN PWSTR Source
)
{
ULONG Length;
@ -419,7 +427,90 @@ RtlCreateUnicodeString (PUNICODE_STRING Destination,
BOOLEAN
STDCALL
RtlEqualString(PSTRING String1, PSTRING String2, BOOLEAN CaseInsensitive)
RtlCreateUnicodeStringFromAsciiz (
IN OUT PUNICODE_STRING Destination,
IN PCSZ Source
)
{
ANSI_STRING AnsiString;
NTSTATUS Status;
RtlInitAnsiString (&AnsiString,
Source);
Status = RtlAnsiStringToUnicodeString (Destination,
&AnsiString,
TRUE);
return NT_SUCCESS(Status);
}
/*
RtlCustomCPToUnicodeN
*/
NTSTATUS
STDCALL
RtlDowncaseUnicodeString (
IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
)
{
ULONG i;
PWCHAR Src, Dest;
if (AllocateDestinationString == TRUE)
{
DestinationString->Length = SourceString->Length;
DestinationString->MaximumLength = SourceString->Length + sizeof(WCHAR);
DestinationString->Buffer = ExAllocatePool (NonPagedPool,
SourceString->Length + sizeof(WCHAR));
if (DestinationString->Buffer == NULL)
return STATUS_NO_MEMORY;
}
else
{
if (SourceString->Length >= DestinationString->MaximumLength)
return STATUS_BUFFER_OVERFLOW;
}
Src = SourceString->Buffer;
Dest = DestinationString->Buffer;
for (i=0; i < SourceString->Length / sizeof(WCHAR); i++)
{
if (*Src < L'A')
{
*Dest = *Src;
}
else if (*Src <= L'Z')
{
*Dest = (*Src + (L'a' - L'A'));
}
else
{
/* FIXME: characters above 'Z' */
*Dest = *Src;
}
Dest++;
Src++;
}
*Dest = 0;
return STATUS_SUCCESS;
}
BOOLEAN
STDCALL
RtlEqualString (
IN PSTRING String1,
IN PSTRING String2,
IN BOOLEAN CaseInsensitive
)
{
unsigned long s1l=String1->Length;
unsigned long s2l=String2->Length;
@ -436,8 +527,8 @@ RtlEqualString(PSTRING String1, PSTRING String2, BOOLEAN CaseInsensitive)
if (CaseInsensitive == TRUE)
{
c1 = toupper(c1);
c2 = toupper(c2);
c1 = RtlUpperChar (c1);
c2 = RtlUpperChar (c2);
}
if (c1 != c2)
@ -460,9 +551,11 @@ RtlEqualString(PSTRING String1, PSTRING String2, BOOLEAN CaseInsensitive)
BOOLEAN
STDCALL
RtlEqualUnicodeString(PUNICODE_STRING String1,
PUNICODE_STRING String2,
BOOLEAN CaseInsensitive)
RtlEqualUnicodeString (
IN PUNICODE_STRING String1,
IN PUNICODE_STRING String2,
IN BOOLEAN CaseInsensitive
)
{
unsigned long s1l = String1->Length / sizeof(WCHAR);
unsigned long s2l = String2->Length / sizeof(WCHAR);
@ -480,8 +573,8 @@ RtlEqualUnicodeString(PUNICODE_STRING String1,
{
if(CaseInsensitive == TRUE)
{
wc1 = towupper (*pw1);
wc2 = towupper (*pw2);
wc1 = RtlUpcaseUnicodeChar (*pw1);
wc2 = RtlUpcaseUnicodeChar (*pw2);
}
else
{
@ -500,9 +593,16 @@ RtlEqualUnicodeString(PUNICODE_STRING String1,
}
/*
RtlEraseUnicodeString
*/
VOID
STDCALL
RtlFreeAnsiString(IN PANSI_STRING AnsiString)
RtlFreeAnsiString (
IN PANSI_STRING AnsiString
)
{
if (AnsiString->Buffer == NULL)
return;
@ -517,7 +617,9 @@ RtlFreeAnsiString(IN PANSI_STRING AnsiString)
VOID
STDCALL
RtlFreeOemString(IN PSTRING OemString)
RtlFreeOemString (
IN POEM_STRING OemString
)
{
if (OemString->Buffer == NULL)
return;
@ -532,7 +634,9 @@ RtlFreeOemString(IN PSTRING OemString)
VOID
STDCALL
RtlFreeUnicodeString(IN PUNICODE_STRING UnicodeString)
RtlFreeUnicodeString (
IN PUNICODE_STRING UnicodeString
)
{
if (UnicodeString->Buffer == NULL)
return;
@ -547,8 +651,10 @@ RtlFreeUnicodeString(IN PUNICODE_STRING UnicodeString)
VOID
STDCALL
RtlInitAnsiString(IN OUT PANSI_STRING DestinationString,
IN PCSZ SourceString)
RtlInitAnsiString (
IN OUT PANSI_STRING DestinationString,
IN PCSZ SourceString
)
{
ULONG DestSize;
@ -569,8 +675,10 @@ RtlInitAnsiString(IN OUT PANSI_STRING DestinationString,
VOID
STDCALL
RtlInitString(IN OUT PSTRING DestinationString,
IN PCSZ SourceString)
RtlInitString (
IN OUT PSTRING DestinationString,
IN PCSZ SourceString
)
{
ULONG DestSize;
@ -588,15 +696,19 @@ RtlInitString(IN OUT PSTRING DestinationString,
DestinationString->Buffer = (PCHAR)SourceString;
}
VOID
STDCALL
RtlInitUnicodeString(IN OUT PUNICODE_STRING DestinationString,
IN PCWSTR SourceString)
RtlInitUnicodeString (
IN OUT PUNICODE_STRING DestinationString,
IN PCWSTR SourceString
)
{
ULONG DestSize;
DPRINT("RtlInitUnicodeString(DestinationString %x, "
"SourceString %x)\n",DestinationString,SourceString);
DPRINT("RtlInitUnicodeString(DestinationString %x, SourceString %x)\n",
DestinationString,
SourceString);
if (SourceString == NULL)
{
@ -615,52 +727,93 @@ RtlInitUnicodeString(IN OUT PUNICODE_STRING DestinationString,
NTSTATUS
STDCALL
RtlIntegerToUnicodeString(IN ULONG Value,
IN ULONG Base, /* optional */
IN OUT PUNICODE_STRING String)
RtlIntegerToChar (
IN ULONG Value,
IN ULONG Base,
IN ULONG Length,
IN OUT PCHAR String
)
{
UNIMPLEMENTED;
ULONG Radix;
CHAR temp[33];
ULONG v = 0;
ULONG i;
PCHAR tp;
PCHAR sp;
return STATUS_NOT_IMPLEMENTED;
#if 0
char *str;
unsigned long len, i;
Radix = Base;
if (Radix == 0)
Radix = 10;
str=ExAllocatePool(NonPagedPool, 1024);
if(Base==16) {
sprintf(str, "%x", Value);
} else
if(Base==8) {
sprintf(str, "%o", Value);
} else
if(Base==2) {
sprintf(str, "%b", Value);
} else {
sprintf(str, "%u", (unsigned int)Value);
};
if ((Radix != 2) && (Radix != 8) &&
(Radix != 10) && (Radix != 16))
return STATUS_INVALID_PARAMETER;
len=strlen(str);
if(String->MaximumLength<len) return STATUS_INVALID_PARAMETER;
tp = temp;
while (v || tp == temp)
{
i = v % Radix;
v = v / Radix;
if (i < 10)
*tp = i + '0';
else
*tp = i + 'a' - 10;
tp++;
}
for(i=0; i<len; i++) {
*String->Buffer=*str;
String->Buffer++;
str++;
};
*String->Buffer=0;
String->Buffer-=len;
String->Length=len;
str-=len;
ExFreePool(str);
if (tp - temp >= Length)
return STATUS_BUFFER_TOO_SMALL;
sp = String;
while (tp > temp)
*sp++ = *--tp;
*sp = 0;
return STATUS_SUCCESS;
#endif
}
NTSTATUS
STDCALL
RtlIntegerToUnicodeString (
IN ULONG Value,
IN ULONG Base, /* optional */
IN OUT PUNICODE_STRING String
)
{
ANSI_STRING AnsiString;
CHAR Buffer[33];
NTSTATUS Status;
Status = RtlIntegerToChar (Value,
Base,
33,
Buffer);
if (!NT_SUCCESS(Status))
return Status;
AnsiString.Buffer = Buffer;
AnsiString.Length = strlen (Buffer);
AnsiString.MaximumLength = 33;
Status = RtlAnsiStringToUnicodeString (String,
&AnsiString,
FALSE);
return Status;
}
/*
RtlOemStringToCountedUnicodeString
*/
ULONG
STDCALL
RtlOemStringToUnicodeSize(IN PANSI_STRING OemString)
RtlOemStringToUnicodeSize (
IN POEM_STRING OemString
)
{
ULONG Size;
@ -674,9 +827,11 @@ RtlOemStringToUnicodeSize(IN PANSI_STRING OemString)
NTSTATUS
STDCALL
RtlOemStringToUnicodeString(PUNICODE_STRING DestinationString,
PANSI_STRING SourceString,
BOOLEAN AllocateDestinationString)
RtlOemStringToUnicodeString (
IN OUT PUNICODE_STRING DestinationString,
IN POEM_STRING SourceString,
IN BOOLEAN AllocateDestinationString
)
{
NTSTATUS Status;
ULONG Length;
@ -744,9 +899,11 @@ RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString)
NTSTATUS
STDCALL
RtlUnicodeStringToAnsiString(IN OUT PANSI_STRING DestinationString,
RtlUnicodeStringToAnsiString (
IN OUT PANSI_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString)
IN BOOLEAN AllocateDestinationString
)
{
NTSTATUS Status;
ULONG Length;
@ -764,8 +921,7 @@ RtlUnicodeStringToAnsiString(IN OUT PANSI_STRING DestinationString,
if (AllocateDestinationString == TRUE)
{
DestinationString->MaximumLength = Length + sizeof(CHAR);
DestinationString->Buffer =
ExAllocatePool (NonPagedPool,
DestinationString->Buffer = ExAllocatePool (NonPagedPool,
DestinationString->MaximumLength);
if (DestinationString->Buffer == NULL)
return STATUS_NO_MEMORY;
@ -797,19 +953,29 @@ RtlUnicodeStringToAnsiString(IN OUT PANSI_STRING DestinationString,
}
/*
RtlUnicodeStringToCountedOemString
*/
NTSTATUS
STDCALL
RtlUnicodeStringToInteger(IN PUNICODE_STRING String,
RtlUnicodeStringToInteger (
IN PUNICODE_STRING String,
IN ULONG Base,
OUT PULONG Value)
OUT PULONG Value
)
{
return STATUS_NOT_IMPLEMENTED;
#if 0
char *str;
unsigned long i, lenmin=0;
BOOLEAN addneg=FALSE;
str=ExAllocatePool(NonPagedPool, String->Length+1);
for(i=0; i<String->Length; i++) {
for(i=0; i<String->Length; i++)
{
*str=*String->Buffer;
if(*str=='b') { Base=2; lenmin++; } else
@ -834,7 +1000,7 @@ RtlUnicodeStringToInteger(IN PUNICODE_STRING String,
return STATUS_INVALID_PARAMETER;
} else
if((((*str>'9') || (*str<'0')) ||
((toupper(*str)>'F') || (toupper(*str)<'A'))) && (Base==16))
((RtlUpperChar(*str)>'F') || (RtlUpperChar(*str)<'A'))) && (Base==16))
{
String->Buffer-=i;
*Value=0;
@ -843,7 +1009,7 @@ RtlUnicodeStringToInteger(IN PUNICODE_STRING String,
str++;
String->Buffer++;
};
}
*str=0;
String->Buffer-=String->Length;
@ -856,12 +1022,15 @@ RtlUnicodeStringToInteger(IN PUNICODE_STRING String,
ExFreePool(str);
return(STATUS_SUCCESS);
#endif
}
ULONG
STDCALL
RtlUnicodeStringToOemSize(IN PUNICODE_STRING UnicodeString)
RtlUnicodeStringToOemSize (
IN PUNICODE_STRING UnicodeString
)
{
ULONG Size;
@ -875,9 +1044,11 @@ RtlUnicodeStringToOemSize(IN PUNICODE_STRING UnicodeString)
NTSTATUS
STDCALL
RtlUnicodeStringToOemString(IN OUT PANSI_STRING DestinationString,
RtlUnicodeStringToOemString (
IN OUT POEM_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString)
IN BOOLEAN AllocateDestinationString
)
{
NTSTATUS Status;
ULONG Length;
@ -928,27 +1099,55 @@ RtlUnicodeStringToOemString(IN OUT PANSI_STRING DestinationString,
}
WCHAR
STDCALL
RtlUpcaseUnicodeChar (
WCHAR Source
)
{
if (Source < L'a')
return Source;
if (Source <= L'z')
return (Source - (L'a' - L'A'));
/* FIXME: characters above 'z' */
return Source;
}
NTSTATUS
STDCALL
RtlUpcaseUnicodeString(IN OUT PUNICODE_STRING DestinationString,
RtlUpcaseUnicodeString (
IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString)
IN BOOLEAN AllocateDestinationString
)
{
ULONG i;
PWCHAR Src, Dest;
if (AllocateDestinationString == TRUE)
{
DestinationString->Buffer=ExAllocatePool(NonPagedPool, SourceString->Length + sizeof(WCHAR));
DestinationString->Length = SourceString->Length;
DestinationString->MaximumLength = SourceString->Length + sizeof(WCHAR);
DestinationString->Buffer = ExAllocatePool (NonPagedPool,
SourceString->Length + sizeof(WCHAR));
if (DestinationString->Buffer == NULL)
return STATUS_NO_MEMORY;
}
else
{
if (SourceString->Length >= DestinationString->MaximumLength)
return STATUS_BUFFER_OVERFLOW;
}
Src = SourceString->Buffer;
Dest = DestinationString->Buffer;
for (i=0; i < SourceString->Length / sizeof(WCHAR); i++)
{
*Dest = towupper (*Src);
*Dest = RtlUpcaseUnicodeChar (*Src);
Dest++;
Src++;
}
@ -957,36 +1156,189 @@ RtlUpcaseUnicodeString(IN OUT PUNICODE_STRING DestinationString,
return STATUS_SUCCESS;
}
VOID
NTSTATUS
STDCALL
RtlUpcaseString(IN OUT PSTRING DestinationString,
IN PSTRING SourceString)
RtlUpcaseUnicodeStringToAnsiString (
IN OUT PANSI_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
)
{
unsigned long i, len;
PCHAR Src, Dest;
NTSTATUS Status;
ULONG Length;
if(SourceString->Length>DestinationString->MaximumLength) {
len=DestinationString->MaximumLength;
} else {
len=SourceString->Length;
};
if (NlsMbCodePageTag == TRUE)
Length = RtlUnicodeStringToAnsiSize (SourceString);
else
Length = SourceString->Length / sizeof(WCHAR);
for(i=0; i<len; i++) {
*DestinationString->Buffer=toupper(*SourceString->Buffer);
DestinationString->Buffer++;
SourceString->Buffer++;
};
*DestinationString->Buffer=0;
// if (Length > 65535)
// return STATUS_INVALID_PARAMETER_2;
DestinationString->Buffer-=len;
SourceString->Buffer-=len;
DestinationString->Length = Length;
if (AllocateDestinationString == TRUE)
{
DestinationString->MaximumLength = Length + sizeof(CHAR);
DestinationString->Buffer = ExAllocatePool (NonPagedPool,
DestinationString->MaximumLength);
if (DestinationString->Buffer == NULL)
return STATUS_NO_MEMORY;
}
else
{
if (Length >= DestinationString->Length)
return STATUS_BUFFER_OVERFLOW;
}
RtlZeroMemory (DestinationString->Buffer,
DestinationString->Length);
Status = RtlUpcaseUnicodeToMultiByteN (DestinationString->Buffer,
DestinationString->Length,
NULL,
SourceString->Buffer,
SourceString->Length);
if (!NT_SUCCESS(Status))
{
if (AllocateDestinationString)
ExFreePool (DestinationString->Buffer);
return Status;
}
DestinationString->Buffer[Length] = 0;
return STATUS_SUCCESS;
}
/*
RtlUpcaseUnicodeStringToCountedOemString
*/
NTSTATUS
STDCALL
RtlUpcaseUnicodeStringToOemString (
IN OUT POEM_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
)
{
NTSTATUS Status;
ULONG Length;
if (NlsMbOemCodePageTag == TRUE)
Length = RtlUnicodeStringToAnsiSize (SourceString);
else
Length = SourceString->Length / sizeof(WCHAR);
// if (Length > 65535)
// return STATUS_INVALID_PARAMETER_2;
DestinationString->Length = Length;
if (AllocateDestinationString == TRUE)
{
DestinationString->MaximumLength = Length + sizeof(CHAR);
DestinationString->Buffer = ExAllocatePool (NonPagedPool,
DestinationString->MaximumLength);
if (DestinationString->Buffer == NULL)
return STATUS_NO_MEMORY;
}
else
{
if (Length >= DestinationString->Length)
return STATUS_BUFFER_OVERFLOW;
}
RtlZeroMemory (DestinationString->Buffer,
DestinationString->Length);
Status = RtlUpcaseUnicodeToOemN (DestinationString->Buffer,
DestinationString->Length,
NULL,
SourceString->Buffer,
SourceString->Length);
if (!NT_SUCCESS(Status))
{
if (AllocateDestinationString)
ExFreePool (DestinationString->Buffer);
return Status;
}
DestinationString->Buffer[Length] = 0;
return STATUS_SUCCESS;
}
/*
RtlUpcaseUnicodeToCustomCP
*/
CHAR
STDCALL
RtlUpperChar (
IN CHAR Source
)
{
WCHAR Unicode;
CHAR Destination;
if (NlsMbCodePageTag == FALSE)
{
/* single-byte code page */
/* ansi->unicode */
Unicode = (WCHAR)Source;
#if 0
Unicode = NlsAnsiToUnicodeData[Source];
#endif
/* upcase conversion */
Unicode = RtlUpcaseUnicodeChar (Unicode);
/* unicode -> ansi */
Destination = (CHAR)Unicode;
#if 0
Destination = NlsUnicodeToAnsiData[Unicode];
#endif
}
else
{
/* single-byte code page */
/* FIXME: implement the multi-byte stuff!! */
Destination = Source;
}
return Destination;
}
VOID
STDCALL
RtlUpperString(PSTRING DestinationString, PSTRING SourceString)
{
UNIMPLEMENTED;
ULONG Length;
ULONG i;
PCHAR Src;
PCHAR Dest;
Length = min(SourceString->Length, DestinationString->MaximumLength - 1);
Src = SourceString->Buffer;
Dest = DestinationString->Buffer;
for (i = 0; i < Length; i++)
{
*Dest = RtlUpperChar (*Src);
Src++;
Dest++;
}
*Dest = 0;
DestinationString->Length = SourceString->Length;
}
/* EOF */

View file

@ -1,529 +0,0 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/rtl/unicode.c
* PURPOSE: String functions
* PROGRAMMER: Jason Filby (jasonfilby@yahoo.com)
* UPDATE HISTORY:
* Created 10/08/98
* Fixed bugs 21/08/98
*/
#include <base.h>
#include <internal/string.h>
#include <ddk/ntddk.h>
#include <internal/ctype.h>
#include <internal/kernel.h>
#include <internal/debug.h>
#define Aa_Difference 'A'-'a';
VOID RtlUpperString(PSTRING DestinationString, PSTRING SourceString)
{
UNIMPLEMENTED;
}
WCHAR wtoupper(WCHAR c)
{
if((c>='a') && (c<='z')) return c+Aa_Difference;
return c;
};
unsigned long wstrlen(PWSTR s)
{
WCHAR c=' ';
unsigned int len=0;
while(c!=0) {
c=*s;
s++;
len++;
};
s-=len;
return len-1;
};
ULONG RtlAnsiStringToUnicodeSize(IN PANSI_STRING AnsiString)
{
return AnsiString->Length*2;
};
NTSTATUS RtlAnsiStringToUnicodeString(IN OUT PUNICODE_STRING DestinationString,
IN PANSI_STRING SourceString, IN BOOLEAN AllocateDestinationString)
{
unsigned long i;
if(AllocateDestinationString==TRUE) {
DestinationString->Buffer=ExAllocatePool(NonPagedPool, SourceString->Length*2+1);
DestinationString->MaximumLength=SourceString->Length;
};
DestinationString->Length=SourceString->Length;
memset(DestinationString->Buffer, 0, SourceString->Length*2);
for (i=0; i<SourceString->Length; i++)
{
*DestinationString->Buffer=*SourceString->Buffer;
SourceString->Buffer++;
DestinationString->Buffer++;
};
*DestinationString->Buffer=0;
SourceString->Buffer-=SourceString->Length;
DestinationString->Buffer-=SourceString->Length;
return STATUS_SUCCESS;
};
NTSTATUS RtlAppendUnicodeStringToString(IN OUT PUNICODE_STRING Destination,
IN PUNICODE_STRING Source)
{
unsigned long i;
if(Destination->MaximumLength-Destination->Length-Source->Length<0)
return STATUS_BUFFER_TOO_SMALL;
Destination->Buffer+=Destination->Length;
for(i=0; i<Source->Length; i++) {
*Destination->Buffer=*Source->Buffer;
Destination->Buffer++;
Source->Buffer++;
};
*Destination->Buffer=0;
Destination->Buffer-=(Destination->Length+Source->Length);
Source->Buffer-=Source->Length;
Destination->Length+=Source->Length;
return STATUS_SUCCESS;
};
NTSTATUS RtlAppendUnicodeToString(IN OUT PUNICODE_STRING Destination,
IN PWSTR Source)
{
unsigned long i, slen=wstrlen(Source);
if(Destination->MaximumLength-Destination->Length-slen<0)
return STATUS_BUFFER_TOO_SMALL;
Destination->Buffer+=Destination->Length;
for(i=0; i<slen; i++) {
*Destination->Buffer=*Source;
Destination->Buffer++;
Source++;
};
*Destination->Buffer=0;
Destination->Buffer-=(Destination->Length+slen);
Source-=slen;
Destination->Length+=slen;
return STATUS_SUCCESS;
};
NTSTATUS RtlCharToInteger(IN PCSZ String, IN ULONG Base, IN OUT PULONG Value)
{
*Value=simple_strtoul((const char *)String, NULL, Base);
};
LONG RtlCompareString(PSTRING String1, PSTRING String2, BOOLEAN CaseInsensitive)
{
unsigned long i;
char c1, c2;
if(String1->Length!=String2->Length) return String1->Length-String2->Length;
for(i=0; i<String1->Length; i++) {
if(CaseInsensitive==TRUE) {
c1=toupper(*String1->Buffer);
c2=toupper(*String2->Buffer);
} else {
c1=*String1->Buffer;
c2=*String2->Buffer;
};
if(c1!=c2) {
String1->Buffer-=i;
String2->Buffer-=i;
return c1-c2;
};
String1->Buffer++;
String2->Buffer++;
};
String1->Buffer-=i;
String2->Buffer-=i;
return 0;
};
LONG RtlCompareUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2,
BOOLEAN CaseInsensitive)
{
unsigned long i;
WCHAR wc1, wc2;
if(String1->Length!=String2->Length) return
String1->Length-String2->Length;
for(i=0; i<String1->Length; i++) {
if(CaseInsensitive==TRUE) {
wc1=wtoupper(*String1->Buffer);
wc2=wtoupper(*String2->Buffer);
} else {
wc1=*String1->Buffer;
wc2=*String2->Buffer;
};
if(wc1!=wc2) {
String1->Buffer-=i;
String2->Buffer-=i;
return wc1-wc2;
};
String1->Buffer++;
String2->Buffer++;
};
String1->Buffer-=i;
String2->Buffer-=i;
return 0;
};
VOID RtlCopyString(IN OUT PSTRING DestinationString, IN PSTRING SourceString)
{
unsigned long copylen, i;
if(SourceString==NULL) {
DestinationString->Length=0;
} else {
if(SourceString->Length<DestinationString->MaximumLength) {
copylen=SourceString->Length;
} else {
copylen=DestinationString->MaximumLength;
};
for(i=0; i<copylen; i++)
{
*DestinationString->Buffer=*SourceString->Buffer;
DestinationString->Buffer++;
SourceString->Buffer++;
};
*DestinationString->Buffer=0;
DestinationString->Buffer-=copylen;
SourceString->Buffer-=copylen;
};
};
VOID RtlCopyUnicodeString(IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString)
{
unsigned long copylen, i;
if(SourceString==NULL) {
DestinationString->Length=0;
} else {
if(SourceString->Length<DestinationString->MaximumLength) {
copylen=SourceString->Length;
} else {
copylen=DestinationString->MaximumLength;
};
for(i=0; i<copylen; i++)
{
*DestinationString->Buffer=*SourceString->Buffer;
DestinationString->Buffer++;
SourceString->Buffer++;
};
*DestinationString->Buffer=0;
DestinationString->Buffer-=copylen;
SourceString->Buffer-=copylen;
};
};
BOOLEAN RtlEqualString(PSTRING String1, PSTRING String2, BOOLEAN CaseInsensitive)
{
unsigned long s1l=String1->Length;
unsigned long s2l=String2->Length;
unsigned long i;
char c1, c2;
if(s1l!=s2l) return FALSE;
for(i=0; i<s1l; i++) {
c1=*String1->Buffer;
c2=*String2->Buffer;
if(CaseInsensitive==TRUE) {
c1=toupper(c1);
c2=toupper(c2);
};
if(c1!=c2) {
String1->Buffer-=i;
String2->Buffer-=i;
return FALSE;
};
String1->Buffer++;
String2->Buffer++;
};
String1->Buffer-=i;
String2->Buffer-=i;
return TRUE;
};
BOOLEAN RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2,
BOOLEAN CaseInsensitive)
{
unsigned long s1l=String1->Length;
unsigned long s2l=String2->Length;
unsigned long i;
char wc1, wc2;
if(s1l!=s2l) return FALSE;
for(i=0; i<s1l; i++) {
if(CaseInsensitive==TRUE) {
wc1=wtoupper(*String1->Buffer);
wc2=wtoupper(*String2->Buffer);
} else {
wc1=*String1->Buffer;
wc2=*String2->Buffer;
};
if(wc1!=wc2) {
String1->Buffer-=i;
String2->Buffer-=i;
return FALSE;
};
String1->Buffer++;
String2->Buffer++;
};
String1->Buffer-=i;
String2->Buffer-=i;
return TRUE;
};
VOID RtlFreeAnsiString(IN PANSI_STRING AnsiString)
{
ExFreePool(AnsiString->Buffer);
};
VOID RtlFreeUnicodeString(IN PUNICODE_STRING UnicodeString)
{
ExFreePool(UnicodeString->Buffer);
};
VOID RtlInitAnsiString(IN OUT PANSI_STRING DestinationString,
IN PCSZ SourceString)
{
unsigned long DestSize;
if(SourceString==NULL) {
DestinationString->Length=0;
DestinationString->MaximumLength=0;
} else {
DestSize=strlen((const char *)SourceString);
DestinationString->Length=DestSize;
DestinationString->MaximumLength=DestSize+1;
};
DestinationString->Buffer=(PCHAR)SourceString;
};
VOID RtlInitString(IN OUT PSTRING DestinationString,
IN PCSZ SourceString)
{
DestinationString->Length=strlen((char *)SourceString);
DestinationString->MaximumLength=strlen((char *)SourceString)+1;
DestinationString->Buffer=SourceString;
};
VOID RtlInitUnicodeString(IN OUT PUNICODE_STRING DestinationString,
IN PCWSTR SourceString)
{
unsigned long i, DestSize;
UNICODE_STRING Dest=*DestinationString;
if(SourceString==NULL) {
DestinationString->Length=0;
DestinationString->MaximumLength=0;
DestinationString->Buffer=NULL;
} else {
DestSize=wstrlen((PWSTR)SourceString);
DestinationString->Length=DestSize;
DestinationString->MaximumLength=DestSize+1;
DestinationString->Buffer=(PWSTR)SourceString;
};
};
NTSTATUS RtlIntegerToUnicodeString(IN ULONG Value, IN ULONG Base, /* optional */
IN OUT PUNICODE_STRING String)
{
char *str;
unsigned long len, i;
str=ExAllocatePool(NonPagedPool, 1024);
if(Base==16) {
sprintf(str, "%x", Value);
} else
if(Base==8) {
sprintf(str, "%o", Value);
} else
if(Base==2) {
sprintf(str, "%b", Value);
} else {
sprintf(str, "%u", Value);
};
len=strlen(str);
if(String->MaximumLength<len) return STATUS_INVALID_PARAMETER;
for(i=0; i<len; i++) {
*String->Buffer=*str;
String->Buffer++;
str++;
};
*String->Buffer=0;
String->Buffer-=len;
String->Length=len;
str-=len;
ExFreePool(str);
return STATUS_SUCCESS;
};
NTSTATUS RtlUnicodeStringToAnsiString(IN OUT PANSI_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString)
{
unsigned long i;
if(AllocateDestinationString==TRUE) {
// Causes excetion 14(0) in _Validate_Free_List
DestinationString->Buffer=ExAllocatePool(NonPagedPool, SourceString->Length+1);
DestinationString->MaximumLength=SourceString->Length+1;
};
DestinationString->Length=SourceString->Length;
for(i=0; i<SourceString->Length; i++) {
*DestinationString->Buffer=*SourceString->Buffer;
DestinationString->Buffer++;
SourceString->Buffer++;
};
*DestinationString->Buffer=0;
DestinationString->Buffer-=SourceString->Length;
SourceString->Buffer-=SourceString->Length;
return STATUS_SUCCESS;
};
NTSTATUS RtlUnicodeStringToInteger(IN PUNICODE_STRING String, IN ULONG Base,
OUT PULONG Value)
{
char *str;
unsigned long i, lenmin=0;
BOOLEAN addneg=FALSE;
str=ExAllocatePool(NonPagedPool, String->Length+1);
for(i=0; i<String->Length; i++) {
*str=*String->Buffer;
if(*str=='b') { Base=2; lenmin++; } else
if(*str=='o') { Base=8; lenmin++; } else
if(*str=='d') { Base=10; lenmin++; } else
if(*str=='x') { Base=16; lenmin++; } else
if(*str=='+') { lenmin++; } else
if(*str=='-') { addneg=TRUE; lenmin++; } else
if((*str>'1') && (Base==2)) {
String->Buffer-=i;
*Value=0;
return STATUS_INVALID_PARAMETER;
} else
if(((*str>'7') || (*str<'0')) && (Base==8)) {
String->Buffer-=i;
*Value=0;
return STATUS_INVALID_PARAMETER;
} else
if(((*str>'9') || (*str<'0')) && (Base==10)) {
String->Buffer-=i;
*Value=0;
return STATUS_INVALID_PARAMETER;
} else
if((((*str>'9') || (*str<'0')) ||
((toupper(*str)>'F') || (toupper(*str)<'A'))) && (Base==16))
{
String->Buffer-=i;
*Value=0;
return STATUS_INVALID_PARAMETER;
} else
str++;
String->Buffer++;
};
*str=0;
String->Buffer-=String->Length;
str-=(String->Length-lenmin);
if(addneg==TRUE) {
*Value=simple_strtoul(str, NULL, Base)*-1;
} else
*Value=simple_strtoul(str, NULL, Base);
ExFreePool(str);
};
NTSTATUS RtlUpcaseUnicodeString(IN OUT PUNICODE_STRING DestinationString,
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString)
{
unsigned long i;
if(AllocateDestinationString==TRUE) {
DestinationString->Buffer=ExAllocatePool(NonPagedPool, SourceString->Length*2+1);
DestinationString->Length=SourceString->Length;
DestinationString->MaximumLength=SourceString->Length+1;
};
for(i=0; i<SourceString->Length; i++) {
*DestinationString->Buffer=wtoupper(*SourceString->Buffer);
DestinationString->Buffer++;
SourceString->Buffer++;
};
*DestinationString->Buffer=0;
DestinationString->Buffer-=SourceString->Length;
SourceString->Buffer-=SourceString->Length;
return STATUS_SUCCESS;
};
VOID RtlUpcaseString(IN OUT PSTRING DestinationString,
IN PSTRING SourceString)
{
unsigned long i, len;
if(SourceString->Length>DestinationString->MaximumLength) {
len=DestinationString->MaximumLength;
} else {
len=SourceString->Length;
};
for(i=0; i<len; i++) {
*DestinationString->Buffer=toupper(*SourceString->Buffer);
DestinationString->Buffer++;
SourceString->Buffer++;
};
*DestinationString->Buffer=0;
DestinationString->Buffer-=len;
SourceString->Buffer-=len;
};

View file

@ -1,4 +1,4 @@
/* $Id: brush.c,v 1.6 1999/11/17 20:54:05 rex Exp $
/* $Id: brush.c,v 1.7 1999/11/20 21:49:23 ekohl Exp $
*/
@ -7,7 +7,7 @@
#include <ddk/ntddk.h>
#include <win32k/bitmaps.h>
#include <win32k/brush.h>
#include <win32k/debug.h>
//#include <win32k/debug.h>
// #define NDEBUG
#include <internal/debug.h>

View file

@ -157,8 +157,8 @@ STUB(RtlRaiseException)
//STUB(RtlUnicodeToMultiByteN)
//STUB(RtlUnicodeToMultiByteSize)
STUB(RtlUnwind)
STUB(RtlUpcaseUnicodeChar)
STUB(RtlUpcaseUnicodeToMultiByteN)
//STUB(RtlUpcaseUnicodeChar)
//STUB(RtlUpcaseUnicodeToMultiByteN)
STUB(STROBJ_bEnum)
STUB(STROBJ_dwGetCodePage)
STUB(STROBJ_vEnumStart)

View file

@ -1,4 +1,4 @@
; $Id: win32k.def,v 1.6 1999/11/15 16:02:00 ekohl Exp $
; $Id: win32k.def,v 1.7 1999/11/20 21:47:58 ekohl Exp $
;
; win32k.def
;
@ -155,21 +155,21 @@ PATHOBJ_vEnumStart
PATHOBJ_vEnumStartClipLines
PATHOBJ_vGetBounds
;RtlAnsiCharToUnicodeChar = NTOSKRNL.RtlAnsiCharToUnicodeChar
;RtlAnsiCharToUnicodeChar
;RtlAnsiCharToUnicodeChar@4
; RtlMultiByteToUnicodeN = NTOSKRNL.RtlMultiByteToUnicodeN
;RtlMultiByteToUnicodeN
;RtlMultiByteToUnicodeN@20
; RtlRaiseException = NTOSKRNL.RtlRaiseException
RtlRaiseException
;RtlRaiseException
; RtlUnicodeToMultiByteN = NTOSKRNL.RtlUnicodeToMultiByteN
;RtlUnicodeToMultiByteN
;RtlUnicodeToMultiByteN@20
; RtlUnicodeToMultiByteSize = NTOSKRNL.RtlUnicodeToMultiByteSize
;RtlUnicodeToMultiByteSize
;RtlUnicodeToMultiByteSize@12
; RtlUnwind = NTOSKRNL.RtlUnwind
RtlUnwind
; RtlUpcaseUnicodeChar = NTOSKRNL.RtlUpcaseUnicodeChar
RtlUpcaseUnicodeChar
;RtlUpcaseUnicodeChar@4
; RtlUpcaseUnicodeToMultiByteN = NTOSKRNL.RtlUpcaseUnicodeToMultiByteN
RtlUpcaseUnicodeToMultiByteN
;RtlUpcaseUnicodeToMultiByteN@20
STROBJ_bEnum
STROBJ_dwGetCodePage
STROBJ_vEnumStart