https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6d2381631fb9b8672ae6495f16bcfb6074dbfbc5

commit 6d2381631fb9b8672ae6495f16bcfb6074dbfbc5
Author:     Mark Jansen <[email protected]>
AuthorDate: Tue Aug 20 19:09:10 2019 +0200
Commit:     Mark Jansen <[email protected]>
CommitDate: Fri Aug 23 18:10:28 2019 +0200

    [TESTS] Add a test for spec2def
---
 modules/rostests/tests/CMakeLists.txt              |   1 +
 modules/rostests/tests/spec2def/CMakeLists.txt     |   3 +
 modules/rostests/tests/spec2def/test.py            | 113 +++++++++++++++++++++
 modules/rostests/tests/spec2def/test.spec          |  19 ++++
 .../rostests/tests/spec2def/testdata/01-test.def   |  14 +++
 .../rostests/tests/spec2def/testdata/02-test.def   |  13 +++
 .../rostests/tests/spec2def/testdata/03-stubs.c    |  17 ++++
 .../rostests/tests/spec2def/testdata/03-test.def   |  14 +++
 .../rostests/tests/spec2def/testdata/04-stubs.c    |  17 ++++
 .../rostests/tests/spec2def/testdata/04-test.def   |  13 +++
 .../rostests/tests/spec2def/testdata/05-stubs.c    |  59 +++++++++++
 .../rostests/tests/spec2def/testdata/05-test.def   |  14 +++
 .../rostests/tests/spec2def/testdata/06-stubs.asm  |  25 +++++
 .../rostests/tests/spec2def/testdata/06-test.def   |  14 +++
 .../rostests/tests/spec2def/testdata/07-stubs.asm  |  21 ++++
 .../rostests/tests/spec2def/testdata/07-test.def   |  13 +++
 .../rostests/tests/spec2def/testdata/08-stubs.c    |  17 ++++
 .../rostests/tests/spec2def/testdata/08-test.def   |  14 +++
 .../rostests/tests/spec2def/testdata/09-stubs.c    |  17 ++++
 .../rostests/tests/spec2def/testdata/09-test.def   |  13 +++
 .../rostests/tests/spec2def/testdata/10-stubs.c    |  59 +++++++++++
 .../rostests/tests/spec2def/testdata/10-test.def   |  14 +++
 22 files changed, 504 insertions(+)

diff --git a/modules/rostests/tests/CMakeLists.txt 
b/modules/rostests/tests/CMakeLists.txt
index 9e2f07c19de..78164342591 100644
--- a/modules/rostests/tests/CMakeLists.txt
+++ b/modules/rostests/tests/CMakeLists.txt
@@ -3,3 +3,4 @@ if(NOT MSVC)
     add_subdirectory(pseh2)
 endif()
 add_subdirectory(dllexport)
+add_subdirectory(spec2def)
diff --git a/modules/rostests/tests/spec2def/CMakeLists.txt 
b/modules/rostests/tests/spec2def/CMakeLists.txt
new file mode 100644
index 00000000000..9553930a3a4
--- /dev/null
+++ b/modules/rostests/tests/spec2def/CMakeLists.txt
@@ -0,0 +1,3 @@
+
+add_custom_target(spec2def_test
+    py -3 ${CMAKE_CURRENT_SOURCE_DIR}/test.py $<TARGET_FILE:native-spec2def>)
diff --git a/modules/rostests/tests/spec2def/test.py 
b/modules/rostests/tests/spec2def/test.py
new file mode 100644
index 00000000000..122af4f978f
--- /dev/null
+++ b/modules/rostests/tests/spec2def/test.py
@@ -0,0 +1,113 @@
+import subprocess
+import os
+import tempfile
+import sys
+import difflib
+
+# ${_spec_file} = ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
+# spec2def -n=${_dllname} -a=${ARCH} ${ARGN} --implib 
-d=${BIN_PATH}/${_libname}_implib.def ${_spec_file}
+# spec2def -n=${_dllname} -a=${ARCH} -d=${BIN_PATH}/${_file}.def 
-s=${BIN_PATH}/${_file}_stubs.c ${__with_relay_arg} ${__version_arg} 
${_spec_file}
+# spec2def --ms -a=${_ARCH} --implib -n=${_dllname} -d=${_def_file} 
-l=${_asm_stubs_file} ${_spec_file}
+# spec2def --ms -a=${ARCH} -n=${_dllname} -d=${BIN_PATH}/${_file}.def 
-s=${BIN_PATH}/${_file}_stubs.c ${__with_relay_arg} ${__version_arg} 
${_spec_file}
+
+SCRIPT_DIR = os.path.dirname(__file__)
+SPEC_FILE = os.path.join(SCRIPT_DIR, 'test.spec')
+DATA_DIR = os.path.join(SCRIPT_DIR, 'testdata')
+
+class ResultFile:
+    def __init__(self, datadir, filename):
+        self.filename = filename
+        with open(os.path.join(datadir, filename), 'r') as content:
+            self.data = content.read()
+
+    def normalize(self):
+        data = self.data.splitlines()
+        data = [line for line in data if line]
+        return '\n'.join(data)
+
+
+class TestCase:
+    def __init__(self, spec_args, prefix):
+        self.spec_args = spec_args
+        self.prefix = prefix
+        self.expect_files = []
+        self.result_files = []
+        self.stdout = self.stderr = None
+        self.returncode = None
+
+    def run(self, cmd, tmpdir, all_datafiles):
+        datafiles = [filename for filename in all_datafiles if 
filename.startswith(self.prefix)]
+        self.expect_files = [ResultFile(DATA_DIR, datafile) for datafile in 
datafiles]
+        tmppath = os.path.join(tmpdir, self.prefix)
+        args = [elem.replace('$tmp$', tmppath) for elem in self.spec_args]
+        args = [cmd] + args + [SPEC_FILE]
+        proc = subprocess.Popen(args, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
+        self.stdout, self.stderr = proc.communicate()
+        self.returncode = proc.returncode
+        self.result_files = [ResultFile(tmpdir, tmpfile) for tmpfile in 
os.listdir(tmpdir)]
+
+    def verify(self):
+        if False:
+            for result in self.result_files:
+                with open(os.path.join(DATA_DIR, result.filename), 'w') as 
content:
+                    content.write(result.data)
+            return
+
+        if self.returncode != 0:
+            print('Failed return code', self.returncode, 'for', self.prefix)
+            return
+        self.expect_files.sort(key= lambda elem: elem.filename)
+        self.result_files.sort(key= lambda elem: elem.filename)
+        exp_len = len(self.expect_files)
+        res_len = len(self.result_files)
+        if exp_len != res_len:
+            print('Not enough files for', self.prefix, 'got:', res_len, 
'wanted:', exp_len)
+            return
+
+        for n in range(len(self.expect_files)):
+            exp = self.expect_files[n]
+            res = self.result_files[n]
+            if exp.normalize() == res.normalize():
+                # Content 100% the same, ignoring empty newlines
+                continue
+
+            exp_name = 'expected/' + exp.filename
+            res_name = 'output/' + res.filename
+            exp = exp.data.splitlines()
+            res = res.data.splitlines()
+            diff = difflib.unified_diff(exp, res, fromfile=exp_name, 
tofile=res_name, lineterm='')
+            for line in diff:
+                print(line)
+
+
+TEST_CASES = [
+    # GCC implib
+    TestCase([ '-n=testdll.xyz', '-a=i386', '--implib', '-d=$tmp$test.def', 
'--no-private-warnings' ], '01-'),
+    TestCase([ '-n=testdll.xyz', '-a=x86_64', '--implib', '-d=$tmp$test.def', 
'--no-private-warnings' ], '02-'),
+    # GCC normal
+    TestCase([ '-n=testdll.xyz', '-a=i386', '-d=$tmp$test.def', 
'-s=$tmp$stubs.c' ], '03-'),
+    TestCase([ '-n=testdll.xyz', '-a=x86_64', '-d=$tmp$test.def', 
'-s=$tmp$stubs.c' ], '04-'),
+    TestCase([ '-n=testdll.xyz', '-a=i386', '-d=$tmp$test.def', 
'-s=$tmp$stubs.c', '--with-tracing' ], '05-'),
+    # MSVC implib
+    TestCase([ '--ms', '-n=testdll.xyz', '-a=i386', '--implib', 
'-d=$tmp$test.def', '-l=$tmp$stubs.asm' ], '06-'),
+    TestCase([ '--ms', '-n=testdll.xyz', '-a=x86_64', '--implib', 
'-d=$tmp$test.def', '-l=$tmp$stubs.asm' ], '07-'),
+    # MSVC normal
+    TestCase([ '--ms', '-n=testdll.xyz', '-a=i386', '-d=$tmp$test.def', 
'-s=$tmp$stubs.c' ], '08-'),
+    TestCase([ '--ms', '-n=testdll.xyz', '-a=x86_64', '-d=$tmp$test.def', 
'-s=$tmp$stubs.c' ], '09-'),
+    TestCase([ '--ms', '-n=testdll.xyz', '-a=i386', '-d=$tmp$test.def', 
'-s=$tmp$stubs.c', '--with-tracing' ], '10-'),
+]
+
+
+def run_test(testcase, cmd, all_files):
+    with tempfile.TemporaryDirectory() as tmpdirname:
+        testcase.run(cmd, tmpdirname, all_files)
+        testcase.verify()
+
+def main(args):
+    cmd = args[0] if args else 'spec2def'
+    all_files = os.listdir(DATA_DIR)
+    for testcase in TEST_CASES:
+        run_test(testcase, cmd, all_files)
+
+if __name__ == '__main__':
+    main(sys.argv[1:])
diff --git a/modules/rostests/tests/spec2def/test.spec 
b/modules/rostests/tests/spec2def/test.spec
new file mode 100644
index 00000000000..52fbdbd5046
--- /dev/null
+++ b/modules/rostests/tests/spec2def/test.spec
@@ -0,0 +1,19 @@
+; Comments be here()
+
+# 2 stdcall CommentedOutFunction(ptr long ptr ptr) # comment 2
+6 fastcall FastcallFunction(ptr ptr ptr long)
+@ stdcall StdcallFunction(long)
+8 fastcall -ret64 Ret64Function(double)
+
+7 fastcall -arch=i386 Fastcalli386(long)
+10 stdcall -arch=i386,x86_64 Stdcalli386x64()
+
+@ stdcall -version=0x351-0x502 StdcallVersionRange(long long wstr wstr)
+@ stdcall -stub -version=0x600+ StdcallStubVersion600(ptr)
+
+@ stdcall StdcallForwarderToSameDll() StdcallTargetInSameDll
+@ stdcall -version=0x600+ StdcallForwarder(ptr ptr ptr) 
ntdll.RtlStdcallForwarder
+
+@ stub StubFunction
+@ stdcall -stub StdcallSuccessStub(ptr)
+
diff --git a/modules/rostests/tests/spec2def/testdata/01-test.def 
b/modules/rostests/tests/spec2def/testdata/01-test.def
new file mode 100644
index 00000000000..fded88c0f4f
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/01-test.def
@@ -0,0 +1,14 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ @FastcallFunction@16
+ StdcallFunction@4
+ @Ret64Function@8
+ @Fastcalli386@4
+ Stdcalli386x64@0
+ StdcallVersionRange@16
+ StdcallForwarderToSameDll@0=StdcallTargetInSameDll@0
+ StubFunction
+ StdcallSuccessStub@4
diff --git a/modules/rostests/tests/spec2def/testdata/02-test.def 
b/modules/rostests/tests/spec2def/testdata/02-test.def
new file mode 100644
index 00000000000..5884c6f74c3
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/02-test.def
@@ -0,0 +1,13 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction
+ StdcallFunction
+ Ret64Function
+ Stdcalli386x64
+ StdcallVersionRange
+ StdcallForwarderToSameDll=StdcallTargetInSameDll
+ StubFunction
+ StdcallSuccessStub
diff --git a/modules/rostests/tests/spec2def/testdata/03-stubs.c 
b/modules/rostests/tests/spec2def/testdata/03-stubs.c
new file mode 100644
index 00000000000..2e8ea99472c
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/03-stubs.c
@@ -0,0 +1,17 @@
+/* This file is autogenerated, do not edit. */
+
+#include <stubs.h>
+
+int StubFunction()
+{
+       DbgPrint("WARNING: calling stub StubFunction()\n");
+       __wine_spec_unimplemented_stub("testdll.xyz", __FUNCTION__);
+       return 0;
+}
+
+int __stdcall StdcallSuccessStub(void* a0)
+{
+       DbgPrint("WARNING: calling stub StdcallSuccessStub(0x%p)\n", (void*)a0);
+       return 0;
+}
+
diff --git a/modules/rostests/tests/spec2def/testdata/03-test.def 
b/modules/rostests/tests/spec2def/testdata/03-test.def
new file mode 100644
index 00000000000..3867a320ac3
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/03-test.def
@@ -0,0 +1,14 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction=@FastcallFunction@16 @6
+ StdcallFunction=StdcallFunction@4
+ Ret64Function=@Ret64Function@8 @8
+ Fastcalli386=@Fastcalli386@4 @7
+ Stdcalli386x64=Stdcalli386x64@0 @10
+ StdcallVersionRange=StdcallVersionRange@16
+ StdcallForwarderToSameDll=StdcallTargetInSameDll@0
+ StubFunction
+ StdcallSuccessStub=StdcallSuccessStub@4
diff --git a/modules/rostests/tests/spec2def/testdata/04-stubs.c 
b/modules/rostests/tests/spec2def/testdata/04-stubs.c
new file mode 100644
index 00000000000..5fcc8f47bf0
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/04-stubs.c
@@ -0,0 +1,17 @@
+/* This file is autogenerated, do not edit. */
+
+#include <stubs.h>
+
+int StubFunction()
+{
+       DbgPrint("WARNING: calling stub StubFunction()\n");
+       __wine_spec_unimplemented_stub("testdll.xyz", __FUNCTION__);
+       return 0;
+}
+
+int StdcallSuccessStub(void* a0)
+{
+       DbgPrint("WARNING: calling stub StdcallSuccessStub(0x%p)\n", (void*)a0);
+       return 0;
+}
+
diff --git a/modules/rostests/tests/spec2def/testdata/04-test.def 
b/modules/rostests/tests/spec2def/testdata/04-test.def
new file mode 100644
index 00000000000..7331f890b22
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/04-test.def
@@ -0,0 +1,13 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction @6
+ StdcallFunction
+ Ret64Function @8
+ Stdcalli386x64 @10
+ StdcallVersionRange
+ StdcallForwarderToSameDll=StdcallTargetInSameDll
+ StubFunction
+ StdcallSuccessStub
diff --git a/modules/rostests/tests/spec2def/testdata/05-stubs.c 
b/modules/rostests/tests/spec2def/testdata/05-stubs.c
new file mode 100644
index 00000000000..6194756a81d
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/05-stubs.c
@@ -0,0 +1,59 @@
+/* This file is autogenerated, do not edit. */
+
+#include <stubs.h>
+#include <wine/debug.h>
+#include <inttypes.h>
+WINE_DECLARE_DEBUG_CHANNEL(relay);
+
+extern int __stdcall StdcallFunction(long a0);
+
+int __stdcall $relaytrace$StdcallFunction(long a0)
+{
+       int retval;
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: StdcallFunction(0x%lx)\n", (long)a0);
+       retval = StdcallFunction(a0);
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: StdcallFunction: retval = 0x%lx\n", 
retval);
+       return retval;
+}
+
+extern int __stdcall Stdcalli386x64();
+
+int __stdcall $relaytrace$Stdcalli386x64()
+{
+       int retval;
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: Stdcalli386x64()\n");
+       retval = Stdcalli386x64();
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: Stdcalli386x64: retval = 0x%lx\n", 
retval);
+       return retval;
+}
+
+extern int __stdcall StdcallVersionRange(long a0, long a1, wchar_t* a2, 
wchar_t* a3);
+
+int __stdcall $relaytrace$StdcallVersionRange(long a0, long a1, wchar_t* a2, 
wchar_t* a3)
+{
+       int retval;
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: 
StdcallVersionRange(0x%lx,0x%lx,'%ws','%ws')\n", (long)a0, (long)a1, 
(wchar_t*)a2, (wchar_t*)a3);
+       retval = StdcallVersionRange(a0, a1, a2, a3);
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: StdcallVersionRange: retval = 0x%lx\n", 
retval);
+       return retval;
+}
+
+int StubFunction()
+{
+       DbgPrint("WARNING: calling stub StubFunction()\n");
+       __wine_spec_unimplemented_stub("testdll.xyz", __FUNCTION__);
+       return 0;
+}
+
+int __stdcall StdcallSuccessStub(void* a0)
+{
+       DbgPrint("WARNING: calling stub StdcallSuccessStub(0x%p)\n", (void*)a0);
+       return 0;
+}
+
diff --git a/modules/rostests/tests/spec2def/testdata/05-test.def 
b/modules/rostests/tests/spec2def/testdata/05-test.def
new file mode 100644
index 00000000000..ee21b9cde67
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/05-test.def
@@ -0,0 +1,14 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction=@FastcallFunction@16 @6
+ StdcallFunction=$relaytrace$StdcallFunction@4
+ Ret64Function=@Ret64Function@8 @8
+ Fastcalli386=@Fastcalli386@4 @7
+ Stdcalli386x64=$relaytrace$Stdcalli386x64@0 @10
+ StdcallVersionRange=$relaytrace$StdcallVersionRange@16
+ StdcallForwarderToSameDll=StdcallTargetInSameDll@0
+ StubFunction
+ StdcallSuccessStub=$relaytrace$StdcallSuccessStub@4
diff --git a/modules/rostests/tests/spec2def/testdata/06-stubs.asm 
b/modules/rostests/tests/spec2def/testdata/06-stubs.asm
new file mode 100644
index 00000000000..5bad411c2f1
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/06-stubs.asm
@@ -0,0 +1,25 @@
+; File generated automatically, do not edit! 
+
+.586
+.model flat
+.code
+PUBLIC @_stub_FastcallFunction@16
+@_stub_FastcallFunction@16: nop
+PUBLIC __stub_StdcallFunction@4
+__stub_StdcallFunction@4: nop
+PUBLIC @_stub_Ret64Function@8
+@_stub_Ret64Function@8: nop
+PUBLIC @_stub_Fastcalli386@4
+@_stub_Fastcalli386@4: nop
+PUBLIC __stub_Stdcalli386x64@0
+__stub_Stdcalli386x64@0: nop
+PUBLIC __stub_StdcallVersionRange@16
+__stub_StdcallVersionRange@16: nop
+PUBLIC __stub_StdcallForwarderToSameDll@0
+__stub_StdcallForwarderToSameDll@0: nop
+PUBLIC __stub_StubFunction
+__stub_StubFunction: nop
+PUBLIC __stub_StdcallSuccessStub@4
+__stub_StdcallSuccessStub@4: nop
+
+    END
diff --git a/modules/rostests/tests/spec2def/testdata/06-test.def 
b/modules/rostests/tests/spec2def/testdata/06-test.def
new file mode 100644
index 00000000000..1c665c3a59d
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/06-test.def
@@ -0,0 +1,14 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction=_stub_FastcallFunction
+ StdcallFunction=_stub_StdcallFunction
+ Ret64Function=_stub_Ret64Function
+ Fastcalli386=_stub_Fastcalli386
+ Stdcalli386x64=_stub_Stdcalli386x64
+ StdcallVersionRange=_stub_StdcallVersionRange
+ StdcallForwarderToSameDll=_stub_StdcallForwarderToSameDll
+ StubFunction=_stub_StubFunction
+ StdcallSuccessStub=_stub_StdcallSuccessStub
diff --git a/modules/rostests/tests/spec2def/testdata/07-stubs.asm 
b/modules/rostests/tests/spec2def/testdata/07-stubs.asm
new file mode 100644
index 00000000000..74c2a6f2f8d
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/07-stubs.asm
@@ -0,0 +1,21 @@
+; File generated automatically, do not edit! 
+
+.code
+PUBLIC _stub_FastcallFunction
+_stub_FastcallFunction: nop
+PUBLIC _stub_StdcallFunction
+_stub_StdcallFunction: nop
+PUBLIC _stub_Ret64Function
+_stub_Ret64Function: nop
+PUBLIC _stub_Stdcalli386x64
+_stub_Stdcalli386x64: nop
+PUBLIC _stub_StdcallVersionRange
+_stub_StdcallVersionRange: nop
+PUBLIC _stub_StdcallForwarderToSameDll
+_stub_StdcallForwarderToSameDll: nop
+PUBLIC _stub_StubFunction
+_stub_StubFunction: nop
+PUBLIC _stub_StdcallSuccessStub
+_stub_StdcallSuccessStub: nop
+
+    END
diff --git a/modules/rostests/tests/spec2def/testdata/07-test.def 
b/modules/rostests/tests/spec2def/testdata/07-test.def
new file mode 100644
index 00000000000..ca7a74849c6
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/07-test.def
@@ -0,0 +1,13 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction=_stub_FastcallFunction
+ StdcallFunction=_stub_StdcallFunction
+ Ret64Function=_stub_Ret64Function
+ Stdcalli386x64=_stub_Stdcalli386x64
+ StdcallVersionRange=_stub_StdcallVersionRange
+ StdcallForwarderToSameDll=_stub_StdcallForwarderToSameDll
+ StubFunction=_stub_StubFunction
+ StdcallSuccessStub=_stub_StdcallSuccessStub
diff --git a/modules/rostests/tests/spec2def/testdata/08-stubs.c 
b/modules/rostests/tests/spec2def/testdata/08-stubs.c
new file mode 100644
index 00000000000..2e8ea99472c
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/08-stubs.c
@@ -0,0 +1,17 @@
+/* This file is autogenerated, do not edit. */
+
+#include <stubs.h>
+
+int StubFunction()
+{
+       DbgPrint("WARNING: calling stub StubFunction()\n");
+       __wine_spec_unimplemented_stub("testdll.xyz", __FUNCTION__);
+       return 0;
+}
+
+int __stdcall StdcallSuccessStub(void* a0)
+{
+       DbgPrint("WARNING: calling stub StdcallSuccessStub(0x%p)\n", (void*)a0);
+       return 0;
+}
+
diff --git a/modules/rostests/tests/spec2def/testdata/08-test.def 
b/modules/rostests/tests/spec2def/testdata/08-test.def
new file mode 100644
index 00000000000..c431c1a799a
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/08-test.def
@@ -0,0 +1,14 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction @6
+ StdcallFunction
+ Ret64Function @8
+ Fastcalli386 @7
+ Stdcalli386x64 @10
+ StdcallVersionRange
+ StdcallForwarderToSameDll=StdcallTargetInSameDll
+ StubFunction
+ StdcallSuccessStub
diff --git a/modules/rostests/tests/spec2def/testdata/09-stubs.c 
b/modules/rostests/tests/spec2def/testdata/09-stubs.c
new file mode 100644
index 00000000000..5fcc8f47bf0
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/09-stubs.c
@@ -0,0 +1,17 @@
+/* This file is autogenerated, do not edit. */
+
+#include <stubs.h>
+
+int StubFunction()
+{
+       DbgPrint("WARNING: calling stub StubFunction()\n");
+       __wine_spec_unimplemented_stub("testdll.xyz", __FUNCTION__);
+       return 0;
+}
+
+int StdcallSuccessStub(void* a0)
+{
+       DbgPrint("WARNING: calling stub StdcallSuccessStub(0x%p)\n", (void*)a0);
+       return 0;
+}
+
diff --git a/modules/rostests/tests/spec2def/testdata/09-test.def 
b/modules/rostests/tests/spec2def/testdata/09-test.def
new file mode 100644
index 00000000000..7331f890b22
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/09-test.def
@@ -0,0 +1,13 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction @6
+ StdcallFunction
+ Ret64Function @8
+ Stdcalli386x64 @10
+ StdcallVersionRange
+ StdcallForwarderToSameDll=StdcallTargetInSameDll
+ StubFunction
+ StdcallSuccessStub
diff --git a/modules/rostests/tests/spec2def/testdata/10-stubs.c 
b/modules/rostests/tests/spec2def/testdata/10-stubs.c
new file mode 100644
index 00000000000..6194756a81d
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/10-stubs.c
@@ -0,0 +1,59 @@
+/* This file is autogenerated, do not edit. */
+
+#include <stubs.h>
+#include <wine/debug.h>
+#include <inttypes.h>
+WINE_DECLARE_DEBUG_CHANNEL(relay);
+
+extern int __stdcall StdcallFunction(long a0);
+
+int __stdcall $relaytrace$StdcallFunction(long a0)
+{
+       int retval;
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: StdcallFunction(0x%lx)\n", (long)a0);
+       retval = StdcallFunction(a0);
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: StdcallFunction: retval = 0x%lx\n", 
retval);
+       return retval;
+}
+
+extern int __stdcall Stdcalli386x64();
+
+int __stdcall $relaytrace$Stdcalli386x64()
+{
+       int retval;
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: Stdcalli386x64()\n");
+       retval = Stdcalli386x64();
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: Stdcalli386x64: retval = 0x%lx\n", 
retval);
+       return retval;
+}
+
+extern int __stdcall StdcallVersionRange(long a0, long a1, wchar_t* a2, 
wchar_t* a3);
+
+int __stdcall $relaytrace$StdcallVersionRange(long a0, long a1, wchar_t* a2, 
wchar_t* a3)
+{
+       int retval;
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: 
StdcallVersionRange(0x%lx,0x%lx,'%ws','%ws')\n", (long)a0, (long)a1, 
(wchar_t*)a2, (wchar_t*)a3);
+       retval = StdcallVersionRange(a0, a1, a2, a3);
+       if (TRACE_ON(relay))
+               DPRINTF("testdll.xyz: StdcallVersionRange: retval = 0x%lx\n", 
retval);
+       return retval;
+}
+
+int StubFunction()
+{
+       DbgPrint("WARNING: calling stub StubFunction()\n");
+       __wine_spec_unimplemented_stub("testdll.xyz", __FUNCTION__);
+       return 0;
+}
+
+int __stdcall StdcallSuccessStub(void* a0)
+{
+       DbgPrint("WARNING: calling stub StdcallSuccessStub(0x%p)\n", (void*)a0);
+       return 0;
+}
+
diff --git a/modules/rostests/tests/spec2def/testdata/10-test.def 
b/modules/rostests/tests/spec2def/testdata/10-test.def
new file mode 100644
index 00000000000..645edb7321b
--- /dev/null
+++ b/modules/rostests/tests/spec2def/testdata/10-test.def
@@ -0,0 +1,14 @@
+; File generated automatically, do not edit!
+
+NAME testdll.xyz
+
+EXPORTS
+ FastcallFunction @6
+ StdcallFunction=$relaytrace$StdcallFunction
+ Ret64Function @8
+ Fastcalli386 @7
+ Stdcalli386x64=$relaytrace$Stdcalli386x64 @10
+ StdcallVersionRange=$relaytrace$StdcallVersionRange
+ StdcallForwarderToSameDll=StdcallTargetInSameDll
+ StubFunction
+ StdcallSuccessStub=$relaytrace$StdcallSuccessStub

Reply via email to