fix windows compilation, fix setmem usage

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2019-10-16 15:38:41 +03:00
parent da51723696
commit 902c497ab0
3 changed files with 26 additions and 8 deletions

View File

@ -14,6 +14,18 @@
#define APTIOMEMORYFIX_PROTOCOL_REVISION 27
#include <Library/UefiLib.h>
//#ifndef EFIAPI
//#if _MSC_EXTENSIONS
///
/// Define the standard calling convention regardless of optimization level.
/// __cdecl is Microsoft* specific C extension.
///
//#define EFIAPI __cdecl
//#endif
//#endif
//
// APTIOMEMORYFIX_PROTOCOL_GUID
// C7CBA84E-CC77-461D-9E3C-6BE0CB79A7C1
@ -26,8 +38,7 @@
//
typedef
BOOLEAN
EFIAPI
(*AMF_SET_NVRAM_REDIRECT) (
(EFIAPI *AMF_SET_NVRAM_REDIRECT) (
IN BOOLEAN NewValue
);

View File

@ -33,7 +33,7 @@ set DEFAULT_CYGWIN_HOME=c:\cygwin
set DEFAULT_PYTHONHOME=
rem d:\Program File\Python37"
set DEFAULT_PYTHON_FREEZER_PATH=%PYTHON_HOME%\Scripts
rem set PYTHON3_ENABLE=TRUE
set PYTHON3_ENABLE=FALSE
set DEFAULT_NASM_PREFIX=
rem C:\Program Files (x86)\NASM"
rem # %DEFAULT_CYGWIN_HOME%\bin
@ -53,10 +53,17 @@ if errorlevel 1 (
rem # get the current revision number
:getrevision
rem get svn revision number
set F_VER_TXT=vers.txt
rem set F_VER_TXT=vers.txt
rem # svnversion -n>%F_VER_TXT%
set /P s=<%F_VER_TXT%
rem set /P s=<%F_VER_TXT%
rem # del %F_VER_TXT%
git rev-list --tags --max-count=1 > revs.txt
set /p c=< revs.txt
del revs.txt
git describe --tags %c% > vers.txt
set /P s=< vers.txt
del vers.txt
set SVNREVISION=
rem # get the current revision number

View File

@ -1175,7 +1175,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
Patches->KextPatches[Patches->NrKexts].MaskFind = NULL;
} else {
Patches->KextPatches[Patches->NrKexts].MaskFind = AllocatePool (FindLen);
SetMem(Patches->KextPatches[Patches->NrKexts].MaskFind, 0xFF, FindLen);
SetMem(Patches->KextPatches[Patches->NrKexts].MaskFind, FindLen, 0xFF);
CopyMem(Patches->KextPatches[Patches->NrKexts].MaskFind, TmpData, MaskLen);
}
FreePool(TmpData);
@ -1318,7 +1318,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
Patches->KernelPatches[Patches->NrKexts].MaskFind = NULL;
} else {
Patches->KernelPatches[Patches->NrKexts].MaskFind = AllocatePool (FindLen);
SetMem(Patches->KernelPatches[Patches->NrKexts].MaskFind, 0xFF, FindLen);
SetMem(Patches->KernelPatches[Patches->NrKexts].MaskFind, FindLen, 0xFF);
CopyMem(Patches->KernelPatches[Patches->NrKexts].MaskFind, TmpData, MaskLen);
}
FreePool(TmpData);
@ -1443,7 +1443,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
Patches->BootPatches[Patches->NrKexts].MaskFind = NULL;
} else {
Patches->BootPatches[Patches->NrKexts].MaskFind = AllocatePool (FindLen);
SetMem(Patches->BootPatches[Patches->NrKexts].MaskFind, 0xFF, FindLen);
SetMem(Patches->BootPatches[Patches->NrKexts].MaskFind, FindLen, 0xFF);
CopyMem(Patches->BootPatches[Patches->NrKexts].MaskFind, TmpData, MaskLen);
}
FreePool(TmpData);