From 9f1bf9ce45537de384216aa7492322d5adc55cce Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 12 Jan 2014 21:55:20 +0000 Subject: [PATCH] [FREELDR/CMLIB] Update Copyright year and fix GCC build svn path=/trunk/; revision=61596 --- reactos/boot/freeldr/freeldr/reactos/registry.c | 7 +++---- reactos/lib/cmlib/cmlib.h | 12 +++++++++++- reactos/lib/cmlib/cmtools.c | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/reactos/registry.c b/reactos/boot/freeldr/freeldr/reactos/registry.c index f80ff8e9725..8126a5c00b6 100644 --- a/reactos/boot/freeldr/freeldr/reactos/registry.c +++ b/reactos/boot/freeldr/freeldr/reactos/registry.c @@ -1,7 +1,7 @@ /* * FreeLoader * - * Copyright (C) 2001, 2002 Timo Kreuzer + * Copyright (C) 2014 Timo Kreuzer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,13 +53,13 @@ RegImportBinaryHive( NULL); if (!NT_SUCCESS(Status)) { - CmpFree(CmHive, 0); + FrLdrTempFree(CmHive, 'eviH'); ERR("Invalid hive Signature!\n"); return FALSE; } /* Save the root key node */ - RootKeyNode = HvGetCell(&CmHive->Hive, Hive->BaseBlock->RootCell); + RootKeyNode = HvGetCell(&CmHive->Hive, CmHive->Hive.BaseBlock->RootCell); TRACE("RegImportBinaryHive done\n"); return TRUE; @@ -316,7 +316,6 @@ RegOpenKey( _Out_ PFRLDRHKEY Key) { UNICODE_STRING RemainingPath, SubKeyName; - UNICODE_STRING RegistryStartPath = RTL_CONSTANT_STRING(L"\\Registry\\MACHINE\\SYSTEM"); UNICODE_STRING CurrentControlSet = RTL_CONSTANT_STRING(L"CurrentControlSet"); PHHIVE Hive = &CmHive->Hive; PCM_KEY_NODE KeyNode; diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h index a5a0b473abb..03d3851bd53 100644 --- a/reactos/lib/cmlib/cmlib.h +++ b/reactos/lib/cmlib/cmlib.h @@ -20,6 +20,16 @@ #define strcasecmp _stricmp #endif//_WIN32 + #ifndef _MSC_VER + #define _In_ + #define _Out_ + #define _Inout_ + #endif + + #ifndef min + #define min(a, b) (((a) < (b)) ? (a) : (b)) + #endif + // Definitions copied from // We only want to include host headers, so we define them manually #define STATUS_SUCCESS ((NTSTATUS)0x00000000) @@ -350,7 +360,7 @@ CmCompareKeyValueName( ULONG NTAPI CmCopyKeyName( - IN PCM_KEY_NODE KeyNode, + _In_ PCM_KEY_NODE KeyNode, _Out_ PWCHAR KeyNameBuffer, _Inout_ ULONG BufferLength); diff --git a/reactos/lib/cmlib/cmtools.c b/reactos/lib/cmlib/cmtools.c index 8c948462cdc..41a28e8bdd1 100644 --- a/reactos/lib/cmlib/cmtools.c +++ b/reactos/lib/cmlib/cmtools.c @@ -183,7 +183,7 @@ CmCopyPackedName( } } - if (BufferLength >= NameLength + sizeof(UNICODE_NULL)) + if (BufferLength >= NameLength + sizeof(WCHAR)) { Buffer[NameLength / sizeof(WCHAR)] = '\0'; } @@ -194,7 +194,7 @@ CmCopyPackedName( ULONG NTAPI CmCopyKeyName( - IN PCM_KEY_NODE KeyNode, + _In_ PCM_KEY_NODE KeyNode, _Out_ PWCHAR KeyNameBuffer, _Inout_ ULONG BufferLength) {