From 5d1e43bb6949f05d9d7401b0b7330b7f98a658d4 Mon Sep 17 00:00:00 2001 From: mrexodia Date: Sat, 29 Jul 2017 15:23:52 +0200 Subject: [PATCH] compile on vs2010 + remove over-allocation --- TitanEngine/TitanEngine.Debugger.cpp | 2 +- TitanEngine/stdafx.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/TitanEngine/TitanEngine.Debugger.cpp b/TitanEngine/TitanEngine.Debugger.cpp index db861c8..af3f961 100644 --- a/TitanEngine/TitanEngine.Debugger.cpp +++ b/TitanEngine/TitanEngine.Debugger.cpp @@ -217,7 +217,7 @@ __declspec(dllexport) void* TITCALL InitNativeDebugW(wchar_t* szFileName, wchar_ // Convert command line and directory to UNICODE_STRING if present SIZE_T ArgumentsLength = szCommandLine != NULL ? lstrlenW(szCommandLine) : 0; SIZE_T BufferSize = ImagePath.Length + ((ArgumentsLength + 4) * sizeof(wchar_t)); - CommandLine.Buffer = (PWSTR)RtlAllocateHeap(RtlProcessHeap(), HEAP_ZERO_MEMORY, BufferSize * 10); + CommandLine.Buffer = (PWSTR)RtlAllocateHeap(RtlProcessHeap(), HEAP_ZERO_MEMORY, BufferSize); CommandLine.MaximumLength = (USHORT)BufferSize; RtlAppendUnicodeToString(&CommandLine, L"\""); RtlAppendUnicodeStringToString(&CommandLine, &ImagePath); diff --git a/TitanEngine/stdafx.h b/TitanEngine/stdafx.h index 5868bae..8008444 100644 --- a/TitanEngine/stdafx.h +++ b/TitanEngine/stdafx.h @@ -33,6 +33,22 @@ #include #include +#ifndef _Out_writes_opt_ +#define _Out_writes_opt_(x) +#endif + +#ifndef _In_reads_ +#define _In_reads_(x) +#endif + +#ifndef _Inout_updates_bytes_ +#define _Inout_updates_bytes_(x) +#endif + +#ifndef _Out_writes_bytes_opt_ +#define _Out_writes_bytes_opt_(X) +#endif + //#include #include "ntdll.h" #include "aplib.h"