Author: hbelusca Date: Sun Jan 17 01:29:43 2016 New Revision: 70603
URL: http://svn.reactos.org/svn/reactos?rev=70603&view=rev Log: [MKHIVE] - Fix two warnings in GCC Linux build (in KeBugCheckEx and in a call to the helper function RepGetValueData). - Remove two unused RTL ANSI functions. - Fix USHORT vs. ULONG type misuage. - Fix SIZE_T vs. ULONG usage.
Modified: trunk/reactos/tools/mkhive/mkhive.h trunk/reactos/tools/mkhive/reginf.c trunk/reactos/tools/mkhive/registry.c trunk/reactos/tools/mkhive/rtl.c
Modified: trunk/reactos/tools/mkhive/mkhive.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/mkhive.h?rev=7... ============================================================================== --- trunk/reactos/tools/mkhive/mkhive.h [iso-8859-1] (original) +++ trunk/reactos/tools/mkhive/mkhive.h [iso-8859-1] Sun Jan 17 01:29:43 2016 @@ -57,15 +57,6 @@ typedef LPVOID LPSECURITY_ATTRIBUTES; typedef HANDLE HKEY, *PHKEY;
-NTSTATUS NTAPI -RtlAnsiStringToUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PANSI_STRING AnsiSource, - IN BOOLEAN AllocateDestinationString); -VOID NTAPI -RtlInitAnsiString( - IN OUT PANSI_STRING DestinationString, - IN PCSTR SourceString); VOID NTAPI RtlInitUnicodeString( IN OUT PUNICODE_STRING DestinationString, @@ -79,9 +70,9 @@ IN HKEY hKey, IN LPCWSTR lpValueName, IN PULONG lpReserved, - OUT PULONG lpType, - OUT PUCHAR lpData, - OUT PSIZE_T lpcbData); + OUT PULONG lpType OPTIONAL, + OUT PUCHAR lpData OPTIONAL, + IN OUT PULONG lpcbData OPTIONAL);
LONG WINAPI RegSetValueExW( @@ -90,7 +81,7 @@ IN ULONG Reserved, IN ULONG dwType, IN const UCHAR* lpData, - IN USHORT cbData); + IN ULONG cbData);
LONG WINAPI RegDeleteKeyW(
Modified: trunk/reactos/tools/mkhive/reginf.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/reginf.c?rev=7... ============================================================================== --- trunk/reactos/tools/mkhive/reginf.c [iso-8859-1] (original) +++ trunk/reactos/tools/mkhive/reginf.c [iso-8859-1] Sun Jan 17 01:29:43 2016 @@ -119,11 +119,11 @@ IN HKEY KeyHandle, IN PWCHAR ValueName, IN PWCHAR Strings, - IN SIZE_T StringSize) + IN ULONG StringSize) { - SIZE_T Size; + ULONG Size; ULONG Type; - size_t Total; + ULONG Total; PWCHAR Buffer; PWCHAR p; size_t len; @@ -182,7 +182,7 @@ 0, REG_MULTI_SZ, (PUCHAR)Buffer, - (ULONG)Total * sizeof(WCHAR)); + Total * sizeof(WCHAR)); }
done: @@ -289,7 +289,7 @@ if (Str == NULL) return FALSE;
- InfHostGetMultiSzField (Context, 5, Str, (ULONG)Size, NULL); + InfHostGetMultiSzField (Context, 5, Str, Size, NULL); }
if (Flags & FLG_ADDREG_APPEND) @@ -319,7 +319,7 @@ if (Str == NULL) return FALSE;
- InfHostGetStringField (Context, 5, Str, (ULONG)Size, NULL); + InfHostGetStringField (Context, 5, Str, Size, NULL); } }
@@ -349,7 +349,7 @@ 0, Type, (PVOID)Str, - (ULONG)Size * sizeof(WCHAR)); + Size * sizeof(WCHAR)); } else { @@ -359,7 +359,7 @@ 0, Type, (PVOID)&EmptyStr, - (ULONG)sizeof(WCHAR)); + sizeof(WCHAR)); } } free (Str); @@ -387,7 +387,7 @@ 0, Type, (PVOID)Data, - (ULONG)Size); + Size);
free (Data); }
Modified: trunk/reactos/tools/mkhive/registry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/registry.c?rev... ============================================================================== --- trunk/reactos/tools/mkhive/registry.c [iso-8859-1] (original) +++ trunk/reactos/tools/mkhive/registry.c [iso-8859-1] Sun Jan 17 01:29:43 2016 @@ -518,7 +518,7 @@ IN ULONG Reserved, IN ULONG dwType, IN const UCHAR* lpData, - IN USHORT cbData) + IN ULONG cbData) { PMEMKEY Key = HKEY_TO_MEMKEY(hKey); // ParentKey PHHIVE Hive; @@ -528,7 +528,7 @@ UNICODE_STRING ValueNameString;
PVOID DataCell; - LONG DataCellSize; + ULONG DataCellSize; NTSTATUS Status;
if (dwType == REG_LINK) @@ -597,7 +597,7 @@ if (!DataCell) return ERROR_UNSUCCESSFUL;
- DataCellSize = -HvGetCellSize(Hive, DataCell); + DataCellSize = (ULONG)(-HvGetCellSize(Hive, DataCell)); } else { @@ -613,12 +613,12 @@ HvFreeCell(Hive, ValueCell->Data);
RtlCopyMemory(&ValueCell->Data, lpData, cbData); - ValueCell->DataLength = (ULONG)(cbData | CM_KEY_VALUE_SPECIAL_SIZE); + ValueCell->DataLength = (cbData | CM_KEY_VALUE_SPECIAL_SIZE); ValueCell->Type = dwType; } else { - if (cbData > (SIZE_T)DataCellSize) + if (cbData > DataCellSize) { /* New data size is larger than the current, destroy current * data block and allocate a new one. */ @@ -642,7 +642,7 @@
/* Copy new contents to cell */ RtlCopyMemory(DataCell, lpData, cbData); - ValueCell->DataLength = (ULONG)(cbData & ~CM_KEY_VALUE_SPECIAL_SIZE); + ValueCell->DataLength = (cbData & ~CM_KEY_VALUE_SPECIAL_SIZE); ValueCell->Type = dwType; HvMarkCellDirty(Hive, ValueCell->Data, FALSE); } @@ -712,7 +712,7 @@ IN PULONG lpReserved, OUT PULONG lpType OPTIONAL, OUT PUCHAR lpData OPTIONAL, - IN OUT PSIZE_T lpcbData OPTIONAL) + IN OUT PULONG lpcbData OPTIONAL) { PMEMKEY ParentKey = HKEY_TO_MEMKEY(hKey); PHHIVE Hive = &ParentKey->RegistryHive->Hive;
Modified: trunk/reactos/tools/mkhive/rtl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/rtl.c?rev=7060... ============================================================================== --- trunk/reactos/tools/mkhive/rtl.c [iso-8859-1] (original) +++ trunk/reactos/tools/mkhive/rtl.c [iso-8859-1] Sun Jan 17 01:29:43 2016 @@ -16,34 +16,6 @@
#include "mkhive.h" #include <bitmap.c> - -/* - * @implemented - * - * NOTES - * If source is NULL the length of source is assumed to be 0. - */ -VOID NTAPI -RtlInitAnsiString( - IN OUT PANSI_STRING DestinationString, - IN PCSTR SourceString) -{ - SIZE_T DestSize; - - if(SourceString) - { - DestSize = strlen(SourceString); - DestinationString->Length = (USHORT)DestSize; - DestinationString->MaximumLength = (USHORT)DestSize + sizeof(CHAR); - } - else - { - DestinationString->Length = 0; - DestinationString->MaximumLength = 0; - } - - DestinationString->Buffer = (PCHAR)SourceString; -}
/* * @implemented @@ -71,41 +43,6 @@ }
DestinationString->Buffer = (PWCHAR)SourceString; -} - -NTSTATUS NTAPI -RtlAnsiStringToUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PANSI_STRING AnsiSource, - IN BOOLEAN AllocateDestinationString) -{ - ULONG Length; - PUCHAR WideString; - USHORT i; - - Length = AnsiSource->Length * sizeof(WCHAR); - if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; - UniDest->Length = (USHORT)Length; - - if (AllocateDestinationString) - { - UniDest->MaximumLength = (USHORT)Length + sizeof(WCHAR); - UniDest->Buffer = (PWSTR) malloc(UniDest->MaximumLength); - if (!UniDest->Buffer) - return STATUS_NO_MEMORY; - } - else if (UniDest->Length >= UniDest->MaximumLength) - { - return STATUS_BUFFER_OVERFLOW; - } - - WideString = (PUCHAR)UniDest->Buffer; - for (i = 0; i <= AnsiSource->Length; i++) - { - WideString[2 * i + 0] = AnsiSource->Buffer[i]; - WideString[2 * i + 1] = 0; - } - return STATUS_SUCCESS; }
LONG NTAPI @@ -222,14 +159,14 @@ VOID NTAPI KeBugCheckEx( - IN ULONG BugCheckCode, + IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4) { char Buffer[70]; - printf("*** STOP: 0x%08lX (0x%08lX, 0x%08lX, 0x%08lX, 0x%08lX)", + printf("*** STOP: 0x%08X (0x%08lX, 0x%08lX, 0x%08lX, 0x%08lX)", BugCheckCode, BugCheckParameter1, BugCheckParameter2, BugCheckParameter3, BugCheckParameter4); ASSERT(FALSE);