diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index cd6ce4a22f2..9b92c7f8c2e 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -306,14 +306,8 @@ endfunction() set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def --kill-at --output-lib=") set(CMAKE_IMPLIB_DELAYED_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def --kill-at --output-delaylib=") function(spec2def _dllname _spec_file) - # Do we also want to add importlib targets? - if(${ARGC} GREATER 2) - if(${ARGN} STREQUAL "ADD_IMPORTLIB") - set(__add_importlib TRUE) - else() - message(FATAL_ERROR "Wrong argument passed to spec2def, ${ARGN}") - endif() - endif() + + cmake_parse_arguments(__spec2def "ADD_IMPORTLIB;WITH_RELAY" "" "" ${ARGN}) # Get library basename get_filename_component(_file ${_dllname} NAME_WE) @@ -323,13 +317,17 @@ function(spec2def _dllname _spec_file) message(FATAL_ERROR "spec2def only takes spec files as input.") endif() + if (__spec2def_WITH_RELAY) + set(__with_relay_arg "--with-tracing") + endif() + # Generate exports def and C stubs file for the DLL add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c - COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} + COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${__with_relay_arg} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def) - if(__add_importlib) + if(__spec2def_ADD_IMPORTLIB) generate_import_lib(lib${_file} ${_dllname} ${_spec_file}) endif() endfunction() diff --git a/reactos/include/reactos/stubs.h b/reactos/include/reactos/stubs.h index 322b89b3e98..f81e53aa45c 100644 --- a/reactos/include/reactos/stubs.h +++ b/reactos/include/reactos/stubs.h @@ -1,13 +1,19 @@ #include #define WIN32_NO_STATUS #include -#include #include #include ULONG __cdecl DbgPrint(_In_z_ _Printf_format_string_ PCSTR Format, ...); +VOID +WINAPI +RaiseException(_In_ DWORD dwExceptionCode, + _In_ DWORD dwExceptionFlags, + _In_ DWORD nNumberOfArguments, + _In_ CONST ULONG_PTR *lpArguments OPTIONAL); + #define __wine_spec_unimplemented_stub(module, function) \ { \ ULONG_PTR args[2]; \ diff --git a/reactos/tools/spec2def/spec2def.c b/reactos/tools/spec2def/spec2def.c index 0bb66a0bc06..61357a2c328 100644 --- a/reactos/tools/spec2def/spec2def.c +++ b/reactos/tools/spec2def/spec2def.c @@ -764,12 +764,20 @@ ParseFile(char* pcStart, FILE *fileDest, PFNOUTLINE OutputLine) exp.nStackBytes += 8; exp.anArgs[exp.nArgCount] = ARG_DBL; } - else if (CompareToken(pc, "ptr") || - CompareToken(pc, "str") || - CompareToken(pc, "wstr")) + else if (CompareToken(pc, "ptr")) { exp.nStackBytes += 4; // sizeof(void*) on x86 - exp.anArgs[exp.nArgCount] = ARG_PTR; // FIXME: handle strings + exp.anArgs[exp.nArgCount] = ARG_PTR; + } + else if (CompareToken(pc, "str")) + { + exp.nStackBytes += 4; // sizeof(void*) on x86 + exp.anArgs[exp.nArgCount] = ARG_STR; + } + else if (CompareToken(pc, "wstr")) + { + exp.nStackBytes += 4; // sizeof(void*) on x86 + exp.anArgs[exp.nArgCount] = ARG_WSTR; } else if (CompareToken(pc, "int64")) {