From 5b164bcd857543cc56cb99df490b0d2e88665a0e Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 29 Sep 2014 17:43:32 +0000 Subject: [PATCH] [SPEC2DEF] Fix asm stubs for thiscall functions. CORE-8576 #resolve svn path=/trunk/; revision=64400 --- reactos/tools/spec2def/spec2def.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/reactos/tools/spec2def/spec2def.c b/reactos/tools/spec2def/spec2def.c index b6c29cc410b..5264f4104b5 100644 --- a/reactos/tools/spec2def/spec2def.c +++ b/reactos/tools/spec2def/spec2def.c @@ -385,7 +385,7 @@ OutputHeader_asmstub(FILE *file, char *libname) } void -Output_symbol(FILE *fileDest, char* pszSymbolName) +Output_stublabel(FILE *fileDest, char* pszSymbolName) { if (giArch == ARCH_ARM) { @@ -429,19 +429,21 @@ OutputLine_asmstub(FILE *fileDest, EXPORT *pexp) sprintf(szNameBuffer, "@_stub_%.*s@%d", pexp->strName.len, pexp->strName.buf, pexp->nStackBytes); } - else if (pexp->nCallingConvention == CC_CDECL || - pexp->nCallingConvention == CC_STUB) + else if ((pexp->nCallingConvention == CC_CDECL) || + (pexp->nCallingConvention == CC_THISCALL) || + (pexp->nCallingConvention == CC_EXTERN) || + (pexp->nCallingConvention == CC_STUB)) { sprintf(szNameBuffer, "__stub_%.*s", pexp->strName.len, pexp->strName.buf); } - else if (pexp->nCallingConvention == CC_EXTERN) + else { - sprintf(szNameBuffer, "__stub_%.*s", - pexp->strName.len, pexp->strName.buf); + fprintf(stderr, "Invalid calling convention"); + return 0; } - Output_symbol(fileDest, szNameBuffer); + Output_stublabel(fileDest, szNameBuffer); return 1; } -- 2.17.1